Hi , I am trying to retrieve value using config db but i can’t.
can anyone tell me the Issue.
In the environment build phase, I have set the value.
int value = 10;
uvm_config_db#(int)::set(null,“*”,value,value);
In the Agent build phase , I am trying to get the value but it is showing error
int value;
if(!uvm_config_db#(int)::get(null,“”,value,value)) uvm_error(get_type_name(),$sformatf("value in config db is not set : %d ",value)) else uvm_info(get_type_name(),$sformatf(“value in config db is set : %d”,value),UVM_LOW)
In your case, it does matter because you are using “*” as a wildcard for set().
The reason you should use “this” instead of “null” is because there will come a time when you want to be selective on which agent you want to configure. “this” provides context for the get().