A method and a system are provided for clock phase detection. A set of delayed versions of a first clock signal is generated. The set of delayed versions of the first clock is used to sample a second clock signal, producing a sequence of samples in a domain corresponding to the first clock signal. At least one edge indication is located within the sequence of samples.
|
1. A method comprising:
generating a set of delayed versions of a first clock signal;
sampling a second clock signal using the set of delayed versions of the first clock signal to produce a sequence of second clock samples in a domain corresponding to the first clock signal; and
locating at least one edge indication within the sequence of second clock samples.
16. An integrated circuit comprising:
first circuitry operating in a first clock domain corresponding to a first clock signal;
second circuitry operating in a second clock domain corresponding to a second clock signal; and
a phase detector configured to:
generate a set of delayed versions of the first clock signal;
sample the second clock signal using the set of delayed versions of the first clock signal to produce a sequence of second clock samples in a domain corresponding to the first clock signal; and
locate at least one edge indication within the sequence of second clock samples.
2. The method of
3. The method of
sampling the first clock signal using the set of delayed versions of the first clock signal to produce a sequence of first clock samples in the domain corresponding to the first clock signal; and
locating a first edge indication within the sequence of first clock samples.
4. The method of
5. The method of
6. The method of
7. The method of
generating a second set of delayed versions of the first clock signal;
sampling the second clock signal using the second set of delayed versions of the first clock signal to produce a second sequence of second clock samples in the domain corresponding to the first clock signal; and
computing a next phase value as the phase value increased by a number of delayed versions of the first clock signal in the second set.
8. The method of
9. The method of
10. The method of
processing the at least one edge indication to compute a phase value representing a phase of the second clock signal relative to the first clock signal; and
computing a next period value as a difference between the phase value increased by a number of delayed versions of the first clock signal in the set and the location of the first edge.
11. The method of
12. The method of
14. The method of
17. The integrated circuit of
18. The integrated circuit of
19. The integrated circuit of
20. The integrated circuit of
|
The present invention relates to circuits, and, more specifically to clock phase detection.
Many digital systems have multiple clock domains. Thus, when signals move from one clock domain to another, they must be synchronized to avoid metastability and synchronization failure. If the two clocks have fixed frequencies, the phase relationship between the two clocks is periodic, at the beat frequency of the two clocks. By taking advantage of this periodic phase relationship, aperiodic synchronizer can be simpler, have lower latency, and a lower probability of failure than a synchronizer that has to handle crossing clock domains where at least one of the clocks operates at a variable frequency.
When at least one of the clocks operates at a variable frequency, the design of the synchronizer is more complicated. Typically, signals passing between clock domains are synchronized with a periodic clock using asynchronous first-in, first-outs (FIFOs). A significant area overhead is incurred for the FIFO memory. The FIFOs also add several cycles of delay as the Gray-coded input and output pointers of the FIFO must be synchronized through multiple flip-flops to reliably transmit the signals across clock domains.
There is thus a need for addressing these and/or other issues associated with the prior art.
A method and a system are provided for clock phase detection. A set of delayed versions of a first clock signal is generated. The set of delayed versions of the first clock is used to sample a second clock signal, producing a sequence of second clock samples in a domain corresponding to the first clock signal. At least one edge indication is located within the sequence of second clock samples.
Processors used in smartphones, tablets, laptops, and other mobile devices sometimes reduce the supply voltage provided to one or more integrated circuit devices to reduce power consumption and extend the time between battery recharging. The integrated circuit devices may also vary the power supply voltage levels to different circuits within the device based on different operating modes. As a power supply voltage level is reduced, any clock signals dependent on the particular power supply voltage level may operate at a lower frequency. When the power supply voltage level increases, the frequency of the clock signal also increases. Because the clock frequencies may vary as a function of power supply voltage levels, conventional synchronization techniques that rely on a fixed relationship between different clock domains cannot be relied on for transmitting signals between clock domains where at least one of the clocks has a variable frequency.
Although, clock frequencies may vary in response to varying power supply voltage levels, the techniques described herein may also be applied to situations for which the clock frequencies vary for other reasons. For example, clock frequencies may vary as temperature varies or may vary as a result of programming.
With respect to the present description, a first clock domain is a clock domain of any type of system from which a signal may be sampled. For example, the first clock domain could be a clock domain of a central processing unit (CPU), a graphics processing unit (GPU), a memory controller, and/or any other system with a clock domain. The first clock domain may include a first clock signal having a particular frequency or a frequency that may vary. A second clock domain may include a second clock signal having a particular frequency or a frequency that may vary. Signals that are transmitted from the second domain to the first domain are synchronized to the first clock domain.
Rather that using a conventional synchronizer that passes signals between clock domains using asynchronous first-in, first-out buffers (FIFOs), a low latency synchronizer may be may be designed that uses the relative phase between the two clock domains. Assuming that the first clock signal is in a receiving clock domain and the second clock signal is in a transmitting clock domain, the relative phase is used to determine when signals in the transmitting clock domain may be sampled by in the receiving clock domain. A high-resolution phase detector, described further herein, may be configured to track frequency transients and generate the relative phase and period between the two clock domains when one or both clock signals have varying frequencies. The high-resolution phase detector uses the first clock signal that is the local or receiving clock (clkr) and accepts the second clock signal from the transmitting clock domain (clkt). The high-resolution phase detector outputs two signals that encode: a phase value (Phase) and a period value (Period). The phase value represents the time, in clkr unit intervals (UI), from the last transition on clkt to the last transition on clkr. The period value represents the time, in clkr UI, between the last two transitions on clkt.
One or more bits of the transition signals 233, ti=Clk_si & ˜Clk_si-1 are true if a rising edge of the Clk 202 occurred between delayed versions of the Clk 201, Clk_di-1 and Clk_di, where i ranges from 0 to N. For example, when a rising edge of Clk 202 occurs between Clk_d3 and Clk_d4 and a falling edge of Clk 202 occurs between Clk_d7 and Clk d8, the Clk_si signals are 000011110 and the transition signals 233 encode the value 000010001 for i ranging 0 to N=8. The transition signals 233, ti, are input to an edge identification unit 232 that finds the first bit that is true and the second bit that is true (starting from tN) in the sequence of transition signals 233—if any of the bits are true. A one-hot encoding of the first bit that is true and the second bit that is true are output on signals first_oh and second_oh that are in turn encoded by the encoders 234 into m=log2(N)-bit binary signals first 235 and second 237. The transition signals 233 and/or the first_oh and second_oh signals maybe considered as edge indications. The first 235 and the second 237 values are encoded as signals and indicate the locations of the edge indications, as a number of bit positions from tN where the first and second transitions occurred respectively. For example, when the transition signals 233 encode the value 000010001, the values of first 235 and second 237, respectively are 000000001 and 000010000. Signals encode the values first_v 236 and second_v 238 that are also produced by the encoders 234 to indicate if a first and second transition were found, respectively.
The next_phase value is input to the phase register 244 that outputs the phase 203 signal. The following Verilog may be translated to generates at a least a portion of the logic shown in the phase unit 240, in particular to provide an input (next_phase) to the phase register 244:
assign next_phase=first—v?first_phase+ONE;
When a second transition is detected, a first transition is also detected. When second_v 238 is asserted, the multiplexor 256 selects the second 237 value as the input to the subtractor 252. When a second transition is not detected, the multiplexor 256 selects the incremented phase 245 as the input to the subtractor 252. The subtractor subtracts the first 235 value from the input to generate an output. When a first transition is detected, the multiplextor 258 selects the output of the subtractor 252 as the next period. Otherwise, the multiplextor 258 selects the output of the period register 254 as the next period and the period 204 value is unchanged.
The following Verilog may be translated to generates at a least a portion of the logic shown in the period unit 250, in particular to provide an input (next_period) to the period register 254:
assign next_period=first—v?(second—v?second:(phase+′ONE))−first):period;
The next_period value is input to the period register 254 that outputs the period 204 signal.
In one embodiment, when Clk 201 is 10 Hz and delay elements 211 can be trimmed across process-voltage-temperature variations (PVT) to 62.5 ns, N=16 and m=4, and the constant ONE is 010000. When the value of N is a power of 2 the calculations performed by the edge detection unit 230 are simplified. The phase 203 and period 204 are represented in a fixed-point notation with m bits to the right of the binary point. The phase register 244 and period register 254 need to include sufficient bits to encode the largest possible period of Clk 202. For example, if the slowest possible Clk 202 has a period that is 5 times longer than the period of Clk 201, then three bits to the left of the binary point are required.
Because of the delay required for retiming and synchronization the values of phase 203 and period 204 reflect the phase and period of Clk 201 a fixed number of Clk 202 cycles in the past. For example when the synchronizers 224 have a delay of four cycles and a retiming delay of one cycle is introduced by the flip-flops 222, the phase 203 and period 204 values represent the state of Clk 202 five Clk 201 cycles in the past. A fast synchronizer design that uses period 204 (and possibly derivatives of period 204) to predict the phase of Clk 202 on the next cycle of Clk 201—predicts forward six cycles of Clk 201.
In one embodiment, the edge detection unit 230 is configured to compute a third value corresponding to a third edge indication. The third value may be used to compute a slope of the relative period when at least one of the Clk 201 and the Clk 202 is changing smoothly. The slope may by used by a synchronization unit to predict a more accurate value of the future phase and future period. Predicting the values of the phase 203 and period 204 one or more clocks ahead is useful because the current phase 203 and period 204 are valid for several clock cycles of the Clk 201 in the past due to the latency of the high-frequency phase detector 200.
At an oldest edge 323, the first 310 value corresponding to a first edge indication at the start of period 312 is located by the edge detection unit 230 and the first 235-B value is computed by the edge detection unit 230. In this example assume that the first 235-B value equals 7 units of the delay 211. Therefore, the next phase is set to 7 by the phase unit 240 and the next period is computed as the difference between phase 203 summed with N=16 and first 310. The phase 203 and period 204 are updated at the clock edge 324. At a next edge 324, no edge indication is located by the edge detection unit 230 and, the next phase is updated by the phase unit 240 as the phase 203 increased by N=16 so that the phase 203 is updated to 7+16=23. The period 204 is unchanged.
At a most recent edge 325, the first 235-A value corresponding to another first edge indication at the end of the period 312 is located by the edge detection unit 230 and the first 235-A value is computed by the edge detection unit 230. In this example assume that this additional first 235-A value equals 6 units of the delay 211. Therefore, the next phase is set to 6 by the phase unit 240 and the next period is computed as the difference between phase 203 summed with N=16 and first 235-A, i.e., 23+16−6=33. The phase 203 and period 204 are updated at the clock edge 325.
At step 420, the phase unit 240 determines if a first edge indication was detected by the edge detection unit 230, and, if not, at step 425 the phase 203 is updated to the phase 203 increased by one period of Clk 201, e.g., phase+ONE. When first edge indication is not detected by the edge detection unit 230, the period 204 is not changed. Otherwise, when a first edge indication is detected, at step 430 the phase unit 240 sets the phase 203 equal to the first 235 signal generated by the edge detection unit 230. At step 435, the period unit 250 determines if a second edge indication is detected by the edge detection unit 230, and, if so, the at step 440 the period unit 250 sets the period 204 equal to the second 237 signal. Otherwise, at step 445, the period unit 250 updates the period 204 to the difference between the sum of the phase 203 and one period of the Clk 201 and the first 235 signal.
One or more bits of the transition signals 533, ti=Clk_pi & ˜Clk_pi-1 are true if a rising edge of the Clk 201 occurred between delayed versions of the Clk 201, Clk_di-1 and Clk_di, where i ranges from 0 to N. The transition signals 533, ti, are input to the edge identification unit 532 that finds the first one (where one is a bit that is true) in the sequence of transition signals 533. The binary encoding of the position at which the first edge is detected is rperiod 535—the period of Clk 301 in units of the delay of one delay 511.
First 235 is a measure (in units of time) from the rising edge of Clk 201 to the most recent transition of the Clk 202. If a transition is detected, e.g., first_v 236 is asserted, first 235 gives the phase value. When first_v 236 is asserted, the multiplexor 546 selects the first 235 value as the output, next phase. When a transition is not detected, e.g., first_v 236 is not asserted, the multiplexor 546 selects incremented phase 545 as the next phase. The incremented phase 545 value is computed by the adder 542 as the pre-divider phase incremented by rperiod 535.
The next_phase value is input to the phase register 544 that outputs the pre-divider phase signal. The following Verilog may be translated to generates at a least a portion of the logic shown in the phase unit 540, in particular to provide an input (next_phase) to the phase register 544:
assign next_phase=first—v?first:predivider_phase+rperiod;
The output of the phase register 544, e.g., pre-divider phase, is divided by rperiod 535 within the phase divider 548 to produce the phase 503 value.
If no transition is detected, e.g., neither first_v 236 nor second_v 238 is asserted, the next_period (and period 504) is unchanged. Otherwise, if two transitions are detected, e.g., first_v 236 and second_v 238 are both asserted, the next_period is computed by subtracting first 235 from the phase of the previous transition, second 237. If only one transition is detected, e.g., first_v 236 is asserted, the next_period is computed by subtracting first 235 from the phase of the previous transition, incremented phase 545. In other words, the current phase, first 235 is subtracted from the phase of the last transition—either second 237 if a second transition is detected in the same period of the Clk 201 or incremented phase 545 otherwise. The number of bits for dividers 548 and 552 is determined by the number of bits in rperiod 535, e.g., 4 bits if N=16. Note that N may be any integer value.
When a second transition is detected, a first transition is also detected. When second_v 238 is asserted, the multiplexor 556 selects the second 237 value as the input to the subtractor 557. When a second transition is not detected, the multiplexor 556 selects the incremented phase 245 as the input to the subtractor 557. The subtractor subtracts the first 235 value from the input to generate an output. When a first transition is detected, the multiplexor 558 selects the output of the subtractor 252 as the next period. Otherwise, the multiplexor 558 selects the output of the period register 554 as the next period and the period 504 value is unchanged.
The following Verilog may be translated to generate at a least a portion of the logic shown in the period unit 550, in particular to provide an input (next_period) to the period register 554:
assign next_period = first_v ?
(second_v ? second : (phase+rperiod)) − first) : period ;
The next_period value is input to the period register 554. The output of the period register 554, e.g., pre-divider period, is divided by rperiod 535 within the period divider 552 to produce the period 504 value.
At step 572, the Clk 201 is sampled by the clock sample unit 520 using the set delayed versions of the Clk 201 to produce the sequence of first clock samples 525 in the domain of the Clk 201. Then, at step 574, the period computation unit 530 locates an edge, e.g., rising, falling, or rising and falling, within the sequence of first clock samples 525 and determines the rperiod 535, e.g., the period of the Clk 201. One or more of steps 572 and 574 may be performed in parallel with one or more of steps 570 and 575.
At step 580, the phase unit 540 determines if a first edge indication was detected by the edge detection unit 230, and, if not, at step 585 the phase 503 is updated to the sum of the phase 503 increased by one period of the Clk 201 and divided by one period of the Clk 201, e.g., (phase+rperiod)/rperiod. When first edge indication is not detected by the edge detection unit 230, the period 504 is not changed. Otherwise, when a first edge indication is detected, at step 590, the phase unit 540 sets the phase 503 equal to the first 235 signal generated by the edge detection unit 230 divided by rperiod 535. At step 595, the period unit 550 determines if a second edge indication is detected by the edge detection unit 230, and, if so, then at step 598 the period unit 550 sets the period 504 equal to the second 237 signal divided by the rperiod 535. Otherwise, at step 598, the period unit 550 updates the period 504 to the difference between the sum of the phase 503 and one period of the Clk 201 and the first 235 signal divided by one period of the Clk 201 (i.e., rperiod 535).
The system 600 also includes input devices 612, a graphics processor 606, and a display 608, i.e. a conventional CRT (cathode ray tube), LCD (liquid crystal display), LED (light emitting diode), plasma display or the like. User input may be received from the input devices 612, e.g., keyboard, mouse, touchpad, microphone, and the like. In one embodiment, the graphics processor 606 may include a plurality of shader modules, a rasterization module, etc. Each of the foregoing modules may even be situated on a single semiconductor platform to form a graphics processing unit (GPU).
In the present description, a single semiconductor platform may refer to a sole unitary semiconductor-based integrated circuit or chip. It should be noted that the term single semiconductor platform may also refer to multi-chip modules with increased connectivity which simulate on-chip operation, and make substantial improvements over utilizing a conventional central processing unit (CPU) and bus implementation. Of course, the various modules may also be situated separately or in various combinations of semiconductor platforms per the desires of the user. One or more of the integrated circuits shown in
The system 600 may also include a secondary storage 610. The secondary storage 610 includes, for example, a hard disk drive and/or a removable storage drive, representing a floppy disk drive, a magnetic tape drive, a compact disk drive, digital versatile disk (DVD) drive, recording device, universal serial bus (USB) flash memory. The removable storage drive reads from and/or writes to a removable storage unit in a well-known manner.
Computer programs, or computer control logic algorithms, may be stored in the main memory 604 and/or the secondary storage 610. Such computer programs, when executed, enable the system 600 to perform various functions. The memory 604, the storage 610, and/or any other storage are possible examples of computer-readable media.
In one embodiment, the architecture and/or functionality of the various previous figures may be implemented in the context of the central processor 601, the graphics processor 606, an integrated circuit (not shown) that is capable of at least a portion of the capabilities of both the central processor 601 and the graphics processor 606, a chipset (i.e., a group of integrated circuits designed to work and sold as a unit for performing related functions, etc.), and/or any other integrated circuit for that matter.
Still yet, the architecture and/or functionality of the various previous figures may be implemented in the context of a general computer system, a circuit board system, a game console system dedicated for entertainment purposes, an application-specific system, and/or any other desired system. For example, the system 600 may take the form of a desktop computer, laptop computer, server, workstation, game consoles, embedded system, and/or any other type of logic. Still yet, the system 600 may take the form of various other devices including, but not limited to a personal digital assistant (PDA) device, a mobile phone device, a television, etc.
Further, while not shown, the system 600 may be coupled to a network (e.g., a telecommunications network, local area network (LAN), wireless network, wide area network (WAN) such as the Internet, peer-to-peer network, cable network, or the like) for communication purposes.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of a preferred embodiment should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
Dally, William J., Tell, Stephen G.
Patent | Priority | Assignee | Title |
10164758, | Nov 30 2016 | TAIWAN SEMICONDUCTOR MANUFACTURING CO , LTD | Read-write data translation technique of asynchronous clock domains |
10644865, | Nov 30 2016 | Taiwan Semiconductor Manufacturing Co., Ltd. | Read-write data translation technique of asynchronous clock domains |
9471091, | Nov 28 2012 | Nvidia Corporation | Periodic synchronizer using a reduced timing margin to generate a speculative synchronized output signal that is either validated or recalled |
Patent | Priority | Assignee | Title |
4295106, | Oct 04 1979 | Method and means for introducing additional asymmetry into audio waves | |
5309035, | Sep 23 1991 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Method and apparatus for clock skew reduction through absolute delay regulation |
5511100, | Dec 13 1993 | Motorola, Inc. | Method and apparatus for performing frequency detection |
5694377, | Apr 16 1996 | SILICON VALLEY BANK, AS ADMINISTRATIVE AGENT | Differential time interpolator |
6194938, | Sep 28 1998 | Texas Instruments Incorporated | Synchronous integrated clock circuit |
6219305, | Sep 17 1996 | XILINX, Inc.; Xilinx, Inc | Method and system for measuring signal propagation delays using ring oscillators |
6429693, | Jun 30 2000 | Texas Instruments Incorporated | Digital fractional phase detector |
6831490, | Jul 18 2000 | SAMSUNG ELECTRONICS CO , LTD | Clock synchronization circuit and method |
7180332, | Nov 28 2002 | Infineon Technologies AG | Clock synchronization circuit |
7304510, | Oct 13 2005 | SOCIONEXT INC | Digital phase detector improving phase detection resolution thereof |
7332940, | Mar 30 2005 | Kyocera Corporation | Voltage hold circuit and clock synchronization circuit |
7333151, | May 28 2004 | LAPIS SEMICONDUCTOR CO , LTD | Dot clock synchronization generator circuit |
7791377, | Jul 24 2007 | Korea University Industrial & Academic Collaboration Foundation | Hierarchical time to digital converter |
7804344, | Apr 20 2007 | U S BANK NATIONAL ASSOCIATION, AS COLLATERAL AGENT | Periodic signal synchronization apparatus, systems, and methods |
7855933, | Jan 08 2008 | Hynix Semiconductor Inc.; Hynix Semiconductor, Inc | Clock synchronization circuit and operation method thereof |
7999531, | Jun 22 2009 | Advantest Corporation | Phase detecting apparatus, test apparatus and adjusting method |
8018258, | Apr 20 2007 | U S BANK NATIONAL ASSOCIATION, AS COLLATERAL AGENT | Periodic signal synchronization apparatus, systems, and methods |
8098085, | Mar 30 2009 | Qualcomm Incorporated | Time-to-digital converter (TDC) with improved resolution |
8155236, | Jun 21 2002 | AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE LIMITED | Methods and apparatus for clock and data recovery using transmission lines |
8174293, | May 21 2009 | Kabushiki Kaisha Toshiba | Time to digital converter |
8415983, | Mar 10 2009 | NEC Corporation | Digital phase comparator |
8760204, | Nov 20 2012 | Nvidia Corporation | Variation-tolerant periodic synchronizer |
8866511, | Nov 20 2012 | Nvidia Corporation | Matrix phase detector |
20020158662, | |||
20020191727, | |||
20050195511, | |||
20060220694, | |||
20070165760, | |||
20080030509, | |||
20080303570, | |||
20090175116, | |||
20090184742, | |||
20100146320, | |||
20100321001, | |||
20110064176, | |||
20110102220, | |||
20110148490, | |||
20110148676, | |||
20110163787, | |||
20110243200, | |||
20120069884, | |||
20120303996, | |||
20120306893, | |||
20120319883, | |||
20130121094, | |||
20130343441, | |||
20140062553, | |||
20140064744, | |||
20140118030, | |||
20140133613, | |||
20140139175, | |||
20140139275, | |||
20140139276, | |||
20140149780, | |||
20140266336, | |||
20140266353, | |||
TW309923, | |||
TW361570, | |||
TW442947, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Nov 09 2012 | DALLY, WILLIAM J | Nvidia Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029638 | /0815 | |
Nov 09 2012 | TELL, STEPHEN G | Nvidia Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029638 | /0815 | |
Nov 13 2012 | Nvidia Corporation | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Mar 25 2019 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Mar 22 2023 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Oct 20 2018 | 4 years fee payment window open |
Apr 20 2019 | 6 months grace period start (w surcharge) |
Oct 20 2019 | patent expiry (for year 4) |
Oct 20 2021 | 2 years to revive unintentionally abandoned end. (for year 4) |
Oct 20 2022 | 8 years fee payment window open |
Apr 20 2023 | 6 months grace period start (w surcharge) |
Oct 20 2023 | patent expiry (for year 8) |
Oct 20 2025 | 2 years to revive unintentionally abandoned end. (for year 8) |
Oct 20 2026 | 12 years fee payment window open |
Apr 20 2027 | 6 months grace period start (w surcharge) |
Oct 20 2027 | patent expiry (for year 12) |
Oct 20 2029 | 2 years to revive unintentionally abandoned end. (for year 12) |