Clock adjustment circuit, chip, electronic equipment and method for improving clock skew

By designing a clock adjustment circuit in the SOC chip and using phase detection and controller to adjust the phase delay of the clock management module, the problem of phase difference between clock signals is solved and the frequency and performance of the chip are improved.

CN118708019APending Publication Date: 2024-09-27HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410773309.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In SOC chip design, due to factors such as parasitic mismatch, clock path mismatch, and voltage differences in physical implementation, the phase difference (clock skew) between clock signals cannot meet design expectations, thereby affecting the function and performance of the chip.

Method used

Design a clock adjustment circuit, including first and second clock management modules, a phase detection module and a controller. The phase detection module detects the phase relationship between clock signals, and according to the detection results, the controller adjusts the clock management module. Phase delay makes the phase of the clock signal consistent, thereby reducing clock skew.

Benefits of technology

It effectively reduces the clock skew between the internal clocks of the chip, improves the operating frequency and performance of the chip, ensures the phase consistency between clock signals, and avoids functional errors caused by clock inconsistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708019A
    Figure CN118708019A
Patent Text Reader

Abstract

The invention relates to a clock adjustment circuit, an SOC chip, electronic equipment and a method for improving clock skew, and belongs to the field of electronic circuits. The clock adjusting circuit comprises a first clock management module, a second clock management module, a phase detection module and a controller. The first clock management module is configured to adjust a phase delay of an input clock signal and generate a first clock signal based on the adjusted input clock signal. The second clock management module is configured to adjust a phase delay of the input clock signal and generate a second clock signal based on the adjusted input clock signal. The phase detection module is connected with the first clock management module and the second clock management module, and the phase detection module is configured to detect the phase relation of the first clock signal relative to the second clock signal. And the controller is respectively connected with the phase detection module, the first clock management module and the second clock management module, and the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relation so as to enable the phase of the first clock signal to be consistent with the phase of the second clock signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic circuits, and specifically relates to a clock adjustment circuit, a SOC chip, an electronic device, and a method for improving clock skew. Background Art

[0002] In SOC (System on Chip) design, a large clock tree or clock mesh is often required to drive the load. In some designs, such as Figure 1 In the logic circuit shown in FIG. 1 , the phase difference between the clock signals launch_ck and capture_ck is usually required to be within a reasonable range, wherein the clock signals (launch_ck and capture_ck) are derived from different clock trees or clock networks, such as Figure 2 However, in actual implementation and chip manufacturing, there are some non-ideal factors, such as parasitic mismatch, clock path mismatch, voltage difference, etc. in physical implementation, which lead to the phase difference between lauch_ck and capture_ck deviating from the design expectation, which may cause Figure 1 The trigger (DelayFlip Flop, DFF) in the circuit has a setup time (establishment time) or hold time (hold time) timing violation, resulting in functional errors. Figure 3 In the consistent FIFO (First In First Out) design shown in the figure, the read and write clocks (write_ck and read_ck) of the consistent FIFO usually also need a relatively certain phase difference. If the phase difference between write_ck and read_ck does not meet the design expectations after chip manufacturing, it will cause consistent FIFO function errors. Especially as the scale of SOC chips becomes larger and larger, when the clock network distance is relatively far, the clock skew will increase, thereby affecting the function of the SOC chip or reducing performance. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a clock adjustment circuit, a SOC chip, an electronic device and a method for improving clock skew, so as to reduce the problem of clock skew between clocks inside the chip.

[0004] The embodiment of the present application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a clock adjustment circuit, comprising: a first clock management module, a second clock management module, a phase detection module and a controller; the first clock management module is configured to adjust the phase delay of an input clock signal, and generate a first clock signal based on the adjusted input clock signal, wherein the driving capability of the first clock signal is stronger than the driving capability of the input clock signal; the second clock management module is configured to adjust the phase delay of the input clock signal, and generate a second clock signal based on the adjusted input clock signal, wherein the driving capability of the second clock signal is stronger than the driving capability of the input clock signal; the phase detection module is respectively connected to the first clock management module and the second clock management module, and the phase detection module is configured to detect the phase relationship of the first clock signal relative to the second clock signal; the controller is respectively connected to the phase detection module, the first clock management module and the second clock management module, and the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship so that the phases of the first clock signal and the second clock signal are consistent.

[0006] In the above embodiment, a phase detection module is used to detect the phase relationship of the first clock signal relative to the second clock signal, and based on the phase relationship, the phase delay of the first clock management module and / or the second clock management module is adjusted to reduce the clock skew between the internal clocks of the chip, so that the phases of the first clock signal and the second clock signal are consistent, thereby increasing the chip operating frequency and improving chip performance.

[0007] In combination with a possible implementation manner of the first aspect embodiment, the controller is specifically configured to control the first clock management module to increase the phase delay, and / or control the second clock management module to reduce the phase delay if the phase of the first clock signal is ahead of the second clock signal; if the phase of the first clock signal is behind the second clock signal, control the first clock management module to reduce the phase delay, and / or control the second clock management module to increase the phase delay.

[0008] In the above embodiment, the first clock management module and / or the second clock management module are adjusted according to the phase relationship between the first clock signal and the second clock signal and the above method is adopted, so that the phases of the first clock signal and the second clock signal can be quickly made consistent.

[0009] In combination with a possible implementation manner of the first aspect embodiment, the controller is also configured to record the number of flipping times of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flipping times reaches a preset number, suspend adjusting the phase delay of the first clock management module and / or the second clock management module.

[0010] In the above embodiment, by introducing a preset number of times, when the number of flipping times reaches the preset number of times (configurable, such as 5 times), the phase of the first clock signal and the second clock signal is assumed to be consistent, thereby suspending the adjustment of the phase delay of the first clock management module and / or the second clock management module, thereby speeding up the adjustment efficiency and avoiding the situation where the adjustment is continuous due to the phase inconsistency between the first clock signal and the second clock signal.

[0011] In combination with a possible implementation manner of the embodiment of the first aspect, the input clock signal is a low-frequency input clock signal or a high-frequency input clock signal; the controller is also configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, the phase delay of the first clock management module and / or the second clock management module is adjusted based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal, so that the phases of the first clock signal and the second clock signal under the high-frequency input clock signal are consistent.

[0012] In the above embodiment, when performing clock deskew, it is divided into two processes: low-frequency clock deskew (for example, the frequency is less than or equal to 100 MHz) and high-frequency clock deskew (the frequency is the clock frequency of the chip). After the low-frequency clock deskew is completed (that is, after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent), skew elimination under the high-frequency clock is performed to ensure that the phase difference of the input clock signal can meet the input range requirement of the phase detection module, thereby reducing the delay adjustment error and deskew failure caused by the error in the detection result of the phase detection module.

