It seems we are still learning from this interesting post.
I am surprised to conclude two points:
- managing illegal states needs a lot of logic(a bucket of logic) and so most tools abandoned it
- safety critical applications demand it and so some tools have this safety option
The following excerpt from the link below explains it well:
http://klabs.org/mapld04/papers/d/d219_berg_p.doc - State
Most designers believe that they are
implementing a bucket-approach to fault tolerance when using the default clause (VHDL- when others) within a CASE statement. However, the synthesis tools ignore these statements when synthesizing
state machines. Most designers are not aware that these statements (that suggest “bucketing” unused states and supplying a transition out of a fault condition) have no bearing on the actual gates being created. The reasoning behind this is that if the synthesis tool were to implement all unused states, the required area would be excessive.
Synthesis tools have a directive that the designer can use called “
safe”. When applying this directive to a
state machine, the tool can produce a bucket of illegal states. However, the designer must be forewarned that using the “
safe” directive has many flaws:
1. It generally creates more gates than desired, i.e. buckets of illegal states can become very large.
2. Synplify will implement a “
safe” one-hot but Leonardo and Precision will only implement a sequential
state machine (binary or Gray encoding) while using the “
safe” directive.
- how Safe
Recently, there has been a surge of designers using the “
safe” options offered by several different synthesis tools. They have defined a
safe state machine as one that will always transition to a known
state - i.e., if an SEU occurs and an illegal or unmapped
state is reached, one will recover to a known
state.
Synthesis tools offer a “
safe” option (demand from the Aerospace industry):TYPE states IS ( IDLE, GET_DATA, PROCESS_DATA, SEND_DATA, BAD_DATA );
[/INDENT]SIGNAL current_state, next_state : states;
[/INDENT]attribute SAFE_FSM: Boolean;
[/INDENT]attribute SAFE_FSM of states: type is true;
[/INDENT]Although this scheme may appear to be “fool-proof”, it is not. The “
safe” option will not always transition to a reliable (or known)
state. Some have defined the word “known” as mapped. However, the idea is to be deterministic. The idea is to always flip into some “ERROR” or “IDLE”
state upon getting an SEU. Flipping into a mapped
state, in which the rest of the system may not know the
state machine is there, is not deterministic. It is not good enough to transition to a mapped
state:
- The machine can get stuck waiting for an input that will never occur (rest of the system doesn’t know that you have flipped into this mapped state).
- Unexpected signals can turn on (or off).
- And many more reasons…