I have two interfaces:
virtual intf vif;
virtual i2c_intf i2c_vif;
I need to connect them at my top level.
Currently, I am connecting it like below:
module tbench_top;
//creating instance of interface
intf i_intf();
i2c_intf i_i2c_intf();
//Testcase instance
test t1(i_intf);
//DUT instance, interface signals are connected to the DUT ports
adder DUT (
.a(i_intf.a),
.b(i_intf.b),
.c(i_intf.c),
.i_scl_in(i_i2c_intf.i_scl_in),
.o_sda_out(i_i2c_intf.o_sda_out)
);
endmodule
When I construct multiple interfaces, I got the error as below:
** at environment.sv(18): Multiple constructors declared for class environment - only one allowed.
Should it be connected using named mapping, or is it the correct way to do it as above? How do I check whether they are connected? Could you guide me please?
For your understanding, here is the EDA playground link: https://www.edaplayground.com/x/utw9