是否可以通过+uvm_set_type_override=test1,test2 覆盖通过+UVM_TESTNAME=test1 指定的uvm 测试?
is it possible to override uvm test that is specified via +UVM_TESTNAME=test1 by also having +uvm_set_type_override=test1,test2?
我想知道是否可以通过 +uvm_set_type_override 覆盖命令行中通过 +UVM_TESTNAME 指定的测试。
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 中看到以下代码片段
// 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));
它正在使用工厂,但我不知道是否实际覆盖了。我还看到了下面的代码。
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
我想知道上面的 "else" 部分是否执行过?或者在什么条件下执行?
UVM 中的命令行处理顺序似乎存在问题——UVM_TESTNAME 在所有其他选项之前单独处理。
可以在初始块中调用 run_test() 之前设置覆盖。
但是设置测试名称然后在同一命令行上覆盖它有什么意义呢?为什么不使用覆盖的测试名称作为测试?
一般来说,在 运行 时间使用 运行 时间命令行开关可以覆盖在 UVM 工厂注册的任何内容。
在测试名称的情况下,有一个名为 +UVM_TESTNAME=selected_test_name_here
的命令行开关。
通常,
- 我们可能将基本测试名称作为顶部模块中
run(your_base_test_name)
的默认名称,
- 然后我们可以 select 在 运行 时进行各种测试,而无需编译 运行 每个测试(只要每个测试都包含在编译
- 还有
+UVM_TESTNAME=selected_test_at_runtime
,因为我们通常在 运行 宁回归或切换测试时循环测试名称,因为我们用每个不同的测试调试我们的设计。
我想知道是否可以通过 +uvm_set_type_override 覆盖命令行中通过 +UVM_TESTNAME 指定的测试。
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 中看到以下代码片段
// 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));
它正在使用工厂,但我不知道是否实际覆盖了。我还看到了下面的代码。
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
我想知道上面的 "else" 部分是否执行过?或者在什么条件下执行?
UVM 中的命令行处理顺序似乎存在问题——UVM_TESTNAME 在所有其他选项之前单独处理。
可以在初始块中调用 run_test() 之前设置覆盖。
但是设置测试名称然后在同一命令行上覆盖它有什么意义呢?为什么不使用覆盖的测试名称作为测试?
一般来说,在 运行 时间使用 运行 时间命令行开关可以覆盖在 UVM 工厂注册的任何内容。
在测试名称的情况下,有一个名为 +UVM_TESTNAME=selected_test_name_here
的命令行开关。
通常,
- 我们可能将基本测试名称作为顶部模块中
run(your_base_test_name)
的默认名称, - 然后我们可以 select 在 运行 时进行各种测试,而无需编译 运行 每个测试(只要每个测试都包含在编译
- 还有
+UVM_TESTNAME=selected_test_at_runtime
,因为我们通常在 运行 宁回归或切换测试时循环测试名称,因为我们用每个不同的测试调试我们的设计。