Uvm_config_db / uvm_resource_db for registering virtual interfaces

In reply to chr_sue:

The problem i see for resource_db is the following :
Here is the code for driver. It s getting virtual interface with name and scope but it does not have information about hierarchy. If we have apb_tx and apb_rx agent how can you get correctly the corresponding interfaces to each agent instances.


class apb_driver extends uvm_driver #(apb_trans);
     virtual interface apb_interface vif;

    `uvm_component_utils(apb_driver)
 
    virtual function void build_phase(uvm_phase phase);
        super.build_phase(phase);
        if(!uvm_resource_db#(virtual interface apb_interface)::get("apb_pkg", "vif", vif))
         `uvm_fatal(get_type_name(), "Unable to get virtual interface");
   
    endfunction: build_phase