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

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Mon Oct 23 2006 - 09:08:47 PDT
Well, that is the question, but I think that is different from what
Francoise was saying.

Shalom

> -----Original Message-----
> From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org]
On
> Behalf Of Arturo Salz
> Sent: Monday, October 23, 2006 6:07 PM
> To: Bresticker, Shalom; Francoise Martinolle; sv-ec@server.eda.org
> Subject: RE: [sv-ec] Associative array with enum index
> 
> Shalom,
> 
> I'm sorry, but I believe the sentence quoted by Brad is clear.
> 
> Indexing and associative array by an enum value that lies outside the
> enumeration's set is no different than indexing a regular (static)
array
> by an out-of-bounds index. The behavior in either case is to return
the
> default value of the element type.
> 
> 	Arturo
> 
> -----Original Message-----
> From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
> Bresticker, Shalom
> Sent: Monday, October 23, 2006 8:26 AM
> To: Francoise Martinolle; sv-ec@eda.org
> Subject: RE: [sv-ec] Associative array with enum index
> 
> You are not reading the index value, you read the data value of the
> indexed entry.
> 
> Shalom
> 
> > -----Original Message-----
> > From: Francoise Martinolle [mailto:fm@cadence.com]
> > Sent: Monday, October 23, 2006 5:22 PM
> > To: Bresticker, Shalom; sv-ec@eda.org
> > Subject: RE: [sv-ec] Associative array with enum index
> >
> >
> > That is not clear what "array type" means. I interpreted it to the
> > the array index type, you interpreted it to the the array element
> type.
> >
> > Francoise
> >     '
> > -----Original Message-----
> > From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com]
> > Sent: Monday, October 23, 2006 11:18 AM
> > To: Francoise Martinolle; sv-ec@eda.org
> > Subject: RE: [sv-ec] Associative array with enum index
> >
> > 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 09:09:31 2006

This archive was generated by hypermail 2.1.8 : Mon Oct 23 2006 - 09:09:35 PDT