I don't see any text in the LRM that addresses this. I would favor making
it an error. For a signed base type, we should also define what happens when
a positive values wraps around to a negative. Is that an error?
Andy Tsay wrote:
> What is the value of 'yellow' in the following example?
> module test(output [1:0] out);
> typedef enum bit [1:0] { red=2'b01, green=2'b11, yellow} Colors;
> assign out = red;
> endmodule
>
> The section '3.10 Enumerations' seems to say 'yellow' is assigned
> with an automatically incremented value after 'green'.
> Does 'yellow' get 2'b00 without error
> or 3'b100 with error?
>
> Thanks,
> Andy Tsay
>
Received on Mon Jun 14 17:36:33 2004
This archive was generated by hypermail 2.1.8 : Mon Jun 14 2004 - 17:36:45 PDT