object BitPat
- Source
- BitPat.scala
- Alphabetic
- By Inheritance
- BitPat
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit class fromUIntToBitPatComparable extends SourceInfoDoc
Value Members
- def N(width: Int = 1): BitPat
Creates a
BitPat
of all 0 of the specified bitwidth.Creates a
BitPat
of all 0 of the specified bitwidth.val myN = BitPat.N(4) // equivalent to BitPat("b0000")
Example: - def Y(width: Int = 1): BitPat
Creates a
BitPat
of all 1 of the specified bitwidth.Creates a
BitPat
of all 1 of the specified bitwidth.val myY = BitPat.Y(4) // equivalent to BitPat("b1111")
Example: - def apply(x: UInt): BitPat
Allows UInts to be used where a BitPat is expected, useful for when an interface is defined with BitPats but not all cases need the partial matching capability.
Allows UInts to be used where a BitPat is expected, useful for when an interface is defined with BitPats but not all cases need the partial matching capability.
- Note
the UInt must be a literal
- def apply(n: String): BitPat
Creates a
BitPat
literal from a string.Creates a
BitPat
literal from a string.- n
the literal value as a string, in binary, prefixed with 'b'
- Note
legal characters are '0', '1', and '?', as well as '_' and white space (which are ignored)
- def bitPatToUInt(x: BitPat): UInt
Allows BitPats to be used where a UInt is expected.
Allows BitPats to be used where a UInt is expected.
- Note
the BitPat must not have don't care bits (will error out otherwise)
- def dontCare(width: Int): BitPat
Creates a
BitPat
of all don't cares of the specified bitwidth.Creates a
BitPat
of all don't cares of the specified bitwidth.val myDontCare = BitPat.dontCare(4) // equivalent to BitPat("b????")
Example: