Which test will run?

In UVM we run a testcase through command line option +UVM_TEST =

We can also run the test through run_test method which presents at the top level module.

Suppose i specify a test by name “wr_test” in the “run_test” method.
But i have ran a test by name “rd_test” in the command line option, which one will get simulated/run?

Please let me know

In reply to ravi_1822:

From uvm_root::run_test

  
// Retrieve the test names provided on the command line.  Command line
// overrides the argument.
      test_name_count = clp.get_arg_values("+UVM_TESTNAME=", test_names);

      // If at least one, use first in queue.
      if (test_name_count > 0) begin
         test_name = test_names[0];
         testname_plusarg = 1;
      end

In reply to ravi_1822:

Hi Ravi,

+UVM_TESTNAME=rd_test overrides the testname passed using method run_test(“wr_test”).
In your case “rd_test” will get simulated.

In reply to Digvijaysinh Suryavanshi:

hey Ravi,

Everytime the test case name you give in script/command line as +UVM_TESTNAME= it will win over the test case name that you`ve given as argument in ‘run_test()’ method.

Best Regards
Ujjwal