Basically, I have a system verilog design that I need to integrate in a simulation framework that's in verilog. So I need to create a wrapper in order to interface with the DUT but am having issues trying to do so.
The interface to the DUT has an interface block as well as other inputs and outputs. The interface to the DUT is seen below
interface ifc(input clk, input rst);
logic [`DATA_WIDTH-1:0] data;
logic valid;
modport in(
input data,
input valid
)
modport out(
output data,
output valid
)
endinterface
The DUT uses the interface as such
module DUT(
ifc.in in0,
ifc.in in1,
ifc.out out0,
ifc.out out1,
output error);
....
endmodule
I created an instance of the interface block and assigned the corresponding signals to the interface and passed the interface into the DUT.
module sim(input clk, input rst,
input in0, input in1,
input ivalid0, input ivalid1,
output out0, output out1
output ovalid0, output ovalid1 );
ifc if0(.clk(clk), .rst(rst));
ifc if1(.clk(clk), .rst(rst));
assign if0.data = in0;
assign if1.data = in1;
assign if0.valid = ivalid0;
assign if1.valid = ivalid1;
assign out0 = if0.data;
assign out1 = if1.data;
assign ovalid0 = if0.valid ;
assign ovalid1 = if1.valid ;
DUT dut(
.in0(if0.in),
.in1(if1.in),
.out0(if0.out),
.out1(if1.out)
);
endmodule
When I try and simulate in Modelsim, I get an error that This or another usage of 'if0.in' inconsistent with 'modport' object. In all the examples I have seen, they use a SystemVerilog wrapper for a Verilog DUT, but I have not seen any the other way around. Is it even possible to do it the other way around? How would I go about instantiating a systemverilog module with an interface in a Verilog wrapper.
Thanks for any help.