Electronic – System Verilog generic modules and unused ports

system-verilogvivado

I have written a parametrized FIFO for reuse. Since I want to use the FIFO in multiple places I added several output signals for the fill state, like full, empty, almostFull and almostEmpty.

However sometimes not all of the output signals are used, resulting in warnings about unused signals and that the associated logic will be removed. These warnings clutter the message pane.

Question

What is the correct way to design a generic module like a FIFO, and avoid
warnings about unused ports (while using interfaces for the connection)?


Related questions:

I do not think https://stackoverflow.com/a/22272949/258418 is the way to go, since I am happy for the synthesis tool to rip it out, I simply don't want a warning for dead code removal.

While How to remove this warning in Verilog? looks related, it does not help, since I can't just remove the offending logic/wires, since they might be used by other instances of the code.

Best Answer

There is nothing in the SystemVerilog language that allows you to specify outputs that are allowed to be left unconnected. And you don't want to globally turn off dead code removal warnings because that could mask much larger problems. I see three possible choices:

  1. Write a script that filters your messages to eliminate the warnings from the dead logic that is OK to remove.
  2. Create separate versions of your FIFO with different sets of outputs and instantiate the correct version depending on which version is needed. I realize this goes against the generic solution you are looking for, but the use of macros or submodules might make it a little more reusable.
  3. Live with it the way the messages are now.