是否可以从通过 UVM_TESTNAME 传递的字符串动态创建 uvm 测试,然后用新创建的测试覆盖基本测试?

问题描述 投票:0回答:1

我有一个用例如下

  1. 有一个基本测试需要大量+args来运行序列
  2. 我不想为每个不同的 +args 组合编写单独的测试用例,但想使用从 +UVM_TESTNAME 传递的名称运行测试

例如,这里我只写了base_test类,但是我传递的命令是

 eg1: make run +UVM_TESTNAME=test_mode1 +arg=mode1 
 eg2: make run +UVM_TESTNAME=test_mode2 +arg=mode2

现在测试平台应该使用名为“test_mode1”或“test_mode2”的新测试创建/覆盖基本测试

我们怎样才能让它发挥作用?

我尝试了以下方法:

case1: make run +UVM_TESTNAME=test_mode1 +arg=mode1 +testname=base_test // for this case there is no class "test_mode1" . 

case2: make run +UVM_TESTNAME=test_mode2 //For this case I have a class written with the name "test_mode2 "

initial begin

if($value$plusargs("testname=%s",test_arg)) begin

  // I would like to create a test with the name UVM_TESTNAME and run it
  run_test(test_arg); // this should run the newly created test
end
else run_test(); // case2 should run as normal uvm-flow

end

问题是 uvm 对 UVM_TESTNAME 的优先级高于 test_arg

command-line-interface system-verilog uvm
1个回答
0
投票

您需要解释为什么不使用 +UVM_TESTNAME=base_test 并传递其他参数。如果这是由于回归系统命名测试的方式造成的,那么应该有办法解决这个问题。查看 makefile 或运行脚本的特定设置

© www.soinside.com 2019 - 2024. All rights reserved.