spinal.core

Bits

Related Doc: package core

class Bits extends BitVector with DataPrimitives[Bits] with BitwiseOp[Bits]

The Bits type corresponds to a vector of bits that does not convey any arithmetic meaning.

Example:
  1. val myBits1 = Bits(32 bits)
    val myBits2 = B(25, 8 bits)
    val myBits3 = B"8'xFF"
    val myBits4 = B"1001_0011
See also

Bits Documentation

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Bits
  2. BitwiseOp
  3. DataPrimitives
  4. BitVector
  5. CheckWidth
  6. Widthable
  7. WidthProvider
  8. BaseType
  9. AssignementTreePart
  10. Data
  11. Assignable
  12. NameableByComponent
  13. Nameable
  14. OwnableRef
  15. Node
  16. SpinalTagReady
  17. ScalaLocated
  18. ContextUser
  19. GlobalDataUser
  20. AnyRef
  21. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Bits()

Type Members

  1. abstract type RefOwnerType

    Definition Classes
    OwnableRef
  2. type T = Bits

    Used to know the data type of the children class of BitVector

    Used to know the data type of the children class of BitVector

    Definition Classes
    BitsBitVector

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. def ##(right: Bits): Bits

    Concatenation between two Bits

    Concatenation between two Bits

    right

    a Bits to append

    returns

    a new Bits of width (w(this) + w(right))

    Example:
    1. val myBits2 = bits1 ## bits2
  3. def ##(right: Data): Bits

    Definition Classes
    Data
  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. def &(right: Bits): Bits

    Logical AND operator

    Logical AND operator

    Definition Classes
    BitsBitwiseOp
  6. def :=(rangesValue: (Any, Any), _rangesValues: (Any, Any)*): Unit

    Assign a range value to a Bits

    Assign a range value to a Bits

    rangesValue

    The first range value

    _rangesValues

    Others range values

    Example:
    1. core.io.interrupt = (0 -> uartCtrl.io.interrupt, 1 -> timerCtrl.io.interrupt, default -> false)
  7. def :=(that: Bits): Unit

    Definition Classes
    DataPrimitives
  8. def <<(that: UInt): Bits

    Logical shift left (output width will increase of w(this) + max(that) bits

  9. def <<(that: Int): Bits

    Logical shift left (output width will increase)

    Logical shift left (output width will increase)

    that

    the number of shift

    returns

    a Bits of width : w(this) + that bits

    Example:
    1. val result = myBits << 4
  10. def <>(that: Bits): Unit

    Definition Classes
    DataPrimitives
  11. def =/=(that: Bits): Bool

    Definition Classes
    DataPrimitives
  12. def =/=(that: MaskedLiteral): Bool

    BitVector is not equal to MaskedLiteral

    BitVector is not equal to MaskedLiteral

    Definition Classes
    BitVector
  13. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def ===(that: Bits): Bool

    Definition Classes
    DataPrimitives
  15. def ===(that: MaskedLiteral): Bool

    Compare a BitVector with a MaskedLiteral (M"110--0")

    Compare a BitVector with a MaskedLiteral (M"110--0")

    that

    the maskedLiteral

    returns

    a Bool data containing the result of the comparison

    Definition Classes
    BitVector
    Example:
    1. val myBool = myBits === M"0-1"
  16. def >>(that: UInt): Bits

    Logical shift right (output width == input width)

  17. def >>(that: Int): Bits

    Logical shift right (output width will decrease)

    Logical shift right (output width will decrease)

    that

    the number of shift

    returns

    a Bits of width : w(this) - that bits

    Example:
    1. val result = myBits >> 4
  18. def \(that: Bits): Bits

    Definition Classes
    DataPrimitives
  19. def ^(right: Bits): Bits

    Logical XOR operator

    Logical XOR operator

    Definition Classes
    BitsBitwiseOp
  20. var _spinalTags: Set[SpinalTag]

    Definition Classes
    SpinalTagReady
  21. def addAttribute(attribute: Attribute): Bits.this.type

    Definition Classes
    BaseTypeDataSpinalTagReady
  22. def addAttribute(name: String, value: String): Bits.this.type

    Definition Classes
    SpinalTagReady
  23. def addAttribute(name: String): Bits.this.type

    Definition Classes
    SpinalTagReady
  24. def addTag(spinalTag: SpinalTag): Bits.this.type

    Definition Classes
    SpinalTagReady
  25. def addTags(tags: Iterable[SpinalTag]): Bits.this.type

    Definition Classes
    SpinalTagReady
  26. def allowPruning(): Unit

    Definition Classes
    Data
  27. def allowSimplifyIt(): Bits.this.type

    Definition Classes
    BaseTypeData
  28. def andR: Bool

    Logical AND of all bits

    Logical AND of all bits

    Definition Classes
    BitVector
  29. def apply(offset: UInt, bitCount: BitCount): Bits.this.type

    Return a range of bits at offset and of width bitCount

    Return a range of bits at offset and of width bitCount

    Definition Classes
    BitsBitVector
    Example:
    1. val myBool = myBits(myUInt, 2 bits)
  30. def apply(offset: Int, bitCount: BitCount): Bits.this.type

    Return a range of bits at offset and of width bitCount

    Return a range of bits at offset and of width bitCount

    Definition Classes
    BitsBitVector
    Example:
    1. val myBool = myBits(3, 2 bits)
  31. def apply(bitId: UInt): Bool

    Return the bit at index bitId

    Return the bit at index bitId

    Definition Classes
    BitsBitVector
    Example:
    1. val myBool = myBits(myUInt)
  32. def apply(bitId: Int): Bool

    Return the bit at index bitId

    Return the bit at index bitId

    Definition Classes
    BitsBitVector
    Example:
    1. val myBool = myBits(3)
  33. def apply(range: Range): Bits.this.type

    Return a range of bits

    Return a range of bits

    Definition Classes
    BitVector
    Example:
    1. val myBool = myBits(3 downto 1)
  34. def apply(hi: Int, lo: Int): Bits.this.type

    Return a range of bits form hi index to lo index

    Return a range of bits form hi index to lo index

    Definition Classes
    BitVector
    Example:
    1. val myBool = myBits(3, 1)
  35. def asBits: Bits

    Definition Classes
    BitsData
  36. def asBools: Vec[Bool]

    Cast the BitVector into a Vector of Bool

    Cast the BitVector into a Vector of Bool

    returns

    a vector of Bool

    Definition Classes
    BitVector
  37. def asData: Data

    Definition Classes
    Data
  38. def asDirectionLess(): Bits.this.type

    Definition Classes
    BaseTypeData
  39. def asInput(): Bits.this.type

    Definition Classes
    BaseTypeData
  40. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  41. def asOutput(): Bits.this.type

    Definition Classes
    BaseTypeData
  42. def asSInt: SInt

    Cast a Bits to a SInt

    Cast a Bits to a SInt

    returns

    a SInt data

    Example:
    1. val mySInt = myBits.asSInt
  43. def asUInt: UInt

    Cast a Bits to an UInt

    Cast a Bits to an UInt

    returns

    an UInt data

    Example:
    1. val myUInt = myBits.asUInt
  44. def assignDontCare(): Bits.this.type

    Definition Classes
    BitVectorBaseTypeData
  45. final def assignFrom(that: AnyRef, conservative: Boolean): Unit

    Definition Classes
    Assignable
  46. def assignFromBits(bits: Bits, hi: Int, lo: Int): Unit

    Definition Classes
    BitsData
  47. def assignFromBits(bits: Bits): Unit

    Definition Classes
    BitsData
  48. def assignFromBits(bits: Bits, offset: Int, bitCount: BitCount): Unit

    Definition Classes
    Data
  49. var assignementThrowable: Throwable

    Definition Classes
    BaseType
  50. def clearAll(): Unit

    Clear all bits

    Clear all bits

    Definition Classes
    BitVector
  51. def clone(): Bits.this.type

    Definition Classes
    BitVectorBaseTypeData → AnyRef
  52. var component: Component

    Definition Classes
    ContextUser
  53. var compositeAssign: Assignable

    Definition Classes
    Assignable
  54. val consumers: ArrayBuffer[Node]

    Definition Classes
    Node
  55. def default(that: ⇒ Bits): Bits

    Definition Classes
    DataPrimitives
  56. var defaultValue: BaseType

    Definition Classes
    BaseType
  57. def dontSimplifyIt(): Bits.this.type

    Definition Classes
    BaseTypeData
  58. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  59. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  60. def existsTag(cond: (SpinalTag) ⇒ Boolean): Boolean

    Definition Classes
    SpinalTagReady
  61. def filterTag(cond: (SpinalTag) ⇒ Boolean): Iterable[SpinalTag]

    Definition Classes
    SpinalTagReady
  62. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  63. def findTag(cond: (SpinalTag) ⇒ Boolean): Option[SpinalTag]

    Definition Classes
    SpinalTagReady
  64. def flatten: Seq[BaseType]

    Definition Classes
    BaseTypeData
  65. def flattenLocalName: Seq[String]

    Definition Classes
    BaseTypeData
  66. def flip(): Bits.this.type

    Definition Classes
    Data
  67. def forEachNameables(doThat: (Any) ⇒ Unit): Unit

    Definition Classes
    Nameable
  68. def genIf(cond: Boolean): Bits.this.type

    Definition Classes
    Data
  69. def getAllToBoolNode(): AllByBool

    Attributes
    protected
    Definition Classes
    BitsBitVector
  70. def getAssignementContext(id: Int): Throwable

    Definition Classes
    BaseTypeAssignementTreePart
  71. def getBitsWidth: Int

    Definition Classes
    BitVectorData
  72. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  73. def getComponent(): Component

    Definition Classes
    DataNameableByComponent
  74. def getComponents(): Seq[Component]

    Definition Classes
    Data
  75. def getDisplayName(): String

    Definition Classes
    Nameable
  76. def getDrivingReg: Bits.this.type

    Definition Classes
    BaseType
  77. def getInput(id: Int): Node

    Definition Classes
    BaseTypeNode
  78. def getInputs: Iterator[Node]

    Definition Classes
    BaseTypeNode
  79. def getInputsCount: Int

    Definition Classes
    BaseTypeNode
  80. def getInstanceCounter: Int

    Definition Classes
    ContextUser
  81. def getName(): String

    Definition Classes
    NameableByComponentNameable
  82. def getName(default: String): String

    Definition Classes
    Nameable
  83. def getRefOwnersChain(): List[Any]

    Definition Classes
    OwnableRef
  84. def getRootParent: Data

    Definition Classes
    Data
  85. def getScalaLocationLong: String

    Definition Classes
    ScalaLocated
  86. def getScalaLocationShort: String

    Definition Classes
    ScalaLocated
  87. def getTag[T <: SpinalTag](clazz: Class[T]): Option[T]

    Definition Classes
    SpinalTagReady
  88. def getWidth: Int

    Definition Classes
    WidthableWidthProvider
  89. def getWidthNoInferation: Int

    Return the width

    Return the width

    Definition Classes
    BitVector
  90. def getWidthStringNoInferation: String

    Definition Classes
    BitVector
  91. def getZero: Bits.this.type

    Definition Classes
    BitsData
  92. def getZeroUnconstrained(): Bits.this.type

    Definition Classes
    BitsBitVector
  93. val globalData: GlobalData

    Definition Classes
    GlobalDataUser
  94. def hasTag(spinalTag: SpinalTag): Boolean

    Definition Classes
    SpinalTagReady
  95. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  96. def high: Int

    Return the upper bound

    Return the upper bound

    Definition Classes
    BitVector
  97. def init(that: Bits): Bits

    Definition Classes
    DataPrimitives
  98. var input: Node

    Definition Classes
    BaseType
  99. def instanceAndSyncNodeAttributes: Iterable[Attribute]

    Definition Classes
    BaseType
  100. def instanceAttributes: Iterable[Attribute]

    Definition Classes
    SpinalTagReady
  101. def isDelay: Boolean

    Definition Classes
    BaseType
  102. def isDirectionLess: Boolean

    Definition Classes
    Data
  103. def isEmptyOfTag: Boolean

    Definition Classes
    SpinalTagReady
  104. def isInput: Boolean

    Definition Classes
    Data
  105. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  106. def isNamed: Boolean

    Definition Classes
    Nameable
  107. def isOutput: Boolean

    Definition Classes
    Data
  108. def isReg: Boolean

    Definition Classes
    BaseTypeData
  109. def isUnnamed: Boolean

    Definition Classes
    Nameable
  110. def keep(): Bits.this.type

    Definition Classes
    Data
  111. def lsb: Bool

    Return the least significant bit

    Return the least significant bit

    Definition Classes
    BitVector
  112. def msb: Bool

    Return the most significant bit

    Return the most significant bit

    Definition Classes
    BitVector
  113. def mux[T <: Data](mappings: (Any, T)*): T

    Definition Classes
    DataPrimitives
  114. def muxList[T <: Data](mappings: Seq[(Any, T)]): T

    Definition Classes
    DataPrimitives
  115. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  116. def newExtract(offset: UInt, size: Int, extract: ExtractBitsVectorFloating): Bits.this.type

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

    Definition Classes
    BitVector
  117. def newExtract(hi: Int, lo: Int, extract: ExtractBitsVectorFixed): Bits.this.type

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

    Definition Classes
    BitVector
  118. def newExtract(bitId: UInt, extract: ExtractBoolFloating): Bool

    Extract a bit of the BitVector

    Extract a bit of the BitVector

    Definition Classes
    BitVector
  119. def newExtract(bitId: Int, extract: ExtractBoolFixed): Bool

    Extract a bit of the BitVector

    Extract a bit of the BitVector

    Definition Classes
    BitVector
  120. final def notify(): Unit

    Definition Classes
    AnyRef
  121. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  122. def onEachAttributes(doIt: (Attribute) ⇒ Unit): Unit

    Definition Classes
    SpinalTagReady
  123. def onEachInput(doThat: (Node) ⇒ Unit): Unit

    Definition Classes
    BaseTypeNode
  124. def onEachInput(doThat: (Node, Int) ⇒ Unit): Unit

    Definition Classes
    BaseTypeNode
  125. def orR: Bool

    Logical OR of all bits

    Logical OR of all bits

    Definition Classes
    BitVector
  126. var parent: Data

    Definition Classes
    Data
  127. def pull(): Bits.this.type

    Definition Classes
    Data
  128. def randBoot(): Bits.this.type

    Definition Classes
    Data
  129. def range: Range

    Return the range

    Return the range

    Definition Classes
    BitVector
  130. var refOwner: RefOwnerType

    Definition Classes
    OwnableRef
  131. def removeAssignements(): Unit

    Definition Classes
    BaseType
  132. def removeTag(spinalTag: SpinalTag): Bits.this.type

    Definition Classes
    SpinalTagReady
  133. def removeTags(tags: Iterable[SpinalTag]): Bits.this.type

    Definition Classes
    SpinalTagReady
  134. def resize(width: Int): Bits.this.type

    Resize the bitVector to width

    Resize the bitVector to width

    returns

    a resized bitVector

    Definition Classes
    BitsBitVector
    Example:
    1. val res = myBits.resize(10)
  135. def resizeLeft(width: Int): Bits

    Resize by keeping MSB at the same place If the final size is bigger than the original size, the leftmost bits are filled with zeroes if the final size is smaller, only width MSB are kept

    Resize by keeping MSB at the same place If the final size is bigger than the original size, the leftmost bits are filled with zeroes if the final size is smaller, only width MSB are kept

    width

    Final width

    returns

    Resized bits vector

  136. def resized: Bits.this.type

    Definition Classes
    Data
  137. def rotateLeft(that: Int): Bits

    Left rotation of that bits

    Left rotation of that bits

    Definition Classes
    BitsBitVector
  138. def rotateLeft(that: UInt): T

    Left rotation of that Bits

    Left rotation of that Bits

    Definition Classes
    BitVector
  139. def rotateRight(that: Int): Bits

    Right rotation of that bits

    Right rotation of that bits

    Definition Classes
    BitsBitVector
  140. def rotateRight(that: UInt): T

    Right rotation of that Bits

    Right rotation of that Bits

    Definition Classes
    BitVector
  141. def setAll(): Unit

    Set all bits

    Set all bits

    Definition Classes
    BitVector
  142. def setAllTo(value: Bool): Unit

    Set all bits to value

    Set all bits to value

    Definition Classes
    BitVector
  143. def setAllTo(value: Boolean): Unit

    Set all bits to value

    Set all bits to value

    Definition Classes
    BitVector
  144. def setAssignementContext(id: Int, that: Throwable): Unit

    Definition Classes
    BaseTypeAssignementTreePart
  145. def setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): Bits.this.type

    Definition Classes
    Nameable
  146. def setCompositeName(nameable: Nameable, postfix: String): Bits.this.type

    Definition Classes
    Nameable
  147. def setCompositeName(nameable: Nameable, weak: Boolean): Bits.this.type

    Definition Classes
    Nameable
  148. def setCompositeName(nameable: Nameable): Bits.this.type

    Definition Classes
    Nameable
  149. def setInput(id: Int, node: Node): Unit

    Definition Classes
    BaseTypeNode
  150. def setName(name: String, weak: Boolean = false): Bits.this.type

    Definition Classes
    Nameable
  151. def setPartialName(name: String, weak: Boolean): Bits.this.type

    Definition Classes
    Nameable
  152. def setPartialName(owner: Nameable, name: String, weak: Boolean): Bits.this.type

    Definition Classes
    Nameable
  153. def setPartialName(name: String): Bits.this.type

    Definition Classes
    Nameable
  154. def setPartialName(owner: Nameable, name: String): Bits.this.type

    Definition Classes
    Nameable
  155. def setRefOwner(that: Any): Unit

    Definition Classes
    OwnableRef
  156. def setWeakName(name: String): Bits.this.type

    Definition Classes
    Nameable
  157. def setWidth(width: Int): Bits.this.type

    Set the width of the BitVector

    Set the width of the BitVector

    width

    the width of the data

    returns

    the BitVector of a given size

    Definition Classes
    BitVector
  158. def simplifyNode: Unit

    Definition Classes
    Node
  159. def spinalTags: Set[SpinalTag]

    Definition Classes
    SpinalTagReady
  160. def subdivideIn(sliceWidth: BitCount): Vec[T]

    Split the BitVector into slice of x bits * @example

    Split the BitVector into slice of x bits * @example

    val res = myBits.subdiviedIn(3 bits)
    sliceWidth

    the width of the slice

    returns

    a Vector of slices

    Definition Classes
    BitVector
  161. def subdivideIn(sliceCount: SlicesCount): Vec[T]

    Split the BitVector into x slice

    Split the BitVector into x slice

    sliceCount

    the width of the slice

    returns

    a Vector of slices

    Definition Classes
    BitVector
    Example:
    1. val res = myBits.subdiviedIn(3 slices)
  162. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  163. def toDataType[T <: Data](dataType: T): T

    Cast a Bits to a given data type

    Cast a Bits to a given data type

    dataType

    the wanted data type

    returns

    a new data type assign with the value of Bits

    Example:
    1. val myUInt = myBits.toDataType(UInt)
  164. def toString(): String

    Definition Classes
    BitVectorBaseTypeNameableNode → AnyRef → Any
  165. def unary_~(): Bits

    Inverse bitwise operator

    Inverse bitwise operator

    Definition Classes
    BitsBitwiseOp
  166. def unsetName(): Unit

    Definition Classes
    Nameable
  167. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  168. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  169. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  170. def wrapCast[T <: BaseType](result: T, node: Cast): T

    Definition Classes
    BaseType
  171. def xorR: Bool

    Logical XOR of all bits

    Logical XOR of all bits

    Definition Classes
    BitVector
  172. def |(right: Bits): Bits

    Logical OR operator

    Logical OR operator

    Definition Classes
    BitsBitwiseOp
  173. def |<<(that: UInt): Bits

    Logical shift left (output width == input width)

  174. def |<<(that: Int): Bits

    Logical shift left (output width == input width)

  175. def |>>(that: UInt): Bits

    Logical shift Right (output width == input width)

  176. def |>>(that: Int): Bits

    Logical shift right (output width == input width)

    Logical shift right (output width == input width)

    that

    the number of shift

    returns

    a Bits of width : w(this)

    Example:
    1. val result = myBits |>> 4

Deprecated Value Members

  1. def !==(that: Bits): Bool

    Definition Classes
    DataPrimitives
    Annotations
    @deprecated
    Deprecated

    Use =/= instead

  2. def unused: Unit

    Definition Classes
    Data
    Annotations
    @deprecated
    Deprecated

    use allowPruning instead

Inherited from BitwiseOp[Bits]

Inherited from DataPrimitives[Bits]

Inherited from BitVector

Inherited from CheckWidth

Inherited from Widthable

Inherited from WidthProvider

Inherited from BaseType

Inherited from AssignementTreePart

Inherited from Data

Inherited from Assignable

Inherited from NameableByComponent

Inherited from Nameable

Inherited from OwnableRef

Inherited from Node

Inherited from SpinalTagReady

Inherited from ScalaLocated

Inherited from ContextUser

Inherited from GlobalDataUser

Inherited from AnyRef

Inherited from Any

Ungrouped