Duty ratio detection circuit and method, clock correction device and chip

The duty cycle detection circuit designed through digital circuits uses data selection and state machines to generate control signals, which solves the problems of inaccurate detection results and high power consumption in traditional circuits, and achieves precise clock signal correction for high-speed SerDes.

CN118826698APending Publication Date: 2024-10-22SHANGHAI FUDAN MICROELECTRONICS GROUP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310425145.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-19
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

The traditional duty cycle detection circuit relies on high-precision analog comparators, which results in high power consumption, large area, and inaccurate detection results. It is greatly affected by factors such as temperature and voltage, and it is difficult to ensure the quality of high-speed SerDes clock signals.

Method used

The duty cycle detection circuit designed by digital circuits divides the parallel sampling data into two channels through the data selection module. The detection module compares it with the set threshold, and the state machine generates phase and duty cycle control signals to realize the correction of the clock signal.

Benefits of technology

It improves the accuracy of duty cycle detection results, reduces sensitivity to temperature and voltage, reduces circuit area and power consumption, and ensures accurate clock signals for high-speed SerDes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118826698A_ABST
    Figure CN118826698A_ABST
Patent Text Reader

Abstract

The invention discloses a duty ratio detection method and circuit, a clock correction device and a chip. The duty ratio detection method comprises the following steps: dividing parallel sampling data into two paths of data; respectively comparing the two paths of data with a set threshold to obtain a comparison result; and generating a phase control signal and a duty ratio control signal for correcting the clock signal according to the two comparison results. By utilizing the scheme of the invention, the accuracy of a duty ratio detection result can be improved, so that an accurate clock signal is provided for high-speed SerDes, and the circuit area and the power consumption are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of circuit technology, and in particular to a duty cycle detection circuit and method, a clock correction device, and a chip. Background Art

[0002] FPGA (Field Programmable Gate Array) is a hardware reconfigurable architecture that is in great demand in aviation, industry, servers, and edge computing, and needs to support different protocol requirements. High-speed SerDes (Serializer Deserializer) is an important resource in FPGA. It is a device that converts parallel data into serial data for transmission and converts received serial data into parallel data. It is the physical layer of the protocol. RX (receiver) is the receiving end of SerDes. The framework of RX circuit 10 is shown in the figure. Figure 1 As shown, it mainly includes a CDR (Clock and Data Recovery) module 11, a CTLE (Continuous-Time Linear Equalizer) 12 and a serial-to-parallel conversion module 13. CTLE is essentially a high-pass filter used to compensate for channel bandwidth limitations, which can be implemented in both active and passive ways. In some high-speed applications with data rates greater than 20Gpbs, due to the need to sample the upper and lower edges simultaneously, even a small duty cycle distortion will have a huge impact on the performance of the system. However, factors such as chip process, temperature, voltage, and delays in electronic components can cause clock duty cycle distortion. Therefore, a duty cycle detection circuit is required to ensure the quality of the clock.

[0003] The traditional duty cycle detection circuit framework is as follows Figure 2 As shown, the differential clock signal is amplified by the differential amplifier circuit 20, and then filtered by the RC filter circuit 21. The filtering result is then used to obtain the direction of duty cycle distortion through the analog comparator 22, and the current duty cycle is calculated through the counter 23. Then, the duty cycle calibration is completed by adjusting the ratio of the pull-up PMOS and the pull-down NMOS in the differential amplifier 20.

[0004] The conventional duty cycle detection circuit is mainly based on the analog comparator 22 to generate a positive or negative bias signal, which requires the use of a high-precision, high-sensitivity analog comparator, which will correspondingly bring about greater power consumption and area. In addition, the RC filter circuit 21 outputs an analog signal, which is easily affected by factors such as process, temperature, and voltage, resulting in greater discreteness, causing the analog comparator 22 input voltage to drift, resulting in inaccurate detection results. Summary of the invention

[0005] Embodiments of the present invention provide a duty cycle detection circuit and method, a clock correction device, and a chip to improve the accuracy of the duty cycle detection result, thereby improving the precise clock signal for high-speed SerDes and reducing the circuit area and power consumption.

[0006] On the one hand, an embodiment of the present invention provides a duty cycle detection circuit, the circuit comprising: a data selection module, two detection channels, and a state machine; the detection channel comprises a detection module;

