首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否可以通过+UVM_TESTNAME=test1指定的uvm测试也具有+uvm_set_type_override=test1、test2?

是否可以通过+UVM_TESTNAME=test1指定的uvm测试也具有+uvm_set_type_override=test1、test2?
EN

Stack Overflow用户
提问于 2019-02-11 16:43:31
回答 2查看 800关注 0票数 3

我想知道是否有可能通过+UVM_TESTNAME通过+uvm_set_type_override覆盖命令行中指定的测试。

代码语言:javascript
复制
I have tried it and this is what i see in prints in log. 
UVM_INFO @ 0: reporter [RNTST] Running test Test1...
UVM_INFO @ 0: reporter [UVM_CMDLINE_PROC] Applying type override from the command line: +uvm_set_type_override=Test1,Test2

所以,在我看来,首先创建测试组件,然后应用工厂重写?

我在uvm_root.svh中看到了下面的代码

代码语言:javascript
复制
 // if test now defined, create it using common factory
 if (test_name != "") begin
   if(m_children.exists("uvm_test_top")) begin
     uvm_report_fatal("TTINST",
         "An uvm_test_top already exists via a previous call to run_test", UVM_NONE);
     #0; // forces shutdown because $finish is forked
  end
   $cast(uvm_test_top, factory.create_component_by_name(test_name,
         "", "uvm_test_top", null));

它正在使用那家工厂,但我不知道是否真的有越野车。我还看到了下面的代码。

代码语言:javascript
复制
 begin
  if(test_name=="") 
     uvm_report_info("RNTST", "Running test ...", UVM_LOW); 
  else if (test_name == uvm_test_top.get_type_name())
     uvm_report_info("RNTST", {"Running test ",test_name,"..."}, UVM_LOW); 
  else
     uvm_report_info("RNTST", {"Running test ",uvm_test_top.get_type_name()," (via factory override for test \"",test_name,"\")..."}, UVM_LOW);
 end

我想知道上面的“其他”部分是否曾经被执行过?或者是在什么条件下执行的?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-02-11 18:02:07

似乎在UVM_TESTNAME在所有其他选项之前单独处理命令行处理顺序存在问题。

可以在初始块中调用run_test()之前设置覆盖。

但是,设置测试名称,然后在相同的命令行中重写它有什么意义呢?为什么不使用重写的测试名称作为测试?

票数 0
EN

Stack Overflow用户

发布于 2021-09-18 07:31:07

通常,在UVM中注册的任何内容都可以通过运行时命令行开关在运行时被覆盖。

在测试名称的情况下,有一个名为+UVM_TESTNAME=selected_test_name_here的命令行开关。

典型的,

  • 在顶部模块的run(your_base_test_name)中,我们可以将基本测试名作为默认值,
  • 然后,我们可以在运行时选择各种测试,而无需在运行每个测试时进行编译(只要每个测试都包含在编译中)。
  • 当我们在每个不同的测试中调试我们的设计时,当我们运行回归或切换测试时,+UVM_TESTNAME=selected_test_at_runtime通常会遍历测试名称。
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54635238

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档