Generate statements for I/O list

Aug 01, 2006 2 Replies

Greetings,



I want to parameterize a module in a way that makes some inputs used or not used. If I have the input defined but don't use it in the module instantiation, I end up with a synthesis warning about tying an unused input to 0. If I use a generate, I'll be trying to add a generate item of the form "input clk," where the comma looks like it won't be a legal generate item.



Anyone have a clean way to remove the input from the module definition list without a `define?



I can imagine specifying a Verilog-1995 style I/O list where only the names are listed initially then outside the module port definition use an if/else to define my value as input or output; if I don't use the output, I get no warning and if I hook something up to the signal I want unused I should have a synthesis warning for too many drivers. But I'd like to keep my Verilog-2001 style of I/O definitions embedded in the portdefs.


- John_H


How often I have wished for this feature, and how often I have wondered why the IEEE committee didn't add it to the spec. But there is no way to make the port list varible. You can only vary the sizes of the ports. The only workaround is to use `defines.

-Kevin

A half work around, at least for SynplifyPro: declare the ports as inout. There aren't warnings for unconnected inputs (yay!) but there aren't warnings for incorrect inputs that are only driven by the module (boo!).

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required