[0007] The data selection module is used to input parallel sampling data, divide the parallel sampling data into two paths of detection data, one path is rising edge sampling data, and the other path is falling edge sampling data, and input the two paths of detection data into corresponding detection channels respectively;

[0008] The detection module is used to compare the detection data of the input detection channel with the set threshold and output the comparison result;

[0009] The state machine is used to generate a phase control signal for adjusting the clock signal according to the two-way comparison results, and to generate a duty cycle control signal by adjusting the phase control signal.

[0010] Optionally, the parallel sampling data is data obtained by frequency-dividing and sampling the clock signal and performing serial-to-parallel conversion.

[0011] Optionally, the two-way detection data is: 2m×N~2(m+1)×N, wherein N is the frequency division number of the clock signal, m is an integer, and when m is an odd number, the corresponding data is the rising edge sampling data, and when m is an even number, the corresponding data is the falling edge sampling data.

[0012] Optionally, the detection module includes: an integrator and a comparator;

[0013] The integrator is used to integrate the detection data to obtain an integrated signal;

[0014] The comparator is used to compare the integrated signal with the set threshold and output the comparison result.

[0015] Optionally, the state machine is specifically used to generate a phase control signal based on the two comparison results, adjust the size of the phase control signal and respectively determine the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped; and generate a duty cycle control signal based on the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped.

[0016] On the other hand, an embodiment of the present invention further provides a duty cycle detection method, the method comprising:

[0017] The parallel sampling data is divided into two paths of detection data, one of which is rising edge sampling data and the other is falling edge sampling data;

[0018] Compare the two detection data with the set thresholds respectively to obtain two comparison results;

[0019] A phase control signal for adjusting the clock signal is generated according to the two comparison results, and a duty cycle control signal is generated by adjusting the phase control signal.

[0020] Optionally, the parallel sampling data is data obtained by frequency-dividing and sampling the clock signal and performing serial-to-parallel conversion.

[0021] Optionally, generating a phase control signal and a duty cycle control signal for correcting the clock signal according to the two-path comparison results includes:

[0022] Generate a phase control signal according to the two-path comparison results;

[0023] Adjust the magnitude of the phase control signal and respectively determine the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped;

[0024] A duty cycle control signal is generated according to the values ​​M1 and M2 of the phase control signals corresponding to when the two comparison results are flipped.

[0025] Optionally, the adjusting the magnitude of the phase control signal and respectively determining the values ​​of the phase control signal when the two comparison results are flipped includes:

[0026] Coarsely adjusting the phase control signal, and after detecting that both comparison results of the two paths are flipped for the first time, finely adjusting the phase control signal;

[0027] Respectively record the values ​​of the phase control signals when the two comparison results are flipped during the forward search and backward search processes during fine adjustment;

[0028] For each detection result, the value of the phase control signal when the corresponding comparison result is flipped is calculated based on the value of the phase control signal when flipping occurs in the corresponding forward search and backward search processes.

[0029] Optionally, generating a duty cycle control signal according to the values ​​M1 and M2 of the phase control signals corresponding to when the two comparison results are flipped includes:

[0030] If the difference between the values ​​of the corresponding phase control signals M1 and M2 when the two comparison results are flipped is greater than 1 / 2 of the clock cycle, a duty cycle control signal indicating a reduction in the clock duty cycle is output; otherwise, a duty cycle control signal indicating an increase in the clock is output.

[0031] On the other hand, an embodiment of the present invention further provides a clock correction device, the device comprising: a sampling module, a serial-to-parallel conversion module, a duty cycle correction module, a phase correction module, and a duty cycle detection circuit;

[0032] The sampling module is used to sample the clock signal to obtain serial sampling data;

[0033] The serial-to-parallel conversion module is used to convert the serial sampled data into parallel sampled data of a set bit width;

[0034] The duty cycle detection circuit is used to perform duty cycle detection based on the parallel sampling data, and output a duty cycle control signal and a phase control signal according to the detection result;

[0035] The duty cycle correction module is used to input a reference clock, perform duty cycle correction on the reference clock according to the duty cycle control signal, and output a first corrected clock;

[0036] The phase correction module is used to shift the phase of the first correction clock according to the phase control signal and output the clock signal.

[0037] Optionally, the sampling module is specifically used to sample the input signal based on the clock signal to obtain serial sampling data, and the input signal is an N-divided clock signal of the sampling clock, N≥2, and N is an even number.

