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.

VHDL "for generate"

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
Is it possible to use the "for generate" statement inside a process ?
 

Possibly not. Generate is only to make multiple instances\copies at the time of Synthesize only based on your generic declaration. Inside a process how do you expect the generate statement to work?.

It is applicable to if generate\for generate.

---------- Post added at 13:56 ---------- Previous post was at 13:55 ----------

Yes, you can use the for and generate statements inside a process...

Oh?. I am not sure, but can you give an example. I can correct myself if I was wrong...

Thanks..
 
No you cannot. Generate is meant for conditionally creating/repeatadly creating some logic. You can however use generics inside a process - they are treated as constants, so remember the logic you may generate by using a for loop.
 
No you cannot. Generate is meant for conditionally creating/repeatadly creating some logic. You can however use generics inside a process - they are treated as constants, so remember the logic you may generate by using a for loop.

I felt right though, thank you for preventing into false assumption.
 

OK...so "generate" can only be used out of process.
What are the constraints about the "loop" statement ? Only in a process ?
 

generate is not the end of the story. There are several generate constructs:

label : if x generate
label : for x in a to b generate

and in VHDL 2008
label : if/elsif/else x generate
label : case x generate

(a label is compulsary for generates). You cannot "exit" from a generate loop, or wait, because it is elaborated before any simulation is run.

Now, moving on to another construct, the loop:
loop --loop until wait or exit is hit
for x in a to b loop --loop from a to b, or an exit or wait is hit
while a loop --loop until a is false, or exit or wait is hit

A normal loop is just a procedural statement like most other VHDL, so has to go inside a process, function or procedure.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top