sealed class BitPat extends BitSet with SourceInfoDoc

Bit patterns are literals with masks, used to represent values with don't care bits. Equality comparisons will ignore don't care bits.

Source
BitPat.scala
Example:
  1. "b10101".U === BitPat("b101??") // evaluates to true.B
    "b10111".U === BitPat("b101??") // evaluates to true.B
    "b10001".U === BitPat("b101??") // evaluates to false.B
Linear Supertypes
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. BitPat
  2. SourceInfoDoc
  3. BitSet
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new BitPat(value: BigInt, mask: BigInt, width: Int)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. macro def ##(that: BitPat): BitPat
  3. final def ##: Int
    Definition Classes
    AnyRef → Any
  4. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from BitPat toany2stringadd[BitPat] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  5. def ->[B](y: B): (BitPat, B)
    Implicit
    This member is added by an implicit conversion from BitPat toArrowAssoc[BitPat] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. macro def =/=(that: UInt): Bool
  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. macro def ===(that: UInt): Bool
  9. macro def apply(x: Int, y: Int): BitPat
  10. macro def apply(x: Int): BitPat
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. def cover(that: BitSet): Boolean

    Check whether this BitSet covers that (i.e.

    Check whether this BitSet covers that (i.e. forall b matches that, b also matches this)

    that

    BitPat to be covered

    returns

    true if this BitSet can cover that BitSet

    Definition Classes
    BitPatBitSet
  14. def do_##(that: BitPat)(implicit sourceInfo: SourceInfo): BitPat

  15. def do_=/=(that: UInt)(implicit sourceInfo: SourceInfo): Bool

  16. def do_===(that: UInt)(implicit sourceInfo: SourceInfo): Bool

  17. def do_apply(x: Int, y: Int)(implicit sourceInfo: SourceInfo): BitPat

  18. def do_apply(x: Int)(implicit sourceInfo: SourceInfo): BitPat

  19. def ensuring(cond: (BitPat) => Boolean, msg: => Any): BitPat
    Implicit
    This member is added by an implicit conversion from BitPat toEnsuring[BitPat] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: (BitPat) => Boolean): BitPat
    Implicit
    This member is added by an implicit conversion from BitPat toEnsuring[BitPat] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean, msg: => Any): BitPat
    Implicit
    This member is added by an implicit conversion from BitPat toEnsuring[BitPat] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean): BitPat
    Implicit
    This member is added by an implicit conversion from BitPat toEnsuring[BitPat] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def equals(obj: Any): Boolean

    Test whether two BitSet matches the same set of value

    Test whether two BitSet matches the same set of value

    returns

    true if two BitSet is same.

    Definition Classes
    BitPatBitSet → AnyRef → Any
    Note

    This method can be very expensive compared to ordinary == operator between two Objects

  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  26. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def getWidth: Int

    Get specified width of said BitPat

    Get specified width of said BitPat

    Definition Classes
    BitPatBitSet
  28. def hashCode(): Int
    Definition Classes
    BitPat → AnyRef → Any
  29. def intersect(that: BitPat): BitSet

    Intersect this and that BitPat.

    Intersect this and that BitPat.

    that

    BitPat to be intersected.

    returns

    a BitSet containing all elements of this that also belong to that.

  30. def intersect(that: BitSet): BitSet

    Intersect this and that BitSet.

    Intersect this and that BitSet.

    that

    BitSet to be intersected.

    returns

    a BitSet containing all elements of this that also belong to that.

    Definition Classes
    BitSet
  31. def inverse: BitSet

    Calculate the inverse of this pattern set.

    Calculate the inverse of this pattern set.

    returns

    A BitSet matching all value (of the given with) iff it doesn't match this pattern.

    Definition Classes
    BitSet
  32. def isEmpty: Boolean

    whether this BitSet is empty (i.e.

    whether this BitSet is empty (i.e. no value matches)

    Definition Classes
    BitPatBitSet
  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. val mask: BigInt
  35. def matches(input: UInt): Bool
    Definition Classes
    BitSet
  36. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. def overlap(that: BitSet): Boolean

    Check whether this BitPat overlap with that BitPat, i.e.

    Check whether this BitPat overlap with that BitPat, i.e. !(intersect.isEmpty)

    that

    BitPat to be checked.

    returns

    true if this and that BitPat have overlap.

    Definition Classes
    BitPatBitSet
  40. def rawString: String

    Generate raw string of a BitPat.

  41. def subtract(that: BitPat): BitSet

    Subtract a BitPat from this.

    Subtract a BitPat from this.

    that

    subtrahend BitPat.

    returns

    a BitSet containing elements of this which are not the elements of that.

  42. def subtract(that: BitSet): BitSet

    Subtract that from this BitSet.

    Subtract that from this BitSet.

    that

    subtrahend BitSet.

    returns

    a BitSet contining elements of this which are not the elements of that.

    Definition Classes
    BitSet
  43. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  44. def terms: Set[BitPat]

    all BitPat elements in terms make up this BitSet.

    all BitPat elements in terms make up this BitSet. all terms should be have the same width.

    Definition Classes
    BitPatBitSet
  45. def toString(): String
    Definition Classes
    BitPatBitSet → AnyRef → Any
  46. def union(that: BitSet): BitSet

    Union this and that BitSet

    Union this and that BitSet

    that

    BitSet to union.

    returns

    a BitSet containing all elements of this and that.

    Definition Classes
    BitSet
  47. val value: BigInt
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  51. val width: Int

Deprecated Value Members

  1. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from BitPat toStringFormat[BitPat] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  2. def [B](y: B): (BitPat, B)
    Implicit
    This member is added by an implicit conversion from BitPat toArrowAssoc[BitPat] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from SourceInfoDoc

Inherited from BitSet

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromBitPat to any2stringadd[BitPat]

Inherited by implicit conversion StringFormat fromBitPat to StringFormat[BitPat]

Inherited by implicit conversion Ensuring fromBitPat to Ensuring[BitPat]

Inherited by implicit conversion ArrowAssoc fromBitPat to ArrowAssoc[BitPat]

Ungrouped

SourceInfoTransformMacro

These internal methods are not part of the public-facing API!

The equivalent public-facing methods do not have the do_ prefix or have the same name. Use and look at the documentation for those. If you want left shift, use <<, not do_<<. If you want conversion to a Seq of Bools look at the asBools above, not the one below. Users can safely ignore every method in this group!

🐉🐉🐉 Here be dragons... 🐉🐉🐉

These do_X methods are used to enable both implicit passing of SourceInfo while also supporting chained apply methods. In effect all "normal" methods that you, as a user, will use in your designs, are converted to their "hidden", do_*, via macro transformations. Without using macros here, only one of the above wanted behaviors is allowed (implicit passing and chained applies)---the compiler interprets a chained apply as an explicit 'implicit' argument and will throw type errors.

The "normal", public-facing methods then take no SourceInfo. However, a macro transforms this public-facing method into a call to an internal, hidden do_* that takes an explicit SourceInfo by inserting an implicitly[SourceInfo] as the explicit argument.