Config_db vs Resource_db

uvm_resource_db #(usb_env_config)::set({get_full_name(), “.*”}, “xHCI_usb_env_cfg”, usb_env_cfg);

is equivalent to

uvm_config_db#(usb_env_config)::set(this, "*", "xHCI_usb_env_cfg", usb_env_cfg);

The corresponding get

if (!uvm_resource_db #(usb_env_config)::read_by_type(get_full_name(), usb_env_cfg, this))
uvm_report_fatal(get_full_name(), “Failed to get usb_env_cfg”);

would be

if (!uvm_config_db #(usb_env_config)::get(this, "", xHCI_usb_env_cfg, usb_env_cfg))
`uvm_fatal(get_full_name(), "Failed to get usb_env_cfg");

The ‘this’ pointer in the uvm_config_db::set() call gives you the hierarchical string name where the config object is created. This hierarchical name will also uniquify the path down to the lower level components, so the string name is irrelevant, really. In the same way that you document that the component requires an object of usb_env_cfg type so your ‘read_by_type(get_full_name()’ does the right thing, you can simply document that the config_object for the component is called ‘cfg_obj’ (or whatever you prefer) and use uvm_config_db.