How to convert code which use resurce_db to config_db

In my tb_top I declare the following instance and set to the resource_db:

   axi_interface vif(ACLK, ARESETn);

   uvm_resource_db#(virtual axi_interface)::set(.scope("ifs"), .name("axi_interface"), .val(vif));

In the driver class I declare the following virtual interface, and in the build phase I read it from the resource_db by get:

 virtual axi_interface  vif;
 void'(uvm_resource_db#(virtual axi_interface)::read_by_name(.scope("ifs"), .name("axi_interface"), .val(vif)));

Since I have understood that its better to use config_db than resource_db I want to change the code.

So in the tb_top I did

uvm_config_db#(virtual axi_interface)::set(null, "uvm_test_top", "axi_interface",vif);

I’m not sure how to change the relevant code (read_by_name) of the driver.

In reply to saritr:

The setting from the top_tb is correct.
Retrieving the the virtual interface in the agent looks like this:
uvm_config_db#(virtual axi_interface)::get(this, “”, .name(“axi_interface”), .val(vif));
this is indicating a relative path.
The scope is the concatenation of this and “”.

In reply to chr_sue:

Why in the agent? Can I do it also from the driver right?

In reply to saritr:

You can do this als in the driver. But in the agnet you might have a monitor which is connected to the virtual interface.