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 equivalent for Generate, Generics in Vhdl

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 2005 generate

Hi All,

In VHDL, we can remove unwanted logics based on generics using "Generate" construct. How we can do the same in Verilog since Verilog does not have a Generate construct.

Also, what is the equivalent construct in Verilog for Generics in Vhdl.

Please share your thoughts,

regards,
freak
 

Verilog Generate

Parmeter is equivalent of genric in verilog ..'

Using generate statement: Verilog 2001 generate statement allow to either instantiating multiple modules without typing them so many times or instantiating modules conditionally. You can use if-else to conditionally instantiate the modules. Also, if you want to instantiate the same module multiple times then better use for loop. This will save you lot of time.

generate for (i=0; i < width; I = i+1) begin

and_or inst1 (out1, in1, in2);

end endgenerate
 

Re: Verilog Generate

vikas_33 said:
Parmeter is equivalent of genric in verilog ..'

Using generate statement: Verilog 2001 generate statement allow to either instantiating multiple modules without typing them so many times or instantiating modules conditionally. You can use if-else to conditionally instantiate the modules. Also, if you want to instantiate the same module multiple times then better use for loop. This will save you lot of time.

generate for (i=0; i < width; I = i+1) begin

and_or inst1 (out1, in1, in2);

end endgenerate


And in Verilog 2005 and SV 2009, the generate in this context is optional as a for loop outside procedural will be interpreted as generate for.

HTH
Ajeetha, CVC
www.cvcblr.com
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top