RE: [sv-bc] enumeration types

From: Maidment, Matthew R <matthew.r.maidment@intel.com>
Date: Thu Dec 09 2004 - 15:41:50 PST

I agree with your conclusions. It should not be legal to
index into an enum if the base type is a scalar.
 
Practically speaking, my experience is that various simulators
consider it a "feature" to enable reference to a scalar with the index
[0].
Not all tools allow it and it's not in the standard AFAICT.
 
Matt

________________________________

        From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf
Of Francoise Martinolle
        Sent: Thursday, December 09, 2004 1:50 PM
        To: sv-bc@eda.org
        Subject: [sv-bc] enumeration types
        
        
        I think that the following is legal:
        typedef enum bit {bit0, bit1} mybit;
         
        But can I use a bit select of a variable of that type when the
base type of the enum is just bit or logic or alias
        thereof?
         
        mybit v;
         
        initial v[0] = 1'b0;
         
         
        I think that if I define:
        typedef enum bit[0:0] {bit0, bit1} mybitvec;
         
        v[0] is legal.
         
        Francoise
               '
Received on Thu Dec 9 15:42:04 2004

This archive was generated by hypermail 2.1.8 : Thu Dec 09 2004 - 15:42:10 PST