FiniteStateMachine<StateIdentifier> class
Simple class for FSM FiniteStateMachine.
Abstraction for representing Finite state machines (FSM). Contains the logic for performing the state transitions.
Constructors
-
FiniteStateMachine(Logic clk, Logic reset, StateIdentifier resetState, List<
State< states)StateIdentifier> > -
Creates an finite state machine for the specified list of
_states
, with an initial state ofresetState
(when synchronousreset
is high) and transitions on positiveclk
edges. -
FiniteStateMachine.multi(List<
Logic> _clks, Logic reset, StateIdentifier resetState, List<State< _states)StateIdentifier> > -
Creates an finite state machine for the specified list of
_states
, with an initial state of resetState (when synchronous reset is high) and transitions on positive edges of any of_clks
.
Properties
- clk → Logic
-
The clock signal to the FSM (when only single-triggered). Otherwise, the
first clock.
no setter
- currentState → Logic
-
The current state of the FSM.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- nextState → Logic
-
The next state of the FSM.
final
- reset → Logic
-
The reset signal to the FSM.
final
- resetState → StateIdentifier
-
The reset state of the FSM to default to when the reset signal is high.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
states
→ List<
State< StateIdentifier> > -
List of all the
State
s in this machine.no setter
Methods
-
generateDiagram(
{String outputPath = 'diagram_fsm.md'}) → void -
Generate a FSM state diagram
_MermaidStateDiagram
. Check on https://mermaid.js.org/intro/ to view the diagram generated. If you are using vscode, you can download the mermaid extension. -
getStateIndex(
StateIdentifier id) → int? -
Provides the corresponding index held in state signals such as
nextState and currentState based on the provided
id
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited