[sv-bc] Queries regarding packed dimension for enum type

From: Surya Pratik Saha <spsaha_at_.....>
Date: Tue Feb 24 2009 - 20:51:03 PST
Hi,

I have some queries regarding the new feature (ref 1800-2009 draft7a, sec:6.19) that allows specifying packed dimension for enum type ::

-- Should we consider the packed dimensions for base type size calculation?
Please consider the following example

typedef enum bit [1:0] {VIOLET, INDIGO, BLUE, GREEN, YELLOW, ORANGE, RED} eType;

This is an error as the enum member 'YELLOW' has value that is outside the range of the enum.
But instead of the above if we specify

typedef enum bit [1:0] {VIOLET, INDIGO, BLUE, GREEN, YELLOW, ORANGE, RED} [1:0] eType;

Will this be correct? For this case what will be the base type width of the enum type - 4 or 2.

-- What will be the processing order of indexes for bit/part select case on enum?

Lets consider the following example ::

typedef enum bit [1:0] {VIOLET, INDIGO, BLUE} [3:0] eType;
                                ^                                                   ^
                                a                                                    b

eType [5:0] var [7:0];
            ^           ^           
             c          d


For an expression like var[i][j][k][l] in which order the dimensions will be processed ?Will it be (d -> c -> b -> a) or something different.

-- For the above example are both the following statements correct ?
   assign var[0][0][0][0] = BLUE;
   assign var[0][0][0] = BLUE;



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. Received on Tue Feb 24 20:52:30 2009

This archive was generated by hypermail 2.1.8 : Tue Feb 24 2009 - 20:53:28 PST