The restriction is trivially worked around by writing "if (1) begin ... end".
An important difference between V2K1 and V2K5 is that in V2K5, a generate block introduces a new level of hierarchy.
Regards,
Shalom
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Gal Vardi
Sent: Thursday, February 24, 2011 11:55 AM
To: SV-BC
Cc: Gal Vardi
Subject: RE: [sv-bc] Generate with multiple begins
Hi,
While fixing a Verilog-2001 code into SV standard, I just found one more example where toplevel labeled begin-ends are necessary:
If you want to re-use the same case statement code in several different generate blocks within the same module,
You must use toplevel labels (SEL1, SEL2) else you will get duplicated labels (CASEOR) in this example :
=======================================
generate
// mandatory label
begin:SEL1
case(SELECTOR1)
4'd1: begin:CASEOR
m_or g52 ();
end // CASEOR
4'd2: begin:CASEOR
m_or g52();
end
4'd3: begin:CASEOR
m_or g52 ();
end
4'd4: begin:CASEOR
m_or g52 ();
end
endcase
end:SEL1
endgenerate
// ------------------------------------------------
generate
// mandatory label
begin:SEL2
case(SELECTOR2)
4'd1: begin:CASEOR
m_or g52 ();
end // CASEOR
4'd2: begin:CASEOR
m_or g52();
end
4'd3: begin:CASEOR
m_or g52 ();
end
4'd4: begin:CASEOR
m_or g52 ();
end
endcase
end:SEL2
endgenerate
// ------------------------------------------------
Regards,
Gal Vardi
-- This message has been scanned for viruses and dangerous content by MailScanner<http://www.mailscanner.info/>, and is believed to be clean. --------------------------------------------------------------------- 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 Thu Feb 24 02:01:12 2011
This archive was generated by hypermail 2.1.8 : Thu Feb 24 2011 - 02:01:21 PST