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


Subject: Re: [sv-bc] New errata for enumeration type bnf definition
From: Clifford E. Cummings (cliffc@sunburst-design.com)
Date: Fri Jan 16 2004 - 16:09:20 PST


I believe Brad is correct.

By default, the enum type is "int," which cannot be sized. Sizing requires
a sized type to be declared along with the range.

Regards - Cliff

At 02:59 PM 1/16/2004, 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
>> '
>
>----------------------------------------------------
>Cliff Cummings - Sunburst Design, Inc.
>14314 SW Allen Blvd., PMB 501, Beaverton, OR 97005
>Phone: 503-641-8446 / FAX: 503-641-8486
>cliffc@sunburst-design.com / www.sunburst-design.com
>Expert Verilog, SystemVerilog, Synthesis and Verification Training



This archive was generated by hypermail 2b28 : Fri Jan 16 2004 - 16:16:18 PST