Uvm_config_db set with inst_name=uvm_test_top v.s. uvm_test_top.*

Hi,
I’m setting an interface on my top module like below:

uvm_config_db #( virtual ahb_if )::set( null , "uvm_test_top" , "data_port" , data_port_if );

And i can’t find it for some reason in my driver:

uvm_config_db #(virtual abh_if)::get(this, "", "data_port", data_port_vi)

But, if i add the wildcard in the set method, i can find it in my driver:

uvm_config_db #( virtual ahb_if )::set( null , "uvm_test_top.*" , "data_port" , data_port_if );

Is this something vendor dependent? (I’m using Questa Sim Version 10.2a)

Thanks,
-grace

Nothing is wrong with your simulator. It has to do with the target of the configuration and where the get() is being called.

The second argument of the set() function allows you to control the scope of the configuration. When you specify “uvm_test_top”, only the component named “uvm_test_top” will get() that configuration item. When you specify "uvm_test_top.", the . now allows all components in the hierarchy below uvm_test_top to get that configuration item.

I’m guessing that you are calling the get() function inside your agent, which is why you aren’t being successful.

The recommendation is that you specifically target only “uvm_test_top” for virtual interface handles, and in turn, get() the values at the test level and store them in each agent’s configuration object. This allows you to have multiple interfaces of the same type, as well as removing the RTL testbench from having to know anything about the UVM testbench hierarchy.

In reply to cgales:

Thanks a lot, that makes so much sense! I did call get() from the agent. I’ll try adding a configuration object then.