[0038] Optionally, the sampling module is specifically used to sample the input signal based on the rising and falling edges of the clock signal to obtain serial sampling data.

[0039] Optionally, the clock signal is a working clock of a high-speed SerDes.

[0040] On the other hand, an embodiment of the present invention further provides a chip, which includes the above-mentioned duty cycle detection circuit, or includes the above-mentioned clock correction device.

[0041] The duty cycle detection circuit and method provided by the embodiment of the present invention divides the parallel sampling data into two detection data, compares the two data with the set threshold respectively, and obtains two comparison results; then generates a phase control signal for adjusting the clock signal according to the two comparison results, and generates a duty cycle control signal by adjusting the phase control signal. The scheme of the present invention can be fully implemented by digital circuits, reducing the sensitivity to external factors such as temperature and voltage, thereby effectively improving the accuracy of the duty cycle detection results, and reducing the circuit area and power consumption.

[0042] Accordingly, the clock correction device provided in the embodiment of the present invention utilizes the duty cycle detection circuit to detect the duty cycle of the clock signal, and corrects the clock according to the detection result, so as to obtain an accurate clock signal, ensure the clock quality, improve the accurate clock signal for high-speed SerDes, and meet the application requirements of high-speed SerDes. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of the RX circuit structure of the traditional SerDes;

[0044] Figure 2 It is a schematic diagram of the structure of a traditional duty cycle detection circuit;

[0045] Figure 3 is a structural schematic diagram of a clock correction device provided by an embodiment of the present invention;

[0046] Figure 4 is a structural schematic diagram of a duty cycle detection circuit provided by an embodiment of the present invention;

[0047] Figure 5 This is an example of dividing parallel sampling data into two paths of data in an embodiment of the present invention;

[0048] Figure 6 is a control flow chart of a state machine in a duty cycle detection circuit according to an embodiment of the present invention;

[0049] Figure 7 Schematic diagram of the relationship between clock signals corresponding to three flips of comparators in two channels in an embodiment of the present invention;

[0050] Figure 8 It is a flow chart of a duty cycle detection method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The principle and spirit of the present invention will be described below with reference to the exemplary embodiments shown in the accompanying drawings. It should be understood that these embodiments are described only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way.

[0052] Duty cycle refers to the ratio of pulse width to period within a pulse signal cycle. The ideal clock model is a square wave with a duty cycle of 50% and a fixed period. Therefore, in order to ensure the quality of the clock, it is necessary to detect the clock duty cycle, and then the clock duty cycle can be corrected according to the detection result to ensure the accuracy of the clock signal. However, the traditional duty cycle detection circuit requires the use of a high-precision, high-sensitivity analog comparator, which will bring about problems such as inaccurate detection results. To this end, the embodiments of the present invention provide a duty cycle detection method and circuit, a clock correction device, and a chip, which can determine the direction of duty cycle offset through a digital comparator, reduce the influence of factors such as temperature and voltage on the circuit, and effectively improve the accuracy of the detection result.

[0053] The duty cycle detection circuit and method provided in the embodiment of the present invention can be used to correct the clock, that is, to correct the clock signal according to the duty cycle detection result. In order to more clearly explain the duty cycle detection circuit of the present invention, the clock correction device based on the duty cycle detection circuit is first described below.

[0054] Reference Figure 3 , is a schematic diagram of a structure of a clock correction device provided by an embodiment of the present invention. The clock correction device 300 includes the following modules:

[0055] The sampling module 301 is used to sample the clock signal to obtain serial sampling data;

[0056] A serial-to-parallel conversion module 302, used to convert the serial sampled data into parallel sampled data of a set bit width;

[0057] A duty cycle detection circuit 303, configured to perform duty cycle detection based on the parallel sampling data, and output a duty cycle control signal and a phase control signal according to the detection result;

[0058] The duty cycle correction module 304 is used to input a reference clock, perform duty cycle correction on the reference clock according to the duty cycle control signal, and output a first corrected clock;

[0059] The phase correction module 305 is used to perform phase shifting on the first correction clock according to the phase control signal and output the clock signal. For example, a phase interpolator (PI) may be used to implement this.

[0060] The sampling module 301 is specifically used to sample the input signal based on the clock signal to obtain serial sampling data.

[0061] In a specific application, a clock signal divided by N of the sampling clock may be used as the input signal, wherein N≥2 and N is an even number. For example, the input signal may be a clock signal divided by 2 or divided by 4.

