Packages

c

spinal.lib

BoundedCounter

abstract class BoundedCounter[T <: BitVector] extends ImplicitArea[T] with CounterLike[T] with CounterAddressable[T]

Abstract base for finite-range counters with explicit upper/lower boundary policies.

Subclasses provide storage and the per-step arithmetic (via willOverflowIfInc / willUnderflowIfDec and writes to valueNext); this base wires up the shared control surface: the four willXxx pulses, derived willOverflow / willUnderflow / willAdvance / willComplete, the BoundaryPolicy.Freeze latch, and the direction-policed increment / decrement / freeRun / freeRunDown entry points.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BoundedCounter
  2. CounterAddressable
  3. CounterLike
  4. ImplicitArea
  5. Area
  6. OverridedEqualsHashCode
  7. ValCallbackRec
  8. ValCallback
  9. NameableByComponent
  10. Nameable
  11. ContextUser
  12. ScalaLocated
  13. GlobalDataUser
  14. OwnableRef
  15. AnyRef
  16. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BoundedCounter(direction: CounterDirection, upper: BoundaryPolicy, lower: BoundaryPolicy)

    direction

    Which directions the counter accepts (mismatched calls fail at elaboration).

    upper

    Policy applied when an increment would exceed the upper boundary.

    lower

    Policy applied when a decrement would fall below the lower boundary.

Type Members

  1. abstract type RefOwnerType
    Definition Classes
    OwnableRef

