Using parameters to enable/disable a signal from module

S

StefanLevie

Guest
I know that you can use defines to enable/disable a signal from a
module such as:

module my_module
(
input sig_A,
`ifdef TYPE_IS_MULTI
input sig_B,
`endif
....

Since `defines are global, it's tricky (but not impossible) to use
this module multiple times with different configurations.

Is it possible to replace `define / `ifdef with a parameter and
effectively do the same thing?

I am already using parameters to control the width (number bits) of a
signal, but have not been able to find an example where they enable/
disable the signal.

Thanks,

Stefan
 
On Aug 12, 12:04 pm, StefanLevie <ste...@technobox.com> wrote:
I know that you can use defines to enable/disable a signal from a
module such as:

module my_module
(
input sig_A,
`ifdef TYPE_IS_MULTI
input sig_B,
`endif
...

Since `defines are global, it's tricky (but not impossible) to use
this module multiple times with different configurations.

Is it possible to replace `define / `ifdef with a parameter and
effectively do the same thing?

I am already using parameters to control the width (number bits) of a
signal, but have not been able to find an example where they enable/
disable the signal.

Thanks,

Stefan
It is, of course allowable to leave ports open during
instantiation, and with a parameter it is easy enough
to render a port effectively unused. I realize that
from an aesthetic point of view it's not as neat as
removing the port, but after synthesis the results
are pretty much the same.

Regards,
Gabor
 

Welcome to EDABoard.com

Sponsor

Back
Top