Dear All,
I would came across 2 uvm files as the below,
- test_tb.sv
class test_tb extends uvm_env;
`uvm_component_utils(test_tb)
test_env test0;
...
uvm_config_int::set(this, "test0", "test_id", 0);
test0 = test_env::type_id::create("test0", this);
endfunction : build_phase
endclass
And,
test_env.sv
class test_env extends uvm_env;
int test_id = 0;
`uvm_component_utils_begin(test_env)
`uvm_field_int(test_id, UVM_ALL_ON)
...
`uvm_component_utils_end
endclass
...
function void test_env::build_phase(uvm_phase phase);
super.build_phase(phase);
uvm_config_int::set(this, "*", "test_id", test_id);
...
endfunction
From 2 above example, I got some query about the usage of configuration method.
- can we put uvm_config_int::set from multiple class?
As you can see the above example, There are used 2 configuration set methods.
uvm_config_int::set(this, "test0", "test_id", 0); and uvm_config_int::set(this, "*", "test_id", test_id);
Is that have any problem such as race condition? you can see the both of uvm_config_int::set are implemented in the build_phase(). I think the same (set) function implemented in different class. So confused this methods. How do I interpret both of uvm_config_int::set~~~~ ?