[0013] In combination with a possible implementation manner of the embodiment of the first aspect, the clock adjustment circuit also includes: a selector, connected to the first clock management module and the second clock management module respectively; the first input end of the selector is used to receive a low-frequency input clock signal, the second input end of the selector is used to receive a high-frequency input clock signal, and the selection end of the selector is used to receive a selection control signal; when the first input end of the selector is connected to its output end, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal; when the second input end of the selector is connected to its output end, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal.

[0014] In the above embodiment, a selector is introduced to select whether the input clock signal connected to the first clock management module and the second clock management module is a low-frequency input clock signal or a high-frequency input clock signal, so that the controller can perform low-frequency clock deskew or high-frequency clock deskew.

[0015] In combination with a possible implementation manner of the embodiment of the first aspect, if the input clock signal is a low-frequency input clock signal, and the output data of the phase detection module is all 0 or contains 0 and 1; the controller is configured to: control the second clock management module to increase the phase delay until the output data is all 1, and record the first delay gear of the second clock management module; then control the second clock management module to reduce the phase delay, if the delay gear of the second clock management module is not adjusted to the minimum gear and the output data is all 0, record the second delay gear of the second clock management module when the output data is all 0, and then control the delay gear of the first clock management module to be the minimum gear, The delay gear of the second clock management module is controlled to be the average of the first delay gear and the second delay gear; if the output data is not all 0 when the delay gear of the second clock management module has been adjusted to the minimum gear, the first clock management module is controlled to increase the phase delay, and the third delay gear of the first clock management module is recorded when the output data is all 0; then the second clock management module is controlled to increase the phase delay until the output data is all 1, and the fourth delay gear of the second clock management module is recorded, then the delay gear of the first clock management module is controlled to be the third delay gear, and the delay gear of the second clock management module is controlled to be half of the fourth delay gear.

[0016] In the above embodiment, when performing a low-frequency clock deskew, if the output data of the phase detection module is all 0, it indicates that the first clock signal is lagging, or the output data of the phase detection module contains 0 and 1, it indicates that the phases of the first clock signal and the second clock signal are close, and in combination with the above-mentioned adjustment method, the phases of the first clock signal and the second clock signal can be quickly made consistent.

[0017] In combination with a possible implementation manner of the embodiment of the first aspect, if the input clock signal is a low-frequency input clock signal, and the output data of the phase detection module are all 1; the controller is configured to: control the first clock management module to increase the phase delay until the output data are all 0, and record the fifth delay gear of the first clock management module; then control the first clock management module to reduce the phase delay, if the delay gear of the first clock management module is not adjusted to the minimum gear and the output data are all 1, record the sixth delay gear of the first clock management module when the output data are all 1, then control the delay gear of the second clock management module to the minimum gear, and control the The delay gear of the first clock management module is the average of the fifth delay gear and the sixth delay gear; if the output data is not all 1 when the delay gear of the first clock management module has been adjusted to the minimum gear, the second clock management module is controlled to increase the phase delay, and the seventh delay gear of the second clock management module is recorded when the output data is all 1; then the first clock management module is controlled to increase the phase delay until the output data is all 0, and the eighth delay gear of the first clock management module is recorded, then the delay gear of the second clock management module is controlled to be the seventh delay gear, and the delay gear of the first clock management module is controlled to be half of the eighth delay gear.

[0018] In the above embodiment, when performing low-frequency clock deskew, if the output data of the phase detection module are all 1, it indicates that the first clock signal is ahead, and in combination with the above adjustment method, the phases of the first clock signal and the second clock signal can be quickly made consistent.

[0019] In combination with a possible implementation manner of the embodiment of the first aspect, the input clock signal is a high-frequency input clock signal. If the phase of the first clock signal lags relative to the second clock signal, the first clock management module is controlled to reduce the phase delay, and / or the second clock management module is controlled to increase the phase delay until the phase of the first clock signal is ahead of the second clock signal; if the phase of the first clock signal is ahead of the second clock signal, the second clock management module is controlled to reduce the phase delay, and / or the second clock management module is controlled to increase the phase delay until the phase of the first clock signal lags relative to the second clock signal; the number of flipping times of the phase lead or lag of the first clock signal relative to the second clock signal is recorded, and when it is determined that the number of flipping times reaches a preset number, the adjustment of the phase delay of the first clock management module and / or the second clock management module is suspended.

[0020] In the above embodiment, if the phase of the first clock signal lags relative to the second clock signal, the first clock management module is controlled to reduce the phase delay, and / or the second clock management module is controlled to increase the phase delay, so that the phase of the first clock signal can be advanced relative to the second clock signal. Then, the second clock management module is controlled to reduce the phase delay, and / or the second clock management module is controlled to increase the phase delay, which will cause the phase of the first clock signal to lag relative to the second clock signal. This will be repeated, and the phase will flip from leading to lagging, and then from lagging to leading. Each time the phase difference of the first clock signal relative to the second clock signal is adjusted, it will become smaller and smaller. By recording the number of flips, when the number of flips reaches the preset number, it can be assumed that the adjustment is completed.

[0021] In a second aspect, an embodiment of the present application further provides a SOC chip, comprising a clock adjustment circuit provided in the embodiment of the first aspect above and / or in combination with any possible implementation of the embodiment of the first aspect above.

[0022] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a clock adjustment circuit provided in the embodiment of the first aspect above and / or in combination with any possible implementation of the embodiment of the first aspect above, or a SOC chip provided in the embodiment of the second aspect above.

[0023] In a fourth aspect, an embodiment of the present application also provides a method for improving clock skew, comprising: obtaining a phase relationship of a first clock signal relative to a second clock signal, wherein the first clock signal is generated by a first clock management module based on an input clock signal, and the second clock signal is generated by a second clock management module based on the input clock signal; based on the phase relationship, adjusting the phase delay of the first clock management module and / or the second clock management module to make the phases of the first clock signal and the second clock signal consistent.

[0024] In combination with a possible implementation manner of the fourth aspect embodiment, the input clock signal is a low-frequency input clock signal or a high-frequency input clock signal; based on the phase relationship, the phase delay of the first clock management module and / or the second clock management module is adjusted, including: based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal, the phase delay of the first clock management module and / or the second clock management module is adjusted; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal, the phase delay of the first clock management module and / or the second clock management module is adjusted to make the phases of the first clock signal and the second clock signal under the high-frequency input clock signal consistent.

