XST can extract Finite State Machines (FSM) from the RTL code and optimizes the FSM by re-encoding based on the number of states and inputs.
If an FSM is extracted, you'll see messages similar to following in the "HDL Synthesis" stage.
And you'll see messages similar to following stating which encoding algorithm is used in the "Low Level Synthesis" stage.
There are some XST options which are usedto controlFSM optimization.
- Whether or not to extract FSM from the RTL code.
- Specify which FSM encoding algorithm to be used. The default value is auto, which meansXST automatically finds the best encoding style for each single FSM.
- Specify which type of resource to be used to implement the FSM, LUT or BRAM. The default value is LUT.By setting it to BRAM,large FSMs can be made faster and more compact by implementing them in Block RAM.
- Whether or not to implement FSM in safe mode.XST can add logic to your FSM implementation that will let your state machine recover from an invalid state.By default, XST will use the reset state as the recovery state.However, any state can be used as a recovery state, and this can be defined via theSafe_recovery_state constraint.
- Definea recovery state for use when anFSM is implemented in Safe Implementation mode. IfSafe_recovery_state is not specified, the reset state is used as the recovery state.
For help for applying XST constraints, please refer to (Xilinx Answer 39749). For more information of these XST constraints about FSM, please refer to XST User Guide See (Xilinx Answer 38931)).