Sunteți pe pagina 1din 16

Full Flow Clock Domain Crossing

- From Source To S

Mark Litterick, Verilab, Germany

Copyright Verilab 2016


Introduction
Overview
pre-silicon flow, metastability & MTBF,
timing analysis for CDC & synchronizers
Physical Requirements
2FF, parallel, handshake & phase-detect synchronizers
timing requirements & failure modes
Continuity & Closure
pragmatic solutions for encapsulation
SVA timing checks for continuity
closure using gate-level CDC analysis,
constraints management & CDC review
13/03/16 Mark Litterick, Verilab 2
Pre-Silicon Flow
Physical implementation goals
transform RTL to GL & GDS
SPECIFICATION optimize area, power & speed
CONSTRAINTS timing & routing closure
CE concept enable manufacture & test
D design LS logic synthesis
V verification LP low-power clk-gates
back-end processes
DFT S design-for-test can compromise CDC
RTL
FP T floor planning effectiveness and
RTL CDC Verification P&R A place & route break synchronizers
structural analysis CTS clock-tree synthesis
synchronizer protocol PS physical synthesis
Even with
operation of rest of DUT in static timing analysis
GATE clean RTL
presence of synchronizers
PV physical verification CDC signoff
relatively early in flow GDSII
front-end back-end
less complex than netlist
most defects observable

13/03/16 Mark Litterick, Verilab 3


Metastability & MTBF
Tsetup eTs/Tc
clk
MTBF = Technology &
TwFcFd Implementation
Thold
d Ts = settling window
Tc = settling time constant
metastable Tw = window of susceptibility
q
Fc = clock frequency Concept &
Fd = data update rate Application
Violation of setup or hold times causes metastability
unstable state eventually decays to 0 or 1, but unpredictable!
real-life transistor effect, not observable in simulations or formal
cannot be avoided, must be designed around & managed
Mean Time Between Failures (MTBF)
probability of metastability not decaying to stable legal value
in time for the next sampling event => catastrophic failure
13/03/16 Mark Litterick, Verilab 4
Timing Arcs & CDC Paths
Tpath
in out
Tck_q
Tck_skew
clk1 clk2

dont care
CDC path

relative timing transition metastability sub-cycle timing clock


CDC data paths time characteristics metastable net skew

Tw = Tsetup + Thold Tc
MTBF =
e Ts/Tc
TwFcFd
Ts = Tperiod Tck_skew Tsetup Tck_q - Tpath

13/03/16 Mark Litterick, Verilab 5


2FF Synchronizer
PHY CDC Requirements
RTL CDC Requirements d_in m
d_out sub-cycle timing on m
no logic on CDC path fast transition time at d_in
no glitches on D input fast metastability damping
D stability > 2 clock clk no scan insertion 2nd FF
tight clock-skew tolerance
glitch = h su su h h
unsampled
narrow pulse clk
( many src clks) d_in
narrow pulse
sim: m filtered out
RTL sim: d_out (2 clk edges!)
or GL
sim real: m
real: d_out

Generation Filtering Uncertainty & Jitter

13/03/16 Mark Litterick, Verilab 6


Failure: Sub-Cycle Timing
actual Max delay for metastable net must be
signal much less than the clock period
timing (even though both FFs in same domain)

clk
normal operation normal
(no su/h violation) d synchronous
Ts1
T1 constraint
m1
m2 T2 additional
metastable Ts2 sub-cycle
(su/h violation) d constraint

m1 " CDC FAIL


m2 ! CDC PASS

MTBF =
e Ts/Tc Ts = Tperiod Tck_skew Tsetup Tck_q - Tpath
TwFcFd
Exponential effect on MTBF

13/03/16 Mark Litterick, Verilab 7


Parallel Synchronizer
RTL CDC Requirements
Asynchronous FIFO Synchronizer
bus is gray-coded at source
(only one bit change per clock)
WR RD
CTRL wa ra CTRL
PHY CDC Requirements
relative timing for all bits must ensure
bus is gray-codedRAMon arrival at 1st FFs
bus_in bus_out wdata rdata
clk
no stability check in each 2FF
only 1 bit can go metastable per clk no gray-code check @ dest clk
su h su h
clk
bus_in 0011 0111 0110 0001 0011 0010 0110 1110

sim bus_out 0011 0111 0110 0001 0010 0110

real bus_out 0011 0111 0110 0001 0011 1110

slow-to-fast (all codes transported) fast-to-slow (some codes dropped)

13/03/16 Mark Litterick, Verilab 8


Failure: Path Variance
No absolute path delay requirement, but
relative timing for all parallel paths
CDC bus under-constrained, e.g.
marked as false-path (unconstrained)
must ensure in-order and variance >Tw
marked as multi-cycle path (either clk)
using slow destination clock period Pragmatic: delay for all paths must be
default constraints (slow-speed scan) less than one source clock period

