increment, decrement enumeration typed variables


Subject: increment, decrement enumeration typed variables
From: Francoise Martinolle (fm@cadence.com)
Date: Fri Dec 06 2002 - 15:48:15 PST


Does anyone remember what was the decision in the sv-bc committee
about incrementing variables of enumeration types. It is unspecified
in the standard.

Do the values wrap around?
example:
enum Colors = {red, blue, green};

Colors c;

initial
   c= red;
   c++; // this should assign blue to c
   c += 2; // if wrap around, this should assign red to c
endinitial

The testbench donation specifies the effect of these operations to wrap
around the values space.
Francoise
    '



This archive was generated by hypermail 2b28 : Fri Dec 06 2002 - 15:48:52 PST