[0025] In combination with a possible implementation manner of the fourth aspect embodiment, if the input clock signal is a low-frequency input clock signal, based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal, adjust the phase delay of the first clock management module and / or the second clock management module, including: if the output data of the phase detection module is all 0 or contains 0 and 1, wherein the phase detection module is configured to detect the phase relationship, then: control the second clock management module to increase the phase delay until the detection data is all 1, and record the first delay gear of the second clock management module; then control the second clock management module to reduce the phase delay, if the delay of the second clock management module When the delay gear has not been adjusted to the minimum gear and the detection data is all 0, the second delay gear of the second clock management module is recorded when the detection data is all 0, then the delay gear of the first clock management module is controlled to be the minimum gear, and the delay gear of the second clock management module is controlled to be the average of the first delay gear and the second delay gear; if the delay gear of the second clock management module has been adjusted to the minimum gear and the detection data is not all 0, the first clock management module is controlled to increase the phase delay, and the third delay gear of the first clock management module is recorded when the detection data is all 0; then the second clock management module is controlled to increase the phase delay until the detection data is all 1, and the second clock management is recorded. module, then control the delay gear of the first clock management module to be the third delay gear, and control the delay gear of the second clock management module to be half of the fourth delay gear; if the output data of the phase detection module are all 1, then: control the first clock management module to increase the phase delay until the detection data are all 0, and record the fifth delay gear of the first clock management module; then control the first clock management module to reduce the phase delay, if the delay gear of the first clock management module is not adjusted to the minimum gear and the detection data are all 1, record the sixth delay gear of the first clock management module when the detection data are all 1, then control the delay gear of the second clock management module The delay gear of the first clock management module is controlled to be the average of the fifth delay gear and the sixth delay gear when the detection data are all 1 when the delay gear of the first clock management module has been adjusted to the minimum gear. The second clock management module is controlled to increase the phase delay, and the seventh delay gear of the second clock management module is recorded when the detection data are all 1. Then the first clock management module is controlled to increase the phase delay until the detection data are all 0, and the eighth delay gear of the first clock management module is recorded. The delay gear of the second clock management module is controlled to be the seventh delay gear, and the delay gear of the first clock management module is controlled to be half of the eighth delay gear.

[0026] In combination with a possible implementation manner of the fourth aspect embodiment, the input clock signal is a high-frequency input clock signal, and based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal, the phase delay of the first clock management module and / or the second clock management module is adjusted, including: if the phase of the first clock signal lags relative to the second clock signal, controlling the first clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal is ahead of the second clock signal; if the phase of the first clock signal is ahead of the second clock signal, controlling the second clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal lags relative to the second clock signal; recording the number of flipping times of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flipping times reaches a preset number, suspending the adjustment of the phase delay of the first clock management module and / or the second clock management module.

[0027] Other features and advantages of the present application will be described in the following description. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The above and other purposes, features and advantages of the present application will be more clear as shown in the drawings.

[0029] Figure 1 A schematic diagram of a logic circuit provided in an embodiment of the present application is shown.

[0030] Figure 2 A schematic diagram showing a clock signal from different clock networks provided in an embodiment of the present application.

[0031] Figure 3 A schematic diagram of a FIFO provided in an embodiment of the present application is shown.

[0032] Figure 4 A schematic structural diagram of a clock adjustment circuit provided in an embodiment of the present application is shown.

[0033] Figure 5 A schematic diagram showing the connection between a clock management module and a controller provided in an embodiment of the present application is shown.

[0034] Figure 6 A circuit diagram of a first clock adjustment circuit provided in an embodiment of the present application is shown.

[0035] Figure 7 A waveform diagram representing the phase relationship between ck1 and ck2 provided in an embodiment of the present application is shown.

[0036] Figure 8 A waveform principle diagram of clock conditioning when ck1 is delayed provided in an embodiment of the present application is shown.

[0037] Fig. 9 A waveform principle diagram of clock conditioning when the phases of ck1 and ck2 are close to each other provided in an embodiment of the present application is shown.

[0038] Fig.10 A waveform principle diagram of clock conditioning when ck1 is ahead provided in an embodiment of the present application is shown.

[0039] Fig.11 A circuit diagram of a second clock adjustment circuit provided in an embodiment of the present application is shown.

[0040] Fig.12 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0041] Fig.13 A flow chart of a method for improving clock skew provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the scope of protection of the present application. It will be appreciated by those skilled in the art that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other.

[0043] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, article or device.

[0044] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0045] In the description of the embodiments of the present application, unless otherwise clearly specified or limited, the technical term "connection" may refer to a direct connection or an indirect connection through an intermediate medium.

[0046] In order to reduce the clock skew between the internal clocks of the chip and reduce the pressure of digital circuit timing sign-off, thereby increasing the chip operating frequency and improving chip performance. The embodiment of the present application provides a clock adjustment circuit to reduce the clock skew between the internal clocks of the chip so that the phase between the first clock signal and the second clock signal is as equal as possible. For example, in some circuit designs, it is necessary to Figure 2 The phases of the clock signals launch_ck and capture_ck in the clock tree are aligned or consistent, that is, the phases of launch_ck and capture_ck need to be as equal as possible. The clock adjustment circuit shown in the present application can make the phases of two clocks from different clock trees or clock networks as equal as possible.

[0047] Combine the following Figure 4 The clock adjustment circuit provided in the embodiment of the present application is described. Figure 4 As shown, the clock adjustment circuit includes: a first clock management module, a second clock management module, a phase detection module and a controller. The phase detection module is connected to the first clock management module and the second clock management module respectively, and the controller is connected to the phase detection module, the first clock management module and the second clock management module respectively.

[0048] The first clock management module is configured to adjust the phase delay of an input clock signal (such as can be represented by ckin), and generate a first clock signal (such as can be represented by ck1) based on the adjusted input clock signal, wherein the driving capability of the first clock signal is stronger than the driving capability of the input clock signal.

[0049] The second clock management module is configured to adjust the phase delay of the input clock signal, and generate a second clock signal (such as can be represented by ck2) based on the adjusted input clock signal, wherein the driving capability of the second clock signal is stronger than the driving capability of the input clock signal.

[0050] The phase detection module is configured to detect the phase relationship of the first clock signal relative to the second clock signal, for example, to detect whether the phase of the first clock signal is ahead or behind the second clock signal, or to detect whether the phase of the first clock signal is close to the second clock signal.

[0051] The controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship to make the phases of the first clock signal and the second clock signal consistent, i.e., make the phases between the first clock signal and the second clock signal as equal as possible.

[0052] The structures of the first clock management module and the second clock management module may be the same, for example, both include a delay line (DL) and a clock mesh, as shown in the schematic diagram. Figure 5 As shown. The delay unit is configured to adjust the phase delay of the input clock signal under the control of the controller, which can be to increase or decrease the phase delay of the input clock signal. The clock network is configured to generate a clock signal with a stronger driving capability based on the adjusted input clock signal. Among them, the delay unit in the first clock management module can be called DL1, the delay unit in the second clock management module can be called DL2, the clock network in the first clock management module can be called Clock Mesh1, and the clock network in the second clock management module can be called Clock Mesh2.

