Forum Discussion
Altera_Forum
Honored Contributor
14 years agoArray of interfaces in SV
Hi all, I want to write a module, which accepts an array of I/F. is this possible? I see that it runs in simulation but I can't synthesize it... could someone please advice me? thanks!
Altera_Forum
Honored Contributor
14 years agoYou can do it, but you have to do it a certain way for Quartus to synthesize it. The module port must be an unpacked array of interface modport's. You need an unpacked array of interfaces to connect to it. When you instantiate the module, make the port connection with the name of the interface array only, not the modports.
interface iface();
logic a;
logic b;
modport mport(input a, output b);
endinterface
module mod (
iface.mport iface_array
);
...
endmodule
module top ();
iface top_iface_array ();
mod mod_inst(.iface_array(top_iface_array));
...
endmodule