Quartus® Prime Pro Edition User Guide: Timing Analyzer

ID 683243
Date 11/26/2024
Public
Document Table of Contents

3.1.1. CDC Timing Overview

Digital clocking provides the pulses that synchronize the operations of digital circuits. These pulses coordinate the timing of data movement and processing within a circuit. A clock domain is a specific region of a digital system where the same clock signal governs all the sequential elements, such as flipflops and registers.

Complex electronic systems typically include multiple clock domains to meet the diverse operational demands of sophisticated systems. As system complexity increases, the system often requires different sections to function at distinct frequencies or phases. Independent clocks are often necessary when interfacing to different I/Os. For example, when data coming in from two ethernet cables is clocked completely independently of each other. Using this approach allows for specialized processing blocks to run at their optimal speed, enhancing performance and efficiency.

The use of multiple clock domains within a single design enables fine-tuned control over each subsystem, but also introduces the challenge of managing the interactions between these asynchronous environments. These challenges are particularly evident when you must safely transfer data from one domain to another.

Single CDC Design without Synchronizers


In the Single CDC Design without Synchronizers example, clk1 triggers the flipflop reg_clk1. clk2 triggers the flipflop reg_clk2. There is a data transfer between reg_clk1 and reg_clk2.

Clock domain crossings (CDCs) occur when a signal or data transfers from one clock domain to another within a digital system. Each clock domain operates under its clock signal. When a signal crosses into a domain that a different clock governs, there is a risk that the receiving domain's flipflops do not properly latch the incoming data. This risk is present because of the potential misalignment of the source and destination clock edges, which can lead to setup and hold time violations.

Metastability is a condition that can arise when a flipflop receives an input signal that changes too close to the clock edge, and not within the required setup or the hold time. In such cases, the flipflop can fail to resolve the input to a definitive logical '0' or '1' in the time expected. Instead, the output can enter an unstable, mid-value voltage that requires excessive time (beyond tCO) to enter a stable 0 or 1 state. This metastability state can propagate through the circuit, leading to unpredictable behavior, data corruption, and system errors.

In the Single CDC Design without Synchronizers diagram, reg_clk1 data crosses clock domains when reg_clk2 samples this data on the rising edge of clk2. If you do not manage CDCs correctly, the probability of metastability increases, especially in systems with high clock frequencies. To mitigate the risks associated with CDC, you must use synchronization techniques, such as using chains of flipflops as synchronizers, to allow enough time for the signal to stabilize before the receiving clock domain uses the signal.