Relation between +UVM_TESTNAME and run_test?

Hi all,

Please let me know, how +UVM_TESTNAME command line argument is linked with run_test in testbench top.
It will be better, if explanation will be provided with some example.

Thanks & Regards
Navnish

As just stated in this post, run_test() does two things, the first of which creates a top-level component which presumably is your test. The optional argument to run_test(“name”) is the string name of the class that was registered with the factory. If you don’t provide an argument to run_test, then you have to provide the name via the +UVM_TESTNAME command line argument. The advantage of using the command line argument instead of the argument to run_test() is that you do not have to re-compile your testbench to select a different test as long as the test class had previously been compiled.

You always need a call to run_test() with or without an argument to start the execution of your UVM test through its various phases.

run_test method contains implementation to get test name which is provided on the command line by using command line processor interface.

In reply to dave_59:

If I provide a testname in run_test and as well as +UVM_TESTNAME which will have more priority?

In reply to Sv-hustler:

Command line overrides the argument.