[0062] It should be noted that the sampling module 301 may sample the clock signal by sampling the input signal based on the rising and falling edges of the clock signal to obtain serial sampling data.

[0063] In this embodiment, the duty cycle correction module 304 can correct the duty cycle of the clock signal according to the duty cycle control signal of the duty cycle detection circuit 303. For example, when the duty cycle control signal C=1 output by the duty cycle detection circuit 303 indicates to reduce the duty cycle of the clock signal, the duty cycle correction module 304 reduces the clock signal by a set value (i.e., the reduction amplitude); when the duty cycle control signal C=0 output by the duty cycle detection circuit 303 indicates to increase the duty cycle of the clock signal, the duty cycle correction module 304 increases the clock signal by a set value (i.e., the reduction amplitude).

[0064] It should be noted that, generally, the magnitude of each increase and decrease of the duty cycle may be the same, and the magnitude may be specifically set according to different requirements for adjustment accuracy, which is not limited in the embodiment of the present invention.

[0065] Of course, in practical applications, the specific form of the above duty cycle control signal is only an example. In specific applications, there may be other representation methods, which are not limited in the embodiments of the present invention.

[0066] The clock signal can be used as a working clock of a high-speed SerDes, and of course can also be used as a clock signal required in other applications, which is not limited in the embodiment of the present invention.

[0067] The duty cycle detection circuit 303 provided in the embodiment of the present invention can be completely implemented by a digital circuit, such as Figure 4 , which is a structural diagram of the duty cycle detection circuit 303 .

[0068] Reference Figure 4 The duty cycle detection circuit 303 includes: a data selection module 331, two detection channels 1 and 2, and a state machine 333, wherein the detection channel includes a detection module.

[0069] The data selection module 331 is used to input parallel sampling data, divide the parallel sampling data into two detection data, one of which is rising edge sampling data and the other is falling edge sampling data, and input the two detection data into corresponding detection channels respectively. Figure 4 Detection channel 1 and detection channel 2 in;

[0070] The detection module of each detection channel is used to compare the detection data input into the detection channel with the set threshold and output the comparison result;

[0071] The state machine 333 is used to generate a phase control signal M for adjusting the clock signal according to the two-way comparison results, and to generate a duty cycle control signal C by adjusting the phase control signal M.

[0072] Also refer to Figure 3 The parallel sampling data is data obtained by performing frequency division sampling (for example, it can be 2-division or 4-division, etc.) on the clock signal and performing serial-to-parallel conversion.

[0073] The data selection module 331 divides the parallel sampling data into two data paths, one of which is odd data path and the other is even data path; the two data paths are: 2m×N~2(m+1)×N, where N is the frequency division number of the clock signal, m is an integer, and the data corresponding to when m is an odd number is used as the odd data path, and the data corresponding to when m is an even number is used as the even data path. For example, the odd data path is input into detection channel 1, and the even data path is input into detection channel 2.

[0074] For example, taking the 4-frequency 16-bit parallel data bit width as an example, the 15th, 13th, 7th, and 5th bits of data are selected as the data of detection channel 1, such as Figure 5 As shown by the dotted arrows in , the 14th, 12th, 6th, and 4th bits of data are selected as the data of detection channel 2, such as Figure 5 As shown by the solid arrow in .

[0075] In a non-limiting embodiment, Figure 4 As shown, the detection module may include: an integrator and a comparator.

[0076] The integrator is used to integrate the input data of the detection module to obtain an integration result;

[0077] The comparator is used to compare the integration result with the set threshold and output the comparison result.

[0078] The size of the set threshold is positively correlated with the bit width of the parallel data and the number of integration times of the integrator. For example, taking the bit width of 16-bit parallel data divided by 4 as an example, the 15th, 13th, 7th, and 5th bits of data are selected as the data of detection channel 1, such as Figure 5 As shown by the dotted arrows in , the 14th, 12th, 6th, and 4th bits of data are selected as the data of detection channel 2, such as Figure 5As shown by the solid arrow in the figure. If the number of integrations of the integrator is selected as 16, then the probability of sampling at the edge of the data is 50% as the basis for setting the threshold. At this time, the threshold size should be 3×16=48. 3 refers to Figure 5 When the clock samples a single channel (such as the dotted arrow) at the data edge, the number of 1s sampled should be 1×50%+1+1×50%+1=3, and 16 refers to the number of integration times of the integrator.

