You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current "sequence" blocks are designed to convert sequential code into a state machine. This makes state machines easy to write, but hard to leverage their full expressive power.
A complementary "fsm" block may make it easy to author states:
fsm my_state {
IDLE => {
led <= 0;
if start_condition {
my_state <= ACTIVE;
}
}
ACTIVE => {
led <= 1;
if some_condition {
my_state <= IDLE; // maybe "next IDLE;" or "fsm <= IDLE;" for anonymous
}
}
}
Some questions:
Can we elide my_state in most cases?
Can we reference my_state outside of the fsm? Can we change (or check) its value from other blocks?
Is an explicit my_state <= {value} allowed inside the fsm?
How do you declare the initial state; is it just the first state?
How does scoping of states work inside of fsm?
Can we nest fsms?
The text was updated successfully, but these errors were encountered:
The current "sequence" blocks are designed to convert sequential code into a state machine. This makes state machines easy to write, but hard to leverage their full expressive power.
A complementary "fsm" block may make it easy to author states:
Some questions:
my_state
in most cases?my_state
outside of the fsm? Can we change (or check) its value from other blocks?my_state
<= {value} allowed inside the fsm?The text was updated successfully, but these errors were encountered: