In reply to kumar.agnishaman@tevatrontech.com:
So there must be a testbench top(module) as well where you are calling
initial
run_test()
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:
------ TOP_TB------
module top_tb;
/ UVM initial block:
// Put virtual interfaces into the resource db & run_test()
initial begin
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
run_test();
end
endmodule: top_tb
-------- test base -----------
class spi_test_base extends uvm_test;
spi_agent_config m_spi_cfg;
// 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”)
end
// similarly get your new interfaces here and assign it to respective agent
Hope this helps.
Please feel free to correct for my misunderstanding.