VHDL1005: FSM states should be encoded using enumerated type
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| LOW | - | MEDIUM | Intentionality | Clear | 5min | synthesis, cnes-std-03900, bug-finder, fsm, do254, cnes, do254-cp5, cnes-std-05800, linty-ultra |
Description
Noncompliant code example
signal sm_moore : std_logic_vector(3 downto 0);
Compliant solution
state_moore_type is (state1, state2, state3); signal sm_moore : state_moore_type;
Only enumerated type should be used to encode an FSM.
Parameters
No parameters.