[0053] The above-mentioned delay unit can be implemented by using the delay unit in the related art. The clock network can also be implemented by using the clock network in the related art, such as Figure 2 The clock network is shown.

[0054] The above-mentioned controller can be implemented by using a controller in the related art. In one implementation, the controller can be a FSM (Finite State Machine), or the controller can be other devices with control functions, such as a processor or a programmable logic device.

[0055] In one implementation, the phase detection module can be implemented by using a sampler or slicer in the field of high-speed interfaces. In this case, the phase detection module may include a sampler or a slicer, wherein the sampler or the slicer is respectively connected to the first clock management module, the second clock management module and the controller. The sampler includes a D and a CK terminal, and the first clock signal ck1 and the second clock signal ck2 are respectively connected to the D and CK terminals of the sampler. The main function of the sampler is to sample ck1 using ck2 as the sampling clock, and compare the sampled signal with a preset slice level (threshold). When the sampled signal exceeds this threshold, a high level or a low level is output, thereby determining the lead and lag information of ck1 and ck2. The function of the slicer is similar to that of the sampler.

[0056] In another possible implementation, the phase detection module includes: a phase comparator, which is respectively connected to the first clock management module, the second clock management module and the controller, and the phase comparator is configured to detect the phase relationship between the first clock signal and the second clock signal. In this case, the schematic diagram of the clock adjustment circuit can be as follows: Figure 6 The phase comparator may be a phase comparator in the related art, which will not be described here.

[0057] In one implementation, the controller is specifically configured to control the first clock management module to increase the phase delay and / or control the second clock management module to reduce the phase delay if the first clock signal is ahead of the second clock signal in phase; and control the first clock management module to reduce the phase delay and / or control the second clock management module to increase the phase delay if the first clock signal is behind the second clock signal in phase. By repeating this action, the phases of the first clock signal and the second clock signal can be made consistent as much as possible.

[0058] For example, in a possible implementation manner, when adjusting the phase delay of the first clock management module and / or the second clock management module, it may be:

[0059] (1) If the first clock signal has a phase lead relative to the second clock signal:

[0060] a) if the delay gear of the delay unit in the second clock management module is not the minimum gear, such as the delay gear 0, then reducing the delay of the delay unit in the second clock management module, and / or increasing the delay of the delay unit in the first clock management module;

[0061] b) If the delay level of the delay unit in the second clock management module is the minimum level, such as delay level 0, the delay of the delay unit in the first clock management module is increased.

[0062] (2) If the phase of the first clock signal lags behind the phase of the second clock signal:

[0063] a) if the delay gear of the delay unit in the first clock management module is not the minimum gear, such as the delay gear 0, then reducing the delay of the delay unit in the first clock management module, and / or increasing the delay of the delay unit in the second clock management module;

[0064] b) If the delay level of the delay unit in the first clock management module is the minimum level, such as delay level 0, the delay of the delay unit in the second clock management module is increased.

[0065] In a possible implementation, the controller is further configured to record the number of flips of the first clock signal leading or lagging the phase of the second clock signal, and when it is determined that the number of flips reaches a preset number, the adjustment of the phase delay of the first clock management module and / or the second clock management module is suspended. By introducing the preset number, when the number of flips reaches the preset number (configurable, such as 5 times), it can be assumed that the phases of the first clock signal and the second clock signal are consistent, thereby suspending the adjustment of the phase delay of the first clock management module and / or the second clock management module, avoiding the situation where the first clock signal and the second clock signal are adjusted continuously due to the inconsistency of the phase.

[0066] Among them, assuming that initially, the first clock signal leads the phase of the second clock signal, after adjusting the phase delay of the first clock management module and / or the second clock management module, the first clock signal may lag in phase with respect to the second clock signal, and then the phase delay of the first clock management module and / or the second clock management module is adjusted again, and the first clock signal may lead in phase with respect to the second clock signal again, and so on and so forth, that is, during the adjustment process, the phase may flip from leading to lagging, and then from lagging to leading, and each time the phase difference of the first clock signal relative to the second clock signal is adjusted, the phase difference will become smaller and smaller. By recording the number of flips, when the number of flips reaches the preset number, it can be assumed that the adjustment is completed.

[0067] In some possible implementations, the above-mentioned input clock signal may be a low-frequency input clock signal (such as represented by Lowckin) or a high-frequency input clock signal (such as represented by Highckin), wherein the high-frequency input clock signal may be a clock signal of a frequency required for normal operation of the chip, and the low-frequency input clock signal is a clock signal with a frequency lower than that of the high-frequency input clock signal. For example, if the frequency of the high-frequency input clock signal is 100MHz, the frequency of the low-frequency input clock signal is lower than 100MHz. The low-frequency input clock signal may be obtained by dividing the high-frequency input clock signal, and the phase difference between ck1 and ck2 under the low-frequency input clock signal may be controlled within a reasonable range, such as within the range of -pi to +pi, by dividing the frequency.

[0068] When the above-mentioned input clock signal is a low-frequency input clock signal or a high-frequency input clock signal, the controller is also configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, the phase delay of the first clock management module and / or the second clock management module is adjusted based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal, so that the phases of the first clock signal and the second clock signal under the high-frequency input clock signal are consistent.

[0069] Since the phase comparator has requirements for the input phase difference, for example, it can only work normally within the range of -pi to +pi; if the clock deskew (de-skew) is performed directly in high-speed mode (the frequency of the input clock signal is higher), the phase difference between ck1 and ck2 may exceed this range, causing the phase comparator to work abnormally, and then causing the controller to make an erroneous delay adjustment. Therefore, in this embodiment, when performing the clock deskew, it is divided into two processes: deskew under a low-frequency input clock signal (for example, a frequency less than or equal to 100MHz) and deskew under a high-frequency input clock signal (such as the clock frequency when the chip is working). After the low-frequency deskew is completed, the main skew has been eliminated. After switching to the chip operating frequency, the delay of ck1 and ck2 at a high frequency may change, such as changes in the voltage on the clock network path, deviations in the frequency response, or different temperatures, and skew elimination at high frequency is required.

[0070] In this implementation mode, the present application first adopts a low-frequency calibration mode. Figure 6The phase difference between ck1 and ck2 is calibrated. This phase difference is mainly caused by the following factors, such as parasitic differences in the physical implementation of clock network 1 (Clock Mesh1) and clock network 2 (ClockMesh2), device size mismatch, inconsistent device speed or voltage, etc. After the low-frequency calibration mode is completed, the phases of ck1 and ck2 are close. However, the working environment of clock network 1 and clock network 2 may be different in high-frequency mode, which will cause the phase difference between ck1 and ck2 to change. For example, the working current is larger in high-frequency mode, which causes the voltage of clock network 1 and clock network 2 to change, the temperature to rise, and the frequency response of clock network 1 and clock network 2 to be inconsistent. It is necessary to continue to monitor the phase difference in high-frequency mode and adjust the phase difference. Because the phase difference between ck1 and ck2 is close after low-frequency calibration, when switching to high-frequency mode, the newly appeared phase difference is usually relatively small, and will be in the range of -pi~pi, and the phase comparator can normally identify the phase.

