In reply to mayurkubavat:
Thank you for your answer, mayurkubavat.
I have tried that, but I think I´m missing something.
In my old verification environment, I would have a separate folder for each testcase, containing a different .hex file for each testcase. So for each testcase the whole design was recompiled and the testbench would read in the specific .hex file in each folder and use it to initialize the memory.
Now with UVM I understood that I have the benefit of compiling everything only once and then selecting the specific testcase via the UVM_TESTNAME argument given to the simulator. So I need to somehow make a difference between which .hex file to read depending on the UVM_TESTNAME argument. So I tried to do the $readmemh() inside of my class “test” (extending uvm_test) and then inside of my class “environment” (extending uvm_env) but from both I get an error saying:
Hierarchical reference from package ‘rbtree_test’ into module ‘rbtree_tb_top’
is not allowed.
The only place where this works, is in the testbench (rbtree_tb_top) but there I can´t make the selection of the .hex file dependent on the UVM_TESTNAME.