RE: [sv-bc] proposal regarding enumeration types


Subject: RE: [sv-bc] proposal regarding enumeration types
From: Mark Hartoog (Mark.Hartoog@synopsys.com)
Date: Wed Jan 07 2004 - 09:48:54 PST


I believe this was an oversight that has been left of the LRM. You should be
able to use
a typedefed type or a type parameter as the base type of an enum. These are
both covered
by type_identifier. I agree with Brad that the optional signing should not
be allowed here. It is not allowed
on a data declaration.
  -----Original Message-----
  From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of Jacobi,
Dan
  Sent: Wednesday, January 07, 2004 9:07 AM
  To: sv-bc@eda.org
  Cc: Maidment, Matthew R
  Subject: [sv-bc] proposal regarding enumeration types

  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:50:39 PST