Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog Generic Input ports

Status
Not open for further replies.

vlsi_freak

Full Member level 2
Joined
Sep 3, 2007
Messages
127
Helped
14
Reputation
28
Reaction score
8
Trophy points
1,298
Activity points
2,041
verilog generic

Hi All,

I have an input port to a module which is 5 bits say Inp_A[4:0]. Now the number of such inputs depends on a generic parameter say Gen_Nm.

How can i declare such an input ports in my module.
I have tried
Input [4:0][Gen_Num-1 : 0] Inp_A; &
Input [Gen_Num-1 : 0][4:0] Inp_A; &
Input [Gen_Num-1 : 0] Inp_A[4:0]; &
Input [4:0] Inp_A[Gen_Num-1 : 0];

All these seems to be giving compile error.

Please help me, how to go about this

regards,
freak
 

verilog generic parameters

First of all Verilog does not support more than one dimensional ports declaration.

You can use define, but you will have to specify it at compile time. You can not change it run time(h/w can not reduce/generate at run time :D).
If you want different number of ports, then you will have to change the define and compile again. But this will only work for one dimensional port.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top