ChiselEnum

chisel3.ChiselEnum
abstract class ChiselEnum

Attributes

Source
ChiselEnum.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

class Type extends EnumType

Attributes

Companion
object
Source
ChiselEnum.scala
Supertypes
class EnumType
class Element
class Data
trait InstanceId
class Object
trait Matchable
class Any
Show all
object Type

Attributes

Companion
class
Source
ChiselEnum.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Type.type

Value members

Concrete methods

def all: Seq[Type]

All Enum values

All Enum values

Attributes

Source
ChiselEnum.scala
def allNames: Seq[String]

All Enum names

All Enum names

Attributes

Source
ChiselEnum.scala
def allWithNames: Seq[(Type, String)]

All Enum values with their names

All Enum values with their names

Attributes

Source
ChiselEnum.scala
def apply(): Type

Attributes

Source
ChiselEnum.scala
def apply(name: String): Type

Return the Enum value of which the name exactly matches the specified String. If @name does not match a valid Enum, fail

Return the Enum value of which the name exactly matches the specified String. If @name does not match a valid Enum, fail

Attributes

Source
ChiselEnum.scala
def apply(n: UInt)(implicit sourceInfo: SourceInfo): Type

Cast an UInt to the type of this Enum

Cast an UInt to the type of this Enum

Value parameters

n

the UInt to cast

Attributes

Returns

the equivalent Enum to the value of the cast UInt

Note

will give a Chisel elaboration time warning if the argument could hit invalid states

Source
ChiselEnum.scala
def asTable: String

Return all Enum (value, name) combinations in a string, one per line. Intended for parsing by external tools, e.g. sim environment, or as gtkwave text filter

Return all Enum (value, name) combinations in a string, one per line. Intended for parsing by external tools, e.g. sim environment, or as gtkwave text filter

Attributes

Source
ChiselEnum.scala
protected def do_Value(name: String): Type

Attributes

Source
ChiselEnum.scala
protected def do_Value(name: String, id: UInt): Type

Attributes

Source
ChiselEnum.scala
def getWidth: Int

Attributes

Source
ChiselEnum.scala
def safe(n: UInt)(implicit sourceInfo: SourceInfo): (Type, Bool)

Safely cast an UInt to the type of this Enum

Safely cast an UInt to the type of this Enum

Value parameters

n

the UInt to cast

Attributes

Returns

the equivalent Enum to the value of the cast UInt and a Bool indicating if the Enum is valid

Source
ChiselEnum.scala
override def toString: String

Print Enum type name, followed by with all Enum values with their names to a string like this: Opcodes(add=0, sub=1, mul=2, div=3)

Print Enum type name, followed by with all Enum values with their names to a string like this: Opcodes(add=0, sub=1, mul=2, div=3)

Attributes

Definition Classes
Any
Source
ChiselEnum.scala

Inherited methods

inline protected def Value(id: UInt): Type

Attributes

Inherited from:
ChiselEnumIntf (hidden)
Source
ChiselEnumIntf.scala
inline protected def Value: Type

Attributes

Inherited from:
ChiselEnumIntf (hidden)
Source
ChiselEnumIntf.scala