Timing Issues in FPGA
Timing Issues in FPGA
Haibo Wang
ECE Department
Southern Illinois University
Carbondale, IL 62901
1-1
FPGA Design Flow
Schematic HDL
Design Entry
capture coding
Function Simulation
Synthesis,
Implementation Technology mapping
placement and routing
Timing Verification
Download
1-2
Introduction to Synchronous Circuits
What are synchronous circuits?
— In synchronous circuits, latching data in to memory elements (D
flip-flops) are synchronized by a number of clocks.
Comb. Comb.
DFF logic DFF logic DFF
CLK
1-3
D Flip-Flop Timing Parameters
D Q
CLK
CLK
1-4
Critical Path in Combinational Circuits
Critical path
Critical Path: The signal path that has the longest propagation delay
1-5
Determine Maximum Clock Frequency
Comb. Comb.
DFF Logic 1 DFF Logic 2 DFF
clk
The delays of the critical paths in comb. logic 1 and comb. Logic 2 are
d1 and d2, respectively. In addition, d1>d2
T
tCLKÆQ d1 tS
1-6
Slow Combinational Logic
Clock period is selected. The propagation delay of Comb. Logic 2
is too large
Comb. Comb.
DFF Logic 1 DFF Logic 2 DFF
clk
T
tCLKÆQ d1 tS
1-7
Too Fast Combinational Logic
Clock period is selected. The propagation delay of Comb. Logic 2
is too small
Comb. Comb.
DFF Logic 1 DFF Logic 2 DFF
clk
d1
tCLKÆQ Hold time violation
1-8
Clock Skew
Due to interconnect delay, the same clock signal may switch at different
time depending on the distance from the clock source. This effect is called
clock skew.
Comb. Comb.
DFF Logic 1 DFF Logic 2 DFF
Propagation delay
CLK
caused by interconnect
clk1 clk1
clk2
clk2
tCLKÆQ d1 tS
tCLKÆQ d1 tS
Setup time
Signal propagation Signal propagation violation
Without clock skew With clock skew
1-9
Clock Skew
Comb. Comb.
DFF Logic 1 DFF Logic 2 DFF
Propagation delay
CLK
caused by interconnect
clk1 clk1
clk2
clk2
thold thold
1-10
Techniques to Reduce Clock Skew
Use global buffers to distribute clock signals to minimize clock skew.
1-11
Timing Constraints in Synchronous Circuits
Shortest path tds
DFF DFF
Comb.
data DFF Logic DFF
clock
Comb.
data DFF Logic DFF
clock
1-13
Specifying Timing Constraints in ASIC Design
Timing constraints are used to specify delay of circuit paths
IPAD
logic OPAD
IPAD
1-14
Period Constraint
Period constraints specify delay of paths between synchronous
elements that are clocked by the same clock
— Period constraint is also called register-to-register delay
— Synchronous elements include D flip-flops, latches, and synchronous Rams
— In the following example, the period constraint specify delay of a path
between two D flip-flops
IPAD
logic OPAD
IPAD
IPAD logic
1-16
External Setup Time
IPAD logic
tCLK
Worst case setup time for input occurs when input is DELAYED
relative to CLK. Means clock edge arrives early, requiring input
to be ready sooner.
1-17
External Hold Time
tH : DFF hold time
tDATA
IPAD logic
tCLK
Worst case hold time for input occurs when CLK is DELAYED
relative to input. Means clock edge arrives late, requiring input
to hold its value longer.
1-18
Pad-to-Pad Time Constraint
IPAD
logic OPAD
IPAD
Pad-to-Pad time constraint
1-19
Specifying Time Constraints in Xilinx Tools
Example circuit
clk
1-20
Specifying Time Constraints in Xilinx Tools
1-21
Report from Static Timing Analysis
Asterisk (*) preceding a constraint indicates it was not met.
This may be due to a setup or hold violation.
--------------------------------------------------------------------------------------------------------
Constraint | Requested | Actual | Logic
| | | Levels
--------------------------------------------------------------------------------------------------------
TS_CLK = PERIOD TIMEGRP "CLK" 20 nS HI | 20.000ns | 3.568ns | 1
GH 50.000000 % | | |
--------------------------------------------------------------------------------------------------------
COMP "A" OFFSET = IN 10 nS BEFORE COMP " | 10.000ns | 1.788ns | 2
CLK" | | |
-------------------------------------------------------------------------------------------------------
* COMP "B" OFFSET = IN 1000 pS BEFORE COMP | 1.000ns | 1.334ns | 2
"CLK" | | |
------------------------------------------------------------------------------------------------------
COMP "O" OFFSET = OUT 10 nS AFTER COMP " | 10.000ns | 9.352ns | 1
CLK" | | |
-------------------------------------------------------------------------------------------------------
1-22
Flow for Achieving Timing Closure
Modify circuit or
HDL coding style
Schematic HDL
capture coding
Design Entry
•••
Increase P&R effort level
Implementation
Timing Verification
1-23
What Affect Circuit Timing Performance
Environmental factors
Source: www.xilinx.com
1-25
Example on Calculating Timing Parameters
Calculate timing parameters
1-26
Calculating Timing Parameters
Maximum register to register delay
U2 Tc2q + U3 Tpd + U1 Tsu= 5 + 8 + 3 = 16 ns.
1-27
Interface with Asynchronous Inputs
Q1 Q2
Asynchronous signal logic
FF FF
Synchronous
circuit
CLK
1
Asynchr. Signal Undefined region
0
If the asynchr. input is in undefined region when the DFF latches it, the DFF output
will be possibly in metastable state. The DFF output will eventually settle to logic 1
or 0. However, this process must complete with a certain period. Otherwise, it will
be a failure.
1-28
Potential Problems of Metastability
Due to metastability, the same signal may be treated as having
different logic values in different part of the circuit
1-29
Metastability Analysis
Mean Time Between Failure: MTBF
tr
eτ
MTBF =
T0 • f in • f clock
Where,
1. tr is metastability resolution time, maximum time the output can remain
metastable without causing synchronizer failure.
2. T0 and τ are constants that depend on the electrical characteristics
of the flip-flop.
3. fin is the frequency of the asynchronous input
4. fclock is the frequency of the sampling clock
1-30
Increasing MTBF
Mean Time Between Failure: MTBF
D Q D Q Synchronous
circuit
Asynchronous
signal
CLK
Synchronizer
1-31
ASIC with Multiple Clock Domains
A group of circuits that are clocked by the same signal is referred
to as a clock domain
Clock domain 1
FLOP FLOP FLOP
ADATA OUT1
D Q D Q D Q
CLK1
Clock domain 2
BUFG FLOP FLOP
D Q D Q OUT2
BUS [7..0]
CLK2
CDATA
= Combinatorial Logic
1-32
Communication Between Different Clock Domains
Methods for different clock domain communication
9 Using synchronizer
9 Using FIFO
9 Using handshaking protocols
Synchronizer
clk2
Handshaking
1-33