In reply to email@example.com:
So there must be a testbench top(module) as well where you are calling
this is the place where you are binding your interfaces to you DUT and this is the indeed place where you set your interfaces handles in config_db. Or in the more simplified words where there you connect your DUT to TB you have to set the interfaces in config_db from there only.
Once you set that you can easily get(its handle through config_db) it in your agent.
Referring examples from cookbook:
/ UVM initial block:
// Put virtual interfaces into the resource db & run_test()
uvm_config_db #(virtual apb_if)::set(null, "uvm_test_top", "APB_vif", APB);
uvm_config_db #(virtual spi_if)::set(null, "uvm_test_top", "SPI_vif", SPI);
uvm_config_db #(virtual intr_if)::set(null, "uvm_test_top", "INTR_vif", INTR);
// similar for you set your interfaces new here
-------- test base -----------
class spi_test_base extends uvm_test;
// The SPI is not configured as such
m_spi_cfg = spi_agent_config::type_id::create("m_spi_cfg");
if(!uvm_config_db #(virtual spi_if)::get(this, "", "SPI_vif", m_spi_cfg.SPI)) begin
`uvm_error("RESOURCE_ERROR", "SPI virtual interface not found")
// similarly get your new interfaces here and assign it to respective agent
Hope this helps.
Please feel free to correct for my misunderstanding.