[0079] Accordingly, the state machine 333 can generate a phase control signal M according to the two-way comparison results, adjust the size of the phase control signal M (i.e., change the phase of the clock signal), and respectively determine the values ​​M1 and M2 of the phase control signal corresponding to when the two-way comparison results are flipped; and generate a duty cycle control signal according to the values ​​M1 and M2 of the phase control signal corresponding to when the two-way comparison results are flipped. Specifically, the state machine 333 determines whether the duty cycle is greater than 50% at this time according to whether the result of M1-M2 is greater than 1 / 2 of the clock cycle. If the duty cycle is greater than 50%, a duty cycle control signal for indicating a reduction in the clock duty cycle can be output, so that Figure 3 The duty cycle correction module 304 in the embodiment reduces the duty cycle of the clock signal; otherwise, a duty cycle control signal for indicating to increase the clock is output, so that Figure 3 The duty cycle correction module 304 in increases the duty cycle of the clock signal.

[0080] Figure 6 It is a control flow chart of a state machine in a duty cycle detection circuit according to an embodiment of the present invention.

[0081] In the initial state, first, in step 601, a coarse forward search is performed until the comparator output result is flipped.

[0082] It should be noted that, during the coarse adjustment, the phase control signal M may be increased by a certain step length A each time. In addition, the reversal of the comparator output result means that the output results of the comparators of the two detection paths are both reversed.

[0083] For example, for Figure 5 The parallel sampling data shown in the figure is used for coarse adjustment forward search. The comparator output result of detection channel 1 is flipped for the first time, and then the comparator output result of detection channel 2 is flipped for the first time. Figure 7 (a) shown.

[0084] Then, in step 602, a fine-tuning reverse search is performed until the comparator output result is flipped, and the value of the phase control signal M at this time is recorded as Ma1 and Ma2, wherein Ma1 is the value of the phase control signal M when the comparator output result of detection channel 1 is flipped during the fine-tuning process, and Ma2 is the value of the phase control signal M when the comparator output result of detection channel 2 is flipped.

[0085] The reverse search means that relative to the adjustment direction of the current coarse adjustment, the current coarse adjustment process is a forward search, and the reverse search is a backward search, that is, during fine adjustment, the phase control signal M is reduced by a certain step size B each time. Similarly, the comparator output result flipping means that the output results of the comparators of the two detection paths are flipped.

[0086] for example, Figure 7 As shown in (b), the comparator output result of detection channel 2 is flipped for the second time first, and then the comparator output result of detection channel 1 is flipped for the second time.

[0087] It should be noted that the step length B should be smaller than the step length A. The specific values ​​of step length A and step length B can be set according to the clock accuracy requirements in the application. For example, step A can be 4, step B can be 1, and so on.

[0088] In step 603, a fine-tuning forward search is performed until the comparator output result is flipped, and the value of the phase control signal M at this time is recorded as Mb1 and Mb2, wherein Mb1 is the value of the phase control signal M when the comparator output result of detection channel 1 is flipped during the fine-tuning process, and Mb2 is the value of the phase control signal M when the comparator output result of detection channel 2 is flipped.

[0089] Similarly, the fine adjustment forward search refers to increasing the phase control signal M by a certain step size B each time. Similarly, the comparator output result flipping refers to the output results of the comparators of the two detection paths flipping.

[0090] In step 604, the phase control value M1 at the time when the comparator output result of detection channel 1 is flipped and the phase control value M2 at the time when the comparator output result of detection channel 2 is flipped are calculated, where:

[0091] M1=(Ma1+Mb1) / 2;

[0092] M2=(Ma2+Mb2) / 2.

[0093] Since the input data of detection channel 1 and detection channel 2 are the sampling data of the rising edge and falling edge of the clock signal respectively, the difference between M1 and M2 is compared to see whether it exceeds 1 / 2 clock cycle, that is, in step 605, it is determined whether M1-M2 is greater than 1 / clock cycle. If yes, step 606 is executed; otherwise, step 607 is executed.

[0094] In step 606, a duty cycle control signal for instructing to reduce the clock duty cycle is output, ie, C=1.

[0095] In step 607, a duty cycle control signal for instructing to increase the clock is output, ie, C=0.