[0071] The working principles of the low-frequency calibration mode and the high-frequency calibration mode of the present application are described below. Before calibration, ck1 and ck2 may be ahead or behind each other. The correlation between ck1 and ck2 includes Figure 7 The three situations shown are described below respectively.

[0072] In low frequency calibration mode:

[0073] If the input clock signal is a low-frequency input clock signal and there is Figure 7In the first case shown in (1), i.e., the case where ck1 lags, the output data of the phase comparator (hereinafter referred to as output data) are all 0. At this time, the controller is configured to: control the delay unit (hereinafter referred to as DL2) in the second clock management module to increase the phase delay until the output data are all 1, and record the first delay gear (recorded as Tright_dly21) of the delay unit in the second clock management module; then control the delay unit in the second clock management module to reduce the phase delay. If the delay gear of the delay unit in the second clock management module is not adjusted to the minimum gear (such as delay gear 0) and the output data are all 0, record the second delay gear (recorded as Tleft_dly21) of the delay unit in the second clock management module when the output data are all 0, then control the delay gear of the delay unit (hereinafter referred to as DL1) in the first clock management module to be the minimum gear, and control the delay gear of the delay unit in the second clock management module to be the average of the first delay gear and the second delay gear, that is, (Tright_dly21+Tleft_dly21) / 2. If the delay gear of the delay unit in the second clock management module has been adjusted to the minimum gear and the output data is not all 0, the delay unit in the first clock management module is controlled to increase the phase delay, and the third delay gear (recorded as Tright_dly11) of the delay unit in the first clock management module is recorded when the output data is all 0; then the delay unit in the second clock management module is controlled to increase the phase delay until the output data is all 1, and the fourth delay gear (recorded as Tright_dly22) of the delay unit in the second clock management module is recorded, then the delay gear of the delay unit in the first clock management module is controlled to be the third delay gear, i.e. Tright_dly11, and the delay gear of the delay unit in the second clock management module is controlled to be half of the fourth delay gear, i.e. (0+Tright_dly22) / 2. The schematic diagram of the above adjustment can be shown as follows Figure 8 As shown, after increasing the delay of DL2 until the output data is all 1 and recording the delay gear of DL2 as Tright_dly21, in the process of reducing the delay of DL2, it will be further divided into two branches, namely, the branches where 3.11 and 3.12 are located, or the branches where 3.21, 3.22, 3.23 and 3.24 are located.

[0074] If the input clock signal is a low-frequency input clock signal and there is Figure 7In the second case shown in (2), that is, the phases of ck1 and ck2 are close, the output data of the phase comparator includes 0 and 1. At this time, the process of adjusting DL1 and DL2 is similar to the process of adjusting DL1 and DL2 in the case of ck1 lag. At this time, the controller is configured to: control the delay unit in the second clock management module to increase the phase delay until the output data are all 1, record the first delay gear of the delay unit in the second clock management module (recorded as Tright_dly21); then control the delay unit in the second clock management module to reduce the phase Delay, if the delay gear of the delay unit in the second clock management module is not adjusted to the minimum gear (such as delay gear 0) and the output data is all 0, record the second delay gear of the delay unit in the second clock management module when the output data is all 0 (recorded as Tleft_dly21), then control the delay gear of the delay unit in the first clock management module to the minimum gear, and control the delay gear of the delay unit in the second clock management module to the average of the first delay gear and the second delay gear, that is, (Tright_dly21+Tleft_dly21) / 2. If the delay gear of the delay unit in the second clock management module has been adjusted to the minimum gear and the output data is not all 0, the delay unit in the first clock management module is controlled to increase the phase delay, and the third delay gear (recorded as Tright_dly11) of the delay unit in the first clock management module is recorded when the output data is all 0; then the delay unit in the second clock management module is controlled to increase the phase delay until the output data is all 1, and the fourth delay gear (recorded as Tright_dly22) of the delay unit in the second clock management module is recorded, then the delay gear of the delay unit in the first clock management module is controlled to be the third delay gear, i.e. Tright_dly11, and the delay gear of the delay unit in the second clock management module is controlled to be half of the fourth delay gear, i.e. (0+Tright_dly22) / 2. The schematic diagram of the above adjustment can be shown as follows Fig. 9 As shown, after increasing the delay of DL2 until the output data is all 1 and recording the delay gear of DL2 as Tright_dly21, in the process of reducing the delay of DL2, it will be further divided into two branches, namely, the branches where 3.11 and 3.12 are located, or the branches where 3.21, 3.22, 3.23 and 3.24 are located.

[0075] If the input clock signal is a low-frequency input clock signal and there is Figure 7In the third case shown in (3), i.e., ck1 is ahead, the output data of the phase comparator are all 1. At this time, the controller is configured to: control the delay unit in the first clock management module to increase the phase delay until the output data are all 0, and record the fifth delay gear of the delay unit in the first clock management module at this time (recorded as Tright_dly12); then control the delay unit in the first clock management module to reduce the phase delay. If the delay gear of the delay unit in the first clock management module is not adjusted to the minimum gear and the output data are all 1, record the sixth delay gear of the delay unit in the first clock management module when the output data are all 1 (recorded as Tleft_dly11), then control the delay gear of the delay unit in the second clock management module to be the minimum gear, i.e., 0, and control the delay gear of the delay unit in the first clock management module to be the average of the fifth delay gear and the sixth delay gear, i.e., (Tright_dly12+Tleft_dly11) / 2. If the delay gear of the delay unit in the first clock management module has been adjusted to the minimum gear and the output data is not all 1, the delay unit in the second clock management module is controlled to increase the phase delay, and the seventh delay gear of the delay unit in the second clock management module is recorded when the output data is all 1 (recorded as Tright_dly23); then the delay unit in the first clock management module is controlled to increase the phase delay until the output data is all 0, and the eighth delay gear of the delay unit in the first clock management module is recorded (recorded as Tright_dly13), then the delay gear of the delay unit in the second clock management module is controlled to be the seventh delay gear, that is, Tright_dly23, and the delay gear of the delay unit in the first clock management module is controlled to be half of the eighth delay gear, that is, (0+Tright_dly13) / 2. The schematic diagram of the above adjustment can be shown as follows Fig.10 As shown, after increasing the delay of DL1 until the output data is all 0 and recording the delay gear of DL1 as Tright_dly12, in the process of reducing the delay of DL1, it will be further divided into two branches, namely, the branches where 3.11 and 3.12 are located, or the branches where 3.21, 3.22, 3.23 and 3.24 are located.

