spinal.core

BitVector

Related Doc: package core

abstract class BitVector extends BaseType with Widthable

BitVector is a family of types for storing multiple bits of information in a single value. This type has three subtypes that can be used to model different behaviours:

See also

BitVector Documentation

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BitVector
  2. Widthable
  3. WidthProvider
  4. BaseType
  5. Expression
  6. StatementDoubleLinkedContainer
  7. DoubleLinkedContainer
  8. DeclarationStatement
  9. LeafStatement
  10. Statement
  11. BaseNode
  12. ExpressionContainer
  13. Data
  14. ScalaLocated
  15. SpinalTagReady
  16. Assignable
  17. NameableByComponent
  18. Nameable
  19. OwnableRef
  20. ContextUser
  21. GlobalDataUser
  22. AnyRef
  23. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BitVector()

Type Members

  1. abstract type RefOwnerType

    Definition Classes
    OwnableRef
  2. abstract type T <: BitVector

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

Abstract Value Members

  1. abstract def apply(offset: UInt, bitCount: BitCount): BitVector.this.type

    Return a range of bits at offset and of width bitCount

    Return a range of bits at offset and of width bitCount

    Example:
    1. val myBool = myBits(myUInt, 2 bits)
  2. abstract def apply(offset: Int, bitCount: BitCount): BitVector.this.type

    Return a range of bits at offset and of width bitCount

    Return a range of bits at offset and of width bitCount

    Example:
    1. val myBool = myBits(3, 2 bits)
  3. abstract def apply(bitId: UInt): Bool

    Return the bit at index bitId

    Return the bit at index bitId

    Example:
    1. val myBool = myBits(myUInt)
  4. abstract def apply(bitId: Int): Bool

    Return the bit at index bitId

    Return the bit at index bitId

    Example:
    1. val myBool = myBits(3)
  5. abstract def asBits: Bits

    Definition Classes
    Data
  6. abstract def assignFromBits(bits: Bits, hi: Int, low: Int): Unit

    Definition Classes
    Data
  7. abstract def assignFromBits(bits: Bits): Unit

    Definition Classes
    Data
  8. abstract def getAllTrue: BitVector.this.type

  9. abstract def getTypeObject: Any

    Definition Classes
    Expression
  10. abstract def getZero: BitVector.this.type

    Definition Classes
    Data
  11. abstract def getZeroUnconstrained(): BitVector.this.type

  12. abstract def opName: String

    Definition Classes
    Expression
  13. abstract def resize(width: Int): BitVector

    Resize the bitVector to width

    Resize the bitVector to width

    returns

    a resized bitVector

    Example:
    1. val res = myBits.resize(10)
  14. abstract def rotateLeft(that: Int): T

    Left rotation of that bits

  15. abstract def rotateRight(that: Int): T

    Right rotation of that bits

  16. abstract def setAll(): Unit

    Set all bits

