Professional Documents
Culture Documents
A Training
• CDC Introduction
• Running Meridian CDC
• Environment Setup
• Structural Checks
• Policies & Debug Flow
• Formal Checks
6
3
1
clk2 4
clk1
clk2
5
2
1. Transmit flop
2. Transmit clock clk1 (asynchronous to clk2)
3. Receive flop
4. Double flop synchronizer on the receive side
5. Receive clock clk2 (asynchronous to clk1)
6. Vertical dashed line indicates an asynchronous clock crossing boundary
D Q clk
When input changes within setup/hold
D window, the output of the flop becomes
clk metastable: could settle into either 0 or 1
Q
Analysis is difficult
Very high number of CDC crossings
Variety of ways of implementing the crossings
Need to model metastability
Loss of Data
Data Corruption
Data
Without control-signal synchronization,
clk1 clk2 metastability could propagate
downstream, resulting in data corruption
Control
clk1 clk2
Glitch Propagation
A timing glitch could be captured in
clk1 the receiving domain, resulting in a
clk3 downstream design failure
clk2
Handshake Protocols
Data
Control
metastability Block D
Gate Level
Verify Gate-Level Netlist D
Q
D
Q
Review Lint report Automatic clock inference Fastest run time, highest capacity
Library setup Help refine environment to ensure Complete coverage with least noise
high quality CDC analysis Intuitive associations on CDC
Concise schematic view for root interface crossings
cause analysis Formally verify CDC interfaces
Intuitive debugging environment Intuitive debugging environment
• meridian_project
• Stores generated design database, rules, and other metadata
• Used for debug in GUI/CLI using iDebug
• Used for incremental analysis
• meridian.log
• Contains Meridian CDC run log, warning or error messages
• From design
• Output .env contains auto-detected environment setup
• analyze_intent -output_env top.env
• set_constant
• Used to set a constant value for a signal
set_constant -value 1’b1 {async_mode}
• Typically used to set mode bits, mux selects, and so on
• set_stable_value
• Used to indicate that a signal value will remain stable once set
set_stable_value {proc_cfg1}
• Used for configuration registers, special function registers, and so on
• These signals treated accordingly for CDC
T_CLK
S_CLK
1’b0
D_CLK
Cause: Because of the constant in the T_CLK propagation path and S_CLK not being defined in the
ENV file, Meridian CDC does not know the clock spec on D_CLK; therefore, S_NOCLK is reported on
D_CLK.
Action: Add clock spec for D_CLK or S_CLK using create_waveform and create_clock commands in
the ENV file.
CLK1
CLK2
D_CLK
SEL
Cause: Clock spec is given for CLK1 and CLK2, however SEL is not tied to a constant.
Both clock waveforms are propagated to D_CLK; one arbitrary waveform is chosen for
D_CLK. S_MULTCLK is reported on D_CLK.
Action: Tie SEL to a constant using the set_constant command in the ENV file.
POR_RST
SOFT_RST
Cause: There is a reset spec for POR_RST; however, there is no reset spec
on SOFT_RST in the environment file; therefore, S_NORST is reported on
SOFT_RST.
Action: Add reset spec for SOFT_RST using the create_reset command in
the ENV file. Use -low to indicate an active-low reset.
W_CLK_RECON
REVIEW INTERFACE
U_INTERFACE
GRAY_CODE_CHECKS
SYNC_CROSSING
RST_SYNC
x
clk2
clk1
W_MASYNC
clk1 x
clk3
clk2
W_ASYNC_RST_FLOPS
RST
Cause: clka and clkb are asynchronous domains to each other. RST, generated from
clka domain, is used in the clkb domain to reset FF1, FF2, and FF3 asynchronously.
Meridian CDC flags FF1, FF2, FF3 as W_ASYNC_RST_FLOPS.
Action: Examine RST signals for the reported flops. Insert a Reset Synchronizer in the
receive clock domain, if needed, else Sign-off after review.
Data
Control
D D
Q Q
Feedback
Associations
Load-Control
Prop-Control (default off)
Fifo-Control
User
DATA
None
W_DATA Err-Prop
Potential-Sync
Data
Control
Feedback
Data
Control
Feedback
Data In
Data Out
+
Binary to Gray Gray to Binary Empty
== ==
Write Pointer Full
+
Gray to Binary Binary to Gray
CLK1 CLK2
Read Pointer
User
Tx Data Rx Data
Tx Domain Rx Domain
W_DATA : None
Tx Data Rx Data
x
Tx Domain Rx Domain
Cause: Signal Tx Data, from the Transmit domain, crosses over into the Receive clock domain.
This crossing is not controlled by a synchronized control signal or a FIFO.
Meridian CDC reports such a DATA-CNTL association as None.
Action: Examine the logic controlling this interface. Try to find unidentified or misdetected
CNTL signals.
x
Sync Control
Tx Domain Rx Domain
Action: Review the identified structural association and make appropriate fixes.
W_DATA : Potential-Sync
Rst SyncRst
inb
Tx Domain Rx Domain
Cause: Could potentially be CNTL crossing, but misidentified by Meridian CDC as DATA crossing.
CNTL : Data
Rx Data
Tx Data
Sync Control
Tx Domain Rx domain
Cause: Meridian CDC detected synchronized CNTL signals blocking or controlling DATA signals in the
receive clock domain. Sync Control is controlling a data signal Tx Data. Meridian CDC reports such a
CNTL signal as Data associated.
Action: Ensure that the CNTL signal and DATA signal associations that Meridian CDC reports are correct.
Tx Data
Sync Control
DataReady Control Signal
CNTL : Is-Feedback
Tx domain Rx domain
Cause: Meridian CDC detected synchronized CNTL signal(s) blocking or controlling DATA
signals in the receive domain and this CNTL signal(s) is being fed back to the transmit domain.
Typically, such asynchronous interface structures are used in handshaking protocols.
This CNTL signal is also fed back to the Tx domain. Meridian CDC reports the signal controlling
the data as Has-Feedback and the signal returning to the Tx domain as Is-Feedback.
Action: Ensure that the CNTL signal and the Feedback signal that Meridian CDC
reported is correct.
©Copyright 2016 Real Intent Inc., Proprietary and Confidential 59
CNTL: None
CNTL/W_CNTL : None
Tx Control Rx Control
Cause: Meridian CDC detected synchronized CNTL signals that are not blocking or controlling any
DATA signals. Typically, synchronized CNTL signals are expected to be controlling DATA crossings .
A signal from the Transmit domain, Tx Control, crosses over into the Receive domain, and there is
no associated DATA. Set the ri_report_none_as_w_cntl variable to true (default is false) to
include those CNTL signals with association None in the W_CNTL category.
Action: The use of the synchronizer may not be necessary or these signals may need to
be reclassified as DATA crossings.
CNTL : User
Tx Control Rx Control
W_CNTL : Blocked
Rx Data
Tx Data
Tx Domain Rx domain
Cause: Meridian CDC detected synchronized CNTL signals that are either blocked by constants
or don’t drive anything. A signal from the Transmit domain, Tx Data, crosses over into the
Receive domain. This crossing is controlled by a synchronized control signal, Sync Control. The
loading of Tx Data into the receive domain flop, Rx Data, is blocked by the signal, Sync Control,
owing to the constant disabling the output of the AND gate. Meridian CDC reports such a DATA-
CNTL association as Blocked.
Action: Examine the CNTL signals to make sure the logic is intended.
Rx Data
Tx Data
Sync Control
DataReady Control Signal
W_CNTL : Has-Err-Feedback
Tx domain Rx domain
Cause: CNTL is associated with some DATA and appears to have a feedback. However, there is
an issue with the feedback such that it will not work as expected.
Cause: CNTL is associated with some DATA, but has no feedback. The Info column displays
Missing-Feedback and reports W_CNTL. To disable, set the set ri_check_missing_feedback
variable to false (default is true).
Action: Ensure that the CNTL signal and DATA signal association that Meridian CDC reports is
correct.
WR_reg
D Q DOUT
DATA
CK
R
R_reg
REN
Q D
WEN
CK Rclk
Wclk R
Setting clock domain of DOUT to be derived from the waveform received by REN signal
•set_data_clock_domain {DOUT} -module {asynchronous_fifo} -derived_from {REN}
New Schematic
read_sdc analyze_intent
Setup
Read
(Intent)
SDC File Analysis
Optional
ENV
• GUI mode:
• idebug
• CLI mode (Tcl interface):
• idebug -cli
• Useful options:
• -i <script> # Run script upon opening
• -e <script> # Run script upon exiting
• -project <directory> # Location of project directory
• -design <name> # Name of design top
• -previous <directory> # Append to results rather than overwrite
©Copyright 2016 Real Intent Inc., Proprietary and Confidential 83
Getting Help in iDebug
Policy
Policy Checks
Policy Severities
Policy
W_GLITCH
rule instance
Export
DESIGN
LIBRARY DESIGN SETUP
OK ? DEBUG
SDC[Tcl]
ENV[Tcl] ENV SETUP
OK ? DEBUG
OK ? DEBUG
POLICIES
(optional) STRUCTURAL ANALYSIS Formal Analysis Sample Script
(to be run using meridian -previous option)
OK ? DEBUG
read_design_db
ASSUMES
(optional) FORMAL ANALYSIS verify_cdc_formal
HERE
source formal_status.tcl
OK ? DEBUG
#set allPolicies {NEW TO_BE_FIXED DEFERRED WAIVED}
#report_policy $allPolicies -output formal.rpt
DONE
©Copyright 2016 Real Intent Inc., Proprietary and Confidential 98
Formal Checks
D1 D2
Data
Control
D D
Benefits
Q Q
Glitch-aware
Metastability-aware
Transmitted data is sampled in the receiving domain at the next receiving cycle;
metastability could propagate, resulting in downstream failure
Two bits transition at the same time; not a safe CDC practice
Data
Control
D D
Q Q
CLK1 CLK2
The transmit control pulse is not wider than one receiving clock cycle;
could potentially be missed at the receiving clock domain
Data
Control
CLK1 CLK2
Error sources:
Bad combinational logic in control path
Bad combinational logic on feedback path
Post-synthesis glitch potential that creates an uncontrolled path
Structural analysis reveals glitch potential; formal analysis finds true glitch situation:
Logic values that cause the generation, propagation, and capture of glitches
Both signals change at the same time, potentially creating a timing glitch;
the glitch can potentially be sampled in the receiving clock domain