Hi,
Is it possible to read value in +UVM_TESTNAME using the uvm_config_db?
Something like this:
string testname;
void’(uvm_config_db#(string)::get(null,“*”,“UVM_TESTNAME”,testname));
The testname is not stored in the config_db(), but you can use $value$plusargs:
module testbench();
string tn;
initial begin
if ($value$plusargs("UVM_TESTNAME=%s", tn))
$display("value was %s", tn);
else
$display("+UVM_TESTNAME= not found");
#100 $finish;
end
endmodule
Thanks a lot, that worked!
I had earlier tried the following:
if ($test$plusargs(“testname” ) begin
…
end
But that did not work.
Note that a UVM testname can also be given as an argument to run_test("testname")
without a +UVM_TESTNAME switch (The switch takes precedence).
uvm_top.find("uvm_test_top").get_type_name()
works either way.
Many Thanks Dave for your response. The run_test() call in the TB I am working on does not specify any “testname”. Instead, the testname gets passed to this function via command line options.
So, then will uvm_top.find(“uvm_test_top”).get_type_name() still work?
I haven’t tried it out, but can do so and see.
At least it will be another alternate way of accessing the testname.
I said: