Subject: RE: [sv-bc] enumerated types
From: Karen Pieper (Karen.Pieper@synopsys.com)
Date: Sat Aug 30 2003 - 08:54:44 PDT
Bounced mail...
>From: "Mark Hartoog" <Mark.Hartoog@synopsys.com>
>To: <sv-bc@server.eda.org>
>Subject: RE: [sv-bc] enumerated types
>Date: Fri, 29 Aug 2003 13:02:11 -0700
>Message-ID: <NGEBIPIGDOEMMEDCGNHPKEKKEDAA.markh@synopsys.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="us-ascii"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3 (Normal)
>X-MSMail-Priority: Normal
>X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Importance: Normal
>In-Reply-To: <HPECIHFPOFICGBKPKCGMOEFFDCAA.bpierce@synopsys.com>
>
> > Two places that constant expressions are defined --
> >
> > A.8.3 (p. 294) in SV3.1 LRM
> >
> > Third paragraph of Clause 4 in V2K LRM, plus 10.3.5 in V2K LRM
> >
> > -- Brad
>
>Section 5.3 in the SV3.1 LRM also discusses constants. It says that
>localparam, specparm and 'const' variables are named constants.
>
>So is this legal:
>
>const int i = 5;
>typedef enum {A=i} ET;
>
>The final paragraph of section 5.3 points out that localparams, specparams,
>and parameters are elaboration time constants, while 'const' variables
>are simulation time constants. I believe that the constant_expression
>BNF production is intended to cover elaboration time constants, not
>simulation time constants. I think this means the above is illegal.
>
>Another question, are enum labels themselves constant expressions?
>This would be something like:
>
>typedef enum {A, B=A+1} ET;
>
>What if you wrote:
>
>typedef enum {A, B=A+1} ET;
>logic [B:0] l;
>
>The current BNF for constant_primaries does not include enum labels,
>so the current BNF would appear to exclude this.
>
>Mark Hartoog
>700 E. Middlefield Road
>Mountain View, CA 94043
>650 584-5404
>markh@synopsys.com
This archive was generated by hypermail 2b28 : Sat Aug 30 2003 - 08:56:06 PDT