Concrete Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def =/=(that: MaskedLiteral): Bool

    BitVector is not equal to MaskedLiteral

  5. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  6. 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

    Example:
    1. val myBool = myBits === M"0-1"
  7. var _spinalTags: Set[SpinalTag]

    Definition Classes
    SpinalTagReady
  8. def addAttribute(attribute: Attribute): BitVector.this.type

    Definition Classes
    BaseTypeDataSpinalTagReady
  9. def addAttribute(name: String, value: String): BitVector.this.type

    Definition Classes
    SpinalTagReady
  10. def addAttribute(name: String): BitVector.this.type

    Definition Classes
    SpinalTagReady
  11. def addTag(spinalTag: SpinalTag): BitVector.this.type

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

    Definition Classes
    SpinalTagReady
  13. var algoIncrementale: Int

    Definition Classes
    BaseNode
  14. var algoInt: Int

    Definition Classes
    BaseNode
  15. def allowDirectionLessIo: BitVector.this.type

    Definition Classes
    Data
  16. def allowOverride: BitVector.this.type

    Definition Classes
    Data
  17. def allowPruning(): Unit

    Definition Classes
    Data
  18. def allowSimplifyIt(): BitVector.this.type

    Definition Classes
    BaseTypeData
  19. def allowUnsetRegToAvoidLatch: BitVector.this.type

    Definition Classes
    Data
  20. def andR: Bool

    Logical AND of all bits

  21. def apply(range: Range): BitVector.this.type

    Return a range of bits

    Return a range of bits

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

    Return a range of bits form hi index to lo index

    Return a range of bits form hi index to lo index

    Example:
    1. val myBool = myBits(3, 1)
  23. 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

  24. def asData: Data

    Definition Classes
    Data
  25. def asDirectionLess(): BitVector.this.type

    Definition Classes
    BaseTypeData
  26. def asInOut(): BitVector.this.type

    Definition Classes
    BaseTypeData
  27. def asInput(): BitVector.this.type

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

    Definition Classes
    Any
  29. def asOutput(): BitVector.this.type

    Definition Classes
    BaseTypeData
  30. def assignDontCare(): BitVector.this.type

    Definition Classes
    Data
  31. final def assignFrom(that: AnyRef, target: AnyRef = this): Unit

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

    Definition Classes
    Data
  33. def clearAll(): Unit

    Clear all bits

  34. var clockDomain: ClockDomain

    Definition Classes
    BaseType
  35. def clone(): BitVector.this.type

    Definition Classes
    BitVectorBaseTypeData → AnyRef
  36. def component: Component

    Definition Classes
    ContextUser
  37. final def compositAssignFrom(that: AnyRef, target: AnyRef, kind: AnyRef): Unit

    Definition Classes
    Assignable
  38. var compositeAssign: Assignable

    Definition Classes
    Assignable
  39. def dirString(): String

    Definition Classes
    Data
  40. def dlcAppend(that: AssignmentStatement): BitVector.this.type

    Definition Classes
    DoubleLinkedContainer
  41. def dlcForeach[T >: AssignmentStatement](func: (T) ⇒ Unit): Unit

    Definition Classes
    DoubleLinkedContainer
  42. def dlcHasOnlyOne: Boolean

    Definition Classes
    DoubleLinkedContainer
  43. var dlcHead: AssignmentStatement

    Definition Classes
    DoubleLinkedContainer
  44. def dlcIsEmpty: Boolean

    Definition Classes
    DoubleLinkedContainer
  45. var dlcLast: AssignmentStatement

    Definition Classes
    DoubleLinkedContainer
  46. def dlcPrepend(that: AssignmentStatement): BitVector.this.type

    Definition Classes
    DoubleLinkedContainer
  47. def dontSimplifyIt(): BitVector.this.type

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

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

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

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

    Definition Classes
    SpinalTagReady
  52. def finalize(): Unit

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

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

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

    Definition Classes
    BaseTypeData
  56. def flip(): BitVector.this.type

    Definition Classes
    Data
  57. def foreachClockDomain(func: (ClockDomain) ⇒ Unit): Unit

    Definition Classes
    BaseTypeStatement
  58. def foreachDrivingExpression(func: (Expression) ⇒ Unit): Unit

    Definition Classes
    ExpressionContainer
  59. def foreachExpression(func: (Expression) ⇒ Unit): Unit

  60. def foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit

    Definition Classes
    Nameable
  61. def foreachStatements(func: (AssignmentStatement) ⇒ Unit): Unit

  62. def genIf(cond: Boolean): BitVector.this.type

    Definition Classes
    Data
  63. def getBitsWidth: Int

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

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

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

    Definition Classes
    Data
  67. def getDisplayName(): String

    Definition Classes
    Nameable
  68. def getDrivingReg: BitVector.this.type

    Definition Classes
    BaseType
  69. def getInstanceCounter: Int

    Definition Classes
    ContextUser
  70. def getName(): String

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

    Definition Classes
    Nameable
  72. def getRealSource: Any

    Definition Classes
    Assignable
  73. def getRealSourceNoRec: Any

    Definition Classes
    DataAssignable
  74. def getRefOwnersChain(): List[Any]

    Definition Classes
    OwnableRef
  75. def getRootParent: Data

    Definition Classes
    Data
  76. def getScalaLocationLong: String

    Definition Classes
    ScalaLocated
  77. def getScalaLocationShort: String

    Definition Classes
    ScalaLocated
  78. def getSingleDriver: Option[BitVector.this.type]

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

    Definition Classes
    SpinalTagReady
  80. def getWidth: Int

    Definition Classes
    WidthableWidthProvider
  81. def getWidthNoInferation: Int

  82. def getWidthStringNoInferation: String

  83. val globalData: GlobalData

    Definition Classes
    GlobalDataUser
  84. def hasInit: Boolean

    Definition Classes
    BaseType
  85. def hasOnlyOneStatement: Boolean

  86. def hasTag(spinalTag: SpinalTag): Boolean

    Definition Classes
    SpinalTagReady
  87. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  88. def head: AssignmentStatement

  89. def high: Int

    Return the upper bound

  90. final def initFrom(that: AnyRef, target: AnyRef = this): Unit

    Definition Classes
    Data
  91. def insertNext(s: Statement): Unit

    Definition Classes
    Statement
  92. def instanceAttributes(language: Language): Iterable[Attribute]

    Definition Classes
    SpinalTagReady
  93. def instanceAttributes: Iterable[Attribute]

    Definition Classes
    SpinalTagReady
  94. def isAnalog: Boolean

    Definition Classes
    BaseTypeData
  95. def isComb: Boolean

    Definition Classes
    BaseTypeData
  96. def isDirectionLess: Boolean

    Definition Classes
    Data
  97. def isEmptyOfTag: Boolean

    Definition Classes
    SpinalTagReady
  98. def isInOut: Boolean

    Definition Classes
    Data
  99. def isInput: Boolean

    Definition Classes
    Data
  100. def isInputOrInOut: Boolean

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

    Definition Classes
    Any
  102. def isNamed: Boolean

    Definition Classes
    Nameable
  103. def isOutput: Boolean

    Definition Classes
    Data
  104. def isOutputOrInOut: Boolean

    Definition Classes
    Data
  105. def isReg: Boolean

    Definition Classes
    BaseTypeData
  106. def isTypeNode: Boolean

    Definition Classes
    BaseType
  107. def isUnnamed: Boolean

    Definition Classes
    Nameable
  108. def isUsingResetSignal: Boolean

    Definition Classes
    BaseType
  109. def isUsingSoftResetSignal: Boolean

    Definition Classes
    BaseType
  110. def isVital: Boolean

    Definition Classes
    BaseType
  111. def keep(): BitVector.this.type

    Definition Classes
    Data
  112. var lastScopeStatement: Statement

    Definition Classes
    Statement
  113. def lsb: Bool

    Return the least significant bit

  114. def msb: Bool

    Return the most significant bit

  115. def mux[T2 <: Data](mappings: (Any, T2)*): T2

    Definition Classes
    BaseType
  116. def muxList[T2 <: Data](defaultValue: T2, mappings: Seq[(Any, T2)]): T2

    Definition Classes
    BaseType
  117. def muxList[T2 <: Data](mappings: Seq[(Any, T2)]): T2

    Definition Classes
    BaseType
  118. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  119. def newExtract(offset: UInt, size: Int, extract: BitVectorRangedAccessFloating): BitVector.this.type

    Extract a range of bits of the BitVector

  120. def newExtract(hi: Int, lo: Int, accessFactory: ⇒ BitVectorRangedAccessFixed): BitVector.this.type

    Extract a range of bits of the BitVector

  121. def newExtract(bitId: UInt, extract: BitVectorBitAccessFloating): Bool

    Extract a bit of the BitVector

  122. def newExtract(bitId: Int, extract: BitVectorBitAccessFixed): Bool

    Extract a bit of the BitVector

  123. var nextScopeStatement: Statement

    Definition Classes
    Statement
  124. def normalizeInputs: Unit

    Definition Classes
    BaseTypeExpressionContainer
  125. final def notify(): Unit

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

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

    Definition Classes
    SpinalTagReady
  128. def orR: Bool

    Logical OR of all bits

  129. var parent: Data

    Definition Classes
    Data
  130. var parentScope: ScopeStatement

    Definition Classes
    ContextUser
  131. def pull(): BitVector.this.type

    Definition Classes
    Data
  132. def randBoot(): BitVector.this.type

    Definition Classes
    Data
  133. def range: Range

    Return the range

  134. var refOwner: RefOwnerType

    Definition Classes
    OwnableRef
  135. def remapDrivingExpressions(func: (Expression) ⇒ Expression): Unit

    Definition Classes
    ExpressionContainer
  136. def remapExpressions(func: (Expression) ⇒ Expression): Unit

  137. def removeAssignments(): BitVector.this.type

    Definition Classes
    BaseType
  138. def removeStatement(): Unit

    Definition Classes
    BaseTypeStatement
  139. def removeStatementFromScope(): Unit

    Definition Classes
    Statement
  140. def removeTag(spinalTag: SpinalTag): BitVector.this.type

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

    Definition Classes
    SpinalTagReady
  142. def resized: BitVector.this.type

    Definition Classes
    Data
  143. def rootScopeStatement: ScopeStatement

    Definition Classes
    BaseTypeStatement
  144. def rotateLeft(that: UInt): T

    Left rotation of that Bits

  145. def rotateRight(that: UInt): T

    Right rotation of that Bits

  146. def setAllTo(value: Bool): Unit

    Set all bits to value

  147. def setAllTo(value: Boolean): Unit

    Set all bits to value

  148. def setAsAnalog(): BitVector.this.type

    Definition Classes
    BaseTypeData
  149. def setAsComb(): BitVector.this.type

    Definition Classes
    BaseType
  150. def setAsReg(): BitVector.this.type

    Definition Classes
    BaseType
  151. def setAsTypeNode(): BitVector.this.type

    Definition Classes
    BaseType
  152. def setAsVital(): BitVector.this.type

    Definition Classes
    BaseType
  153. def setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): BitVector.this.type

    Definition Classes
    Nameable
  154. def setCompositeName(nameable: Nameable, postfix: String): BitVector.this.type

    Definition Classes
    Nameable
  155. def setCompositeName(nameable: Nameable, weak: Boolean): BitVector.this.type

    Definition Classes
    Nameable
  156. def setCompositeName(nameable: Nameable): BitVector.this.type

    Definition Classes
    Nameable
  157. def setName(name: String, weak: Boolean = false): BitVector.this.type

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

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

    Definition Classes
    Nameable
  160. def setPartialName(name: String): BitVector.this.type

    Definition Classes
    Nameable
  161. def setPartialName(owner: Nameable, name: String): BitVector.this.type

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

    Definition Classes
    OwnableRef
  163. def setScalaLocated(source: ScalaLocated): BitVector.this.type

    Definition Classes
    ScalaLocated
  164. def setWeakName(name: String): BitVector.this.type

    Definition Classes
    Nameable
  165. def setWidth(width: Int): BitVector.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

  166. def simplifyNode: Expression

    Definition Classes
    Expression
  167. def spinalTags: Set[SpinalTag]

    Definition Classes
    SpinalTagReady
  168. 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

  169. 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

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

    Definition Classes
    AnyRef
  171. def toString(): String

    Definition Classes
    BitVectorBaseTypeExpressionNameable → AnyRef → Any
  172. def toStringMultiLine(): String

    Definition Classes
    BaseNode
  173. def unsetName(): BitVector.this.type

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  177. def walkDrivingExpressions(func: (Expression) ⇒ Unit): Unit

    Definition Classes
    ExpressionContainer
  178. def walkExpression(func: (Expression) ⇒ Unit): Unit

    Definition Classes
    ExpressionContainer
  179. def walkParentTreeStatements(func: (TreeStatement) ⇒ Unit): Unit

    Definition Classes
    Statement
  180. def walkParentTreeStatementsUntilRootScope(func: (TreeStatement) ⇒ Unit): Unit

    Definition Classes
    Statement
  181. def walkRemapDrivingExpressions(func: (Expression) ⇒ Expression): Unit

    Definition Classes
    ExpressionContainer
  182. def walkRemapExpressions(func: (Expression) ⇒ Expression): Unit

    Definition Classes
    ExpressionContainer
  183. def wrapCast[T <: BaseType](result: T, node: Cast): T

    Definition Classes
    BaseType
  184. def xorR: Bool

    Logical XOR of all bits

Inherited from Widthable

Inherited from WidthProvider

Inherited from BaseType

Inherited from Expression

Inherited from DeclarationStatement

Inherited from LeafStatement

Inherited from Statement

Inherited from BaseNode

Inherited from ExpressionContainer

Inherited from Data

Inherited from ScalaLocated

Inherited from SpinalTagReady

Inherited from Assignable

Inherited from NameableByComponent

Inherited from Nameable

Inherited from OwnableRef

Inherited from ContextUser

Inherited from GlobalDataUser

Inherited from AnyRef

Inherited from Any

Ungrouped