Professional Documents
Culture Documents
Week 15 - Metastability and Synchronizer Design
Week 15 - Metastability and Synchronizer Design
- Synchronization failure
1
What happens when we violate setup and hold time
constraints?
d q
D Q
clk
d
ts th
clk
tdCQ
q
Metastability and Synchronization Failure
- Metastability
3
Storage loop has a metastable state between 0 and 1
V2
Stable point
Metastable point
Stable point
V1 V2
+ DV -
V1
Dynamics of DV
V2
Stable point
Metastable point
V1 V2
+ DV -
Stable point
V1
Dynamics of DV
DV
1
e-1
V1 V2
+ DV - 1t 2t t
-e-1
-1
Metastability and Synchronization Failure
- Probability of illegal state
7
Probability of entering an illegal state
Probability that an input signal transition violates the setup or hold time
of flip-flop is
ts + th
PE = = fcy (ts + th)
tcy
If the asynchronous signal has transitions with frequency fa, then the
frequency of violating setup or hold time is
fE = fa PE = fa fcy (ts + th)
8
Example
Suppose we have a flip-flop with ts = th = 100ps and our cycle time tcy = 2ns.
Then, the probability of error is
ts + th 100 + 100
PE = = = 0.1
tcy 2000
9
Probability of leaving an illegal state
10
Summary
Clocking a flip-flop during the “keep-out” interval may leave the storage node in an
“illegal state”
Some “illegal states” are Metastable
Time to decay to a legal state depends on log of initial voltage
t = -t log(DV (0))
Probability of entering metastable state is probability of hitting “keep-out” interval.
ts + th
PE =
tcy
Probability of staying in metastable state after time tw is the probability that initial
voltage was too small to decay in time tw.
æ - tW ö
PS = expç ÷
è t ø
11
Synchronizer Design – Where
are synchronizers used?
12
Where are synchronizer used?
13
Synchronizer Design
– Brute-force synchronizer
14
A Brute-Force Synchronizer
A FF1 AW FF2 AS
D Q D Q
Clk
Clk
AW
AS
15
What if AW is still in a metastable state when FF2 is
clocked?
Clk
AW
AS
16
Calculating Synchronization Failure
(The Big Picture)
17
Probability of Entering a Metastable State
Clk
t +t
PE = s h = fcy (t s + th )
t cy
ts+th
tcy
18
Probability of Staying in the Metastable State
æ - tw ö
DVS = DVF expçç ÷÷
è tS ø
æ - tw ö DVF=1
PS = expçç ÷÷
è tS ø DVS
tw
19
Failure Probability and Error Rate
Clk
DVF=1
ts+th
tcy DVS
tw
20
Failure Rate Calculation
• How do we get failure rate to one every 10 years ~ 3 x 108s (fF < 3 x 10-9)
21
Example: Brute-force synchronizer
Calculate the mean time to failure for a system with fa = 100kHz, fcy = 1GHz,
ts = th = 50ps, s = 100ps, and tdCQ = 80ps that uses three back-to-back flip-
flops for a synchronizer.
22
Summary
Brute-force synchronizer can also be used on multi-bit signals only when they are
Gray-coded.
24
Synchronizing multi-bit signals
Consider a 4-bit counter running on clk1 you need the value of this
counter sampled by clk2. Will the following circuit work? (assume tw >> )
counter
clk1 clk2
25
When synchronizing a multi-bit signal, each changing bit is independently
synchronized
Consider what happens on the 0111 to 1000 transition. All bits are
changing. Each can independently fall either way.
clk1 clk2
26
Solution:
27
module GrayCount4(clk, rst, out) ;
input clk, rst ;
output [3:0] out ;
wire [3:0] out, next ;
28
# xxxx
# 0000
# 0001
# 0011
# 0010
# 0110
# 0111
# 0101
# 0100
# 1100
# 1101
# 1111
# 1110
# 1010
# 1011
# 1001
# 1000
# 0000
# 0001
# 0011
# 0010
FIFO Synchronizer Showing Control Path
30
Summary
Brute-force synchronizer can also be used on multi-bit signals only when they are
Gray-coded.