[0076] After the low-frequency calibration is completed, the phase difference between ck1 and ck2 can meet ±pi. The phase comparator continuously detects the phase difference between ck1 and ck2, and adjusts the phase of ck1 and ck2 by adjusting the delay of DL1 and DL2 through the controller until the phase of ck1 is aligned with the phase of ck2. In the high-frequency calibration mode, the input clock signal is a high-frequency input clock signal, and the calibration process can be: if the first clock signal lags behind the phase of the second clock signal, control the first clock management module to reduce the phase delay, and / or control the second clock management module to increase the phase delay until the first clock signal leads the second clock signal; if the first clock signal leads the phase of the second clock signal, control the second clock management module to reduce the phase delay, and / or control the second clock management module to increase the phase delay until the first clock signal lags behind the second clock signal; record the number of flips of the first clock signal leading or lagging the phase relative to the second clock signal, and when it is determined that the number of flips reaches the preset number, suspend the adjustment of the phase delay of the first clock management module and / or the second clock management module.

[0077] In the high frequency calibration mode, the calibration process is divided into ck1 lagging calibration and ck1 leading calibration.

[0078] 2.1ck1 hysteresis calibration process:

[0079] The output data of the phase comparator is all 0 or mostly 0, that is, ck1 lags, and the controller makes corresponding adjustments according to the delay unit settings. If the gear position of DL1 is not 0, reduce the delay of DL1 and / or increase the delay of DL2 until the output data is all 1, that is, ck1 leads. If the gear position of DL1 is 0, increase the delay of DL2 until the output data is all 1, that is, ck1 leads.

[0080] After the output data is all 0, that is, ck1 is ahead, the calibration process 2.2 is entered.

[0081] 2.2ck1 advanced calibration process:

[0082] After the output data of the phase comparator is all 1 or mostly 1, that is, ck1 is ahead, the controller makes corresponding adjustments according to the delay unit setting. If the gear position of DL2 is not 0, the delay of DL2 is reduced and / or the delay of DL1 is increased until the output data is all 0, that is, ck1 lags. If the gear position of DL2 is 0, the delay of DL1 is increased; until the output data is all 0, that is, ck1 lags. After the output data is all 0, that is, ck1 lags, enter the calibration process of 2.1 above.

[0083] During the adjustment process, the phase may flip from leading to lagging and then from lagging to leading. Each time the phase difference of the first clock signal relative to the second clock signal is adjusted, the phase difference will become smaller and smaller. By recording the number of flips, when the number of flips reaches a preset number, the adjustment can be considered completed by default.

[0084] In one possible implementation, the clock adjustment circuit further includes: a selector, whose output end is connected to the first clock management module and the second clock management module respectively. The first input end of the selector is used to receive a low-frequency input clock signal (such as represented by Lowckin), the second input end of the selector is used to receive a high-frequency input clock signal (such as represented by Highckin), and the selection end of the selector is used to receive a selection control signal (such as represented by S1). When the first input end of the selector is connected to its output end, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal. When the second input end of the selector is connected to its output end, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal.

[0085] The controller may also be configured to send a selection control signal, the selection control signal being used to control whether the first input end of the selector is connected to its output end, or the second input end of the selector is connected to its output end. For example, when the selection control signal is a high level "1", the first input end of the selector is connected to its output end, and when the selection control signal is a low level "0", the second input end of the selector is connected to its output end. The selection control signal may also come from a third-party device outside the controller.

[0086] In one possible implementation, the clock adjustment circuit further includes: a clock generator, which is connected to two input ends of the controller and the selector. The clock generator is configured to output a high-frequency input clock signal and a low-frequency input clock signal under the control of the controller. In one possible implementation, the clock generator may include a phase-locked loop (PLL) and a clock controller. The phase-locked loop is used to generate an initial clock signal, and the clock controller is used to respond to the control of the controller and generate various clocks that meet the requirements based on the initial clock signal generated by the phase-locked loop. For example, under the action of the controller, a high-frequency input clock signal and a low-frequency input clock signal are generated.

[0087] In one implementation, the circuit diagram of the clock adjustment circuit can be as follows: Fig.11 As shown. It is understandable that Fig.11 This is only one of many embodiments of the present application. Fig.11The two selectors in can also be combined into one. In this case, the output ends of the selector are connected to DelayLine1 and DelayLine2 respectively. Fig.11 A 1 on the selector indicates the first input terminal, and a 0 on the selector indicates the second input terminal.

[0088] The embodiment of the present application further provides a SOC chip, the SOC chip comprising the clock adjustment circuit. The SOC chip shown in the embodiment of the present application may be a chip with signal processing capability, such as a processor or an AI (Artificial Intelligence) chip.

[0089] The clock adjustment circuit provided in the SOC chip embodiment has the same implementation principle and technical effects as those in the aforementioned clock adjustment circuit embodiment. For the sake of brief description, for matters not mentioned in the SOC chip embodiment, reference may be made to the corresponding contents in the aforementioned clock adjustment circuit embodiment.

[0090] The present application also provides an electronic device, which may include the above-mentioned SOC chip or the above-mentioned clock adjustment circuit. In a possible implementation manner, the structural block diagram of an electronic device 200 provided in the present application may be as follows: Fig.12 The electronic device 200 includes: a transceiver 210, a memory 220, a communication bus 230 and a processor 240. The processor 240 may be the above-mentioned SOC chip.

[0091] The transceiver 210, the memory 220, and the processor 240 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 230 or signal lines. Among them, the transceiver 210 is used to send and receive data. The memory 220 is used to store data or computer programs. The processor 240 is used to execute the computer program stored in the memory 220. The processor 240 may include the above-mentioned clock adjustment circuit.

[0092] Among them, the memory 220 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0093] The processor 240 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a microprocessor, etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Alternatively, the processor 240 may also be any conventional processor, etc.

[0094] The electronic device 200 mentioned above includes but is not limited to a mobile phone, a tablet, a notebook, a computer, a vehicle-mounted device, etc.

[0095] The embodiment of the present application also provides a method for improving clock skew, such as Fig.13 As shown, the method for improving clock skew may include S1 and S2.

[0096] S1: Obtain a phase relationship between a first clock signal and a second clock signal.

[0097] The first clock signal may be generated by the first clock management module according to the input clock signal, and the second clock signal may be generated by the second clock management module according to the input clock signal. The input clock signal may be a low-frequency input clock signal or a high-frequency input clock signal.

[0098] The phase relationship between the first clock signal and the second clock signal can be detected by the above-mentioned phase detection module, and can also be detected by other devices such as a time-to-digital converter (TDC), which is not limited here.