src_clk
Normal failure:
bus_in[0] T0 slow path signal reorder
bus_in[1] T1 (visible in GLS)
fast path
SENT# 00 01 11
Corner case:
dest_clk
close together
bus_out[0] but in-order
bus_out[1]
RECEIVED# 10 11
Received value
00
" CDC FAIL was not sent

[(Tperiod1 + T1) (Tck_skew1 + T0)] > (Tsetup2 + Thold2)

13/03/16 Mark Litterick, Verilab 9


Handshake Synchronizer
SOURCE DESTINATION
RTL CDC Requirements req_o req_i
full handshake protocol
D stable until ack in src dest_clk
ack_i ack_o
PHY CDC Requirements src_clk
max delay on data relative
data_o data_i
to req and dest_clk

src_clk
req_o
ack_i
data d1 d2
REQ ACK !REQ !ACK
dest_clk
req_i
ack_o
sample data
13/03/16 Mark Litterick, Verilab 10
Failure: Slow Path
CDC data under-constrained, e.g. Data has path delay requirement,
marked as false-path (unconstrained) relative to req and destination clock
marked as multi-cycle path (src_clk)
using slow source clock period Pragmatic: MCP of 2 x dest_clk periods
default constraints (slow-speed scan) (slight over-constrained if Treq > Thold2)

src_clk CDC control no path


req Treq delay requirement

datas " CDC FAIL


Tdata
dataf ! CDC PASS
Tmcp
dest_clk
m
req_i
sample data
multi-cycle path relative to dest_clk (earliest)

(Tdata + Tck_skew1) < [Treq + (2 x Tperiod2) Thold2)]


13/03/16 Mark Litterick, Verilab 11
Phase-Detect Synchronizers
digital delay line d1 d2 d1
c2
d1 d2 d2
c1 c2 conflict
detect
conflict c2 delay
ctrl
detect
conflict
delay detect

PHY CDC Requirements


c1 sub-cycle timing on CDC data
d1

c2 Mesochronous
d2 (phase offset)

c2 Plesiochronous
d2 (phase changes)

13/03/16 Mark Litterick, Verilab 12


Pragmatic Solutions
If available in target technology!
fast settling time (Tc) m
narrow susceptibility (Tw) d_in d_out

metastability-hardened monolithic hard


flip-flop clk 2FF macro-cell
Encapsulates & protects many of the physical concerns (not eradicated!)
Synthesize to meta-hard FF or (better) 2FF macro-cell
hard to map all RTL to desired circuits (e.g. no reset, no scan)
manageable with internal blocks, difficult with third-party IP
Instantiate meta-hard FF or 2FF macro-cell into RTL
compromises portability and flexibility of the RTL
(RTL becomes technology and frequency dependent)
manageable for internal designs and technology derivatives
inappropriate or impossible if using or supplying third-party IP
13/03/16 Mark Litterick, Verilab 13
SVA Timing Checks
SVA allows time and property p_max_time(start, stop, duration);
EventExpression time start_time;
@(start)
formal arguments (1,start_time = $time) |=> argument used as
event expression
Actual arguments are @(stop)
(($time - start_time) <= duration);
supplied by assert endproperty argument used
property statement as time variable

a_meta_sub_cycle: assert property (p_max_time(posedge clk, m, 300ps));

maximum delay from posedge clk to any change on m must be less than 300ps

Provides good safety net for validating


Use assertions for both closure on some timing-based intent ...
RTL and gate-level
... but be aware that assertion binding
to optimized netlist can be non-trivial!
13/03/16 Mark Litterick, Verilab 14
Tools & Methodology
Gate-level CDC analysis
some formal CDC analysis tools can handle GL complexity
add structural checks, clock-tree aware, reuse RTL intent
complement, but do not eradicate CDC-aware STA
Constraints management
evolution and refinement of constraints is major issue
especially with multiple tool vendors in the flow
tools emerging to manage & validate equivalence of constraints
Multi-discipline CDC reviews
recognize that CDC is not just an RTL problem...
review CDC functional operation and synchronizer physical
implementation with a multi-discipline multi-talented team!
13/03/16 Mark Litterick, Verilab 15
Conclusion
Presented an overview of the problem
RTL verification of CDC is necessary but not sufficient
additional requirements need to be understood front & back-end
Illustrated detailed hazards for some common synchronizers
intra-domain operation within synchronizers
inter-domain CDC requirements and relationships
Discussed some pragmatic solutions & tool advances
anything which closes the gap is good!

Primary goal: raise multi-discipline CDC awareness

mark.litterick@verilab.com
13/03/16 Mark Litterick, Verilab 16

S-ar putea să vă placă și