RE: [sv-ec] Associative array with enum index

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Oct 23 2006 - 08:18:02 PDT
Yes, but that is where the enum is the element type, not the index type,
I think.

Shalom


> -----Original Message-----
> From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org]
On
> Behalf Of Francoise Martinolle
> Sent: Monday, October 23, 2006 5:12 PM
> To: Steven Sharp; sv-ec@server.eda.org; Brad.Pierce@synopsys.com
> Subject: RE: [sv-ec] Associative array with enum index
> 
>  The table 5.9.1 states that the default initial value for the base
type
> of the enum type should be
> returned for a non existing array index.
> 
> 
> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
> Steven Sharp
> Sent: Saturday, October 21, 2006 6:14 PM
> To: sv-ec@eda.org; Brad.Pierce@synopsys.com
> Subject: Re: [sv-ec] Associative array with enum index
> 
> 
> >From: "Brad Pierce" <Brad.Pierce@synopsys.com>
> 
> >If the index type of an associative array is an enumeration type, and
> >an expression not equivalent to the enum type is used instead, such
as
> >integer, is that an error?  I hope so and that the expression would
> >need to be cast.
> 
> I would assume so.  It says that indices larger or smaller than the
> index type get truncated or extended, but that is the normal implicit
> conversion for integral types.  There is not an implicit conversion
from
> an integer to an enum, so I agree that that should be an error.
> 
> 
> >If an expression is cast to the enumeration type, but does not have a
> >valid value for that enumeration type, is this treated as in 5.9.6?
> >That is, return default initial value on read and do nothing on
write?
> 
> That is one possible way it could be defined.  A simpler way would be
to
> just use the value given, and do reads and writes normally.  Your
> suggestion would require an extra run-time value check before every
> access to the AA.
> 
> What would be the most likely uses of an AA with an enum index?  That
> might tell us what the desired behavior would be, and whether the
extra
> cost is justified.
> 
> Steven Sharp
> sharp@cadence.com
Received on Mon Oct 23 08:19:55 2006

This archive was generated by hypermail 2.1.8 : Mon Oct 23 2006 - 08:19:59 PDT