Interfaces Instantiations

Hi,

I am doing a scenario which has two DUTS of same ports but with different names,so here i am instantiating the same agent twice and trying to set_config object of the two instances of virtual interface but it is throwing build error to unable to find the virtual in the driver?

what could be the potential cause?

Taahir

In reply to syed taahir ahmed:
Can you show the code you used to set and get the virtual interface? as well as the code used to set the name of the driver (either create or new)?

In reply to dave_59:

Dave,

please find the code::

// create S2P Bus interface container class handle
//s2p_vif_container_h = new();
s2p2_hvl_if = new(“test_bench.dut.s2p2_if_inst”);
s2p2_vif_container_h = s2p2_vif_container_t::type_id::create( “s2p2_vif_container_h” );
s2p2_vif_container_h.m_vif_h = test_bench.dut.s2p2_if_inst;
set_config_object(“*m_s2p2_agent_h.m_s2p2_driver_h”, “s2p2_vif_container_h”, s2p2_vif_container_h, 0);

// create S2P Bus interface container class handle
//s2p_vif_container_h = new();
s2p2_sw2_hvl_if = new(“test_bench.dut.s2p2_if_inst1”);
s2p2_sw2_vif_container_h = s2p2_sw2_vif_container_t::type_id::create( “s2p2_sw2_vif_container_h” );
s2p2_sw2_vif_container_h.m_vif_h = test_bench.dut.s2p2_if_inst1;
set_config_object(“*m_s2p2_sw2_agent_h.m_s2p2_driver_h”, “s2p2_sw2_vif_container_h”, s2p2_sw2_vif_container_h, 0);

Drver Code

ifdef S2P2_TOP typedef uvm_vif_container #(virtual s2p2_if) s2p2_vif_container_t; else
typedef uvm_vif_container #(virtual s2p2_if) s2p2_sw2_vif_container_t;
`endif

`ifdef S2P2_TOP
s2p2_vif_container_t s2p2_vif_container_h;
`else
s2p2_sw2_vif_container_t s2p2_sw2_vif_container_h;
`endif
vector_vif_container_t vector_vif_container_h;



`ifdef S2P2_TOP
if(!get_config_object("s2p2_vif_container_h", dummy, 0)) begin
  uvm_report_error("build", "no virtual interface available");
end
else begin
  if(!$cast(s2p2_vif_container_h, dummy)) begin
    uvm_report_error("build", "virtual interface is incorrect type");
  end
  else begin
    s2p2_virtual_vif_h = s2p2_vif_container_h.m_vif_h;
  end
end
`else
 if(!get_config_object("s2p2_sw2_vif_container_h", dummy, 0)) begin
  uvm_report_error("build", "no virtual interface available");
end
else begin
  if(!$cast(s2p2_sw2_vif_container_h, dummy)) begin
    uvm_report_error("build", "virtual interface is incorrect type");
  end
  else begin
    s2p2_virtual_vif_h = s2p2_sw2_vif_container_h.m_vif_h;
  end
end

`endif

Please let me know ASAP.

Thanks
Syed Taahir