class StateFsm[T <: StateMachineAccessor] extends State with StateCompletionTrait
Allows you to describe a state containing a nested state machine.
When the nested state machine is done (exited), statements in whenCompleted { ... } are executed.
This allows embedding a state machine as a state within another state machine. The embedded state machine starts on entry and completes on exit.
// internalFsm is a function defined below val stateC = new StateFsm(fsm=internalFsm()) { whenCompleted { goto(stateD) } } def internalFsm() = new StateMachine { val counter = Reg(UInt(8 bits)) init(0) val stateA : State = new State with EntryPoint { whenIsActive { goto(stateB) } } val stateB : State = new State { onEntry (counter := 0) whenIsActive { when(counter === 4) { exit() } counter := counter + 1 } } }
- Alphabetic
- By Inheritance
- StateFsm
- StateCompletionTrait
- State
- Area
- OverridedEqualsHashCode
- ValCallbackRec
- ValCallback
- NameableByComponent
- Nameable
- ContextUser
- ScalaLocated
- GlobalDataUser
- OwnableRef
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StateFsm(fsm: T)(implicit stateMachineAccessor: StateMachineAccessor)
Type Members
-
abstract
type
RefOwnerType
- Definition Classes
- OwnableRef
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
_context: Capture
- Definition Classes
- Area
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
childNamePriority: Byte
- Definition Classes
- Area
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
def
component: Component
- Definition Classes
- ContextUser
-
def
doWhenCompletedTasks(): Unit
- Attributes
- protected
- Definition Classes
- StateCompletionTrait
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
exit(): Unit
Schedules the state machine to be in the boot state the next cycle (or, in StateFsm, to exit the current nested state machine).
-
def
foreachReflectableNameables(doThat: (Any) ⇒ Unit): Unit
- Definition Classes
- Nameable
- val fsm: T
-
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
-
def
getStateMachineAccessor(): StateMachineAccessor
Used internally by the state machine library
Used internally by the state machine library
- Definition Classes
- State
-
val
globalData: GlobalData
- Definition Classes
- GlobalDataUser
-
def
goto(state: State): Unit
Schedules the state machine to be in the provided State the next cycle.
-
def
hashCode(): Int
- Definition Classes
- OverridedEqualsHashCode → AnyRef → Any
-
def
innerFsm(that: ⇒ StateMachine): Unit
Internal to the state machine library
Internal to the state machine library
- Definition Classes
- State
-
var
innerFsm: ArrayBuffer[StateMachine]
- Definition Classes
- State
-
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
-
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
onEntry(doThat: ⇒ Unit): StateFsm.this.type
Defines statements to apply when the state machine is not in this state but will be in it during the next cycle.
Defines statements to apply when the state machine is not in this state but will be in it during the next cycle.
- doThat
hardware statement(s)
- Definition Classes
- State
val stateA: State = new State with EntryPoint { onEntry { counter := 0 io.led := True } whenIsActive { goto(stateB) } }
Example: -
val
onEntryTasks: ArrayBuffer[() ⇒ Unit]
- Definition Classes
- State
-
def
onExit(doThat: ⇒ Unit): StateFsm.this.type
Defines statements applied when the state machine is in this state and will be in another state the next cycle.
Defines statements applied when the state machine is in this state and will be in another state the next cycle.
- doThat
Hardware statement(s)
- Definition Classes
- State
val stateA: State = new State with EntryPoint { whenIsActive { goto(stateB) } onExit { io.result := True io.led := False } }
Example: -
val
onExitTasks: ArrayBuffer[() ⇒ Unit]
- Definition Classes
- State
-
def
overrideLocalName(name: String): StateFsm.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
-
val
scalaTrace: Throwable
- Definition Classes
- ScalaLocated
-
def
setCompositeName(nameable: Nameable, postfix: String, namePriority: Byte): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String, weak: Boolean): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, postfix: String): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, namePriority: Byte): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable, weak: Boolean): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setCompositeName(nameable: Nameable): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setLambdaName(isNameBody: ⇒ Boolean)(nameGen: ⇒ String): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, namePriority: Byte): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setName(name: String, weak: Boolean): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setName(name: String): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setNameAsWeak(): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte, owner: Any): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, namePriority: Byte): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String, weak: Boolean): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, namePriority: Byte): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String, weak: Boolean): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(name: String): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable, name: String): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setPartialName(owner: Nameable): StateFsm.this.type
- Definition Classes
- Nameable
-
def
setRefOwner(that: Any): Unit
- Definition Classes
- OwnableRef
-
def
setScalaLocated(source: ScalaLocated): StateFsm.this.type
- Definition Classes
- ScalaLocated
-
def
setWeakName(name: String): StateFsm.this.type
- Definition Classes
- Nameable
-
val
stateId: Int
- Definition Classes
- State
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toString(): String
-
def
unsetName(): StateFsm.this.type
- Definition Classes
- Nameable
-
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
-
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( ... )
-
val
whenActiveTasks: ArrayBuffer[StateMachineTask]
- Definition Classes
- State
-
def
whenCompleted(doThat: ⇒ Unit): StateFsm.this.type
- Definition Classes
- StateCompletionTrait
-
val
whenCompletedTasks: ArrayBuffer[() ⇒ Unit]
- Definition Classes
- StateCompletionTrait
-
val
whenInactiveTasks: ArrayBuffer[() ⇒ Unit]
- Definition Classes
- State
-
def
whenIsActive(doThat: ⇒ Unit): StateFsm.this.type
Defines statements applied when the state machine is in this state.
Defines statements applied when the state machine is in this state.
- doThat
hardware statement(s)
- Definition Classes
- State
val stateA: State = new State with EntryPoint { whenIsActive { counter := counter + 1 when(counter === 10) { goto(stateB) } } }
Example: -
def
whenIsActiveWithPriority(priority: Int)(doThat: ⇒ Unit): StateFsm.this.type
Used internally by the state machine library
Used internally by the state machine library
- Definition Classes
- State
- See also
#whenIsActive()
-
def
whenIsInactive(doThat: ⇒ Unit): StateFsm.this.type
Defines statements applied when the state machine is not in this state.
Defines statements applied when the state machine is not in this state.
- doThat
hardware statement(s)
- Definition Classes
- State
-
def
whenIsNext(doThat: ⇒ Unit): StateFsm.this.type
Defines statements applied when the state machine will be in state the next cycle (even if it is already in it).
Defines statements applied when the state machine will be in state the next cycle (even if it is already in it).
- Definition Classes
- State
-
val
whenIsNextTasks: ArrayBuffer[() ⇒ Unit]
- Definition Classes
- State
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated