Problem related to connection of two interfaces through configuration

Hi All

I have made BFM for master and slave and all sub component like driver, monitor ,agent of APB and AHB protocol.
I have made one configuration class of name conifig_AHB_APB in which , I called both interfaces of AHB and APB and declared as Virtual.
So I want to connect AHB to APB using the above configuration class.
Tell me how can I connect these both interfaces using config_db, and where this connection can be done in environment or BASE test.
Actually I have no idea of this type of connection.
can anyone help me out…

Generally we set the virtual interface in config_db from TB_TOP (module declaration for TestBench) and it is recommended to keep the all the connections to DUT/Interfaces there.

You can make any connection you want there and set the interfaces in config_db

Better you can take any example for understanding it, my personal recommendations try UVM_COOKBOOK from Mentor

In reply to karandeepsingh:

Hi Karan

Thanks for reply. I know how to use get/set in config_db function. I have run the complete environment of AHB and APB individually.
But this time I want to connect AHB and APB in single environment class. But I cant understand how to connect both interfaces to each other and where.
I declared both interfaces as virtual in a single config_ahb_apb class.

class config_ahb_apb;
////interface of AHB
virtual intf_ahb dut_vi;
/////interface of APB
virtual intf_apb dut_slave;
endclass

In reply to kumar.agnishaman@tevatrontech.com:

I want to understand what do you mean by connecting both the interfaces.

Does it mean your DUT has two interfaces APB and AHB separately? And you want both the interfaces to be driven by your agents.

If its so again you need to map it in TB_TOP which is your top level testbench module.

Apart from that I am unable to understand the connect both interfaces to each other and where. Whatever the mapping you want to do to DUT will be done at testbench module level.

Thanks for explaining your requirements.

In reply to karandeepsingh:

Yes I have 2 agents agent_ahb and agent_apb. agent_ahb have driver monitor and interface_1. agent_apb have driver monitor and interface_2. I want to connect both agents in environment class. I have made one Base_Test class in which I called environment class.
How I can pass my interfaces to agents through config_db.

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.