case class Bcd(digitCount: Int) extends Bundle with Product with Serializable

Binary-Coded Decimal (BCD) data type, where each decimal digit is stored in 4 bits.

Example:
  1. val bcd = Bcd(4)                    // 4-digit BCD (0-9999)
    val converted = Bcd.fromUInt(myUInt) // Binary to BCD conversion
    val binary = bcd.toUInt             // BCD to binary conversion
    val sum = bcd1 + bcd2               // BCD addition
See also

BCD on Wikipedia

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Bcd
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Bundle
  7. ValCallbackRec
  8. ValCallback
  9. MultiData
  10. Data
  11. InComponent
  12. OverridedEqualsHashCode
  13. SpinalTagReady
  14. Assignable
  15. NameableByComponent
  16. Nameable
  17. OwnableRef
  18. ContextUser
  19. ScalaLocated
  20. GlobalDataUser
  21. AnyRef
  22. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Bcd(digitCount: Int)

Type Members

  1. abstract type RefOwnerType
    Definition Classes
    OwnableRef

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. def ##(right: Data): Bits

    Concatenation between two signals

    Concatenation between two signals

    Definition Classes
    Data
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. def #*(count: Int): Bits

    Return the count time concatenation of the signal.

    Return the count time concatenation of the signal.

    Definition Classes
    Data
  5. def +(that: Bcd): Bcd
  6. def <(that: Bcd): Bool
  7. def <<(n: UInt): Bcd
  8. def <<(n: Int): Bcd
  9. def <=(that: Bcd): Bool
  10. def =/=(that: Bcd): Bool
  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def ===(that: Bcd): Bool
  13. def >(that: Bcd): Bool
  14. def >=(that: Bcd): Bool
  15. def >>(n: UInt): Bcd
  16. def >>(n: Int): Bcd
  17. def @@(that: Bcd): Bcd
  18. def IFparent: Data
    Definition Classes
    Data
  19. val _spinalTags: LinkedHashSet[SpinalTag]
    Definition Classes
    SpinalTagReady
  20. def addAttribute(attribute: Attribute): Bcd.this.type
    Definition Classes
    DataSpinalTagReady
  21. def addAttribute(name: String, value: Int): Bcd.this.type
    Definition Classes
    SpinalTagReady
  22. def addAttribute(name: String, value: String): Bcd.this.type
    Definition Classes
    SpinalTagReady
  23. def addAttribute(name: String): Bcd.this.type
    Definition Classes
    SpinalTagReady
  24. def addTag[T <: SpinalTag](spinalTag: T): Bcd.this.type
    Definition Classes
    MultiDataSpinalTagReady
  25. def addTags(h: SpinalTag, tail: SpinalTag*): Bcd.this.type
    Definition Classes
    SpinalTagReady
  26. def addTags[T <: SpinalTag](tags: Iterable[T]): Bcd.this.type
    Definition Classes
    SpinalTagReady
  27. def allowDirectionLessIo(): Bcd.this.type

    Allow a signal of an io Bundle to be directionless.

    Allow a signal of an io Bundle to be directionless.

    Definition Classes
    Data
    See also

    IO Bundle Error Documentation

  28. def allowOverride(): Bcd.this.type

    Allow a signal to be overridden.

    Allow a signal to be overridden.

    Definition Classes
    Data
    See also

    Assignment overlap Error Documentation

  29. def allowPartialyAssigned(): Bcd.this.type

    Allow a register to be partially assigned

    Allow a register to be partially assigned

    Definition Classes
    Data
  30. def allowPruning(): Bcd.this.type
    Definition Classes
    Data
  31. def allowSimplifyIt(): Bcd.this.type
    Definition Classes
    Data
  32. def allowUnsetRegToAvoidLatch(): Bcd.this.type

    Allow a register to have only an init (no assignments)

    Allow a register to have only an init (no assignments)

    Definition Classes
    Data
    See also

    "Register with only init" Error Documentation

  33. def apply(offset: UInt, count: Int): Bcd
  34. def as[T <: Data](dataType: HardType[T]): T
    Definition Classes
    Data
  35. def asBits: Bits

    Cast signal to Bits

    Cast signal to Bits

    Definition Classes
    MultiDataData
  36. def asData: Data
    Definition Classes
    Data
  37. def asInOut(): Bcd.this.type

    Set a signal as inout

    Set a signal as inout

    Definition Classes
    MultiDataData
  38. def asInput(): Bcd.this.type

    Set a data as input

    Set a data as input

    Definition Classes
    MultiDataData
  39. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  40. def asOutput(): Bcd.this.type

    Set a data as output

    Set a data as output

    Definition Classes
    MultiDataData
  41. def asReversedBits: Bits

    Concatenate the bits of the elements in reverse order.

    Concatenate the bits of the elements in reverse order.

    This does not recurse, so elements which are composite will appear in forward order.

    Definition Classes
    MultiData
  42. def assignAllByName(that: Bundle): Unit

    Assign the bundle with an other bundle by name

    Assign the bundle with an other bundle by name

    Definition Classes
    Bundle
  43. def assignDontCare(): Bcd.this.type

    Assign the default 'x' value to all signals composing this type.

    Assign the default 'x' value to all signals composing this type.

    Definition Classes
    Data
    See also

    Data type documentation

    "Don't care term" wikipedia article

  44. def assignDontCareToUnasigned(): Bcd.this.type
    Definition Classes
    Data
  45. def assignFormalRandom(kind: RandomExpKind): Unit
    Definition Classes
    MultiDataData
  46. final def assignFrom(that: AnyRef, target: AnyRef = this)(implicit loc: Location): Unit
    Definition Classes
    Data
  47. def assignFromBits(bits: Bits, hi: Int, lo: Int): Unit
    Definition Classes
    MultiDataData
  48. def assignFromBits(bits: Bits): Unit
    Definition Classes
    MultiDataData
  49. def assignFromBits(bits: Bits, offset: Int, bitCount: BitCount): Unit
    Definition Classes
    Data
  50. def assignFromImpl(that: AnyRef, target: AnyRef, kind: AnyRef)(implicit loc: Location): Unit
    Attributes
    protected
    Definition Classes
    BundleAssignable
  51. def assignSomeByName(that: Bundle): Unit

    Assign all possible signal fo the bundle with an other bundle by name

    Assign all possible signal fo the bundle with an other bundle by name

    Definition Classes
    Bundle
  52. def assignUnassignedByName(that: MultiData): Unit
    Definition Classes
    MultiData
  53. def bitWidth: Int
  54. def bundleAssign(that: Bundle)(f: (Data, Data) ⇒ Unit): Unit
    Definition Classes
    Bundle
  55. def checkDir(that: Bundle): Boolean

    for interface find modport

    for interface find modport

    Definition Classes
    Bundle
  56. def clearAll(): Bcd.this.type

    Clear all bits to False and return itself

    Clear all bits to False and return itself

    Definition Classes
    Data
  57. def clone(): Bcd
    Definition Classes
    BcdBundleData → AnyRef
  58. def component: Component
    Definition Classes
    ContextUser
  59. final def compositAssignFrom(that: AnyRef, target: AnyRef, kind: AnyRef)(implicit loc: Location): Unit
    Definition Classes
    Assignable
  60. val compositeAssign: Assignable
    Definition Classes
    Assignable
  61. def copyDirectionOfImpl(that: Data): Bcd.this.type
    Definition Classes
    MultiDataData
  62. val digitCount: Int
  63. val digits: Vec[UInt]
  64. def dirString(): String
    Definition Classes
    Data
  65. def dontSimplifyIt(): Bcd.this.type
    Definition Classes
    Data
  66. def elements: ArrayBuffer[(String, Data)]
    Definition Classes
    BundleMultiData
  67. var elementsCache: ArrayBuffer[(String, Data)]
    Definition Classes
    Bundle
  68. def elementsString: String
    Definition Classes
    MultiData
  69. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  70. def equals(obj: Any): Boolean
    Definition Classes
    OverridedEqualsHashCode → 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 find(name: String): Data
    Definition Classes
    MultiData
  74. def findTag(cond: (SpinalTag) ⇒ Boolean): Option[SpinalTag]
    Definition Classes
    SpinalTagReady
  75. def flatten: Seq[BaseType]
    Definition Classes
    MultiDataData
  76. def flattenForeach(body: (BaseType) ⇒ Unit): Unit
    Definition Classes
    MultiDataData
  77. def flattenLocalName: Seq[String]
    Definition Classes
    MultiDataData
  78. def flip(): Bcd.this.type

    Flip the direction of the signal.

    Flip the direction of the signal.

    in and out are swapped, inout stay the same.

    Definition Classes
    MultiDataData
  79. def foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit
    Definition Classes
    Nameable
  80. def foreachTag(body: (SpinalTag) ⇒ Unit): Unit
    Definition Classes
    SpinalTagReady
  81. def freeze(): Bcd.this.type
    Definition Classes
    MultiDataData
  82. def getAheadValue(): Bcd.this.type

    For a register, get the value it will have at the next clock, as a combinational signal.

    For a register, get the value it will have at the next clock, as a combinational signal.

    Definition Classes
    Data
  83. def getBitsWidth: Int

    Return the width of the data

    Return the width of the data

    Definition Classes
    MultiDataData
  84. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  85. def getComponent(): Component
    Definition Classes
    DataInComponentNameableByComponent
  86. def getComponents(): Seq[Component]

    Get current component with all parents

    Get current component with all parents

    Definition Classes
    InComponent
  87. def getDirection: IODirection
    Definition Classes
    Data
  88. def getDisplayName(): String
    Definition Classes
    Nameable
  89. def getInstanceCounter: Int
    Definition Classes
    ContextUser
  90. def getMode: Byte
    Attributes
    protected
    Definition Classes
    Nameable
  91. def getMuxType[T <: Data](list: TraversableOnce[T]): HardType[T]
    Definition Classes
    Data
  92. def getName(default: String): String
    Definition Classes
    NameableByComponentNameable
  93. def getName(): String
    Definition Classes
    NameableByComponentNameable
  94. def getPartialName(): String
    Definition Classes
    Nameable
  95. def getPath(from: Component, to: Component): Seq[Component]
    Definition Classes
    NameableByComponent
  96. def getRealSource: Any
    Definition Classes
    Assignable
  97. def getRealSourceNoRec: Any
    Definition Classes
    DataAssignable
  98. def getRefOwnersChain(): List[Any]
    Definition Classes
    OwnableRef
  99. def getRootParent: Data
    Definition Classes
    Data
  100. def getRtlPath(separator: String = "/"): String
    Definition Classes
    Data
  101. def getScalaLocationLong: String
    Definition Classes
    ScalaLocated
  102. def getScalaLocationShort: String
    Definition Classes
    ScalaLocated
  103. def getScalaTrace(): Throwable
    Definition Classes
    ScalaLocated
  104. def getTag[T <: SpinalTag](clazz: Class[T]): Option[T]
    Definition Classes
    SpinalTagReady
  105. def getTags(): LinkedHashSet[SpinalTag]
    Definition Classes
    SpinalTagReady
  106. def getTagsOf[T <: SpinalTag]()(implicit tag: ClassTag[T]): Iterable[T]
    Definition Classes
    SpinalTagReady
  107. def getTypeString: String
    Definition Classes
    Bundle
  108. def getZero: Bcd.this.type

    Create a signal set to 0

    Create a signal set to 0

    Definition Classes
    MultiDataData
  109. val globalData: GlobalData
    Definition Classes
    GlobalDataUser
  110. var hardtype: HardType[_]
    Definition Classes
    Bundle
  111. def hasTag[T <: SpinalTag](clazz: Class[T]): Boolean
    Definition Classes
    SpinalTagReady
  112. def hasTag(spinalTag: SpinalTag): Boolean
    Definition Classes
    SpinalTagReady
  113. def hashCode(): Int
    Definition Classes
    OverridedEqualsHashCode → AnyRef → Any
  114. final def initFrom(that: AnyRef, target: AnyRef = this): Unit
    Definition Classes
    Data
  115. def instanceAttributes(language: Language): Iterable[Attribute]
    Definition Classes
    SpinalTagReady
  116. def instanceAttributes: Iterable[Attribute]
    Definition Classes
    SpinalTagReady
  117. def isAnalog: Boolean
    Definition Classes
    Data
  118. def isComb: Boolean
    Definition Classes
    Data
  119. def isCompletelyUnnamed: Boolean
    Definition Classes
    Nameable
  120. def isDirectionLess: Boolean
    Definition Classes
    Data
  121. def isEmptyOfTag: Boolean
    Definition Classes
    SpinalTagReady
  122. def isInOut: Boolean
    Definition Classes
    Data
  123. def isInput: Boolean
    Definition Classes
    Data
  124. def isInputOrInOut: Boolean
    Definition Classes
    Data
  125. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  126. final def isNamed: Boolean
    Definition Classes
    Nameable
  127. def isOutput: Boolean
    Definition Classes
    Data
  128. def isOutputOrInOut: Boolean
    Definition Classes
    Data
  129. def isPriorityApplicable(namePriority: Byte): Boolean
    Definition Classes
    Nameable
  130. def isReg: Boolean
    Definition Classes
    Data
  131. def isRegOnAssign: Boolean
    Definition Classes
    Data
  132. def isUnnamed: Boolean
    Definition Classes
    NameableByComponentNameable
  133. def isZero: Bool
  134. def leadingZeroes: UInt
  135. def lsd: UInt
  136. def msd: UInt
  137. val name: String
    Definition Classes
    Nameable
  138. val nameableRef: Nameable
    Attributes
    protected
    Definition Classes
    Nameable
    Annotations
    @DontName()
  139. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  140. def noBackendCombMerge(): Bcd.this.type

    Put the combinatorial logic driving this signal in a separate process

    Put the combinatorial logic driving this signal in a separate process

    Definition Classes
    Data
  141. def noCombLoopCheck(): Bcd.this.type

    Disable combinatorial loop checking for this Data

    Disable combinatorial loop checking for this Data

    Definition Classes
    Data
    See also

    Combinatorial loop Error Documentation

  142. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  143. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  144. def onEachAttributes(doIt: (Attribute) ⇒ Unit): Unit
    Definition Classes
    SpinalTagReady
  145. def overrideLocalName(name: String): Bcd.this.type
    Definition Classes
    Nameable
  146. val parent: Data
    Definition Classes
    Data
  147. val parentScope: ScopeStatement
    Definition Classes
    ContextUser
  148. def pull(propagateName: Boolean): Bcd.this.type
    Definition Classes
    Data
  149. def pull(): Bcd.this.type

    Pull a signal to the top level (use for debugging)

    Pull a signal to the top level (use for debugging)

    Definition Classes
    Data
  150. def purify(): Bcd.this.type
    Definition Classes
    Data
  151. def randBoot(u: Unit): Bcd.this.type

    Useful for register that doesn't need a reset value in RTL, but need a random value for simulation (avoid x-propagation)

    Useful for register that doesn't need a reset value in RTL, but need a random value for simulation (avoid x-propagation)

    Definition Classes
    Data
  152. val refOwner: RefOwnerType
    Definition Classes
    OwnableRef
    Annotations
    @DontName()
  153. def reflectNames(): Unit
    Definition Classes
    Nameable
  154. def removeAssignments(data: Boolean = true, init: Boolean = true, initial: Boolean = true): Bcd.this.type
    Definition Classes
    Data
  155. def removeDataAssignments(): Bcd.this.type
    Definition Classes
    Data
  156. def removeInitAssignments(): Bcd.this.type
    Definition Classes
    Data
  157. def removeTag(spinalTag: SpinalTag): Bcd.this.type
    Definition Classes
    SpinalTagReady
  158. def removeTags(tags: Iterable[SpinalTag]): Bcd.this.type
    Definition Classes
    SpinalTagReady
  159. def resize(n: Int): Bcd
  160. def resized: Bcd.this.type

    Return a version of the signal which is allowed to be automatically resized where needed.

    Return a version of the signal which is allowed to be automatically resized where needed.

    The resize operation is deferred until the point of assignment later. The resize may widen or truncate, retaining the LSB.

    Definition Classes
    Data
    See also

    Width checking Documentation

  161. def rootIF(): Interface

    root interface

    root interface

    Definition Classes
    Data
  162. def rootIFList(): List[Interface]
    Definition Classes
    Data
  163. def rootIFrec(now: Data, lastRoot: List[Interface]): List[Interface]
    Definition Classes
    Data
  164. val scalaTrace: Throwable
    Definition Classes
    ScalaLocated
  165. def setAll(): Bcd.this.type

    Set all bits to True and return itself

    Set all bits to True and return itself

    Definition Classes
    Data
  166. def setAsAnalog(): Bcd.this.type
    Definition Classes
    Data
  167. def setAsComb(): Bcd.this.type

    Set baseType to Combinatorial

    Set baseType to Combinatorial

    Definition Classes
    MultiDataData
  168. def setAsDirectionLess(): Bcd.this.type

    Remove the direction (in, out, inout) to a signal

    Remove the direction (in, out, inout) to a signal

    Definition Classes
    MultiDataData
  169. def setAsReg(): Bcd.this.type

    Set baseType to reg

    Set baseType to reg

    Definition Classes
    MultiDataData
  170. def setCompositeName(nameable: Nameable, postfix: String, namePriority: Byte): Bcd.this.type
    Definition Classes
    Nameable
  171. def setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): Bcd.this.type
    Definition Classes
    Nameable
  172. def setCompositeName(nameable: Nameable, postfix: String): Bcd.this.type
    Definition Classes
    Nameable
  173. def setCompositeName(nameable: Nameable, namePriority: Byte): Bcd.this.type
    Definition Classes
    Nameable
  174. def setCompositeName(nameable: Nameable, weak: Boolean): Bcd.this.type
    Definition Classes
    Nameable
  175. def setCompositeName(nameable: Nameable): Bcd.this.type
    Definition Classes
    Nameable
  176. def setLambdaName(isNameBody: ⇒ Boolean)(nameGen: ⇒ String): Bcd.this.type
    Definition Classes
    Nameable
  177. def setName(name: String, namePriority: Byte): Bcd.this.type
    Definition Classes
    Nameable
  178. def setName(name: String, weak: Boolean): Bcd.this.type
    Definition Classes
    Nameable
  179. def setName(name: String): Bcd.this.type
    Definition Classes
    Nameable
  180. def setNameAsWeak(): Bcd.this.type
    Definition Classes
    Nameable
  181. def setOutputAsReg(): Bcd.this.type

    Recursively set baseType to reg only for output

    Recursively set baseType to reg only for output

    Definition Classes
    Data
  182. def setPartialName(name: String, namePriority: Byte, owner: Any): Bcd.this.type
    Definition Classes
    Nameable
  183. def setPartialName(name: String, namePriority: Byte): Bcd.this.type
    Definition Classes
    Nameable
  184. def setPartialName(name: String, weak: Boolean): Bcd.this.type
    Definition Classes
    Nameable
  185. def setPartialName(owner: Nameable, name: String, namePriority: Byte): Bcd.this.type
    Definition Classes
    Nameable
  186. def setPartialName(owner: Nameable, name: String, weak: Boolean): Bcd.this.type
    Definition Classes
    Nameable
  187. def setPartialName(name: String): Bcd.this.type
    Definition Classes
    Nameable
  188. def setPartialName(owner: Nameable, name: String): Bcd.this.type
    Definition Classes
    Nameable
  189. def setPartialName(owner: Nameable): Bcd.this.type
    Definition Classes
    Nameable
  190. def setRefOwner(that: Any): Unit
    Definition Classes
    OwnableRef
  191. def setScalaLocated(source: ScalaLocated): Bcd.this.type
    Definition Classes
    ScalaLocated
  192. def setWeakName(name: String): Bcd.this.type
    Definition Classes
    Nameable
  193. def spinalTags: LinkedHashSet[SpinalTag]
    Definition Classes
    SpinalTagReady
  194. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  195. def toIo(): Bcd.this.type
    Definition Classes
    Data
  196. def toMuxInput[T <: Data](muxOutput: T): T
    Definition Classes
    Data
  197. def toString(): String
    Definition Classes
    BundleNameable → AnyRef → Any
  198. def toUInt: UInt
  199. def unfreeze(): Bcd.this.type
    Definition Classes
    MultiDataData
  200. def unsetName(): Bcd.this.type
    Definition Classes
    Nameable
  201. def usedDigits: UInt
  202. def valCallback[T](ref: T, name: String): T
    Definition Classes
    ValCallbackRec → ValCallback
  203. def valCallbackOn(ref: Any, name: String, refs: Set[Any]): Unit
    Definition Classes
    ValCallbackRec
  204. def valCallbackRec(ref: Any, name: String): Unit
    Definition Classes
    BundleValCallbackRec
  205. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  206. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  207. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  208. def wrapNext(): Bcd.this.type
    Definition Classes
    Data
  209. def zipByName(that: MultiData, rec: ArrayBuffer[(BaseType, BaseType)] = ArrayBuffer()): ArrayBuffer[(BaseType, BaseType)]
    Definition Classes
    MultiData

Deprecated Value Members

  1. def asDirectionLess(): Bcd.this.type
    Definition Classes
    Data
    Annotations
    @deprecated
    Deprecated

    (Since version ???) use setAsDirectionLess instead

  2. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated
  3. def genIf(cond: Boolean): Bcd.this.type

    Generate this if condition is true

    Generate this if condition is true

    Definition Classes
    Data
    Annotations
    @deprecated
    Deprecated

    does not work with <>, use 'someBool generate Type()' or 'if(condition) Type() else null' instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Bundle

Inherited from ValCallbackRec

Inherited from ValCallback

Inherited from MultiData

Inherited from Data

Inherited from InComponent

Inherited from OverridedEqualsHashCode

Inherited from SpinalTagReady

Inherited from Assignable

Inherited from NameableByComponent

Inherited from Nameable

Inherited from OwnableRef

Inherited from ContextUser

Inherited from ScalaLocated

Inherited from GlobalDataUser

Inherited from AnyRef

Inherited from Any

Ungrouped