[0099] S2: Based on the phase relationship, adjust the phase delay of the first clock management module and / or the second clock management module to make the phases of the first clock signal and the second clock signal consistent.

[0100] After the phase relationship between the first clock signal and the second clock signal is obtained, the phase delay of the first clock management module and / or the second clock management module can be adjusted based on the phase relationship to make the phases of the first clock signal and the second clock signal consistent.

[0101] In a possible implementation, the implementation process of S2 may be: based on the phase relationship between the first clock signal and the second clock signal under the low-frequency input clock signal, adjust the phase delay of the first clock management module and / or the second clock management module; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, based on the phase relationship between the first clock signal and the second clock signal under the high-frequency input clock signal, adjust the phase delay of the first clock management module and / or the second clock management module to make the phases of the first clock signal and the second clock signal under the high-frequency input clock signal consistent. In this implementation, the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are first made consistent in the low-frequency mode, and then the phases of the first clock signal and the second clock signal under the high-frequency input clock signal are made consistent.

[0102] In a possible implementation manner, the input clock signal is a low-frequency input clock signal, and based on the phase relationship between the first clock signal and the second clock signal under the low-frequency input clock signal, the process of adjusting the phase delay of the first clock management module and / or the second clock management module may be:

[0103] If the output data of the phase detection module are all 0 or contain 0 and 1, and the phase detection module is configured to detect the phase relationship, then: control the second clock management module to increase the phase delay until the detection data are all 1, and record the first delay gear of the second clock management module; then control the second clock management module to reduce the phase delay, if the delay gear of the second clock management module is not adjusted to the minimum gear and the detection data are all 0, record the second delay gear of the second clock management module when the detection data are all 0, then control the delay gear of the first clock management module to the minimum gear, and control the second clock management The delay gear of the module is the average of the first delay gear and the second delay gear; if the delay gear of the second clock management module has been adjusted to the minimum gear and the detection data is not all 0, the first clock management module is controlled to increase the phase delay, and the third delay gear of the first clock management module is recorded when the detection data is all 0; then the second clock management module is controlled to increase the phase delay until the detection data is all 1, and the fourth delay gear of the second clock management module is recorded, then the delay gear of the first clock management module is controlled to be the third delay gear, and the delay gear of the second clock management module is controlled to be half of the fourth delay gear. If the output data of the phase detection module are all 1, then: control the first clock management module to increase the phase delay until the detection data are all 0, and record the fifth delay gear of the first clock management module; then control the first clock management module to reduce the phase delay, if the detection data are all 1 when the delay gear of the first clock management module has not been adjusted to the minimum gear, record the sixth delay gear of the first clock management module when the detection data are all 1, then control the delay gear of the second clock management module to the minimum gear, and control the delay gear of the first clock management module to the average of the fifth delay gear and the sixth delay gear; if the delay gear of the first clock management module has been adjusted to the minimum gear and the detection data are not all 1, control the second clock management module to increase the phase delay, and record the seventh delay gear of the second clock management module when the detection data are all 1; then control the first clock management module to increase the phase delay until the detection data are all 0, record the eighth delay gear of the first clock management module, then control the delay gear of the second clock management module to the seventh delay gear, and control the delay gear of the first clock management module to half of the eighth delay gear.

[0104] In one implementation mode, if the input clock signal is a high-frequency input clock signal, based on the phase relationship of the first clock signal relative to the second clock signal under the high-frequency input clock signal, the process of adjusting the phase delay of the first clock management module and / or the second clock management module may be: if the phase of the first clock signal lags relative to the second clock signal, controlling the first clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal is ahead of the second clock signal; if the phase of the first clock signal is ahead of the second clock signal, controlling the second clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal lags relative to the second clock signal; recording the number of flipping times of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flipping times reaches a preset number, suspending the adjustment of the phase delay of the first clock management module and / or the second clock management module.

[0105] The above method for improving clock skew can be implemented based on the above clock adjustment circuit, or can be implemented based on other devices.

[0106] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0107] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0108] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A clock adjustment circuit, characterized in that: include: a first clock management module configured to adjust a phase delay of an input clock signal and generate a first clock signal based on the adjusted input clock signal, wherein a driving capability of the first clock signal is stronger than a driving capability of the input clock signal; a second clock management module configured to adjust a phase delay of an input clock signal and generate a second clock signal based on the adjusted input clock signal, wherein a driving capability of the second clock signal is stronger than a driving capability of the input clock signal; a phase detection module, connected to the first clock management module and the second clock management module respectively, and configured to detect a phase relationship between the first clock signal and the second clock signal; A controller is connected to the phase detection module, the first clock management module, and the second clock management module, respectively. The controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship so that the phases of the first clock signal and the second clock signal are consistent.

2. The clock adjustment circuit according to claim 1, wherein: The controller is specifically configured to control the first clock management module to increase the phase delay, and / or control the second clock management module to decrease the phase delay if the phase of the first clock signal is ahead of the second clock signal; If the phase of the first clock signal lags behind that of the second clock signal, the first clock management module is controlled to reduce the phase delay, and / or the second clock management module is controlled to increase the phase delay.

3. The clock adjustment circuit according to claim 2, wherein: The controller is further configured to record the number of flips of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flips reaches a preset number, suspend adjusting the phase delay of the first clock management module and / or the second clock management module.

4. The clock adjustment circuit according to claim 1, wherein: The input clock signal is a low-frequency input clock signal or a high-frequency input clock signal; The controller is further configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the low-frequency input clock signal relative to the second clock signal; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal under the high-frequency input clock signal relative to the second clock signal, so that the phases of the first clock signal and the second clock signal under the high-frequency input clock signal are consistent.

5. The clock adjustment circuit according to claim 4, wherein: The clock adjustment circuit further includes: A selector is connected to the first clock management module, the controller and the second clock management module respectively; The first input terminal of the selector is used to receive a low-frequency input clock signal, and the second input terminal of the selector is used to receive a high-frequency input clock signal; When the first input terminal of the selector is connected to the output terminal thereof, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on a phase relationship between the first clock signal and the second clock signal under the low-frequency input clock signal; When the second input end of the selector is connected to its output end, the controller is configured to adjust the phase delay of the first clock management module and / or the second clock management module based on the phase relationship of the first clock signal relative to the second clock signal under the high-frequency input clock signal.

