spinal.core

SInt

Related Doc: package core

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

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

Example:
  1. val mySInt = SInt(8 bits)
    mySInt    := S(4, 8 bits) + S"0000_1111"
    mySInt    := S(4) - S"h1A"
See also

SInt Documentation

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SInt
  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 SInt()

Type Members

  1. abstract type RefOwnerType

    Definition Classes
    OwnableRef
  2. type T = SInt

    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
    SIntBitVector

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: SInt): SInt

    Modulo

    Modulo

    Definition Classes
    SIntNum
  5. def &(right: SInt): SInt

    Logical AND operator

    Logical AND operator

    Definition Classes
    SIntBitwiseOp
  6. def *(right: SInt): SInt

    Multiplication

    Multiplication

    Definition Classes
    SIntNum
  7. def +(right: SInt): SInt

    Addition

    Addition

    Definition Classes
    SIntNum
  8. def -(right: SInt): SInt

    Substraction

    Substraction

    Definition Classes
    SIntNum
  9. def /(right: SInt): SInt

    Division

    Division

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

    Assign a range value to a SInt

    Assign a range value to a SInt

    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: SInt): Unit

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

    Is less than right

    Is less than right

    Definition Classes
    SIntNum
  13. def <<(that: Int): SInt

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

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

    Definition Classes
    SIntNum
  14. def <<(that: UInt): SInt

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

  15. def <=(right: SInt): Bool

    Is equal or less than right

    Is equal or less than right

    Definition Classes
    SIntNum
  16. def <>(that: SInt): Unit

    Definition Classes
    DataPrimitives
  17. def =/=(that: SInt): 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: SInt): 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: SInt): Bool

    Is greater than right

    Is greater than right

    Definition Classes
    SIntNum
  23. def >=(right: SInt): Bool

    Is equal or greater than right

    Is equal or greater than right

    Definition Classes
    SIntNum
  24. def >>(that: Int): SInt

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

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

    Definition Classes
    SIntNum
  25. def >>(that: UInt): SInt

    Logical shift Right (output width == input width)

    Logical shift Right (output width == input width)

    that

    the number of right shift

    returns

    a Bits of width : w(this)

    Example:
    1. val result = mySInt >> myUIntShift
  26. def @@(that: Bool): SInt

    Concatenation between a SInt and a Bool

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

    Concatenation between a SInt and UInt

  28. def @@(that: SInt): SInt

    Concatenation between two SInt

    Concatenation between two SInt

    that

    an SInt to append

    returns

    a new SInt of width (width(this) + width(right))

    Example:
    1. val mySInt = sInt1 @@ sInt2
  29. def \(that: SInt): SInt

    Definition Classes
    DataPrimitives
  30. def ^(right: SInt): SInt

    Logical XOR operator

    Logical XOR operator

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

    Definition Classes
    SpinalTagReady
  32. def abs(enable: Bool): UInt

    Return the absolute value of the SInt when enable is True

  33. def abs: UInt

    Absolute value of a SInt

    Absolute value of a SInt

    returns

    a UInt assign with the absolute value of the SInt

    Example:
    1. myUInt := mySInt.abs
  34. def addAttribute(attribute: Attribute): SInt.this.type

    Definition Classes
    BaseTypeDataSpinalTagReady
  35. def addAttribute(name: String, value: String): SInt.this.type

    Definition Classes
    SpinalTagReady
  36. def addAttribute(name: String): SInt.this.type

    Definition Classes
    SpinalTagReady
  37. def addTag(spinalTag: SpinalTag): SInt.this.type

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

    Definition Classes
    SpinalTagReady
  39. def allowPruning(): Unit

    Definition Classes
    Data
  40. def allowSimplifyIt(): SInt.this.type

    Definition Classes
    BaseTypeData
  41. def andR: Bool

    Logical AND of all bits

    Logical AND of all bits

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

    Return the bit at index bitId

    Return the bit at index bitId

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

    Return the bit at index bitId

    Return the bit at index bitId

    Definition Classes
    SIntBitVector
    Example:
    1. val myBool = myBits(3)
  46. def apply(range: Range): SInt.this.type

    Return a range of bits

    Return a range of bits

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

    Definition Classes
    SIntData
  49. 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
  50. def asData: Data

    Definition Classes
    Data
  51. def asDirectionLess(): SInt.this.type

    Definition Classes
    BaseTypeData
  52. def asInput(): SInt.this.type

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

    Definition Classes
    Any
  54. def asOutput(): SInt.this.type

    Definition Classes
    BaseTypeData
  55. def asUInt: UInt

    Cast a SInt into an UInt

    Cast a SInt into an UInt

    returns

    a UInt data

    Example:
    1. myUInt := mySInt.asUInt
  56. def assignDontCare(): SInt.this.type

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

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

    Definition Classes
    SIntData
  59. def assignFromBits(bits: Bits): Unit

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

    Definition Classes
    Data
  61. var assignementThrowable: Throwable

    Definition Classes
    BaseType
  62. def clearAll(): Unit

    Clear all bits

    Clear all bits

    Definition Classes
    BitVector
  63. def clone(): SInt.this.type

    Definition Classes
    BitVectorBaseTypeData → AnyRef
  64. var component: Component

    Definition Classes
    ContextUser
  65. var compositeAssign: Assignable

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

    Definition Classes
    Node
  67. def default(that: ⇒ SInt): SInt

    Definition Classes
    DataPrimitives
  68. var defaultValue: BaseType

    Definition Classes
    BaseType
  69. def dontSimplifyIt(): SInt.this.type

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

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

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

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

    Definition Classes
    SpinalTagReady
  74. def finalize(): Unit

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

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

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

    Definition Classes
    BaseTypeData
  78. def flip(): SInt.this.type

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

    Definition Classes
    Nameable
  80. def genIf(cond: Boolean): SInt.this.type

    Definition Classes
    Data
  81. def getAllToBoolNode(): AllByBool

    Attributes
    protected
    Definition Classes
    SIntBitVector
  82. def getAssignementContext(id: Int): Throwable

    Definition Classes
    BaseTypeAssignementTreePart
  83. def getBitsWidth: Int

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

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

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

    Definition Classes
    Data
  87. def getDisplayName(): String

    Definition Classes
    Nameable
  88. def getDrivingReg: SInt.this.type

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

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

    Definition Classes
    BaseTypeNode
  91. def getInputsCount: Int

    Definition Classes
    BaseTypeNode
  92. def getInstanceCounter: Int

    Definition Classes
    ContextUser
  93. def getName(): String

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

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

    Definition Classes
    OwnableRef
  96. def getRootParent: Data

    Definition Classes
    Data
  97. def getScalaLocationLong: String

    Definition Classes
    ScalaLocated
  98. def getScalaLocationShort: String

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

    Definition Classes
    SpinalTagReady
  100. def getWidth: Int

    Definition Classes
    WidthableWidthProvider
  101. def getWidthNoInferation: Int

    Return the width

    Return the width

    Definition Classes
    BitVector
  102. def getWidthStringNoInferation: String

    Definition Classes
    BitVector
  103. def getZero: SInt.this.type

    Definition Classes
    SIntData
  104. def getZeroUnconstrained(): SInt.this.type

    Definition Classes
    SIntBitVector
  105. val globalData: GlobalData

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

    Definition Classes
    SpinalTagReady
  107. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  108. def high: Int

    Return the upper bound

    Return the upper bound

    Definition Classes
    BitVector
  109. def init(that: SInt): SInt

    Definition Classes
    DataPrimitives
  110. var input: Node

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

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

    Definition Classes
    SpinalTagReady
  113. def isDelay: Boolean

    Definition Classes
    BaseType
  114. def isDirectionLess: Boolean

    Definition Classes
    Data
  115. def isEmptyOfTag: Boolean

    Definition Classes
    SpinalTagReady
  116. def isInput: Boolean

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

    Definition Classes
    Any
  118. def isNamed: Boolean

    Definition Classes
    Nameable
  119. def isOutput: Boolean

    Definition Classes
    Data
  120. def isReg: Boolean

    Definition Classes
    BaseTypeData
  121. def isUnnamed: Boolean

    Definition Classes
    Nameable
  122. def keep(): SInt.this.type

    Definition Classes
    Data
  123. def lsb: Bool

    Return the least significant bit

    Return the least significant bit

    Definition Classes
    BitVector
  124. def max(right: SInt): SInt

    Return the maximum value between this and right

    Return the maximum value between this and right

    Definition Classes
    Num
  125. def maxValue: BigInt

    Definition Classes
    SIntMinMaxProvider
  126. def min(right: SInt): SInt

    Return the minimum value between this and right

    Return the minimum value between this and right

    Definition Classes
    Num
  127. def minValue: BigInt

    Definition Classes
    SIntMinMaxProvider
  128. def msb: Bool

    Return the most significant bit

    Return the most significant bit

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

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

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

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

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

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

    Extract a range of bits of the BitVector

    Extract a range of bits of the BitVector

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

    Extract a bit of the BitVector

    Extract a bit of the BitVector

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

    Extract a bit of the BitVector

    Extract a bit of the BitVector

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

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

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

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

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

    Definition Classes
    BaseTypeNode
  141. def orR: Bool

    Logical OR of all bits

    Logical OR of all bits

    Definition Classes
    BitVector
  142. var parent: Data

    Definition Classes
    Data
  143. def pull(): SInt.this.type

    Definition Classes
    Data
  144. def randBoot(): SInt.this.type

    Definition Classes
    Data
  145. def range: Range

    Return the range

    Return the range

    Definition Classes
    BitVector
  146. var refOwner: RefOwnerType

    Definition Classes
    OwnableRef
  147. def removeAssignements(): Unit

    Definition Classes
    BaseType
  148. def removeTag(spinalTag: SpinalTag): SInt.this.type

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

    Definition Classes
    SpinalTagReady
  150. def resize(width: Int): SInt.this.type

    Resize the bitVector to width

    Resize the bitVector to width

    returns

    a resized bitVector

    Definition Classes
    SIntBitVector
    Example:
    1. val res = myBits.resize(10)
  151. def resized: SInt.this.type

    Definition Classes
    Data
  152. def rotateLeft(that: Int): SInt

    Left rotation of that bits

    Left rotation of that bits

    Definition Classes
    SIntBitVector
  153. def rotateLeft(that: UInt): T

    Left rotation of that Bits

    Left rotation of that Bits

    Definition Classes
    BitVector
  154. def rotateRight(that: Int): SInt

    Right rotation of that bits

    Right rotation of that bits

    Definition Classes
    SIntBitVector
  155. def rotateRight(that: UInt): T

    Right rotation of that Bits

    Right rotation of that Bits

    Definition Classes
    BitVector
  156. def setAll(): Unit

    Set all bits

    Set all bits

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

    Set all bits to value

    Set all bits to value

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

    Set all bits to value

    Set all bits to value

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

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

    Definition Classes
    Nameable
  161. def setCompositeName(nameable: Nameable, postfix: String): SInt.this.type

    Definition Classes
    Nameable
  162. def setCompositeName(nameable: Nameable, weak: Boolean): SInt.this.type

    Definition Classes
    Nameable
  163. def setCompositeName(nameable: Nameable): SInt.this.type

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

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

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

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

    Definition Classes
    Nameable
  168. def setPartialName(name: String): SInt.this.type

    Definition Classes
    Nameable
  169. def setPartialName(owner: Nameable, name: String): SInt.this.type

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

    Definition Classes
    OwnableRef
  171. def setWeakName(name: String): SInt.this.type

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

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

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

    Definition Classes
    AnyRef
  178. def toString(): String

    Definition Classes
    BitVectorBaseTypeNameableNode → AnyRef → Any
  179. def unary_-(): SInt

    Negative number

    Negative number

    returns

    return a negative number

    Example:
    1. val result = -mySInt
  180. def unary_~(): SInt

    Inverse bitwise operator

    Inverse bitwise operator

    Definition Classes
    SIntBitwiseOp
  181. def unsetName(): Unit

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

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

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

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

    Definition Classes
    BaseType
  186. def xorR: Bool

    Logical XOR of all bits

    Logical XOR of all bits

    Definition Classes
    BitVector
  187. def |(right: SInt): SInt

    Logical OR operator

    Logical OR operator

    Definition Classes
    SIntBitwiseOp
  188. def |<<(that: UInt): SInt

    Logical shift left (output width == input width)

  189. def |<<(that: Int): SInt

    Logical shift left (output width == input width)

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

    Logical shift Right (output width == input width)

  191. def |>>(that: Int): SInt

    Logical shift right (output width == input width)

    Logical shift right (output width == input width)

    that

    the number of right shift

    returns

    a Bits of width : w(this)

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

Deprecated Value Members

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

Inherited from DataPrimitives[SInt]

Inherited from MinMaxProvider

Inherited from Num[SInt]

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