[0096] It should be noted that in the above Figure 6 In the flow shown, the coarse adjustment process is to first perform a forward search, that is, increase the phase control signal M by a larger value A. Of course, in practical applications, a backward search can also be performed first, that is, the phase control signal M is reduced by a larger value A until the comparator output result is reversed. Correspondingly, the reverse search at the beginning of fine adjustment is to first increase the phase control signal M by a smaller value B until the comparator output result is reversed, and then enter the fine adjustment backward search, that is, reduce the control signal M by the value B until the comparator output result is reversed.

[0097] In addition, the above-mentioned indication method of the duty cycle control signal for indicating the reduction and increase of the spatiotemporal duty cycle is only an example. In practical applications, other indication methods may be used, which are not limited in the embodiments of the present invention.

[0098] The duty cycle detection circuit provided by the embodiment of the present invention divides the parallel sampling data into two detection data, compares the two data with the set threshold respectively, and obtains two comparison results; then generates a phase control signal for adjusting the clock signal according to the two comparison results, and generates a duty cycle control signal by adjusting the phase control signal. The scheme of the present invention can be completely implemented by digital circuits, reducing the sensitivity to external factors such as temperature and voltage, thereby effectively improving the accuracy of the duty cycle detection result, and reducing the circuit area and power consumption.

[0099] Accordingly, an embodiment of the present invention further provides a duty cycle detection method, such as Figure 8 FIG. 1 is a flow chart of a duty cycle detection method provided by an embodiment of the present invention, comprising the following steps:

[0100] Step 801, dividing the parallel sampling data into two paths of data.

[0101] The parallel sampling data is data obtained by frequency-dividing and sampling the clock signal and performing serial-to-parallel conversion.

[0102] The parallel sampling data is divided into two paths of data, one of which is odd-path data and the other is even-path data; the two paths of data are: 2m×N~2(m+1)×N, where N is the frequency division number of the clock signal, m is an integer, and the data corresponding to when m is an odd number is used as the odd-path data, and the data corresponding to when m is an even number is used as the even-path data.

[0103] Step 802: Compare the two paths of data with the set thresholds respectively to obtain comparison results.

[0104] Step 803: Generate a phase control signal and a duty cycle control signal for correcting the clock signal according to the two comparison results.

[0105] Specifically, a phase control signal is generated according to the two comparison results; the size of the phase control signal is adjusted and the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped are determined respectively; and a duty cycle control signal is generated according to the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped.

[0106] The process of adjusting the size of the phase control signal can refer to the previous description, that is, the phase control signal is first coarsely adjusted, and after detecting that the two comparison results have flipped for the first time, the phase control signal is fine-tuned; the values ​​of the phase control signals when the two comparison results are flipped during the forward search and backward search during fine adjustment are recorded separately; then for each detection result, the value of the phase control signal when the corresponding comparison result is flipped is calculated based on the value of the phase control signal when the flip occurs during the corresponding forward search and backward search.

[0107] By utilizing the duty cycle detection method provided by the embodiment of the present invention, the accuracy of the duty cycle detection result can be effectively improved, and the circuit area and power consumption can be reduced.

[0108] Correspondingly, an embodiment of the present invention further provides a chip, wherein the chip includes the duty cycle detection circuit described above, or includes the clock correction device described above.

[0109] In a specific implementation, each module / unit included in each device or product described in the above embodiments may be a software module / unit or a hardware module / unit, or may be partly a software module / unit and partly a hardware module / unit.

[0110] For example, for each device or product applied to or integrated in a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated in a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The element can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0111] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A duty cycle detection circuit, characterized in that: The circuit includes: a data selection module, two detection channels, and a state machine; the detection channel includes a detection module; The data selection module is used to input parallel sampling data, divide the parallel sampling data into two paths of detection data, one path is rising edge sampling data, and the other path is falling edge sampling data, and input the two paths of detection data into corresponding detection channels respectively; The detection module is used to compare the detection data of the input detection channel with the set threshold and output the comparison result; The state machine is used to generate a phase control signal for adjusting the clock signal according to the two-way comparison results, and to generate a duty cycle control signal by adjusting the phase control signal.

2. The duty cycle detection circuit according to claim 1, characterized in that: The parallel sampling data is data obtained by frequency-dividing and sampling the clock signal and performing serial-to-parallel conversion.

3. The duty cycle detection circuit according to claim 1, characterized in that: The two-way detection data is: 2m×N~2(m+1)×N, where N is the frequency division number of the clock signal, m is an integer, and when m is an odd number, the corresponding data is the rising edge sampling data, and when m is an even number, the corresponding data is the falling edge sampling data.

