我有一个模块,作为它的端口之一,它有一个未打包的接口数组。我正试图使用赋值模式将它连接到几个不同的奇异接口,就像简单端口一样。
这样做会导致QuestaSim中的一个错误:
“期望一个接口实例作为‘intf_out’的实际实例。”
我需要什么语法糖才能起作用?
我写了一个很小的例子来说明这个问题。
interface example_interface #(
parameter SIZE = 4
);
logic [SIZE-1:0] example_signal;
endinterface
module example_module (
example_interface intf_in,
example_interface intf_out [0:2]
);
assign intf_out[0].example_signal = intf_in.example_signal;
assign intf_out[1].example_signal = intf_in.example_signal;
assign intf_out[2].example_signal = intf_in.example_signal;
endmodule
module example_port_connection ();
example_interface #(.SIZE(3)) a ();
example_interface #(.SIZE(4)) b ();
example_interface #(.SIZE(5)) c ();
example_interface #(.SIZE(6)) d ();
example_module uut (
.intf_in(a),
.intf_out('{b,c,d}) //error here
);
endmodule发布于 2017-12-05 22:13:18
这不能在SystemVerilog中使用接口完成。除了没有接口连接的任何语法之外,当每个元素是不同的类型时,就不再有数组了。
https://stackoverflow.com/questions/47662034
复制相似问题