Enum

chisel3.util.Enum
See theEnum companion object
trait Enum

Defines a set of unique UInt constants

Unpack with a list to specify an enumeration. Usually used with switch to describe a finite state machine.

Attributes

Example
val state_on :: state_off :: Nil = Enum(2)
val current_state = WireDefault(state_off)
switch (current_state) {
 is (state_on) {
   ...
 }
 is (state_off) {
   ...
 }
}
Companion
object
Source
Enum.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Enum

Members list

Value members

Concrete methods

def apply(n: Int): List[UInt]

Returns n unique UInt values

Returns n unique UInt values

Value parameters

n

Number of unique UInt constants to enumerate

Attributes

Returns

Enumerated constants

Source
Enum.scala