4. The duty cycle detection circuit according to claim 1, characterized in that: The detection module includes: an integrator and a comparator; The integrator is used to integrate the detection data to obtain an integrated signal; The comparator is used to compare the integrated signal with the set threshold and output the comparison result.

5. The duty cycle detection circuit according to any one of claims 1 to 4, characterized in that: The state machine is specifically used to generate a phase control signal according to the two comparison results, adjust the size of the phase control signal and respectively determine the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped; and generate a duty cycle control signal according to the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped.

6. A duty cycle detection method, characterized in that: The method comprises: The parallel sampling data is divided into two paths of detection data, one of which is rising edge sampling data and the other is falling edge sampling data; Compare the two detection data with the set thresholds respectively to obtain two comparison results; A phase control signal for adjusting the clock signal is generated according to the two comparison results, and a duty cycle control signal is generated by adjusting the phase control signal.

7. The duty cycle detection method according to claim 6, characterized in that: The parallel sampling data is data obtained by frequency-dividing and sampling the clock signal and performing serial-to-parallel conversion.

8. The duty cycle detection method according to claim 6 or 7, characterized in that: The generating of the phase control signal and the duty cycle control signal for correcting the clock signal according to the two-path comparison results comprises: Generate a phase control signal according to the two-path comparison results; Adjust the magnitude of the phase control signal and respectively determine the values ​​M1 and M2 of the phase control signal corresponding to when the two comparison results are flipped; A duty cycle control signal is generated according to the values ​​M1 and M2 of the phase control signals corresponding to when the two comparison results are flipped.

9. The duty cycle detection method according to claim 8, characterized in that: The adjusting the magnitude of the phase control signal and respectively determining the value of the phase control signal when the two comparison results are flipped comprises: Coarsely adjusting the phase control signal, and after detecting that both comparison results of the two paths are flipped for the first time, finely adjusting the phase control signal; Respectively record the values ​​of the phase control signals when the two comparison results are flipped during the forward search and backward search processes during fine adjustment; For each detection result, the value of the phase control signal when the corresponding comparison result is flipped is calculated based on the value of the phase control signal when flipping occurs in the corresponding forward search and backward search processes.

10. The duty cycle detection method according to claim 8, characterized in that: The step of generating a duty cycle control signal according to the values ​​M1 and M2 of the phase control signals corresponding to the flipping of the two comparison results comprises: If the difference between the values ​​of the corresponding phase control signals M1 and M2 when the two comparison results are flipped is greater than 1 / 2 of the clock cycle, a duty cycle control signal indicating a reduction in the clock duty cycle is output; otherwise, a duty cycle control signal indicating an increase in the clock is output.

11. A clock correction device, characterized in that: The device comprises: a sampling module, a serial-to-parallel conversion module, a duty cycle correction module, a phase correction module, and a duty cycle detection circuit according to any one of claims 1 to 5; The sampling module is used to sample the clock signal to obtain serial sampling data; The serial-to-parallel conversion module is used to convert the serial sampled data into parallel sampled data of a set bit width; The duty cycle detection circuit is used to perform duty cycle detection based on the parallel sampling data, and output a duty cycle control signal and a phase control signal according to the detection result; The duty cycle correction module is used to input a reference clock, perform duty cycle correction on the reference clock according to the duty cycle control signal, and output a first corrected clock; The phase correction module is used to shift the phase of the first correction clock according to the phase control signal and output the clock signal.

12. The clock correction device according to claim 11, characterized in that: The sampling module is specifically used to sample the input signal based on the clock signal to obtain serial sampling data, and the input signal is an N-divided clock signal of the sampling clock, N≥2, and N is an even number.

13. The clock correction device according to claim 12, characterized in that: The sampling module is specifically used to sample the input signal based on the rising and falling edges of the clock signal to obtain serial sampling data.

14. The clock correction device according to any one of claims 11 to 13, characterized in that: The clock signal is the working clock of the high-speed SerDes.

15. A chip, characterized in that: The chip includes the duty cycle detection circuit as described in any one of claims 1 to 5, or includes the clock correction device as described in any one of claims 11 to 14.

Citation Information

Cited By

  • Duty ratio and orthogonal four-phase clock detection and correction circuit

    CN120880396A