Returns n unique values of the specified type.
Returns n unique values of the specified type. Can be used with unpacking to define enums.
nodeType must be of UInt type (note that Bits() creates a UInt) with unspecified width.
val state_on :: state_off :: Nil = Enum(UInt(), 2) val current_state = UInt() switch (current_state) { is (state_on) { ... } if (state_off) { ... } }
Returns n unique UInt values, use with unpacking to specify an enumeration.
Returns n unique UInt values, use with unpacking to specify an enumeration.
val state_on :: state_off :: Nil = Enum(2) val current_state = UInt() switch (current_state) { is (state_on) { ... } if (state_off) { ... } }
Returns a sequence of Bits subtypes with values from 0 until n.
Returns a sequence of Bits subtypes with values from 0 until n. Helper method.
An old Enum API that returns a map of symbols to UInts.
An old Enum API that returns a map of symbols to UInts.
Unlike the new list-based Enum, which can be unpacked into vals that the compiler understands and can check, map accesses can't be compile-time checked and typos may not be caught until runtime.
Despite being deprecated, this is not to be removed from the compatibility layer API. Deprecation is only to nag users to do something safer.
(Since version not soon enough) Use list-based Enum
An old Enum API that returns a map of symbols to UInts.
An old Enum API that returns a map of symbols to UInts.
Unlike the new list-based Enum, which can be unpacked into vals that the compiler understands and can check, map accesses can't be compile-time checked and typos may not be caught until runtime.
Despite being deprecated, this is not to be removed from the compatibility layer API. Deprecation is only to nag users to do something safer.
(Since version not soon enough) Use list-based Enum