Thursday, January 12, 2012

FPGA Timing

All right, I keep forgetting how FPGA timing works, so I'm writing it down here so I don't have to continue to search the internet

There are four main time periods we care about dealing with FPGA timing: Tclk, Tsu, Th, and Tco.


  • Tclk is the period of the clock the registers in question are synchronous to.
  • Tsu (Setup time) is the amount of time before the edge trigger of a register that the data must be settled on the input of the register
  • Th (Hold time) is the amount of time after the edge trigger of a register that the data must remain stable on the input of the register
  • Tco (Clock to output time)  is the amount of time from the edge trigger of the register to when the newly latched data is available as an output.

FPGA Timing Diagram Example

Here is an attached picture of three registers on the same clock, with the above time periods
From this we can see the amount of time a signal has to get from one register to another register in an FPGA is defined as
Time Skew = (Tclk - Tco - Tsu)

Skew is eaten into by delay that is a function of the speed of light, the trace material dielectric, the width of the trace, and probably something else I am forgetting.

These rules hold true in SDR or DDR -- we just care about the data with respect to the appropriate edge.  It can get more complicated with Center Aligned data or Edge Aligned, or dealing with external interfaces to the FPGA, but the main rule applies:

Data has to be there a certain amount of time before and after the sampling edge (Tsu and Th), and will take a certain amount of time before being available as an output (Tco), and is constrained by the clock period (Tclk) and the laws of physics.

1 comment: