# Uvm\_config\_db / uvm\_resource\_db for registering virtual interfaces

**URL:** <https://verificationacademy.com/forums/t/uvm-config-db-uvm-resource-db-for-registering-virtual-interfaces/33179>\
**Category:** UVM\
**Tags:** virtual-interface, UVM, uvm\_config\_db\
**Created:** [June 6, 2017, 1:53pm UTC](https://verificationacademy.com/forums/t/uvm-config-db-uvm-resource-db-for-registering-virtual-interfaces/33179 "2017-06-06T13:53:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Vperrin](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/eada6e/32.png) [@Vperrin](https://verificationacademy.com/forums/u/Vperrin)\
**Post date:** [June 6, 2017, 3:21pm UTC](https://verificationacademy.com/forums/t/uvm-config-db-uvm-resource-db-for-registering-virtual-interfaces/33179/5 "2017-06-06T15:21:35Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/uvm-config-db-uvm-resource-db-for-registering-virtual-interfaces/33179/4):_

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.

```verilog

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

```

---

_[View the full topic](https://verificationacademy.com/forums/t/uvm-config-db-uvm-resource-db-for-registering-virtual-interfaces/33179)._
