From: Francoise Martinolle (fm@cadence.com)
Date: Mon Apr 05 2004 - 10:20:27 PDT
My improved comments are in green color
Example_12_4_3.v
// Example in section 12.4.3 (reformatted and comments added)
module top;
parameter genblk2 = 0;
genvar i;
// generate scope is implicitly named genblk1
if (genblk2) reg a; // top.genblk1.a
else reg b; // top.genblk1.b
// generate scope is implicitly named genblk02 as genblk2 is already a
declared identifier
if (genblk2) reg a; // top.genblk02.a
else reg b; // top.genblk02.b
// generate scope would have been named genblk3 but is explicitly named g1
for (i = 0; i < 1; i = i + 1) begin : g1 // block name
// generate scope would be named genblk1 as the first nested scope inside of g1
if (1) reg a; // top.g1[0].genblk1.a
end
// generate scope is implicitly named genblk4 as the previous generate
construct would have been named genblk3 if it would not have been
explicitly named g1
for (i = 0; i < 1; i = i + 1)
// generate scope is implicitly named genblk1 as the first nested scope of
genblk4
if (1) reg a; // top.genblk4[0].genblk1.a
// generate scope is implicitly named genblk5
if (1) reg a; // top.genblk5.a
endmodule
This archive was generated by hypermail 2.1.4
: Mon Apr 05 2004 - 10:02:44 PDT
and
sponsored by Boyd Technology, Inc.