I have a use case as follows

  1. There is a base test that takes lots of +args to run the sequence
  2. I don't want to write separate test cases for each different +args combination but want to run the test with the name passed from +UVM_TESTNAME

for example, Here I only have the base_test class written, but the commands I pass are

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

Now the Testbench should create/override the base test with new test called "test_mode1" or "test_mode2"

How could we get this working?

I tried the following:

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

The issue is uvm take higher precedence for UVM_TESTNAME over test_arg

1

There are 1 best solutions below

0
dave_59 On

You need to explain why you do not use +UVM_TESTNAME=base_test and pass the other arguments. If this is because of the way your regression system names tests, there should be ways around that. Look at the particular setup of your makefile or run scrips