Altera_Forum
Honored Contributor
15 years agoVerilog question- referencing modules?
I've got a system written in Verilog that includes several instances of an arithmetic module block scattered throughout the system hierarchy. We'd like to consolidate these arithmetic module instances into a single instance that multiplexes operations -- thereby reducing the number of logic elements devoted to the arithmetic operation at the expense of more wiring and a delay penalty before getting a result.
In my mind, we'll need to create the multiplexed arithmetic module at the top-level, and then route the I/O from all the blocks that currently rely on separate instances of the module up to this top-level instance. The sticking point is that some of the modules that currently instantiate the arithmetic module are buried pretty deep, so I'd potentially have to update the I/O ports on quite a few blocks to bring the I/O back to the top-level for processing. Ugh. Being a newbie at Verilog, I'm wondering if there is a simpler method of achieving this. Is there a way to create a single instance of a module and then reference arbitrary ports for that instance by other modules... especially ones that may be 'buried' deep in the design? Or, am I going to be stuck doing it the hard way? Any and all help will be greatly appreciated! Thanks, --tim