Abstract Value Members

  1. abstract def loadOrdinal(index: UInt): Unit

    Load the counter into its index-th ordinal state.

    Load the counter into its index-th ordinal state. 0 is the start, stateCount - 1 is the end.

    Definition Classes
    CounterAddressable
  2. abstract def stateCount: BigInt

    Total number of legal states the counter can occupy.

    Total number of legal states the counter can occupy.

    Definition Classes
    CounterLike
  3. abstract def value: T

    Current registered counter value.

    Current registered counter value.

    Definition Classes
    CounterLike
  4. abstract def valueNext: T

    Combinational next value driven into the register this cycle.

    Combinational next value driven into the register this cycle.

    Definition Classes
    CounterLike
  5. abstract def willOverflowIfInc: Bool

    True when the registered value sits at the upper boundary (i.e.

    True when the registered value sits at the upper boundary (i.e. an increment would overflow).

  6. abstract def willUnderflowIfDec: Bool

    True when the registered value sits at the lower boundary (i.e.

    True when the registered value sits at the lower boundary (i.e. a decrement would underflow).

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val _context: Capture
    Definition Classes
    Area
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def childNamePriority: Byte
    Definition Classes
    Area
  7. def clear(): Unit

    Schedule a reset to the initial value on this cycle.

    Schedule a reset to the initial value on this cycle.

    Definition Classes
    CounterLike
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  9. def component: Component
    Definition Classes
    ContextUser
  10. lazy val decOnly: Bool
    Attributes
    protected
  11. def decrement(): Unit

    Schedule a decrement on this cycle.

    Schedule a decrement on this cycle. Requires direction to be Down or Both.

  12. val direction: CounterDirection
  13. lazy val effectiveDec: Bool
    Attributes
    protected
  14. lazy val effectiveInc: Bool
    Attributes
    protected
  15. def enableStandardPruning(): Unit
    Attributes
    protected
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(obj: Any): Boolean
    Definition Classes
    OverridedEqualsHashCode → AnyRef → Any
  18. def foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit
    Definition Classes
    Nameable
  19. def freeRun(): BoundedCounter.this.type

    Make this counter free-running upward (increments every cycle).

    Make this counter free-running upward (increments every cycle). Requires direction to be Up or Both.

  20. def freeRunDown(): BoundedCounter.this.type

    Make this counter free-running downward (decrements every cycle).

    Make this counter free-running downward (decrements every cycle). Requires direction to be Down or Both.

  21. def frozen: Bool

    True when the counter is currently latched at a BoundaryPolicy.Freeze boundary.

    True when the counter is currently latched at a BoundaryPolicy.Freeze boundary.

    Definition Classes
    BoundedCounterCounterLike
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  23. def getDisplayName(): String
    Definition Classes
    Nameable
  24. def getInstanceCounter: Int
    Definition Classes
    ContextUser
  25. def getMode: Byte
    Attributes
    protected
    Definition Classes
    Nameable
  26. def getName(default: String): String
    Definition Classes
    NameableByComponentNameable
  27. def getName(): String
    Definition Classes
    NameableByComponentNameable
  28. def getPartialName(): String
    Definition Classes
    Nameable
  29. def getPath(from: Component, to: Component): Seq[Component]
    Definition Classes
    NameableByComponent
  30. def getRefOwnersChain(): List[Any]
    Definition Classes
    OwnableRef
  31. def getScalaLocationLong: String
    Definition Classes
    ScalaLocated
  32. def getScalaLocationShort: String
    Definition Classes
    ScalaLocated
  33. def getScalaTrace(): Throwable
    Definition Classes
    ScalaLocated
  34. val globalData: GlobalData
    Definition Classes
    GlobalDataUser
  35. val hasDown: Boolean
    Attributes
    protected
  36. val hasUp: Boolean
    Attributes
    protected
  37. def hashCode(): Int
    Definition Classes
    OverridedEqualsHashCode → AnyRef → Any
  38. def implicitValue: T
    Definition Classes
    CounterLikeImplicitArea
  39. lazy val incOnly: Bool
    Attributes
    protected
  40. def increment(): Unit

    Schedule an increment on this cycle.

    Schedule an increment on this cycle. Requires direction to be Up or Both.

  41. def isCompletelyUnnamed: Boolean
    Definition Classes
    Nameable
  42. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  43. final def isNamed: Boolean
    Definition Classes
    Nameable
  44. def isPriorityApplicable(namePriority: Byte): Boolean
    Definition Classes
    Nameable
  45. def isUnnamed: Boolean
    Definition Classes
    NameableByComponentNameable
  46. def load(raw: T): Unit

    Schedule loading raw into the counter on this cycle.

    Schedule loading raw into the counter on this cycle.

    Definition Classes
    CounterLike
  47. def loadOrdinal(index: BigInt): Unit

    Definition Classes
    CounterAddressable
    See also

    loadOrdinal(UInt)

  48. def loadOrdinal(index: Int): Unit

    Definition Classes
    CounterAddressable
    See also

    loadOrdinal(UInt)

  49. val lower: BoundaryPolicy
  50. val name: String
    Definition Classes
    Nameable
  51. val nameableRef: Nameable
    Attributes
    protected
    Definition Classes
    Nameable
    Annotations
    @DontName()
  52. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  53. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  54. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  55. def overrideLocalName(name: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  56. val parentScope: ScopeStatement
    Definition Classes
    ContextUser
  57. val refOwner: RefOwnerType
    Definition Classes
    OwnableRef
    Annotations
    @DontName()
  58. def reflectNames(): Unit
    Definition Classes
    Nameable
  59. def rework[T](body: ⇒ T): T
    Definition Classes
    Area
  60. def saturatedHigh: Bool

    True when the counter is currently pinned at the upper boundary by BoundaryPolicy.Saturate; always false if upper is not Saturate.

  61. def saturatedLow: Bool

    True when the counter is currently pinned at the lower boundary by BoundaryPolicy.Saturate; always false if lower is not Saturate.

  62. val scalaTrace: Throwable
    Definition Classes
    ScalaLocated
  63. def setCompositeName(nameable: Nameable, postfix: String, namePriority: Byte): BoundedCounter.this.type
    Definition Classes
    Nameable
  64. def setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): BoundedCounter.this.type
    Definition Classes
    Nameable
  65. def setCompositeName(nameable: Nameable, postfix: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  66. def setCompositeName(nameable: Nameable, namePriority: Byte): BoundedCounter.this.type
    Definition Classes
    Nameable
  67. def setCompositeName(nameable: Nameable, weak: Boolean): BoundedCounter.this.type
    Definition Classes
    Nameable
  68. def setCompositeName(nameable: Nameable): BoundedCounter.this.type
    Definition Classes
    Nameable
  69. def setLambdaName(isNameBody: ⇒ Boolean)(nameGen: ⇒ String): BoundedCounter.this.type
    Definition Classes
    Nameable
  70. def setName(name: String, namePriority: Byte): BoundedCounter.this.type
    Definition Classes
    Nameable
  71. def setName(name: String, weak: Boolean): BoundedCounter.this.type
    Definition Classes
    Nameable
  72. def setName(name: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  73. def setNameAsWeak(): BoundedCounter.this.type
    Definition Classes
    Nameable
  74. def setPartialName(name: String, namePriority: Byte, owner: Any): BoundedCounter.this.type
    Definition Classes
    Nameable
  75. def setPartialName(name: String, namePriority: Byte): BoundedCounter.this.type
    Definition Classes
    Nameable
  76. def setPartialName(name: String, weak: Boolean): BoundedCounter.this.type
    Definition Classes
    Nameable
  77. def setPartialName(owner: Nameable, name: String, namePriority: Byte): BoundedCounter.this.type
    Definition Classes
    Nameable
  78. def setPartialName(owner: Nameable, name: String, weak: Boolean): BoundedCounter.this.type
    Definition Classes
    Nameable
  79. def setPartialName(name: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  80. def setPartialName(owner: Nameable, name: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  81. def setPartialName(owner: Nameable): BoundedCounter.this.type
    Definition Classes
    Nameable
  82. def setRefOwner(that: Any): Unit
    Definition Classes
    OwnableRef
  83. def setScalaLocated(source: ScalaLocated): BoundedCounter.this.type
    Definition Classes
    ScalaLocated
  84. def setWeakName(name: String): BoundedCounter.this.type
    Definition Classes
    Nameable
  85. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  86. def toFlow(): Flow[T]

    Stream the counter as a Flow whose payload carries value and whose valid follows willAdvance.

    Stream the counter as a Flow whose payload carries value and whose valid follows willAdvance.

    Definition Classes
    CounterLike
  87. def toString(): String
    Definition Classes
    AreaNameable → AnyRef → Any
  88. def unsetName(): BoundedCounter.this.type
    Definition Classes
    Nameable
  89. val upper: BoundaryPolicy
  90. def valCallback[T](ref: T, name: String): T
    Definition Classes
    ValCallbackRec → ValCallback
  91. def valCallbackOn(ref: Any, name: String, refs: Set[Any]): Unit
    Definition Classes
    ValCallbackRec
  92. def valCallbackRec(obj: Any, name: String): Unit
    Definition Classes
    AreaValCallbackRec
  93. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  94. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  95. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  96. lazy val willAdvance: Bool

    True on the cycle the counter is moving (incrementing or decrementing).

    True on the cycle the counter is moving (incrementing or decrementing).

    Definition Classes
    BoundedCounterCounterLike
  97. val willClear: Bool

    True on the cycle the counter is being reset to its initial value.

    True on the cycle the counter is being reset to its initial value.

    Definition Classes
    BoundedCounterCounterLike
  98. lazy val willComplete: Bool

    True on the cycle the counter is completing a wrap (overflow or underflow).

    True on the cycle the counter is completing a wrap (overflow or underflow).

    Definition Classes
    BoundedCounterCounterLike
  99. val willDecrement: Bool

    True on the cycle a decrement is requested.

  100. val willIncrement: Bool

    True on the cycle an increment is requested.

  101. val willLoad: Bool

    True on the cycle the counter is being loaded from an external value.

    True on the cycle the counter is being loaded from an external value.

    Definition Classes
    BoundedCounterCounterLike
  102. lazy val willOverflow: Bool

    willOverflowIfInc qualified with willIncrement (and, in Both mode, gated by !willDecrement).

  103. lazy val willUnderflow: Bool

    willUnderflowIfDec qualified with willDecrement (and, in Both mode, gated by !willIncrement).

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from CounterAddressable[T]

Inherited from CounterLike[T]

Inherited from ImplicitArea[T]

Inherited from Area

Inherited from OverridedEqualsHashCode

Inherited from ValCallbackRec

Inherited from ValCallback

Inherited from NameableByComponent

Inherited from Nameable

Inherited from ContextUser

Inherited from ScalaLocated

Inherited from GlobalDataUser

Inherited from OwnableRef

Inherited from AnyRef

Inherited from Any

Ungrouped