[sv-bc] proposal regarding enumeration types


Subject: [sv-bc] proposal regarding enumeration types
From: Jacobi, Dan (dan.jacobi@intel.com)
Date: Wed Jan 07 2004 - 09:06:58 PST


Hello All,

            Matt Maidment and my-self found a small problem with the
grammar of the enumeration definitions.

 

Following is a short proposal regarding this issue.

 

 

Motivation

=======

Due to the following BNF from A.2.2.1 Net and variable types

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 ]

 

The following RTL is considered legal

typedef enum logic [1:0] {a,b,c,d} myenumtype1;

typedef enum bit {on,off} myenumtype2;

 

However the following RTL should yield on a syntax error

  typedef logic[1:0] logicarray;

  typedef enum logicarray {a,b,c,d} myenumtype1;

 

  typedef bit mybit;

  typedef enum mybit {on,off} myenumtype2;

 

typedef bit mybit;

typedef enum mybit [1:0] {on,off} myenumtype3;

 

 

Proposal

=======

Under Section A.2.2.1 Net and variable types

REPLACE

enum_base_type ::=

integer_atom_type [ signing ]

| integer_vector_type [ signing ] [ packed_dimension ]

WITH (adding the last rule)

            enum_base_type ::=

integer_atom_type [ signing ]

| integer_vector_type [ signing ] [ packed_dimension ]

| type_identifier [ signing ] [ packed_dimension ] 23

 

(23 is in superscript indicating a foot note index)

 

Under Appendix A in the note section

ADD the corresponding foot note

23) A typedef identifier may be used only if it defines an integer
vector type or an integer atom type (for the later a packed dimension
may not be used).

 

Thanks

Dan Jacobi, Intel Corporation

Tel : +(972)-4-8655855

 



This archive was generated by hypermail 2b28 : Wed Jan 07 2004 - 09:07:49 PST