IMPORTANT NOTICE: Please be advised that the Verification Academy Forums will be offline for scheduled maintenance on Sunday, March 23rd at 4:00 US/Pacific.
Strictly from a language point of view - No you cannot synthesize a top level design with a SystemVerilog Interface. As the error message in the reference link shows, an interface port of a module must be connected to an actual interface (there’s elaboration time checking happening between the port type and the connected interface).
An interface can only be instantiated at the calling module (or above). Since the synthesizer is only looking at module “top” there’s nothing above it to actually instantiate an interface.
From a practical point of view as well, the answer is NO as well. Most post-synthesis implementation tools, in practice, break down with anything other than than the most basic of port types at the top-level (think single-dimension vectors at most).
We use SystemVerilog Interfaces (and arrays thereof) heavily in our designs. But not at the top level.
The concept of a top-level module may be different for simulation and synthesis tools. You’ll need to bring this up with your synthesis tool vendor. I do know that some tools provide a way to deal with this, but this Mentor sponsored public forum is not for discussion of tool specific issues.
@Mark@dave
Thank you! Switching back to basic ports for top level. I don’t think it’s a good idea to introduce confusion into the project by implementing something that only works sometimes
//map interface signals – is there a better way to do this?
bus1_if_s.bus1_in1 = bus1_in1;
bus1_if_s.bus1_in2 = bus1_in2;
bus1_out1 = bus1_if_s.bus1_out1;
bus1_out2 = bus1_if_s.bus1_out2
//is there a better way to do this?
bus2_if_s.bus1_in1 = bus2_in1;
bus2_if_s.bus1_in2 = bus2_in2;
bus2_out1 = bus2_if_s.bus2_out1;
bus2_out2 = bus2_if_s.bus2_out2
That’s pretty much what you need to do. Try and use vectors more, instead of single bit wires is the only suggestion I can offer.
Today’s top-level designs (both FPGAs and ASICs) can have 100s and even 1000s of signal I/Os. There’s going to be a bit of tedium to hook all these signals up in any solution.