Synchronous digital circuits employ clock signals that periodically transition between high and low states, each transition forming a signal edge. The sequence of periodic edges can be communicated like the beats of a metronome to share timing information among and between circuit elements to coordinate their actions. Clock frequency and timing stability—the timing accuracy of clock edges—are measures of merit. As circuit complexity increases, so too does the difficulty to supplying stable, high-frequency clock signals. Doing so sometimes calls for two clock signals to be compared and their phases—the timing of edges—and frequencies to be matched. For example, a circuit element called a phase-locked loop (PLL) compares the phase difference between a reference clock signal and a feedback clock signal and adjusts the frequency of the feedback clock signal to synchronize the clock signals. The frequency of the feedback clock signal “locks” to the frequency of the reference clock signal.
Clock domain 105 includes a pair of cross-coupled flip-flops 115 and 120, synchronous elements that together form a quadrature clock generator that issues periodic signals ps1 and ps2 that are both phase-dependent upon clock signal Clk1 and are in quadrature, which is to say they are phase offset from one another by ninety degrees. Different numbers and phase offsets can be used in other embodiments.
Clock domain 110 includes a di-bit sampler 125, a brute-force synchronizer 130 with a series of N flip-flops 135, a delay element 140, a finite state machine (FSM) 145, a counter 150, a register 155, and a clock source 160. Di-bit sampler 125 samples both periodic signals ps1 and ps2 on rising edges of clock signal Clk2 to produce a sequence of two-bit states s′[1:0], each state including concurrent samples of the first and second periodic signals ps1 and ps2.
Sampling periodic signals ps1 and ps2 on edges of clock signal Clk2 can introduce metastable states. Should an edge of clock signal Clk2 occur during a signal transition of one of signals ps1 and ps2, for example, the resulting sample can represent a metastable state between the binary values of one and zero. Flip-flops 135 of synchronizer 130 force such metastable samples into a stable state, the more flip-flops the more corrective the forced state.
Synchronizer 130 conveys a stabilized sequence of states S′[1:0] to delay element 140 and FSM 145. Delay element 140 delays this sequence by one clock cycle and presents the resultant delayed sequence of states S[1:0] to FSM 145. Successive states S′[1:0] and S[1:0] allow FSM 145 to evaluate transitions between states. As detailed below, state transitions occur in a predictable order when clock signals Clk1 and Clk2 are locked. Out-of-order state transitions indicate phase misalignment and can cumulatively indicate frequency mismatches and lock loss between clock signals Clk1 and Clk2. Register 155 can be programmed to establish a maximum count for counter 150, which FSM 145 employs to adjust the frequency-offset tolerance for issuing a lock signal Lock?.
Lock-detection circuit 100 can be instantiated on an integrated-circuit device (IC) along with circuitry timed to one or both of clock signals Clk1 and Clk2, circuitry that includes e.g. transmitters and receivers to send and receive synchronous data signals from and to the IC and interoperable circuits that communicate among nodes within the IC.
Beginning with timing diagram 200, each edge of first clock signal Clk1 stimulates one of flip-flops 115 and 120 to transition high or low to yield quadrature periodic signals ps1 and ps2. Di-bit sampler 125 samples both signals ps1 and ps2 on rising edges of clock signal Clk2 to generate binary pairs, a logic one (zero) for samples of relatively high (low) signals. A pair of sample points 225 illustrates sample timing in which a rising edge of clock signal Clk2 samples a high value for periodic signal ps1 and a low value for periodic signal ps2, yielding a di-bit state value S[1:0]=10. The next pair of sample points 230 illustrate sample timing in which a rising edge of clock signal Clk2 samples low values for both signals ps1 and ps2, yielding a state value S[1:0]=00. Due to the quadrature nature of signals ps1 and ps2, states S[1:0] transition in Gray code, repeating the pattern 00, 01, 11, 10 so long as clock signal Clk1 remains phase and frequency matched with clock signal Clk2. Deviations from Gray-code state transitions on rising edges of clock signal Clk2 indicate phase errors between clock signal Clk1 and Clk2.
Referring next to diagram 205, clock signal Clk1 is of a higher frequency than clock signal Clk2 so edges of clock signal Clk1 arrive ever earlier with respect to those of clock signal Clk2. Transitions S[1:0] generally follow the expected Gray code sequence of the example of diagram 200. However, the phase mismatch between clock signals Clk1 and Clk2 will sometimes produce an error in the expected sequence. A pair of sample points 235 illustrate sample timing in which a rising edge of clock signal Clk2 samples a high value for periodic signal ps1 and a low value for periodic signal ps2, yielding a state value S[1:0]=10. This sample instant occurs during a falling edge of signal ps1, in which case the sampled value could well be a one or a zero. The timings of signals ps1 and ps2 are even earlier relative to clock signal Clk2 during the next pair of sample points 240. The state transition thus changes both bits, from S[1:0]=10 to S[1:0]=01, an error in the Gray code sequence that correlates with a relatively early edge of clock signal Clk1 relative to clock signal Clk2.
State table 215 relates state transitions from a prior state S[1:0] to a current state S′[1:0]. In the example of diagram 205, at sample points 240 state S[1:0] transitions from a prior state S[1:0]=10 to a current state S′[1:0]=01. With reference to table 215, this transition indicates an EARLY condition, which is to say that the edge of clock signal Clk1 occurred early relative to a corresponding transition of clock signal Clk2. In this example, the phase error is due to a frequency mismatch. In practice, phase errors can be due to phase noise, frequency mismatches, or a combination of both.
Turning to diagram 210, clock signal Clk1 is of a lower frequency than clock signal Clk2 so edges of clock signal Clk1 arrive progressively later with respect to those of clock signal Clk2. A pair of sample points 245 illustrate sample timing in which a rising edge of clock signal Clk2 samples high and low values for respective signals ps1 and ps2, yielding a state value S[1:0]=10. The timings of signals ps1 and ps2 are later relative to clock signal Clk2 during the next pair of sample points 250. Neither state variable transitions so that state remains S[1:0]=10, an error in the Gray code sequence. With reference to state table 215, this error indicates a LATE condition, which is to say that the edge of clock signal Clk1 occurred late relative to a corresponding transition of clock signal Clk2.
Table 215 is populated with entries interpreting state transitions for signals S[1:0]. Errors indicative of early and late edges are as noted above. States that increment in Gray code are “OK”, and the remaining states designate errors (ERR) and would only be expected to occur in cases of large instantaneous phase jumps.
State diagram 220 illustrates the operation of FSM 145 in accordance with an embodiment that follows state table 215 and is programmable to adjust the permissible frequency offset between clock signals Clk1 and Clk2 before reporting an unlocked condition. FSM 145 remains in an idle state 255 in which signal Lock? is asserted (Lock?=1 for “yes”) so long as the state transitions of table 215 are deemed OK. An early indication EARLY instigates a transition to early state 260. Counter 150 begins decrementing from a value stored in register 155, a value that sets a timeframe that determines the frequency sensitivity of lock-detection circuit 100. If a late indication LATE occurs in state 260 or the count reaches zero, the state returns to idle state 255. If a second early indication EARLY occurs before the count reaches zero, the state changes to unlock state 270 and FSM 145 de-asserts lock signal Lock? (Lock?=0 for “no”) to signal an unlocked condition.
Alternating between early and late edges indicates edge instability (jitter) rather than frequency mismatch, and successive state errors indicative of early edges can be within frequency offset tolerance if sufficiently spaced in time. Register 155 allows circuit 100 to be programmed such that counter 150 establishes that sufficient spacing. State diagram 220 thus requires either an “error” event ERR or two successive “early” events without an intervening “late” event to issue an error signal Lock?=0.
Returning to state 255, a late indication LATE instigates a transition to late state 265. Counter 150 begins decrementing from the value stored in register 155. If an early indication EARLY occurs in state 265 or the count reaches zero, the state returns to idle state 255. If a second late indication occurs before the count reaches zero, the state changes to unlock state 270 and FSM 145 sets lock signal Lock? to zero to indicate an unlocked condition. State diagram 220 transitions to unlocked state 270 from any other state if a state transition indicates an error ERR.
The examples of diagrams 205 and 210 assume the frequency of clock signal Clk1 differs from that of clock signal Clk2, and these differences cause the edges of clock signal Clk1 to misalign with those of claim signal Clk2. Edge misalignment can also occur due to phase jitter. In some embodiments, FSM 145 can issue measures of jitter that can be used to evaluate and adjust clock performance.
Although the present invention is described in connection with certain specific embodiments for instructional purposes, the present invention is not limited thereto. Therefore, the spirit and scope of the appended claims should not be limited to the foregoing description. Only those claims specifically reciting “means for” or “step for” should be construed in the manner required under the sixth paragraph of 35 U.S.C. § 112.
Number | Date | Country | |
---|---|---|---|
63384467 | Nov 2022 | US |