05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

State Registers<br />

HDL Coding Techniques<br />

State registers must be initialized with an asynchronous or<br />

synchronous signal. XST does not support FSM without initialization<br />

signals. Please refer to the “Registers” section of this chapter for<br />

templates on how to write Asynchronous and Synchronous<br />

initialization signals.<br />

In VHDL the type of a state register can be a different type: integer,<br />

bit_vector, std_logic_vector, for example. But it is common and<br />

convenient to define an enumerated type containing all possible state<br />

values and to declare your state register with that type.<br />

In Verilog, the type of state register can be an integer or a set of<br />

defined parameters. In the following Verilog examples the state<br />

assignments could have been made like this:<br />

parameter [3:0]<br />

s1 = 4’b0001,<br />

s2 = 4’b0010,<br />

s3 = 4’b0100,<br />

s4 = 4’b1000;<br />

reg [3:0] state;<br />

These parameters can be modified to represent different state<br />

encoding schemes.<br />

Next State Equations<br />

Next state equations can be described directly in the sequential<br />

process or in a distinct combinational process. The simplest template<br />

is based on a Case statement. If using a separate combinational<br />

process, its sensitivity list should contain the state signal and all FSM<br />

inputs.<br />

FSM Outputs<br />

Non-registered outputs are described either in the combinational<br />

process or in concurrent assignments. Registered outputs must be<br />

assigned within the sequential process.<br />

XST <strong>User</strong> <strong>Guide</strong> 2-183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!