Inside my top level SystemVerilog module is an instance, (rd_blk), that has an interface modport, (sec_rd). I need to temporarily connect it to combinational code, but I'm having difficulty coming up with an error free solution. Suggestions please.
interface sec_rd_if (
input wire clk
);
logic sec_rd;
logic [7:0] sec_rd_addr;
logic sec_rd_rdy;
modport dst (
input sec_rd,
input sec_rd_addr,
output sec_rd_rdy,
);
modport src (
output sec_rd,
output sec_rd_addr,
input sec_rd_rdy,
);
endinterface
module dst_rd_blk (
input logic clk,
sec_rd_if.dst sec_rd
);
< main rtl code >
endmodule
module top (
input logic clk
);
always_comb begin
// Combo logic to connect to sec_rd port goes here?
end
dst_rd_blk rd_blk (
.clk (clk),
.sec_rd (???)
);
endmodule
Your code is missing an instance of the
interface. I added one intop:The code compiles without errors.