Re: [sv-bc] enumeration types

From: Brad Pierce <Brad.Pierce@synopsys.com>
Date: Tue Dec 14 2004 - 10:54:24 PST

What I meant was that, in my opinion, the text of the LRM should
require that an enum base type be equivalent to some simple bit
vector type.

-- Brad

-----Original Message-----
From: Francoise Martinolle [mailto:fm@cadence.com]
Sent: Tuesday, December 14, 2004 10:45 AM
To: Brad.Pierce@synopsys.COM; sv-bc@eda.org
Subject: RE: [sv-bc] enumeration types

Brad,

it is legal as per the bnf
That is what the bnf specifies:

enum [ enum_base_type ] { enum_name_declaration { , enum_name_declaration }
}

enum_base_type ::=
integer_atom_type [ signing ]
| integer_vector_type [ signing ] [ packed_dimension ]
| type_identifier [ packed_dimension ]24

An integer_vector_type is defined as:
integer_vector_type ::= bit | logic | reg

Is that an errata?
Francoise
    '

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Brad
Pierce
Sent: Monday, December 13, 2004 11:46 AM
To: sv-bc@eda.org
Subject: Re: [sv-bc] enumeration types

I don't accept that 'logic' is a legal base type. I think that the base
type must be a vector, e.g.,

   typedef enum logic [0:0] {false, true} myenum;

and that if the LRM doesn't explicitly say that, it's an erratum.

-- Brad

-----Original Message-----
From: Francoise Martinolle [mailto:fm@cadence.com]
Sent: Monday, December 13, 2004 8:25 AM
To: 'Maidment, Matthew R'; 'Francoise Martinolle'; 'Steven Sharp';
sv-bc@eda.org; Brad.Pierce@synopsys.COM
Subject: RE: [sv-bc] enumeration types

I don't disagree with it being a scalar, I am just seeking confirmation that
this is the only case (with a base type) where an enumeration type could be
a scalar and we would have to check for bit selects or part selects and
issue an error.

Francoise
    '

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Maidment, Matthew R
Sent: Friday, December 10, 2004 10:29 PM
To: Francoise Martinolle; Steven Sharp; sv-bc@eda.org;
Brad.Pierce@synopsys.com
Subject: RE: [sv-bc] enumeration types

Why is this NOT a scalar?

>-----Original Message-----
>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
>Francoise Martinolle
>Sent: Friday, December 10, 2004 6:47 PM
>To: 'Steven Sharp'; sv-bc@eda.org; Brad.Pierce@synopsys.com
>Subject: RE: [sv-bc] enumeration types
>
>
>Yes, this is exactly my question.
>Is:
>typedef enum logic {flase, true} myenum; a scalar or a vector 1 bit
>wide.
>
>-----Original Message-----
>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
>Steven Sharp
>Sent: Thursday, December 09, 2004 7:12 PM
>To: sv-bc@eda.org; Brad.Pierce@synopsys.com
>Subject: RE: [sv-bc] enumeration types
>
>Yes, the standard clearly states that it is illegal to bit-select a
>scalar.
>
>The question is whether that applies to an enum that was declared with
>an underlying base type that is a scalar. In other words, when an enum
>data object is used in an expression, is it treated like it is of the
>base type of the enum?
>
>Steven Sharp
>sharp@cadence.com
>
>
>
Received on Tue Dec 14 10:52:37 2004

This archive was generated by hypermail 2.1.8 : Tue Dec 14 2004 - 10:52:42 PST