On 05/02/2013 01:00 AM, Ethan Spitz wrote:
> Hi, I was wondering what the specific difference between a for loop used in generate and a for loop by itself in say a module is. Also, is genvar used only with generate, or can I use it with a by-itself for loop as its variable.
>
The generate keyword is optional. A for loop inside a
generate/endgenerate pair, and one without the generate/endgenerate pair
in the same place (inside a module but outside any procedural blocks)
are essentially the same thing. The only difference is the resulting
hierarchy.
A for loop not in a generate block (and not in a procedural block) is
still a loop generate construct and thus could use a genvar.
Jared