ISSUE 631

Add Proposal  Add Analysis  Edit Class, Environment, or Release
Number 631
Category errata
Synopsis Issue: Genvar Clarification
State open
Class errata-simple
Arrival-DateNov 08 2004
Originator Bineet SRIVASTAVA <bineet.srivastava@st.com>
Release 2001b
Description
Hello,

according to section 12.1.3.1 on "genvar - generate statement index
variable"

"A genvar is an integer that is local to and shall only be used within a
generate loop that uses it as an index variable."

&

"The value of a genvar can be referenced in any context where the value
of a parameter could be referenced."

Clarification is sought for, can we have genvar passed as the parameter
value assignment for module instantiation??



bineet

-----Original Message-----
From: owner-etf@boyd.com [mailto:owner-etf@boyd.com] On Behalf Of
Shalom.Bresticker@freescale.com
Sent: Monday, November 08, 2004 1:50 PM
To: etf-bugs@boyd.com
Subject: Re: errata/288: PROPOSAL - 4.1.14: replication operator and
function calls


The following reply was made to PR errata/288; it has been noted by GNATS.

From: Shalom.Bresticker@freescale.com
To: brad.pierce@synopsys.com
Cc: etf-bugs@boyd.com
Subject: Re: errata/288: PROPOSAL - 4.1.14: replication operator and
function calls
Date: Mon, 8 Nov 2004 10:26:48 +0200 (IST)

Brad,

Without taking a position on your proposal, it should include closing 527
as well.

Shalom

--
Shalom Bresticker Shalom.Bresticker @freescale.com
Design & Verification Methodology Tel: +972 9 9522268
Freescale Semiconductor Israel, Ltd. Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 5441478



Fix

Unknown
Audit-Trail
From: Shalom Bresticker <Shalom.Bresticker@freescale.com>
To: Bineet SRIVASTAVA <bineet.srivastava@st.com>
Cc: etf-bugs@boyd.com
Subject: Re: errata/631: Genvar Clarification
Date: Mon, 08 Nov 2004 14:09:56 +0200

Hi,

There is a new version of the generate description.

It says,

"A loop generate construct permits a generate block to be instantiated multiple
times using syntax that is similar to a for-loop statement. The loop index
variable must be declared in a genvar declaration prior to its use in a loop
generate scheme.

The genvar is used as an integer during elaboration to evaluate the generate
loop and create instances of the generate block, but it does not exist at
simulation time. A genvar shall not be referenced anywhere other than in a loop
generate scheme.

Both the initialization and iteration assignments in the loop generate scheme
shall assign to the same genvar. The initialization assignment shall not
reference the loop index variable on the right hand side.

Within the generate block of a loop generate construct, there is an implicit
localparam declaration. This is an integer parameter that has the same name and
type as the loop index variable, and its value within each instance of the
generate block is the value of the index variable at the time the instance was
elaborated. This parameter can be used anywhere within the generate block that
a normal parameter with an integer value can be used. It can be referenced with
a hierarchical name.

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."

So I believe the answer to your question is yes.

However, if you will give an example of what you want to do, your question will
be clearer.

Thanks,
Shalom


> According to section 12.1.3.1 on "genvar - generate statement index
> variable"
>
> "A genvar is an integer that is local to and shall only be used within a
> generate loop that uses it as an index variable."
>
> "The value of a genvar can be referenced in any context where the value
> of a parameter could be referenced."
>
> Clarification is sought for, can we have genvar passed as the parameter
> value assignment for module instantiation??

--
Shalom Bresticker Shalom.Bresticker @freescale.com
Design & Verification Methodology Tel: +972 9 9522268
Freescale Semiconductor Israel, Ltd. Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 5441478

[ ]Freescale Internal Use Only [ ]Freescale Confidential Proprietary



From: Steven Sharp <sharp@cadence.com>
To: etf-bugs@boyd.com, bineet.srivastava@st.com
Cc:
Subject: Re: errata/631: Issue: Genvar Clarification
Date: Mon, 8 Nov 2004 14:46:33 -0500 (EST)

>according to section 12.1.3.1 on "genvar - generate statement index
>variable"
>
>"A genvar is an integer that is local to and shall only be used within a
>generate loop that uses it as an index variable."
>
>&
>
>"The value of a genvar can be referenced in any context where the value
>of a parameter could be referenced."
>
>Clarification is sought for, can we have genvar passed as the parameter
>value assignment for module instantiation??

Yes. Assuming that the module instantiation is inside the generate loop,
then the genvar is being used within the generate loop, as required. The
parameter being overridden with the value of the genvar is not inside the
generate loop, but the use of the genvar is.

As Shalom has said, there has been some rewording to resolve the potential
confusion between the genvar, which takes on different values as controlled
by the for-loop, and a reference to the genvar inside the loop scope, which
is a constant for any given instance of the loop scope. But the answer to
your question is still "Yes". The only difference is that now you aren't
technically using the genvar in the parameter value override, you are using
the implicitly declared localparam that has the same name as the genvar.
It is declared in the scope associated with the generate-loop, and can be
used like any localparam declared in that scope.

Steven Sharp
sharp@cadence.com

Unformatted



Hosted by Boyd Technology