[sv-bc] genvar nesting

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Oct 29 2007 - 08:23:59 PDT
The LRM says with respect to genvars:

Because this implicit localparam has the same name as the genvar, any
reference to this name inside the
loop generate block will be a reference to the localparam, not to the
genvar. As a consequence, it is not
possible to have two nested loop generate constructs that use the same
genvar.

and that this is illegal:

genvar i;
for (i=0; i<5; i=i+1) begin:a
  for (i=0; i<5; i=i+1) begin:b
    ... // error -- using "i" as loop index for
    ... // two nested generate loops

What about the following:

for (genvar i=0; i<5; i=i+1) begin:a
  for (genvar i=0; i<5; i=i+1) begin:b
    ...

Legal? Why or not?

Thanks,
Shalom

Shalom Bresticker
Intel Jerusalem LAD DA
+972 2 589-6852
+972 54 721-1033

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Oct 29 08:24:54 2007

This archive was generated by hypermail 2.1.8 : Mon Oct 29 2007 - 08:25:09 PDT