class OneHotCounter extends BoundedCounter[Bits]
One-hot encoded counter with stateCount states.
The register is stateCount bits wide and carries exactly one set bit. Increment rotates the
hot bit toward the MSB; decrement rotates it toward the LSB.
- Alphabetic
- By Inheritance
- OneHotCounter
- BoundedCounter
- CounterAddressable
- CounterLike
- ImplicitArea
- Area
- OverridedEqualsHashCode
- ValCallbackRec
- ValCallback
- NameableByComponent
- Nameable
- ContextUser
- ScalaLocated
- GlobalDataUser
- OwnableRef
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
OneHotCounter(stateCount: BigInt, initialValue: BigInt = 0, direction: CounterDirection = CounterDirection.Up, upper: BoundaryPolicy = BoundaryPolicy.Wrap, lower: BoundaryPolicy = BoundaryPolicy.Wrap)
- stateCount
Number of states (bit-width of the register).
- initialValue
Index of the bit set after reset; must satisfy
0 <= initialValue < stateCount.
Type Members
-
abstract
type
RefOwnerType
- Definition Classes
- OwnableRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def !==(that: UInt): Bool
- def !==(that: BigInt): Bool
- def !==(that: Int): Bool
- def !==(that: Bits): Bool
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def =/=(that: UInt): Bool
- def =/=(that: BigInt): Bool
- def =/=(that: Int): Bool
- def =/=(that: Bits): Bool
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ===(that: UInt): Bool
- def ===(that: BigInt): Bool
- def ===(that: Int): Bool
- def ===(that: Bits): Bool
-
val
_context: Capture
- Definition Classes
- Area
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
childNamePriority: Byte
- Definition Classes
- Area
-
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
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
def
component: Component
- Definition Classes
- ContextUser
-
lazy val
decOnly: Bool
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
def
decrement(): Unit
Schedule a decrement on this cycle.
Schedule a decrement on this cycle. Requires
directionto beDownorBoth.- Definition Classes
- BoundedCounter
-
val
direction: CounterDirection
- Definition Classes
- BoundedCounter
-
lazy val
effectiveDec: Bool
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
lazy val
effectiveInc: Bool
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
def
enableStandardPruning(): Unit
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit
- Definition Classes
- Nameable
-
def
freeRun(): OneHotCounter.this.type
Make this counter free-running upward (increments every cycle).
Make this counter free-running upward (increments every cycle). Requires
directionto beUporBoth.- Definition Classes
- BoundedCounter
-
def
freeRunDown(): OneHotCounter.this.type
Make this counter free-running downward (decrements every cycle).
Make this counter free-running downward (decrements every cycle). Requires
directionto beDownorBoth.- Definition Classes
- BoundedCounter
-
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
- BoundedCounter → CounterLike
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
getDisplayName(): String
- Definition Classes
- Nameable
-
def
getInstanceCounter: Int
- Definition Classes
- ContextUser
-
def
getMode: Byte
- Attributes
- protected
- Definition Classes
- Nameable
-
def
getName(default: String): String
- Definition Classes
- NameableByComponent → Nameable
-
def
getName(): String
- Definition Classes
- NameableByComponent → Nameable
-
def
getPartialName(): String
- Definition Classes
- Nameable
-
def
getPath(from: Component, to: Component): Seq[Component]
- Definition Classes
- NameableByComponent
-
def
getRefOwnersChain(): List[Any]
- Definition Classes
- OwnableRef
-
def
getScalaLocationLong: String
- Definition Classes
- ScalaLocated
-
def
getScalaLocationShort: String
- Definition Classes
- ScalaLocated
-
def
getScalaTrace(): Throwable
- Definition Classes
- ScalaLocated
-
val
globalData: GlobalData
- Definition Classes
- GlobalDataUser
-
val
hasDown: Boolean
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
val
hasUp: Boolean
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
def
hashCode(): Int
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
implicitValue: Bits
- Definition Classes
- OneHotCounter → CounterLike → ImplicitArea
-
lazy val
incOnly: Bool
- Attributes
- protected
- Definition Classes
- BoundedCounter
-
def
increment(): Unit
Schedule an increment on this cycle.
Schedule an increment on this cycle. Requires
directionto beUporBoth.- Definition Classes
- BoundedCounter
-
def
init(initValue: UInt): OneHotCounter.this.type
Override the reset state with the one-hot encoding of
initValue. -
def
init(initValue: Bits): OneHotCounter.this.type
Override the reset state to the given one-hot pattern (caller is responsible for one-hot validity).
-
def
init(initValue: BigInt): OneHotCounter.this.type
Override the reset state to have bit
initValueset. -
def
init(initValue: Int): OneHotCounter.this.type
Override the reset state to have bit
initValueset. - val initialValue: BigInt
-
def
isCompletelyUnnamed: Boolean
- Definition Classes
- Nameable
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isNamed: Boolean
- Definition Classes
- Nameable
-
def
isPriorityApplicable(namePriority: Byte): Boolean
- Definition Classes
- Nameable
-
def
isUnnamed: Boolean
- Definition Classes
- NameableByComponent → Nameable
-
def
load(index: UInt): Unit
Load with the bit at position
indexset. -
def
load(index: Int): Unit
Load with the bit at position
indexset. -
def
load(raw: Bits): Unit
Schedule loading
rawinto the counter on this cycle.Schedule loading
rawinto the counter on this cycle.- Definition Classes
- CounterLike
-
def
loadOrdinal(index: UInt): Unit
Load the counter into its
index-th ordinal state.Load the counter into its
index-th ordinal state.0is the start,stateCount - 1is the end.- Definition Classes
- OneHotCounter → CounterAddressable
-
def
loadOrdinal(index: BigInt): Unit
- Definition Classes
- CounterAddressable
- See also
loadOrdinal(UInt)
-
def
loadOrdinal(index: Int): Unit
- Definition Classes
- CounterAddressable
- See also
loadOrdinal(UInt)
-
val
lower: BoundaryPolicy
- Definition Classes
- BoundedCounter
-
val
name: String
- Definition Classes
- Nameable
- val nameableRef: Nameable
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
overrideLocalName(name: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
val
parentScope: ScopeStatement
- Definition Classes
- ContextUser
-
val
refOwner: RefOwnerType
- Definition Classes
- OwnableRef
- Annotations
- @DontName()
-
def
reflectNames(): Unit
- Definition Classes
- Nameable
-
def
rework[T](body: ⇒ T): T
- Definition Classes
- Area
-
def
saturatedHigh: Bool
True when the counter is currently pinned at the upper boundary by BoundaryPolicy.Saturate; always false if
upperis notSaturate.True when the counter is currently pinned at the upper boundary by BoundaryPolicy.Saturate; always false if
upperis notSaturate.- Definition Classes
- BoundedCounter
-
def
saturatedLow: Bool
True when the counter is currently pinned at the lower boundary by BoundaryPolicy.Saturate; always false if
loweris notSaturate.True when the counter is currently pinned at the lower boundary by BoundaryPolicy.Saturate; always false if
loweris notSaturate.- Definition Classes
- BoundedCounter
-
val
scalaTrace: Throwable
- Definition Classes
- ScalaLocated
-
def
setCompositeName(nameable: Nameable, postfix: String, namePriority: Byte): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, namePriority: Byte): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, weak: Boolean): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setLambdaName(isNameBody: ⇒ Boolean)(nameGen: ⇒ String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, namePriority: Byte): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, weak: Boolean): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setName(name: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setNameAsWeak(): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte, owner: Any): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, weak: Boolean): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, namePriority: Byte): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, weak: Boolean): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable): OneHotCounter.this.type
- Definition Classes
- Nameable
-
def
setRefOwner(that: Any): Unit
- Definition Classes
- OwnableRef
-
def
setScalaLocated(source: ScalaLocated): OneHotCounter.this.type
- Definition Classes
- ScalaLocated
-
def
setWeakName(name: String): OneHotCounter.this.type
- Definition Classes
- Nameable
-
val
stateCount: BigInt
Total number of legal states the counter can occupy.
Total number of legal states the counter can occupy.
- Definition Classes
- OneHotCounter → CounterLike
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toFlow(): Flow[Bits]
Stream the counter as a Flow whose payload carries value and whose
validfollows willAdvance.Stream the counter as a Flow whose payload carries value and whose
validfollows willAdvance.- Definition Classes
- CounterLike
- def toString(): String
-
def
unsetName(): OneHotCounter.this.type
- Definition Classes
- Nameable
-
val
upper: BoundaryPolicy
- Definition Classes
- BoundedCounter
-
def
valCallback[T](ref: T, name: String): T
- Definition Classes
- ValCallbackRec → ValCallback
-
def
valCallbackOn(ref: Any, name: String, refs: Set[Any]): Unit
- Definition Classes
- ValCallbackRec
-
def
valCallbackRec(obj: Any, name: String): Unit
- Definition Classes
- Area → ValCallbackRec
-
val
value: Bits
Current registered counter value.
Current registered counter value.
- Definition Classes
- OneHotCounter → CounterLike
-
val
valueNext: Bits
Combinational next value driven into the register this cycle.
Combinational next value driven into the register this cycle.
- Definition Classes
- OneHotCounter → CounterLike
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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
- BoundedCounter → CounterLike
-
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
- BoundedCounter → CounterLike
-
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
- BoundedCounter → CounterLike
-
val
willDecrement: Bool
True on the cycle a decrement is requested.
True on the cycle a decrement is requested.
- Definition Classes
- BoundedCounter
-
val
willIncrement: Bool
True on the cycle an increment is requested.
True on the cycle an increment is requested.
- Definition Classes
- BoundedCounter
-
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
- BoundedCounter → CounterLike
-
lazy val
willOverflow: Bool
willOverflowIfInc qualified with
willIncrement(and, inBothmode, gated by!willDecrement).willOverflowIfInc qualified with
willIncrement(and, inBothmode, gated by!willDecrement).- Definition Classes
- BoundedCounter
-
val
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).
- Definition Classes
- OneHotCounter → BoundedCounter
-
lazy val
willUnderflow: Bool
willUnderflowIfDec qualified with
willDecrement(and, inBothmode, gated by!willIncrement).willUnderflowIfDec qualified with
willDecrement(and, inBothmode, gated by!willIncrement).- Definition Classes
- BoundedCounter
-
val
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).
- Definition Classes
- OneHotCounter → BoundedCounter
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated