SoC Clock Domain Crossing Guide
SoC Clock Domain Crossing Guide
1
Clock Domain Crossing
Overview
As modern System-on-Chip (SoC) designs continue to face increasing size and
complexity challenges, multiple asynchronous clock domains have been employed for
different I/O interfaces. A CDC-based (Clock Domain Crossing) design is a design that
has one clock asynchronous to, or has a variable phase relation with, another clock. A
CDC signal is a signal latched by a flip-flop (FF) in one clock domain and sampled in
another asynchronous clock domain. Transferring signals between asynchronous clock
domains may lead to setup or hold timing violations of flip-flops. These violations may
cause signals to be meta-stable. Even if synchronizers could eliminate the meta-
stability, incorrect use, such as convergence of synchronized signals or improper
synchronization protocols, may also result in functional CDC errors. Functional validation
of such SoC designs is one of the most complex and expensive tasks. Simulation on
register transfer level (RTL) is still the most widely used method. However, standard
RTL simulation can not model the effect of meta-stability.
Within one clock domain, proper static timing analysis (STA) can guarantee that data
does not change within clock setup and hold times. When signals pass from one clock
domain to another asynchronous domain, there is no way to avoid meta-stability since
data can change at any time.
As the CDC errors are not addressed and verified early in the design cycles, many
designs exhibit functional errors only late in their design cycles or during post-silicon
verification. Several coverage metrics are proposed to measure the validation's
adequacy and progress, such as code based coverage, finite state machine coverage,
and functional coverage. Nevertheless, these coverage metrics do not have direct
relations with CDC issues.
To address clock domain problems due to meta-stability and data sampling issues,
designers typically employ several types of synchronizers. The most commonly used
synchronizer is based on the well-known two-flip-flop circuit. Other types of
synchronizers are based on handshaking protocols or FIFOs. In a limited number of
cases it may be useful to employ dual-clock FIFO buffers or other mechanisms
optimized for domains with similar clock frequencies.
To accurately verify clock domain crossings, both structural and functional CDC analysis
should be carried out. Structural clock domain analysis looks for issues like insufficient
synchronization, or combinational logic driving flip-flop based synchronizers. Functional
clock domain analysis uses assertion-based verification to check the correct usage of
synchronizers. Assertions may be used to find problems such as data stability violations
when going from a fast clock domain to a slower one. Assertions generated in PSL or
other assertion languages such as OpenVera or SystemVerilog, can then be used in
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 1/25
19/12/2013 1 Clock Domain Crossing
Background
Clock domain
A clock domain is a part of a design that has a clock that operates asynchronous to, or
has a variable phase relationship with, another clock in the design. For example, a clock
and its derived clock (via a clock divider) are in the same clock domain because they
have a constant phase relationship. But, 50MHz and 37MHz clocks (whose phase
relationship changes over time) define two separate clock domains. Figure 1 illustrates
three different clocks in a design, but synchronous to each other. CLK, its inversion and
D1 (derived from CLK) are synchronous to each other.
Figure 1:
Synchronous
Clock
A clock
domain
crossing
signal is a signal from one clock domain that is sampled by a register in another clock
domain. More details of the clock origin/domain inference engine are given in [1].
Meta-stability
Every flip-flop (FF) that is used in any design has a specified setup and hold time, or
the time in which the data input is not legally permitted to change before and after a
sampling clock edge. This time window is specified as a design parameter precisely to
keep a data signal from changing too close to another synchronizing signal that could
cause the output to go meta-stable.
value can change at any time with respect to bdat1's clock (bclk). If the value of adat
changes during bdat1's setup and hold time, the register bdat1 might/might not assume
a state between 0 and 1. In this state, the register is said to be meta-stable. A meta-
stable register may/may not (unpredictably) settle to either 0 or 1, causing illegal
signal values to be propagated throughout the rest of the design.
In a multi-
clock design,
meta-stability
is inevitable,
but there are
certain design
techniques
that help to
avoid the
chance of
getting meta-
stable. The
following
section
provides an
overview of
different synchronization techniques.
Synchronization Techniques
The main responsibility of a synchronizer is to allow sufficient time such that any meta-
sable output can settle down to a stable value in the destination clock domain. The
most common synchronizer used by designers is two-flip-flop (2-FF) synchronizers as
shown in Figure 4. Usually the control signals in a design are synchronized by 2-FF
synchronizers.
remain meta-stable for a full destination clock cycle is asymptotically close to zero. This
calculation of the probability of the time between synchronization failures (MTBF) is a
function of multiple variables including the clock frequencies used to generate the input
signal and to clock the synchronizing flip-flops. For most synchronization applications, a
2-FF synchronizer is sufficient to remove all likely meta-stability.
Even if a 2-FF synchronizer helps to prevent propagation of meta-stable values, for the
correct operation of the design, some other issues needs to be tackled. These issues
are explained in the following sections.
Gray
Encoding
to Avoid
Data
Example - Suppose a vector control signal Sig [2:0] crosses from Domain 1 to Domain 2.
Signal Sig also decides the state of Domain 2 and you assume that the value "100" of
Sig [2:0] indicates an invalid state for Domain 2. Now, think of a situation, where the
signal Sig wants to change its value from "000" to "101" (both indicate valid states).
This requires the two bits Sig [0] and Sig [2] to transit simultaneously. Both these
transition occurs very close to the destination sampling clock edge (see Fig 6). By virtue
of meta-stability, transition on Sig [2] gets captured correctly and the transition on Sig
[0] is missed. In this way, in the first cycle of the destination clock, the system moves
to state "100" which is invalid.
This case would not have happened, if changing the states of the design requires
changing only a single bit of the vector (Sig in this case). In case of a single bit
transition, either that transition would be captured in the destination domain or not.
This way the design either stays in the previous state or move to a valid state.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 4/25
19/12/2013 1 Clock Domain Crossing
Therefore, for
vector control
signals (multi-
bit signals,
such as
address
buses), the
usual solution
is to use a
Gray code
when crossing
a clock
domain
boundary. A
Gray code
ensures that
only a single
bit changes as
the bus
counts up or down. The presence of gray coding on vector control signal can be checked
by using assertions. For more information, see the section "Gray Code Encoding for
Vector Control Signals".
Three common methods for synchronizing data between clock domains are:
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 5/25
19/12/2013 1 Clock Domain Crossing
"req" signal
(request) to
the receiving
clock
domain.
When the
"req" signal
is recognized
in the
destination
clock
domain, the
receiver
clocks the
data into a
register (the
data should
have been stable for at
least two/three sampling
clock edges in the
destination clock
domain) and then passes
an "ack" signal
(acknowledgement)
through a synchronizer to
the sender. When the
sender recognizes the
synchronized "ack"
signal, the sender can
change the value being
driven onto the data bus.
Passing Data by
FIFO between Clock Domains
One of the most popular methods of passing data between clock domains is to use a
FIFO. A dual port memory is used for the FIFO storage. One port is controlled by the
sender, which puts data into the memory as fast as one data word (or one data bit for
serial applications) per write clock. The other port is controlled by the receiver, which
pulls data out of memory; one data word per read clock. Two control signals are used to
indicate if the FIFO is empty, full, or partially full. Two additional control signals are
frequently used to indicate if the FIFO is almost full or almost empty. In theory, placing
data into a shared memory with one clock and removing the data from the shared
memory with another clock seems like an easy and ideal solution to passing data
between clock domains. For the most part it is, but generating accurate full and empty
flags can be challenging.
User-defined Synchronizers
Sometimes, you may specify some cells to be synchronizers. If this cell is found on the
path between the FF, the path has to be considered as synchronized. Note that the cell
itself may have other inputs than the source flip-flop as shown in the following
illustration. The way of specifying a synchronizer is explained in chapter 2, section
"Using Tcl Command 'set_cdc_synchronizer'".
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 6/25
19/12/2013 1 Clock Domain Crossing
CDC Analysis
Following are the basic steps for
CDC analysis and checking
(irrespective of toolset
implementation):
Structural Analysis to
Identify CDC Signals and
Appropriate
Synchronizers
The most important task of any
CDC structural analyzer is to find
out all the signals (CDC) that
cross clock boundaries. In Leda,
rule NTL_CDC01 (For more
information, see the section "CDC
Ruleset" in chapter 2.) reports all
the un-synchronized CDC paths.
However a CDC path may be
synchronized in the destination
clock domain. Thus, identification
of synchronization schemes is very
important to avoid reporting false
CDC reports. Automatic detection of synchronizers is very tough and may depend on the
underlying design principle. Therefore, sometime, the designer needs to provide
additional information for the underlying synchronization schemes.
Once extraction of information for all the CDC paths (synchronized and un-synchronized)
is over, you need to see whether there are structural defects before and after the
synchronizers.
Many design teams choose a few synchronizer styles, apply them to all signals crossing
clock domains and enforce their usage by design style rules and design reviews.
Although proper synchronizers are essential for multi-clock designs, they are insufficient
to avoid all possible problems regarding signals crossing clock domains. Considerable
extra care must be taken in the design process to avoid these problems. Some of the
structural problems that may cause functional errors in multi-clock based systems are
as follows.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 7/25
19/12/2013 1 Clock Domain Crossing
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 8/25
19/12/2013 1 Clock Domain Crossing
Synchronization and
glitch elimination
alone are not enough
to ensure reliable
transfer of data
across clock domains.
When a signal goes
meta-stable, a
synchronizer settles it
down, but cannot
guarantee the precise
number of cycles
before the valid signal
is available in the
receiving clock
domain. Therefore, if
(1) two independent
signals or (2) bits of a
multi-bit signal are
independently
synchronized (using
same type of
synchronizers or
different types of
synchronizers), the
bits may arrive in the
receiving clock domain
skewed with respect to
one another. A very simple form of re-convergence is shown in Figure 14. Rule
NTL_CDC05 and NTL_CDC07 detect this issue.
Leda has six rules that check all the above structural checks for CDC signals. The
purpose of these rules is to provide the following information. Detailed description of all
the Leda structural checks is provided in chapter 2.
information about the difference, see the section "CDC Ruleset" in chapter 2.
Flip-flop Synchronizer
MUX Synchronizer
Handshake Synchronizer
FIFO Synchronizer
A more complete description of the CDC AEP (automatically extracted properties) usage
is given in the section "CDC AEP Rule Usage".
1. The environment (associated logic) must interact properly with the synchronizer.
2. The synchronizer itself behaves correctly.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 10/25
19/12/2013 1 Clock Domain Crossing
Flip-flop Synchronizers
Description
The FF synchronizers (shown in Fig 16) form the basic building block for most of the
existing synchronization circuits. A simple FF synchronizer consists of m (> 1) FF
modeled as a shift register running on the 'destination clock'. Once the presence of a FF
synchronizer having m stages is detected, the following property is generated to ensure
that the device functions correctly in presence of this synchronizer.
If no assumptions are made about the relationship between the 'source' and
'destination' clock domains, then the following property ensures that all input signal
values can be reliably transported to the synchronizer output.
Input data values must be stable for m+1 destination clock edges.
Implementation
Example SVA codes for the above properties are given as follows. This assertion verifies
the stability of din as observed in the destination clock domain. Signal rst is the reset
signal (if any, with the appropriate polarity) extracted from the synchronizer FF, din is
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 11/25
19/12/2013 1 Clock Domain Crossing
property p_stability;
disable iff (rst)
@(<appropriate_edge> dclk)
!$stable (din) |=> $stable
(din)[*m] );
endproperty
A_p_stability: assert property (p_stability);
MUX Synchronizers
Description
Designs typically have both control and data paths. As shown in the following figure
(Fig 17), the control paths are usually flop-synchronized while the synced-in control
signals are used to synchronize the data paths. Here, these data paths use a controlled
synchronizer MUX for crossing clock domains. These control MUXs are sometimes called
D-MUX, MUX synchronizer, or sync MUX.
The MUX
synchronizer
has the
following
functional
requirements
to ensure
correct results.
sready must
be stable for
m+1 number
of destination
clock cycles
(modeled by
property
p_stability as explained in the section "Flip-flop Synchronizers").
data should remain stable in the destination clock domain during the data
transfer phase (indicated by the time dready is asserted in dclk domain and
until dready deasserted in dclk domain).
Implementation
Stability of Data
property p_data_stable;
disable iff (drst)
@(<appropriate edge> dclk)
((dready) |=> ($stable (data) ||
(!dready));
endproperty
A_p_data_stable: assert property (p_data_stable);
Description
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 12/25
19/12/2013 1 Clock Domain Crossing
There are different types of handshake synchronizers in practice, but most come down
to the fundamental working principle of synchronizing a single-bit request into the
destination clock domain and waiting for a synchronized version of the acknowledge to
come back. The differences in the architecture of the handshake synchronizers take
place because of the higher level protocols for the associated interfaces, data
management, etc.
The handshake synchronizers use two m-flip-flop synchronizers to generate request and
acknowledge signals. The associated properties are given as follows.
Input Data Stability for the m-flip-flop Synchronizers - Input data values must
be stable for m+1 destination clock edges (Re-use of the assertion in 6.a)
Protocol check - The sender and the receiver should follow the handshake
protocol correctly.
Data Stability - The data must be present when request is asserted on the
destination and remain stable until the acknowledgment is generated.
Implementation
The following assertions cover the proper use of the m-flip-flop synchronizers, the
handshake protocol, and the corresponding data stability.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 13/25
19/12/2013 1 Clock Domain Crossing
Similar properties for the destination clock domain (dclk) are given as follows.
- The receiver should continue to assert the dack signal till dreq is asserted at the
destination clock (dclk) domain.
- The receiver should not assert a new acknowledgement (dack), until a new request is
received in the destination clock (dclk) domain.
A SVA property that covers the above two checks is given as follows.
property dest_conformance (clk, rst, ssig, dsig);
disable iff (rst)
@(<appropriate edge> clk)
ssig |=>dsig;
endproperty
A_dest_conformance_req: assert property (dest_conformance (dclk, drst,
dreq, dack));
A_dest_conformance_new_req:
assert property (dest_conformance (dclk, drst, !dreq, !dack));
3. Data stability
- The receiver should continue to receive stable data till it asserts the acknowledgment.
The following SVA property implements the above two scenarios.
property data_stability (clk, rst, dreq, dack, data);
disable iff (rst)
@(<appropriate edge> clk) (dreq && !dack) => $stable (data);
endproperty
A_data_stability_dest:
assert property (dest_stability (dclk, drst, dreq, dack, data));
The checks for Pull synchronizers are similar.
Description
Another common CDC synchronization circuit, which is used when the high latency of
the handshake protocols cannot be tolerated, is the dual-clock asynchronous FIFO as
shown in Fig 19. Although many implementation variations exist, the basic operation is
the same; data is written into a dual-port RAM block from the source clock domain and
the RAM is read in the destination clock domain. Gray-coded read and write pointers are
passed into the alternate clock domain (using two m-flip-flop synchronizers) to
generate full and empty status flags. The following properties are generated for the
dual-clock asynchronous FIFO:
Implementation
The following SVA code provides a possible implementation of these checks. The
p_data_integrity assertion starts a new thread with a unique cnt value whenever wdata
is written to the FIFO and checks the rdata value against the local data variable
whenever the corresponding read occurs. The first_match is required in p_data_integrity
to ensure the property checks rdata on the first occurrence of a read with the
corresponding cnt, otherwise it waits for ever for a rdata match at the rcnt value. You
should create a module M, which contains the assertions. It is then bound to the
nearest top-level module instance containing the FIFO code.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 14/25
19/12/2013 1 Clock Domain Crossing
No Load on
Full & No
Read on
Empty
property p_bad_acces
@(<appropriate_edge>
endproperty : p_bad_
//-- Property for ba
A_p_bad_access_write
//-- Property for ba
A_p_bad_access_read:
Order and
Data
Preservation
//- The following code mimics the grey coded read and write pointers. If
you have
//- those pointers automatically identified from the design, this is not
required
bit [$bit (waddr)-1:0] rcnt=0, wcnt=0;
always @(posedge wclk or negedge wrst_n) begin
if (wrst_n) wcnt <= 0;
else if (winc) begin
wcnt = wcnt + 1;
end
end
always @(posedge rclk or negedge rrst_n) begin
if (rrst_n) rcnt <= 0;
else if (rinc) begin
rcnt = rcnt + 1;
end
end
property p_data_integrity
int cnt; logic [$bits (wdata)-1:0] data;
(rdata == data));
endproperty : p_data_integrity
Description
This check addresses multi-bit signals (bit vectors or a collection of individual signals)
that originate in one clock domain with the clocking event sclk and then re-converge in
another clock domain with the clocking event dclk without using any of the above
handshake-based synchronization schemes. Such signals must all have m-flip-flop
synchronizers and in addition they must be Grey-code encoded before entering the
synchronizers. In this way, when there is a change from one state of the multi-bit
signal to another, only one bit changes at a time. It ensures that the destination side
will not sample inconsistent state values due to different skews and meta-stability
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 15/25
19/12/2013 1 Clock Domain Crossing
delays on each bit. The Gray code may be decoded on the destination side, after the
individual synchronizers.
Implementation
Each individual m-flip-flop synchronizer must satisfy the signal stability properties
indicated in 1.1.2. In addition, the Gray code assertion verifies that whenever there is a
change of value on data_in the next value differs from the preceding one only in one
bit. The vector data_in is formed by concatenating all the variables that are part of the
multi-bit signal.
In the following section, you will read how Leda generates these assertions and how to
use these assertions for verification.
The purpose of adding these five rules is to provide the following information:
Furthermore, the detailed structural analysis statistics for the CDC synchronizers (such
as the numbers, locations etc.) can be accessed in the following ways:
While using Tcl mode (switch leda +tcl_shell), there is a command called
'report_cdc_info', which displays all types of detected CDC structures.
There are 7 rules (NTL_CDC01, NTL_CDC01_0, NTL_CDC01_1, ...,
NTL_CDC01_6) which when selected displays all types of CDC structures
(synchronized, unsynchronized) detected in a design by Leda.
The section "CDC Tcl Interface" provides details of the current CDC Tcl interface.
Additionally, each of the CDC assertion specific rules NTL_CDC14 - NTL_CDC16 also
provides signal specific information about the CDC synchronizers. An example is
provided in the section "CDC Analysis".
Each of these assertion definition files are generated only once. As every complex
synchronizer (MUX, FIFO, and Handshake) uses FF synchronizers for synchronizing the
control signals, aep_signal_satbility.v is also re-used for each of them.
The general idea for generating properties is to use prepackage modules containing
assertions and bind them to the verified design. The bind should try to bind the lowest
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 17/25
19/12/2013 1 Clock Domain Crossing
possible module in the design hierarchy in order to allow reduction of the design size
for the formal tool. The bind command will have the general following syntax:
i_<RULE_LABEL>_<INSTANCE_NUMBER>
For example if there are three FF synchronizers detected in a design, there would be
one control signal stability assertion definition and three separate bind statements
generated with three unique assertion instances namely - i_NTL_CDC06_1,
i_NTL_CDC06_2, and i_NTL_CDC06_3.
Sometimes, if you want to avoid explosion of the simulation time or Magellan running
time, you can also bound the number of properties that are generated. The
set_max_properties command placed in the design configuration file allows controlling
this number. This command is not specific to the CDC Manager; it is part of the property
generation manager.
The set of assertion related files are generated in a directory naming 'ForMG'. This
directory is located by default in .leda_work or in case .leda_work is missing in the 'run
directory.
Failure Debugging
In case of any CDC assertion violations for a design, you need to use the debugging
aids of the associated checker (VCS/Magellan) for finding the root cause of the failure.
Syntax
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 18/25
19/12/2013 1 Clock Domain Crossing
The general idea for generating properties is to use prepackage modules containing
assertions and bind them to the verified design. The bind tries to bind the lowest
possible module in the design hierarchy in order to allow reduction of the design size
for the formal tool. The bind command will have the general following syntax:
Syntax
Assertion Library
Instead of generating assertions or properties for each check, Leda uses an assertion
library packaged with the tool. Each check now binds to the module containing the
prepackaged property. This library is a set of modules containing the necessary
properties. These modules may also have parameters to set different options or bit
width.
The following assertion is generated for the condition that data signals must be stable
while the control signal is asserted (from source of control path asserted until target of
control path deasserted):
Grey Coding
The following assertion is generated by the rule that checks if two or more signals
are gray coded (for example, multi-bit control signals).
bind top aep_assert_gray_coding #( BitWidth, "Error : multibit control
signals must be gray coded") CDC08_test_v_40 (ck1, rst, CtrlSig );
As explained earlier, loss of correlation can also occur when two apparently independent
signals are synchronized separately, but ultimately fed into the same logic. This
scenario, sometimes dubbed re-convergence, is especially difficult to detect by manual
inspection of the synchronization schemes during design review.
Another form of correlation loss can occur when a signal has fan-outs into multiple
synchronizers. The two branches of the signal can have different delays; the electrical
and routing effects can also cause different delays in the clocks going to the two
synchronizers. Therefore, if the two synchronizers sample their inputs at different times
then the two copies of the signal can be skewed by a cycle and no longer correlated.
To prevent these correlation loss scenarios, Leda has two CDC rules that confirm that
there is no "re-convergence of synchronized signals" in the design.
The first one "NTL_CDC05" confirms that two signals synchronized in two different
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 19/25
19/12/2013 1 Clock Domain Crossing
synchronizers (thus forming two different CDC elements) never converge.
On the other-hand "NTL_CDC07" confirms that CDC paths synchronized by the same
synchronizer (thus grouped in a single CDC element) never converges after being
synchronized in the target clock domain.
Examples:
For CDC05 rule, two one bit signals are synchronized by two 2-FF synchronizers in two
different target domains (CLK2 and CLK3), thus forms two different CDC elements. After
the synchronization is done, these two signals converge in an AND gate.
For CDC07 rule, a single bit signal has fan-outs two 2-FF synchronizers. After the
synchronization is done (in the single target domain CLK2 thus forming a single CDC
element), these two signals converge in an AND gate. The HDL codes and related CDC
error messages are given as follows.
For more information about these rules, see the chapter "Clock Domain Crossing Rules".
set_cdc_ignored_path
Use the set_cdc_ignored_path command to specify a path to be ignored by CDC
analysis.
Syntax
Although -from and -to are optional, at least one of the options must be used. If you
don't specify any one of the options, then it's value is considered as 'any'. For example:
For the above command, any CDC path from top.rst will be ignored.
set_cdc_synchronizer
Syntax
For all the specified synchronizers, the parameters are a list of strings that specify
some values. The following table lists the parameters that are applicable for various
synchronizers.
set_cdc_group
Use the set_cdc_group command to override the automatic CDC inference. This
command enables you to create a CDC element and specify additional information like
synchronization type. In other words, it allows a complete specification of the CDC
information from you. This command is generated by the dump mode of the CDC. After
CDC inference in dump mode, all the inferred information is dumped using the
set_cdc_group command. If you want to modify the inferred information or grouping of
the different paths, you need to edit the dumped file and adapt the information.
The rules concerning reconvergent paths and gray coding of control paths are highly
dependent on the grouping. So, make sure that the groups are formed correctly. In
addition to the automatic inference algorithm and the possibility to define synchronizer,
Leda also offers the flexibility to fully customize the CDC information.
The CDC inference engine first uses the information from the set_cdc_group command.
If this information is incomplete, then it tries to automatically complete it. When the
command set_cdc_group contains only the -paths directive and no -synchronizer
information, then the synchronizer is recognized automatically. Similarly, if you provide
only the synchronizer type information, then the parameters (specially for fifo and
handshake) is computed automatically.
Syntax
set_cdc_input_delay
Use the set_cdc_input_delay command to specify a clock that controls the module pins
or ports specified with the option -pin_port_list. This helps you to analyze the CDC
issue in a given module and focus on debugging in that module.
Syntax
You can instantiate this module in a design and specify a new clock, say "clk1" that
controls the pin in_data. To avoid debugging the whole design and to just focus on this
synchronizer module, you need to specify the set_cdc_input_delay command in the
leda_clock_file.tcl as follows:
set_cdc_output_delay
create_cdc_clock
Use the command to specify a given pin of the cell as a clock pin of a hard IP cell.
Example
You can specify hard IP blocks and provide information about the relation between
clocks and data ports of the block. A cell which is instantiated from a library and does
not contain any statement (only port definition) is considered a hard IP cell. In such
case, for efficient CDC checking, you can specify the relationship between data pins and
clock pins.
The command to specify a given pin of the cell as a clock pin of a hard IP cell is as
follows:
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 22/25
19/12/2013 1 Clock Domain Crossing
The
following
commands
allow
creating a
relationship
between a
clock pin and
a data pin.
set_cdc_input_delay
set_cdc_output_delay
If such
information
is provided
to the
checker then
efficient CDC
checking can
be
performed
even on
designs
using hard
IP. Else, no
checking will
be possible
since no connectivity information is available.
For example, the previous illustration shows a hard IP block with two clocks, two input
ports, and two output ports:
Here the connection from O1 to the D input of the third flip-flop has a CDC issue that
could be detected if you provide the following relations:
extract_cdc_info
Use the extract_cdc_info command to run the CDC inference within the Tcl shell mode in
order to refine the different parameters for this inference.
Syntax
extract_cdc_info
You need to execute this command only after elaboration. You can then use the
report_cdc_info command to visualize the inferred CDC elements. You may execute this
command many times, but it is important to run the clear_cdc_info command before any
call.
report_cdc_info
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 23/25
19/12/2013 1 Clock Domain Crossing
Use the report_cdc_info command to print the inferred CDC elements on the console or
to a file.
Syntax
This command reports all the CDC elements set using the command set_cdc_group
syntax. This allows you to visualize the inferred information.
When you redirect the output of this command to a file, the console does not display
any information.
You can customize and source this file from the tcl_shell or the design_config file to
have a clean CDC inference.
clear_cdc_info
Use the clear_cdc_info command to clear all the inferred CDC informations.
Syntax
clear_cdc_info
In the Tcl shell mode, you may be interested to try several parameters until you get the
correct CDC inference. In order to do this incrementally, you can call the clear_cdc_info
command to reset everything and start the inference with new parameters.
set_cdc_parameter
Use the set_cdc_parameter command to specify a value for the parameters for CDC
inference.
Syntax
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 24/25
19/12/2013 1 Clock Domain Crossing
default value of this parameter is set to 4, to allow Leda to detect all kinds of
synchronizers. In a design using logic synchronizers, it is recommended to
limit this number to 2 or 1.
https://filebox.ece.vt.edu/~athanas/4514/ledadoc/html/pol_cdc.html 25/25