How do we know hierarchy at uvm_config_db()?

Dear All,

static function void set(uvm_component cntxt, string inst_name, string field_name, T value)

When we use “uvm_config_db”, usually we put some path into “inst_name” such as the below,


uvm_config_db#(virtual channel_if)::set(null, "*.tb.chan0.*", "vif", top.ch0);
uvm_config_db#(virtual channel_if)::set(null, "*.tb.chan1.*", "vif", top.ch1);
uvm_config_db#(virtual channel_if)::set(null, "*.tb.chan2.*", "vif", top.ch2);

Question 1.
But when we start project, we don’t know about overall hierarchy path to put a inst_name into uvm_config_db(); don’t we?

How do we know the hierarchy path into inst_name?

In reply to UVM_LOVE:

Ideally, set method will not check whether actual instance is available or not.
it, will store value with instance name provide by you into config database.
However tricky part here is, if you have not set via proper instance name.
You won’t be able to retrieve value from config database via get.

that’s why always recommended add checking logic at get time.


  if(!uvm_config_db #(<type>)::get(...................)) `uvm_fatal("GET_FAIL","Value not retried")

Thanks!