Altera_Forum
Honored Contributor
13 years agoSimple Verilog Question--Impossible?
I have a verilog file Intensifier.v. In it is a module with the following port list:
module Intensifier ( clk, _reset, intensifierInput, intensifierOutput ); Now I have a top level file named Main.v. In it I want to instantiate an array of instances of Intensifier. If I code: Intensifier [1023:0]intensifiers; I get the error: "Intensifier is not a type" I am not surprised I get an error, as I have not instantiated Intensifier using a port list. So, in Main.v I code: Intensifier intensifier( .clk(clk), ._reset(_reset), .intensifierInput(mainTestIn), .intensifierOutput(mainTestOut) ); This does not give an error, but it is only a single instance of Intensifier, not an array of Intensifiers. Also, I have assigned mainTestIn and mainTestOut to intensifierInput and intensifierOutput, and if and when I can create an array of intensifiers, I will want each Intensifier in the array to have different inputs and outputs. To be able to use different inputs and outputs, in Main.v I instantiate an instance of Intensifier using a port list but without assigning some inputs and outputs: Intensifier intensifier( .clk(clk), ._reset(_reset), .intensifierInput(), .intensifierOutput() ); This does compile without errors, but I'm not sure how I'll code .intensifierInput and .intensifierOutput later, and I still don't have an array of Intensifiers. To get an array, if, in Main.v, I now try: intensifier [1023:0]arrayOfIntensifiers( .clk(clk), ._reset(_reset), .intensifierInput(), .intensifierOutput() ); Or if now, in Main.v, I try: intensifier [1023:0]ArrayOfIntensifiers; I get the same sorts of errors. Is it possible to instantiate an array of Intensifiers in a similar manner as instantiating an array of reg: reg [1023:0] myregs;