Enums
Enums are a simple, unparameterizable logic type that contain a list of variants, each with a specified numeric value. In the future, automatic value determination may be supported. Enums support equality and inequality operators, and assignments from other values of the same enum type. See unions for a Rust-like enum type, known as a tagged union or sum type.
Validator
An enum declaration creates a LogicType
that can only assign from/to itself. It also has accessors for each variant, which return a LogicVal
with the logic type of that enum. Timing and assignability are handled the same as any logic value.
Generator
Enum values become basic wires of the minimum width required to represent the largest variant value. Any instantiations of an enum from a variant accessor become constant values.