spinal.core

UInt

Related Doc: package core

class UInt extends BitVector with Num[UInt] with MinMaxProvider with DataPrimitives[UInt] with BitwiseOp[UInt]

The UInt type corresponds to a vector of bits that can be used for unsigned integer arithmetic.

Example:
  1. val myUInt = UInt(8 bits)
     myUInt := U(2,8 bits)
     myUInt := U(2)
     myUInt := U"0000_0101"
     myUInt := U"h1A"
See also

UInt Documentation

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UInt
  2. BitwiseOp
  3. DataPrimitives
  4. MinMaxProvider
  5. Num
  6. BitVector
  7. CheckWidth
  8. Widthable
  9. WidthProvider
  10. BaseType
  11. AssignementTreePart
  12. Data
  13. Assignable
  14. NameableByComponent
  15. Nameable
  16. OwnableRef
  17. Node
  18. SpinalTagReady
  19. ScalaLocated
  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 UInt()

Type Members

  1. abstract type RefOwnerType

    Definition Classes
    OwnableRef
  2. type T = UInt

    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
    UIntBitVector

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 %(right: UInt): UInt

    Modulo

    Modulo

    Definition Classes
    UIntNum
  5. def &(right: UInt): UInt

    Logical AND operator

    Logical AND operator

    Definition Classes
    UIntBitwiseOp
  6. def *(right: UInt): UInt

    Multiplication

    Multiplication

    Definition Classes
    UIntNum
  7. def +(right: UInt): UInt

    Addition

    Addition

    Definition Classes
    UIntNum
  8. def -(right: UInt): UInt

    Substraction

    Substraction

    Definition Classes
    UIntNum
  9. def /(right: UInt): UInt

    Division

    Division

    Definition Classes
    UIntNum
  10. def :=(rangesValue: (Any, Any), _rangesValues: (Any, Any)*): Unit

    Assign a range value to an UInt

    Assign a range value to an UInt

    rangesValue

    The first range value

    _rangesValues

    Others range values

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

    Definition Classes
    DataPrimitives
  12. def <(right: UInt): Bool

    Is less than right

    Is less than right

    Definition Classes
    UIntNum
  13. def <<(that: UInt): UInt

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

  14. def <<(that: Int): UInt

    Logical left shift (w(T) = w(this) + shift)

    Logical left shift (w(T) = w(this) + shift)

    Definition Classes
    UIntNum
  15. def <=(right: UInt): Bool

    Is equal or less than right

    Is equal or less than right

    Definition Classes
    UIntNum
  16. def <>(that: UInt): Unit

    Definition Classes
    DataPrimitives
  17. def =/=(that: UInt): Bool

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

    BitVector is not equal to MaskedLiteral

    BitVector is not equal to MaskedLiteral

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

    Definition Classes
    AnyRef → Any
  20. def ===(that: UInt): Bool

    Definition Classes
    DataPrimitives
  21. 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"
  22. def >(right: UInt): Bool

    Is greater than right

    Is greater than right

    Definition Classes
    UIntNum
  23. def >=(right: UInt): Bool

    Is equal or greater than right

    Is equal or greater than right

    Definition Classes
    UIntNum
  24. def >>(that: UInt): UInt

    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 = myUInt >> myUIntShift
  25. def >>(that: Int): UInt

    Logical right shift (w(T) = w(this) - shift)

    Logical right shift (w(T) = w(this) - shift)

    Definition Classes
    UIntNum
  26. def @@(that: Bool): UInt

    Append a Bool to an UInt

  27. def @@(that: UInt): UInt

    Concatenation between two UInt

    Concatenation between two UInt

    that

    an UInt to append

    returns

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

    Example:
    1. val myUInt = uInt1 @@ uInt2
  28. def \(that: UInt): UInt

    Definition Classes
    DataPrimitives
  29. def ^(right: UInt): UInt

    Logical XOR operator

    Logical XOR operator

    Definition Classes
    UIntBitwiseOp
  30. def _data: UInt

    Definition Classes
    UIntDataPrimitives
  31. var _spinalTags: Set[SpinalTag]

    Definition Classes
    SpinalTagReady
  32. def addAttribute(attribute: Attribute): UInt.this.type

    Definition Classes
    BaseTypeDataSpinalTagReady
  33. def addAttribute(name: String, value: String): UInt.this.type

    Definition Classes
    SpinalTagReady
  34. def addAttribute(name: String): UInt.this.type

    Definition Classes
    SpinalTagReady
  35. def addTag(spinalTag: SpinalTag): UInt.this.type

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

    Definition Classes
    SpinalTagReady
  37. def allowPruning(): Unit

    Definition Classes
    Data
  38. def allowSimplifyIt(): UInt.this.type

    Definition Classes
    BaseTypeData
  39. def andR: Bool

    Logical AND of all bits

    Logical AND of all bits

    Definition Classes
    BitVector
  40. def apply(offset: UInt, bitCount: BitCount): UInt.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
    UIntBitVector
    Example:
    1. val myBool = myBits(myUInt, 2 bits)
  41. def apply(offset: Int, bitCount: BitCount): UInt.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
    UIntBitVector
    Example:
    1. val myBool = myBits(3, 2 bits)
  42. def apply(bitId: UInt): Bool

    Return the bit at index bitId

    Return the bit at index bitId

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

    Return the bit at index bitId

    Return the bit at index bitId

    Definition Classes
    UIntBitVector
    Example:
    1. val myBool = myBits(3)
  44. def apply(range: Range): UInt.this.type

    Return a range of bits

    Return a range of bits

    Definition Classes
    BitVector
    Example:
    1. val myBool = myBits(3 downto 1)
  45. def apply(hi: Int, lo: Int): UInt.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)
  46. def asBits: Bits

    Definition Classes
    UIntData
  47. 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
  48. def asData: Data

    Definition Classes
    Data
  49. def asDirectionLess(): UInt.this.type

    Definition Classes
    BaseTypeData
  50. def asInput(): UInt.this.type

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

    Definition Classes
    Any
  52. def asOutput(): UInt.this.type

    Definition Classes
    BaseTypeData
  53. def asSInt: SInt

    Cast an UInt to a SInt

    Cast an UInt to a SInt

    returns

    a SInt data

    Example:
    1. mySInt := myUInt.asSInt
  54. def assignDontCare(): UInt.this.type

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

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

    Definition Classes
    UIntData
  57. def assignFromBits(bits: Bits): Unit

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

    Definition Classes
    Data
  59. def assignMask(maskedLiteral: MaskedLiteral): Unit

    Assign a mask to the output signal

    Assign a mask to the output signal

    maskedLiteral

    masked litteral value

    Example:
    1. output4 assignMask M"1111
  60. var assignementThrowable: Throwable

    Definition Classes
    BaseType
  61. def clearAll(): Unit

    Clear all bits

    Clear all bits

    Definition Classes
    BitVector
  62. def clone(): UInt.this.type

    Definition Classes
    BitVectorBaseTypeData → AnyRef
  63. var component: Component

    Definition Classes
    ContextUser
  64. var compositeAssign: Assignable

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

    Definition Classes
    Node
  66. def default(that: ⇒ UInt): UInt

    Definition Classes
    DataPrimitives
  67. var defaultValue: BaseType

    Definition Classes
    BaseType
  68. def dontSimplifyIt(): UInt.this.type

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

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

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

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

    Definition Classes
    SpinalTagReady
  73. def finalize(): Unit

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

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

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

    Definition Classes
    BaseTypeData
  77. def flip(): UInt.this.type

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

    Definition Classes
    Nameable
  79. def genIf(cond: Boolean): UInt.this.type

    Definition Classes
    Data
  80. def getAllToBoolNode(): AllByBool

    Attributes
    protected
    Definition Classes
    UIntBitVector
  81. def getAssignementContext(id: Int): Throwable

    Definition Classes
    BaseTypeAssignementTreePart
  82. def getBitsWidth: Int

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

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

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

    Definition Classes
    Data
  86. def getDisplayName(): String

    Definition Classes
    Nameable
  87. def getDrivingReg: UInt.this.type

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

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

    Definition Classes
    BaseTypeNode
  90. def getInputsCount: Int

    Definition Classes
    BaseTypeNode
  91. def getInstanceCounter: Int

    Definition Classes
    ContextUser
  92. def getName(): String

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

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

    Definition Classes
    OwnableRef
  95. def getRootParent: Data

    Definition Classes
    Data
  96. def getScalaLocationLong: String

    Definition Classes
    ScalaLocated
  97. def getScalaLocationShort: String

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

    Definition Classes
    SpinalTagReady
  99. def getWidth: Int

    Definition Classes
    WidthableWidthProvider
  100. def getWidthNoInferation: Int

    Return the width

    Return the width

    Definition Classes
    BitVector
  101. def getWidthStringNoInferation: String

    Definition Classes
    BitVector
  102. def getZero: UInt.this.type

    Definition Classes
    UIntData
  103. def getZeroUnconstrained(): UInt.this.type

    Definition Classes
    UIntBitVector
  104. val globalData: GlobalData

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

    Definition Classes
    SpinalTagReady
  106. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  107. def high: Int

    Return the upper bound

    Return the upper bound

    Definition Classes
    BitVector
  108. def init(that: UInt): UInt

    Definition Classes
    DataPrimitives
  109. var input: Node

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

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

    Definition Classes
    SpinalTagReady
  112. def isDelay: Boolean

    Definition Classes
    BaseType
  113. def isDirectionLess: Boolean

    Definition Classes
    Data
  114. def isEmptyOfTag: Boolean

    Definition Classes
    SpinalTagReady
  115. def isInput: Boolean

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

    Definition Classes
    Any
  117. def isNamed: Boolean

    Definition Classes
    Nameable
  118. def isOutput: Boolean

    Definition Classes
    Data
  119. def isReg: Boolean

    Definition Classes
    BaseTypeData
  120. def isUnnamed: Boolean

    Definition Classes
    Nameable
  121. def keep(): UInt.this.type

    Definition Classes
    Data
  122. def lsb: Bool

    Return the least significant bit

    Return the least significant bit

    Definition Classes
    BitVector
  123. def max(right: UInt): UInt

    Return the maximum value between this and right

    Return the maximum value between this and right

    Definition Classes
    Num
  124. def maxValue: BigInt

    Definition Classes
    UIntMinMaxProvider
  125. def min(right: UInt): UInt

    Return the minimum value between this and right

    Return the minimum value between this and right

    Definition Classes
    Num
  126. def minValue: BigInt

    Definition Classes
    UIntMinMaxProvider
  127. def msb: Bool

    Return the most significant bit

    Return the most significant bit

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

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

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

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

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

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

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

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

    Extract a bit of the BitVector

    Extract a bit of the BitVector

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

    Extract a bit of the BitVector

    Extract a bit of the BitVector

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

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

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

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

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

    Definition Classes
    BaseTypeNode
  140. def orR: Bool

    Logical OR of all bits

    Logical OR of all bits

    Definition Classes
    BitVector
  141. var parent: Data

    Definition Classes
    Data
  142. def pull(): UInt.this.type

    Definition Classes
    Data
  143. def randBoot(): UInt.this.type

    Definition Classes
    Data
  144. def range: Range

    Return the range

    Return the range

    Definition Classes
    BitVector
  145. var refOwner: RefOwnerType

    Definition Classes
    OwnableRef
  146. def removeAssignements(): Unit

    Definition Classes
    BaseType
  147. def removeTag(spinalTag: SpinalTag): UInt.this.type

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

    Definition Classes
    SpinalTagReady
  149. def resize(width: Int): UInt.this.type

    Resize the bitVector to width

    Resize the bitVector to width

    returns

    a resized bitVector

    Definition Classes
    UIntBitVector
    Example:
    1. val res = myBits.resize(10)
  150. def resized: UInt.this.type

    Definition Classes
    Data
  151. def rotateLeft(that: Int): UInt

    Left rotation of that bits

    Left rotation of that bits

    Definition Classes
    UIntBitVector
  152. def rotateLeft(that: UInt): T

    Left rotation of that Bits

    Left rotation of that Bits

    Definition Classes
    BitVector
  153. def rotateRight(that: Int): UInt

    Right rotation of that bits

    Right rotation of that bits

    Definition Classes
    UIntBitVector
  154. def rotateRight(that: UInt): T

    Right rotation of that Bits

    Right rotation of that Bits

    Definition Classes
    BitVector
  155. def setAll(): Unit

    Set all bits

    Set all bits

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

    Set all bits to value

    Set all bits to value

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

    Set all bits to value

    Set all bits to value

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

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

    Definition Classes
    Nameable
  160. def setCompositeName(nameable: Nameable, postfix: String): UInt.this.type

    Definition Classes
    Nameable
  161. def setCompositeName(nameable: Nameable, weak: Boolean): UInt.this.type

    Definition Classes
    Nameable
  162. def setCompositeName(nameable: Nameable): UInt.this.type

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

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

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

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

    Definition Classes
    Nameable
  167. def setPartialName(name: String): UInt.this.type

    Definition Classes
    Nameable
  168. def setPartialName(owner: Nameable, name: String): UInt.this.type

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

    Definition Classes
    OwnableRef
  170. def setWeakName(name: String): UInt.this.type

    Definition Classes
    Nameable
  171. def setWidth(width: Int): UInt.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
  172. def simplifyNode: Unit

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

    Definition Classes
    SpinalTagReady
  174. 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
  175. 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)
  176. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  177. def toString(): String

    Definition Classes
    BitVectorBaseTypeNameableNode → AnyRef → Any
  178. def twoComplement(enable: Bool): SInt

    2'Complement

    2'Complement

    enable

    enable the 2'complement

    returns

    Return the 2'Complement of the number

  179. def unary_~(): UInt

    Inverse bitwise operator

    Inverse bitwise operator

    Definition Classes
    UIntBitwiseOp
  180. def unsetName(): Unit

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

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

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

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

    Definition Classes
    BaseType
  185. def xorR: Bool

    Logical XOR of all bits

    Logical XOR of all bits

    Definition Classes
    BitVector
  186. def |(right: UInt): UInt

    Logical OR operator

    Logical OR operator

    Definition Classes
    UIntBitwiseOp
  187. def |<<(that: UInt): UInt

    Logical shift left (output width == input width)

  188. def |<<(that: Int): UInt

    Logical shift left (output width == input width)

  189. def |>>(that: UInt): UInt

    Logical shift Right (output width == input width)

  190. def |>>(that: Int): UInt

    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 = myUInt |>> 4

Deprecated Value Members

  1. def !==(that: UInt): 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[UInt]

Inherited from DataPrimitives[UInt]

Inherited from MinMaxProvider

Inherited from Num[UInt]

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