MuxLookup

chisel3.util.MuxLookup
object MuxLookup

Creates a cascade of n Muxs to search for a key value. The Selector may be a UInt or an EnumType.

Attributes

Example
MuxLookup(idx, default)(Seq(0.U -> a, 1.U -> b))
MuxLookup(myEnum, default)(Seq(MyEnum.a -> 1.U, MyEnum.b -> 2.U, MyEnum.c -> 3.U))
Source
Mux.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MuxLookup.type

Members list

Value members

Inherited methods

def apply[S <: UInt, T <: Data](key: S, default: T, mapping: Seq[(S, T)])(using SourceInfo): T

Value parameters

default

a default value if nothing is found

key

a key to search for

mapping

a sequence to search of keys and values

Attributes

Returns

the value found or the default if not

Inherited from:
MuxLookup$Intf (hidden)
Source
MuxIntf.scala
def applyEnum[S <: EnumType, T <: Data](key: S, default: T, mapping: Seq[(S, T)])(using SourceInfo): T

Value parameters

default

a default value if nothing is found

key

a key to search for

mapping

a sequence to search of keys and values

Attributes

Returns

the value found or the default if not

Inherited from:
MuxLookup$Intf (hidden)
Source
MuxIntf.scala