1.9.4. FSM Compiler
If the FSM Compiler is turned off, the compiler does not optimize logic as state machines. The state machines are implemented as HDL code. Thus, if the coding style for a state machine is sequential, the implementation is also sequential.
Use the syn_state_machine compiler directive to specify or prevent a state machine from being extracted and optimized. To override the default encoding of the FSM Compiler, use the syn_encoding directive.
|Sequential||Generates state machines with the fewest possible flipflops. Sequential, also called binary, state machines are useful for area-critical designs when timing is not the primary concern.|
|Gray||Generates state machines where only one flipflop changes during each transition. Gray-encoded state machines tend to be glitches.|
|One-hot||Generates state machines containing one flipflop for each state. One-hot state machines typically provide the best performance and shortest clock-to-output delays. However, one-hot implementations are usually larger than sequential implementations.|
|Safe||Generates extra control logic to force the state machine to the reset state if an invalid state is reached. You can use the safe value in conjunction with any of the other three values, which results in the state machine being implemented with the requested encoding scheme and the generation of the reset logic.|
Sample VHDL Code for Applying syn_encoding Directive
SIGNAL current_state : STD_LOGIC_VECTOR (7 DOWNTO 0); ATTRIBUTE syn_encoding : STRING; ATTRIBUTE syn_encoding OF current_state : SIGNAL IS "sequential";
By default, the state machine logic is optimized for speed and area, which may be potentially undesirable for critical systems. The safe value generates extra control logic to force the state machine to the reset state if an invalid state is reached.
Did you find the information on this page useful?