Verilog 使用数组实例化接口时无法访问Modport
当接口实例化时,通常可以访问ModPort 例如: 但当inerface与array关联时,我无法访问接口intf2中的MODPORT,有没有办法访问intf2中多实例接口的MOPORTVerilog 使用数组实例化接口时无法访问Modport,verilog,system-verilog,Verilog,System Verilog,当接口实例化时,通常可以访问ModPort 例如: 但当inerface与array关联时,我无法访问接口intf2中的MODPORT,有没有办法访问intf2中多实例接口的MOPORT interface intf1; reg a3, c3; modport mp3 (output a3, c3); assign c3 = a3; endinterface interface intf2(intf1.mp3 p2[3]); //assign p2[3].a3 = 1'
interface intf1;
reg a3, c3;
modport mp3 (output a3, c3);
assign c3 = a3;
endinterface
interface intf2(intf1.mp3 p2[3]);
//assign p2[3].a3 = 1'b1; // compiler reports Invalid bounds count
endinterface
module top(input din,output reg dout);
assign dout = din;
intf1 INTF1 [3:1] ();
intf2 INTF2 (INTF1);
endmodule
这是当前标准的一个限制。看 我的建议是不要使用modport。如果必须将它们用于合成,则不能将它们用于接口数组
interface intf2(intf1.mp3 p2[3]);
assign p2[0].a3 = 1'b1;
assign p2[1].a3 = 1'b1;
assign p2[2].a3 = 1'b1; // compiler reports Invalid bounds count
endinterface
同时检查下面的链接。现在它似乎工作正常
p2[2].a3
有效吗?我猜元素的索引范围是0到2。无法将p2[2]或p2[1]错误用作无效初始化
interface intf2(intf1.mp3 p2[3]);
assign p2[0].a3 = 1'b1;
assign p2[1].a3 = 1'b1;
assign p2[2].a3 = 1'b1; // compiler reports Invalid bounds count
endinterface