6. The clock adjustment circuit according to claim 4, wherein: If the input clock signal is a low-frequency input clock signal, and the output data of the phase detection module are all 0 or contain 0 and 1; the controller is configured to: Control the second clock management module to increase the phase delay until the output data is all 1, and record the first delay gear of the second clock management module; then control the second clock management module to reduce the phase delay, if the output data is all 0 when the delay gear of the second clock management module is not adjusted to the minimum gear, record the second delay gear of the second clock management module when the output data is all 0, then control the delay gear of the first clock management module to the minimum gear, and control the delay gear of the second clock management module to the average of the first delay gear and the second delay gear; If the output data is not all 0 when the delay gear of the second clock management module has been adjusted to the minimum gear, control the first clock management module to increase the phase delay, and record the third delay gear of the first clock management module when the output data is all 0; then control the second clock management module to increase the phase delay until the output data is all 1, record the fourth delay gear of the second clock management module, then control the delay gear of the first clock management module to the third delay gear, and control the delay gear of the second clock management module to half of the fourth delay gear.

7. The clock adjustment circuit according to claim 4, wherein: If the input clock signal is a low-frequency input clock signal and the output data of the phase detection module are all 1, the controller is configured to: Controlling the first clock management module to increase the phase delay until the output data is all 0, and recording the fifth delay gear of the first clock management module; then controlling the first clock management module to decrease the phase delay, if the output data is all 1 when the delay gear of the first clock management module is not adjusted to the minimum gear, recording the sixth delay gear of the first clock management module when the output data is all 1, controlling the delay gear of the second clock management module to the minimum gear, and controlling the delay gear of the first clock management module to the average of the fifth delay gear and the sixth delay gear; If the output data is not all 1 when the delay gear of the first clock management module has been adjusted to the minimum gear, the second clock management module is controlled to increase the phase delay, and the seventh delay gear of the second clock management module when the output data is all 1 is recorded; then the first clock management module is controlled to increase the phase delay until the output data is all 0, and the eighth delay gear of the first clock management module is recorded. The delay gear of the second clock management module is controlled to be the seventh delay gear, and the delay gear of the first clock management module is controlled to be half of the eighth delay gear.

8. The clock adjustment circuit according to claim 4, wherein: The input clock signal is a high-frequency input clock signal, and if the phase of the first clock signal lags relative to the second clock signal, controlling the first clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal leads relative to the second clock signal; If the phase of the first clock signal is ahead of the phase of the second clock signal, control the second clock management module to reduce the phase delay, and / or control the second clock management module to increase the phase delay until the phase of the first clock signal is behind the phase of the second clock signal; Record the number of flips of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flips reaches a preset number, suspend adjusting the phase delay of the first clock management module and / or the second clock management module.

9. A SOC chip, characterized in that: The method comprises the clock adjustment circuit according to any one of claims 1 to 8.

10. An electronic device, characterized in that: The method comprises the clock adjustment circuit according to any one of claims 1 to 8, or the SOC chip according to claim 9.

11. A method for improving clock skew, characterized in that: include: Obtaining a phase relationship between a first clock signal and a second clock signal, wherein the first clock signal is generated by a first clock management module based on an input clock signal, and the second clock signal is generated by a second clock management module based on the input clock signal; Based on the phase relationship, the phase delay of the first clock management module and / or the second clock management module is adjusted to make the phases of the first clock signal and the second clock signal consistent.

12. The method according to claim 11, characterized in that The input clock signal is a low-frequency input clock signal or a high-frequency input clock signal; Adjusting the phase delay of the first clock management module and / or the second clock management module based on the phase relationship includes: Based on the phase relationship between the first clock signal and the second clock signal under the low-frequency input clock signal, adjust the phase delay of the first clock management module and / or the second clock management module; after the phases of the first clock signal and the second clock signal under the low-frequency input clock signal are consistent, based on the phase relationship between the first clock signal and the second clock signal under the high-frequency input clock signal, adjust the phase delay of the first clock management module and / or the second clock management module to make the phases of the first clock signal and the second clock signal under the high-frequency input clock signal consistent.

13. The method according to claim 11, characterized in that If the input clock signal is a low-frequency input clock signal, adjusting the phase delay of the first clock management module and / or the second clock management module based on a phase relationship between the first clock signal and the second clock signal under the low-frequency input clock signal includes: If the output data of the phase detection module is all 0 or contains 0 and 1, wherein the phase detection module is configured to detect the phase relationship, then: Control the second clock management module to increase the phase delay until the detection data are all 1, and record the first delay gear of the second clock management module; then control the second clock management module to reduce the phase delay, if the detection data are all 0 when the delay gear of the second clock management module has not been adjusted to the minimum gear, record the second delay gear of the second clock management module when the detection data are all 0, then control the delay gear of the first clock management module to the minimum gear, and control the delay gear of the second clock management module to be the average of the first delay gear and the second delay gear; if the delay gear of the second clock management module has been adjusted to the minimum gear and the detection data are not all 0, control the first clock management module to increase the phase delay, and record the third delay gear of the first clock management module when the detection data are all 0; then control the second clock management module to increase the phase delay until the detection data are all 1, record the fourth delay gear of the second clock management module, then control the delay gear of the first clock management module to the third delay gear, and control the delay gear of the second clock management module to half of the fourth delay gear; If the output data of the phase detection module are all 1, then: Control the first clock management module to increase the phase delay until the detection data are all 0, and record the fifth delay gear of the first clock management module; then control the first clock management module to reduce the phase delay. If the detection data are all 1 when the delay gear of the first clock management module has not been adjusted to the minimum gear, record the sixth delay gear of the first clock management module when the detection data are all 1, then control the delay gear of the second clock management module to the minimum gear, and control the delay gear of the first clock management module to be the average of the fifth delay gear and the sixth delay gear; if the delay gear of the first clock management module has been adjusted to the minimum gear and the detection data are not all 1, control the second clock management module to increase the phase delay, and record the seventh delay gear of the second clock management module when the detection data are all 1; then control the first clock management module to increase the phase delay until the detection data are all 0, record the eighth delay gear of the first clock management module, then control the delay gear of the second clock management module to the seventh delay gear, and control the delay gear of the first clock management module to half of the eighth delay gear.

14. The method according to claim 11, characterized in that The input clock signal is a high-frequency input clock signal, and adjusting the phase delay of the first clock management module and / or the second clock management module based on a phase relationship between the first clock signal and the second clock signal under the high-frequency input clock signal includes: If the phase of the first clock signal lags behind that of the second clock signal, controlling the first clock management module to reduce the phase delay, and / or controlling the second clock management module to increase the phase delay until the phase of the first clock signal leads that of the second clock signal; If the phase of the first clock signal is ahead of the phase of the second clock signal, control the second clock management module to reduce the phase delay, and / or control the second clock management module to increase the phase delay until the phase of the first clock signal is behind the phase of the second clock signal; Record the number of flips of the phase advance or lag of the first clock signal relative to the second clock signal, and when it is determined that the number of flips reaches a preset number, suspend adjusting the phase delay of the first clock management module and / or the second clock management module.

Citation Information

Cited By

  • Cross-die clock synchronization system, die, and electronic device

    WO2026148793A1