Re: [sv-bc] New errata for enumeration type bnf definition


Subject: Re: [sv-bc] New errata for enumeration type bnf definition
From: Francoise Martinolle (fm@cadence.com)
Date: Mon Jan 19 2004 - 08:02:06 PST


If that is incorrect, then why do we have examples which show that you can
only have the range specified?

// Error in the bronze and gold member declarations
enum [3:0] {bronze=5'h13, silver, gold=3'h5} medal4;
// Error in c declaration, requires at least 2 bits
enum [0:0] {a,b,c} alphabet;

Francoise
       '

At 05:59 PM 1/16/2004 -0500, Francoise Martinolle wrote:
>Brad,
>
>Yes, the example should have been:
>enum [3:0] {a,b,c,d} alphabet;
>
>
>
>The bnf is currently
>
>data_type_common_item = ...
> enum [ enum_base_type ] {
> enum_name_declaration { , enum_name_declaration } }
>
>enum_base_type ::=
>integer_atom_type [ signing ]
>| integer_vector_type [ signing ] [ packed_dimension ]
>
>enum_name_declaration ::=
>enum_identifier [ [ integral_number ] ] [ = constant_expression ]
>| enum_identifier [ [ integral_number : integral_number ] ] [ =
>constant_expression ]
>
>integer_vector_type ::= bit | logic | reg
>integer_atom_type ::= byte | shortint | int | longint | integer
>
>
>The bnf does not allow to have an optional integer_atom_type or
>integer_vector_type. I cannot write enum [3:0] ... it looks like I always
>have to specify either logic or bit or reg wherever I want to specify an
>explicit range.
>
>
>
>
>At 02:39 PM 1/16/2004 -0800, Brad Pierce wrote:
>>Francoise,
>>
>>I think the = in your example is not correct syntax.
>>Also, according to the second paragraph of 3.10,
>>
>> "In the absence of a data type declaration, the
>> default data type shall be 'int'. Any other
>> data type used with enumerated types shall
>> require an explicit data type declaration."
>>
>>So I think the BNF is correct for this issue.
>>
>>-- Brad
>>
>>
>>-----Original Message-----
>>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of
>>Francoise Martinolle
>>Sent: Friday, January 16, 2004 11:40 AM
>>To: sv-bc@eda.org
>>Subject: [sv-bc] New errata for enumeration type bnf definition
>>
>>
>>I believe that the BNF is not correct and does not support the following
>>legal enumeration type:
>>
>>enum [3:0] = {a, b, c, b};
>>
>>
>>The bnf seems to require to have the bit or logic qualifier before the
>>range.
>>
>>Francoise
>> '



This archive was generated by hypermail 2b28 : Mon Jan 19 2004 - 13:37:33 PST