Electronic devices and systems often represent information by varying electrical parameters such as voltage, current, frequency, wavelength, etc. These electrical parameters may be controlled in many ways, for example, a digital device may vary a voltage amplitude discretely over time while an analog device may vary a voltage amplitude continuously over time. These two variations alone provide limitless ways to represent information.
Digital devices are further differentiated as synchronous or asynchronous. Synchronous devices use periodic synchronization signals, also called clock pulses, to synchronize device circuitry while asynchronous devices are not slaved to a clock. Synchronous signaling is typically less complex and has less overhead than asynchronous signaling, which benefits device performance.
Unfortunately, synchronous devices and systems are susceptible to errors within their clock signals. Ideally, a synchronous system has universal clock signal characteristics such as phase or frequency throughout the entire system. This is not achieved in practice. Some potential sources of error are environmental influences on clocking, clock distribution variations, and signaling between clock domains.
In devices or systems that are synchronized with a clock signal, slight variations in the clock signal cause malfunctions. If a signal is sampled at a wrong time, data corruption occurs. For example, metastability happens if a data signal transitions too close to or at the same time as a clock transition, causing the data signal to be sampled in an invalid intermediate state. In order to reliably sample a data value the value must be steady for a brief time before a clock transition through a brief time after a clock transition, also called setup time and hold time, respectively.
When signals are passed between clock domains, from circuitry running on one clock to circuitry running on another clock, asynchronous relationships at the clock domain interface must be reconciled to ensure data integrity. Since each domain is operating on different clocks, numerous sources for error exist. For example, clock domain interfaces may have an unknown phase relationship even if the two clock domains are operating at the same frequency. Therefore data corruptions are likely if not otherwise compensated for.
In the following description, numerous specific details are set forth. However, it is understood that embodiments of the inventions may be practiced without these specific details. In other instances, well-known circuits, structures, and techniques have not been shown in detail in order to improve the understanding of this description. Reference in the specification to “one embodiment” or “an embodiment”, etc., means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one aspect of the invention. The appearances of the phrase “in one embodiment” in various places in the specification do not necessarily all refer to the same embodiment.
In general, when transferring signals across a clock domain interface, that is between circuitry running on one clock and other circuitry running on another clock, clocking information from one domain may be used in the other clock domain in a manner that avoids data corruptions while sending data signals across the interface.
Referring to the embodiment in
A receive sequential element 130 is clocked by CLK3155 and receives the M-bit data across the clock domain interface 135 from the SIPO 115. CLK 2 need not be a division of CLK1, it may be larger, smaller or equal, therefore the clock divider 120 is used for illustration purposes. Furthermore, the present embodiment uses 1-bit data and M-bit data, but embodiments of the present invention need not be limited to any data widths and therefore may be applied to any clocked data.
An embodiment may comprise a data circuit, a clock circuit to synchronize the data circuit, and a sampling circuit to sample a clock signal from a separate clock domain. In this embodiment the sampling circuit may control the clock circuit in response to a sampled clock signal and may delay the data circuit from providing data if it would result in data corruption due to clock misalignment. In an embodiment the sampling circuit may further control the clock circuit with a signal that bounds the setup and hold window of the sampled clock signal.
Therefore, the embodiment in
This embodiment illustrates phase control of CLK2145 with the INIT_CLK signal 150, which is a control signal in the CLK1 domain. In this case, if INIT_CLK 150 is deasserted, CLK2145 initializes to produce a transition, such as a rising edge. By adjusting the CLK2 phase, a frame alignment of the M-bit data bus can be set.
An embodiment may further comprise a data delay circuit to delay data in the data circuit in response to the clock circuit delaying data provided from the data circuit. In an embodiment the data delay circuit adds delay to the data circuit only when needed to prevent data corruption. In an embodiment a data circuit may internally process data serially and provide parallel data.
Referring to the example in
Referring back to
The present embodiment eliminates phase conflict between CLK2 and CLK3 by considering three things. By sampling CLK3 in the CLK1 domain, the CLK1 domain can adjust timing to avoid data corruptions for data traversing the clock domain interface 135. The sampling of CLK3 is shown in
An embodiment may be a system comprising a first element to provide data and to use a first clock signal in a first clock domain, a clock divider to generate a second clock signal from the first clock signal, a second element to receive data from the first element, the second element to use the second clock signal and to output data to a second clock domain, a receive sequential element to receive data from the second element, the receive sequential element to use a third clock signal and to operate in the second clock domain, and circuitry to sample the third clock signal, generate a control signal with a fixed level bounding transitions in the third clock signal, and provide to the clock divider a control signal to adjust the phase of the second clock signal and align data released from the second element with the third clock signal.
In an embodiment the circuitry may delay the data entering the second element. This embodiment may add delay to the data only when needed to prevent data corruption at the receive sequential element. In an embodiment the data from the sequential element may be serial data. In an embodiment the second element may be a serial in parallel out (SIPO) element.
The two waveforms referenced at 360 highlight re-sampling of CLK3 to the CLK1 domain. The sampled CLK3 in the CLK1 domain is referred to as CLK3′. At reference 365, CLK3′_shift is generated from the sampled CLK3 and has a fixed level bounding the rising edge window of CLK3. Furthermore, references 340 and 350 represent uncertainty periods each of duration of 1 CLK1 cycle, as is shown by the dashed waveforms. Generally,
Referring to
CLK3′_shift can now be used to prevent M-bit data from being released on CLK2 near the capture edge of CLK3.
CLK3′_shift and INIT_CLK can now be used to prevent data being released from the SIPO 115 near the capture edge of CLK3. By constraining the assertion of INIT_CLK to occur only during the “TRANSITION” region shown in
An embodiment may be a method comprising sending data from a first clock domain to a separate second clock domain, sampling a clock signal from the second clock domain, and using the sampled clock signal to delay a clock signal in the first clock domain to avoid corruption of data passed between the clock domains. In an embodiment the clock signal delay is at least 1 cycle in a first clock domain. An embodiment may delay data in the first clock domain to correspond with the delayed clock signal. An embodiment may delay the data in the first clock domain only happens when needed to prevent data corruption.
An embodiment may delay a clock signal in the first clock domain when it otherwise would transition in the setup and hold window of a sampled clock from a second clock domain.
Referring to
Referring to the embodiment illustrated in
In an embodiment, the phase relationship of two clocks, on either side of a clock domain interface, is analyzed and automatically adjusted during initialization. In an embodiment latency is only added to the data path when needed to prevent data corruption.
Embodiments of the present invention may also eliminate the need for area-intensive elastic buffers that have traditionally been used in clock crossings, may prevent data corruption due to an asynchronous clock interface, may remove fixed latency associated with clock crossing logic, and are adaptable to any frequency ratio and data bus width. In an embodiment, the defined “keep-out” region is adjustable to begin and end at any rising edge of the fast CLK1 within 1 cycle, due to uncertainty.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative instead of restrictive or limiting. Therefore, the scope of the invention is indicated by the appended claims rather than by the foregoing description. All changes, modifications, and alterations that come within the meaning, spirit, and range of equivalency of the claims are to be embraced as being within the scope of the appended claims.