Usage of configuration method and method naming

Dear All,

I would came across 2 uvm files as the below,

  1. 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.

  1. 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~~~~ ?

In reply to UVM_LOVE:

if we look into UVM_LRM section C.4.2, below statement is written.


/*
If a setting is made at build time, the cntxt hierarchy is used to determine the setting’s precedence in the
database. Settings from hierarchically higher levels have higher precedence
*/

As, in your case “test_tb” higher level component then “test_env”.
So, test_id set via “test_tb” will be visible up to test0.
However, set via “test_env” visible to test_env’s all lower level component.

Thanks!