Clock Crossing Principles¶
Constraining¶
Manual Constraining¶
All clock-crossings require the following constraints:
set_max_delay -from [get_clocks <src-clock>] -to [get_clocks <dst-clock>] -datapath_only <period-of-faster-clock>
set_max_delay -from [get_clocks <dst-clock>] -to [get_clocks <src-clock>] -datapath_only <period-of-faster-clock>
Note: Automatic constraining currently only works for AMD tools (Vivado). Manual constraints are required for other tools.
Note: For using Open Logic from in Vivado, manual constraints are required for Versions prior to 2024.2. Automatic constraining currently only works for verilog only since 2024.2.
Automatic Constraining¶
For AMD tools (Vivado) scoped constraints files exist, which automatically identify all Open Logic clock-crossings
and constrain them correctly. When using the import_sources.tcl script to add Open Logic to your project (see
How To ... section), the constraints are applied automatically.
To alternatively configure usage of the scoped constraints manually , follow the steps below.
- Create an empty TCL file and add it to the Vivado project as constraint.
- Enable the TCL file for implementation only (see screenshot below)
- In the TCL file, add a single line
source <path-to-open-logic>/src/base/tcl/constraints_amd.tcl

Reset Handling¶
Most clock crossings need logic in both clock domains to be reset if a reset in one of the two domains is detected. The logic to transfer a reset from one clock domain to the other and ensure that both clock domains stay in reset at the same time for at least one clock cycle before resets are released is implemented in olo_base_cc_reset, which is used within most clock crossings.
Because logic around clock crossings usually must be reset along with them, most clock crossings provide not only reset inputs (Xxx_RstIn) but also reset outputs (Xxx_RstOut) on both clock domains. The reset input is the port through which a reset is requested. The reset output does indicate that a reset is active on the related clock domain (because of a reset input being requested on one or the other clock domain).
Any logic that must be reset when the clock crossing is reset shall be connected to the reset output signals (Xxx_RstOut).

Radiation Hardening¶
Designs for radiation environments often triplicate all registers automatically, e.g. with the Synplify attribute
syn_radhardlevel = "tmr" for Microchip devices. Voters between the stages of a synchronizer would add delay to the
path that determines the metastability MTBF. Therefore the synchronizer registers of all Open Logic clock crossings
are excluded from automatic TMR (syn_radhardlevel = "none"): the tool triplicates the registers around the
synchronizers but not the synchronizers themselves. This concerns the synchronizers of
olo_base_cc_bits, olo_base_cc_reset,
olo_base_reset_gen and olo_intf_sync, and thus all clock
crossings built on them. Other tools ignore the attribute.
The generic SyncTmr_g selects whether the synchronizers are implemented once or three times. It is available on all entities that have a SyncStages_g generic.
Single Synchronizers¶
By default (SyncTmr_g = false), every synchronizer is implemented once. A single-event upset of a synchronizer register is not masked: the receiving side sees a wrong value for one clock cycle. Depending on the clock crossing, this can lead to a wrong level for one cycle, a spurious or lost pulse or transfer (toggle-based crossings such as olo_base_cc_pulse), a wrong pointer value for one cycle (olo_base_fifo_async) or a spurious reset. Take this into account in the radiation analysis of the design.
Triplicated Synchronizers¶
With SyncTmr_g = true, every synchronizer is implemented as three independent chains (including the input register of olo_base_cc_bits), followed by a bitwise majority voter after the last stage. The chains are excluded from automatic TMR as well, so there are no voters between the stages and the metastability MTBF of each chain is the one of a single synchronizer. The voter masks an upset of a register in one of the chains. The chains carry the same synthesis attributes as a single synchronizer, which also keep the tools from merging them. The latency does not change; the cost is three times the synchronizer registers plus one voter per bit.
Only the synchronizers are triplicated. All other registers of the clock crossings are left to the automatic TMR of the design. SyncTmr_g = true is therefore meant for designs that use automatic TMR.
Without upsets, the behavior is the same as with single synchronizers. However, the three chains can see a change of their input one clock cycle apart (skew between the chains, metastability), so after a change they can disagree for one clock cycle. An upset of one of the other two chains in this cycle is not masked. If every level of the synchronized signal is stable for at least two clock cycles of the slower clock, this does not change the result: the change only appears one clock cycle later at the output. If a level is shorter, an upset in this cycle can have the same effect as with a single synchronizer. The constraints (see Constraining) limit the skew between the chains to the period of the faster clock, which is what the two clock cycles are based on.
- olo_base_cc_simple, olo_base_cc_status, olo_base_cc_handshake, olo_base_cc_reset, olo_base_reset_gen, olo_base_cc_n2xn, olo_base_cc_xn2n and olo_intf_clk_meas fulfill this requirement by design.
- olo_intf_i2c_master, olo_intf_spi_slave and olo_intf_uart fulfill it within their minimum ratio between the Clk frequency and the interface frequency, as long as the interface lines do not glitch.
- For olo_intf_debounce, an upset during a short level has the same effect as a bounce, which the debouncing handles.
- olo_base_fifo_async does not need it: the Gray-coded pointers change only one bit at a time, so every chain sees either the old or the new pointer value and the voted value is always one of the two.
- olo_base_cc_pulse fulfills it if the pulses are at least two clock cycles of the slower clock apart, which is the maximum pulse rate of the entity.
- For olo_base_cc_bits and olo_intf_sync, the user must hold every level of the input for at least two clock cycles of the slower clock (Clk for olo_intf_sync) to profit from the full protection.
Selection Table¶
Every clock crossing has certain pros and cons. The table below aims to summarize them
| Entity | Async. Clocks | Data | Multi Bits | Valid (Sampled) | Ready | Reset Crossing | 100% Perf. | No RAM |
|---|---|---|---|---|---|---|---|---|
| olo_base_cc_reset | x | x | x | |||||
| olo_base_cc_bits | x | x | x | x | ||||
| olo_base_cc_pulse | x | x | x | x | x | |||
| olo_base_cc_simple | x | x | x | x | x | x | ||
| olo_base_cc_status | x | x | x | x | x | |||
| olo_base_cc_handshake | x | x | x | x | x | x | x | |
| olo_base_fifo_async | x | x | x | x | x | x | x | |
| olo_base_cc_n2xn | x | x | x | x | x | x | ||
| olo_base_cc_xn2n | x | x | x | x | x | x |
The meanings of the columns are as follows:
- Async. Clocks
- Allows fully asynchronous (not phase locked) clocks
- Data
- Allows transferring data (not only events)
- Multi Bits
- Allows transferring multi-bits signals safely
- Valid (Samples)
- Comes with a valid signal (i.e. allows transferring samples without duplication)
- Ready
- Comes with a ready signal (i.e. supports backpressure)
- Reset Crossing
- Contains a reset clock crossing
- 100% Perf.
- Does not enforce any idle cycles.
- No RAM
- Does not require any RAM resources