A clock phase adjustment method, circuit, storage medium and computer device

Through the combination of data processing module, counting module and control module, the phase adjustment coefficient is calculated and applied for frequency division processing of the clock signal, which solves the problems of clock phase adjustment complexity and insufficient accuracy in the existing technology, and achieves flexibility and high precision. clock phase adjustment.

CN118449496BActive Publication Date: 2024-09-20ZHUHAI HAOZE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410904048.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-09-20
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

The clock phase adjustment scheme in the prior art is complex, difficult to implement, and difficult to meet the phase adjustment requirements of different functional modules, resulting in poor phase adjustment accuracy.

Method used

Using a combination of data processing module, counting module and control module, by receiving the frequency division coefficient and phase adjustment coefficient, calculating the rising edge jump coefficient and falling edge jump coefficient, combined with the reference clock signal for frequency division processing and phase adjustment, to achieve the goal clock signal output.

Benefits of technology

By flexibly adjusting the frequency of the reference clock signal, the phase adjustment needs of different functional modules are met, the design is simplified, and the accuracy and ease of implementation of the phase adjustment are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118449496B
    Figure CN118449496B
Patent Text Reader

Abstract

The present invention discloses a clock phase adjustment method, circuit, storage medium and computer equipment, and relates to the field of integrated circuit technology. The method includes: a data processing module receives a frequency division coefficient and a first phase adjustment coefficient, and calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient; a counting module receives a reference clock signal, counts the rising edge and / or falling edge of the reference clock signal, and obtains an edge count value of the reference clock signal; a control module performs frequency division processing and a first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient, and obtains a target clock signal. The above method can flexibly select the accuracy of phase adjustment by adjusting the frequency of the reference clock signal, can meet different clock phase adjustment requirements, is convenient for multiplexing, and the scheme design is simple and flexible, and easy to implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of integrated circuits, and in particular to a clock phase adjustment method, circuit, storage medium and computer equipment. Background Art

[0002] In the field of integrated circuits, it is often necessary to adjust the phase of the input clock of a functional module. The purpose of clock phase adjustment is to match the arrival time of the clock signal with the timing requirements within the system. Clock phase adjustment can ensure that each functional module works in a coordinated manner according to the preset order and time, which is crucial for the correct transmission and processing of data.

[0003] In practical applications, different functional modules may have different phases to be adjusted, resulting in different requirements for phase adjustment accuracy. Therefore, if a fixed phase adjustment accuracy is used, it is difficult to meet the phase adjustment requirements of different functional modules, resulting in poor phase adjustment accuracy. In related technologies, clock phase adjustment schemes that can change the phase adjustment accuracy are usually complex and difficult to implement. Summary of the invention

[0004] In view of this, the present application provides a clock phase adjustment method, circuit, storage medium and computer device, the main purpose of which is to solve the technical problem of complex clock phase adjustment schemes in related technologies.

[0005] According to a first aspect of the present invention, a clock phase adjustment method is provided. The method is applied to a clock phase adjustment circuit, wherein the circuit comprises a data processing module, a counting module and a control module, wherein the data processing module and the counting module are respectively connected to the control module, and the method comprises:

[0006] The data processing module receives a frequency division coefficient and a first phase adjustment coefficient, calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and sends the rising edge jump coefficient and the falling edge jump coefficient to the control module;

[0007] The counting module receives a reference clock signal, counts rising edges and / or falling edges of the reference clock signal, obtains an edge count value of the reference clock signal, and sends the edge count value to the control module;

[0008] The control module performs frequency division processing and first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal.

[0009] Optionally, the clock phase adjustment circuit also includes a preprocessing module, which is connected to the data processing module; before the data processing module receives the division coefficient and the first phase adjustment coefficient, the method also includes: the preprocessing module determines a first phase adjustment step according to a preset first phase to be adjusted, determines the frequency of the reference clock signal according to the first phase adjustment step, determines the division coefficient according to the frequency of the reference clock signal and a preset target frequency, and sends the division coefficient to the data processing module, wherein the target frequency is the frequency of the target clock signal; the preprocessing module calculates the first phase adjustment coefficient according to the first phase to be adjusted and the first phase adjustment step, and sends the first phase adjustment coefficient to the data processing module, wherein the first phase adjustment coefficient is less than the division coefficient.

[0010] Optionally, the data processing module calculates a rising edge jump coefficient and a falling edge jump coefficient based on the frequency division coefficient and the first phase adjustment coefficient, including: obtaining a preset count initial value, and summing the count initial value and the first phase adjustment coefficient to obtain the rising edge jump coefficient; if the first phase adjustment coefficient is less than half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the result with the count initial value and the first phase adjustment coefficient to obtain the falling edge jump coefficient; if the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the result with the count initial value and the first phase adjustment coefficient, and then subtracting the frequency division coefficient to obtain the falling edge jump coefficient.

[0011] Optionally, the data processing module is also connected to the counting module; before the counting module counts the rising edge and / or falling edge of the reference clock signal, the method further includes: the data processing module obtains a preset frequency division condition, obtains a frequency division indication signal according to the frequency division coefficient and the frequency division condition, and sends the frequency division indication signal to the counting module and the control module, wherein the frequency division indication signal is used to indicate the counting module how to count the rising edge and / or falling edge of the reference clock signal, and is used to indicate the control module to count the reference clock signal. A method of row frequency division processing and first-level phase adjustment; wherein the frequency division condition includes a first frequency division condition and a second frequency division condition, the first frequency division condition is to require that the duty cycle of the target clock signal is 50%, and the second frequency division condition is not to require the duty cycle of the target clock signal to be 50%; when the frequency division coefficient is an odd number and the frequency division condition is the first frequency division condition, the frequency division indication signal is the first frequency division indication signal; when the frequency division coefficient is an odd number and the frequency division condition is the second frequency division condition, or when the frequency division coefficient is an even number, the frequency division indication signal is the second frequency division indication signal.

[0012] Optionally, the counting module counts the rising edge and / or falling edge of the reference clock signal to obtain an edge count value of the reference clock signal, and sends the edge count value to the control module, including: if the frequency division indication signal is the first frequency division indication signal, counting the rising edge of the reference clock signal to obtain a first rising edge count value, and sending the first rising edge count value to the control module; and, counting the falling edge of the reference clock signal to obtain a first falling edge count value, and sending the first falling edge count value to the control module; if the frequency division indication signal is the second frequency division indication signal, counting the rising edge of the reference clock signal to obtain a second rising edge count value, and sending the second rising edge count value to the control module; or, counting the falling edge of the reference clock signal to obtain a second falling edge count value, and sending the second falling edge count value to the control module.

[0013] Optionally, the control module performs frequency division processing and a first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal, including: if the frequency division indication signal is the first frequency division indication signal, then obtain the first rising edge count value and the first falling edge count value, generate a first frequency-divided clock signal based on the first rising edge count value, and generate a second frequency-divided clock signal based on the first falling edge count value; generate the first frequency-divided clock signal based on the first rising edge count value, including: when the first rising edge count value is equal to the rising edge jump coefficient, control the first frequency-divided clock signal to jump to a high level; when the first rising edge count value is equal to the falling edge jump coefficient, control the first frequency-divided clock signal to jump to a low level; the generating the second frequency-divided clock signal based on the first falling edge count value includes: when the first falling edge count value is equal to the rising edge jump coefficient when the first falling edge count value is equal to the falling edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a high level; when the first falling edge count value is equal to the falling edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a low level; a logical operation is performed on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; if the frequency-dividing indication signal is the second frequency-dividing indication signal, the second rising edge count value or the second falling edge count value is obtained, and the target clock signal is generated based on the second rising edge count value or the second falling edge count value; the generating of the target clock signal based on the second rising edge count value or the second falling edge count value includes: when the second rising edge count value or the second falling edge count value is equal to the rising edge jump coefficient, the target clock signal is controlled to jump to a high level; when the second rising edge count value or the second falling edge count value is equal to the falling edge jump coefficient, the target clock signal is controlled to jump to a low level.

[0014] Optionally, the clock phase adjustment circuit also includes a delay chain constructed by connecting multiple inverters in series, and the delay chain is connected to the control module, wherein the number of inverters is calculated based on the period of the reference clock signal and the second phase adjustment step, and the second phase adjustment step is determined based on the delay duration of the inverter; the method also includes: the control module inputs the target clock signal into the delay chain; the delay chain delays the target clock signal according to a preset second phase adjustment coefficient to obtain the target clock signal after secondary phase adjustment, wherein the second phase adjustment coefficient is calculated based on the second phase to be adjusted and the second phase adjustment step, and the second phase to be adjusted is calculated based on the first phase to be adjusted, the first phase adjustment step and the first phase adjustment coefficient.

[0015] According to a second aspect of the present invention, there is provided a clock phase adjustment circuit, the circuit comprising: a data processing module, a counting module and a control module, wherein the data processing module and the counting module are respectively connected to the control module;

[0016] The data processing module is used to receive a frequency division coefficient and a first phase adjustment coefficient, calculate a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and send the rising edge jump coefficient and the falling edge jump coefficient to the control module;

[0017] The counting module is used to receive a reference clock signal, count the rising edge and / or falling edge of the reference clock signal, obtain an edge count value of the reference clock signal, and send the edge count value to the control module;

[0018] The control module is used to perform frequency division processing and first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal.

[0019] According to a third aspect of the present invention, there is provided a storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned clock phase adjustment method is implemented.

[0020] According to a fourth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned clock phase adjustment method when executing the program.

[0021] The present invention provides a clock phase adjustment method, circuit, storage medium and computer equipment. First, the data processing module receives a frequency division coefficient and a first phase adjustment coefficient, calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and sends the rising edge jump coefficient and the falling edge jump coefficient to the control module; then, the counting module receives a reference clock signal, counts the rising edge and / or falling edge of the reference clock signal, obtains an edge count value of the reference clock signal, and sends the edge count value to the control module; finally, the control module performs frequency division processing and a first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal. The clock phase adjustment method provided by the present application introduces a first phase adjustment coefficient in the calculation process of the rising edge jump coefficient and the falling edge jump coefficient, so that the phase adjustment of the target clock signal can be achieved based on frequency division. By adjusting the clock phase in this way, the accuracy of phase adjustment can be flexibly selected by adjusting the frequency of the reference clock signal, which can meet different clock phase adjustment requirements and facilitate multiplexing. The scheme design is simple, flexible and easy to implement.

[0022] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0024] Figure 1 A schematic diagram of a process flow of a clock phase adjustment method provided by an embodiment of the present invention is shown;

[0025] Figure 2 A schematic diagram of the structure of a clock phase adjustment circuit provided by an embodiment of the present invention is shown;

[0026] Figure 3 A schematic diagram showing the structure of another clock phase adjustment circuit provided by an embodiment of the present invention is shown;

[0027] Figure 4 A clock phase adjustment waveform diagram based on odd-number frequency division provided by an embodiment of the present invention is shown;

[0028] Figure 5A clock phase adjustment waveform diagram based on even-number frequency division provided by an embodiment of the present invention is shown;

[0029] Figure 6 A schematic diagram of the structure of a delay chain provided by an embodiment of the present invention is shown;

[0030] Figure 7 A schematic structural diagram of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0031] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0032] In the field of integrated circuits, for example, in the process of designing IP (Intellectual Property) cores (referring to pre-designed circuit function modules) of digital front-ends, it is often necessary to adjust the phase of the input clock of the function module. The commonly used method in related technologies is to use a phase-locked loop for phase adjustment, but the design of the phase-locked loop is complex and not easy to implement. Based on this, this embodiment provides a flexible, simple and easy-to-implement clock phase adjustment solution.

[0033] It should be noted that in the various embodiments shown below, the first, second and various digital numbers are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application. For example, different frequency division indication signals, rising edge count values ​​and falling edge count values ​​in different frequency division situations, etc. are distinguished. "And / or" is used to describe the association relationship of objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0034] In one embodiment, Figure 1 As shown, a clock phase adjustment method is provided, and the method is applied to a clock phase adjustment circuit, such as Figure 2 As shown, the clock phase adjustment circuit includes a data processing module 301, a counting module 302 and a control module 303, and the data processing module 301 and the counting module 302 are respectively connected to the control module 303. The clock phase adjustment circuit can be implemented based on a digital circuit. The clock phase adjustment method includes the following steps:

[0035] 101. The data processing module 301 receives a frequency division coefficient and a first phase adjustment coefficient, calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and sends the rising edge jump coefficient and the falling edge jump coefficient to the control module 303.

[0036] 102 . The counting module 302 receives a reference clock signal, counts rising edges and / or falling edges of the reference clock signal, obtains an edge count value of the reference clock signal, and sends the edge count value to the control module 303 .

[0037] 103. The control module 303 performs frequency division processing and one-stage phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal.

[0038] The clock phase adjustment circuit provided in this embodiment can be implemented based on a digital circuit. Among them, the frequency division coefficient is used to divide the frequency of the reference clock signal into a target frequency. In this embodiment, one cycle of the reference clock signal can be used as a unit phase shift (phase adjustment step) to adjust the phase of the clock signal obtained by the frequency division while dividing. The first phase adjustment coefficient is used to indicate the number of steps of phase shift during frequency division. By introducing the first phase adjustment coefficient in the frequency division process, the clock phase adjustment based on frequency division is realized. It is specifically implemented in the following manner: determining the frequency division coefficient and the first phase adjustment coefficient, and inputting the frequency division coefficient and the first phase adjustment coefficient into the data processing module 301. Among them, the frequency division coefficient can be determined according to the reference clock signal and the target frequency. For example, if the frequency of the reference clock signal is 8000MHz and the target frequency is 1000MHz, the reference clock signal can be divided by 8 to obtain a target clock signal with a target frequency, that is, the frequency division coefficient is 8. The first phase adjustment coefficient can be obtained according to the phase to be adjusted and the step size of the phase adjustment.

[0039] In this embodiment, the phase can be characterized by angle, time, or waveform width. For example, if the frequency of the target clock signal is 1000 MHz and the frequency of the reference clock signal is 8000 MHz, from the angle dimension, assuming that the phase of the target clock signal to be adjusted is 90° of the target clock signal, the representation from the time dimension is ,in is the period of the target clock signal; for the target clock signal, from the dimension of waveform width, it is ,in is the width of one cycle of the target clock signal. For the reference clock signal, the waveform width dimension is: ,in is the period of the reference clock signal, is the width of one cycle of the reference clock signal. In practical applications, the phase to be adjusted can be characterized by angle, time or waveform width according to the needs for subsequent calculations.

[0040] In this embodiment, the step length of phase adjustment can be characterized by the width of the reference clock signal cycle, that is, when the target clock signal is phase adjusted, the step length of each phase adjustment is the width of a reference clock signal cycle. , the phase adjustment step is , two steps of adjustment are required to meet the phase adjustment requirement, so in the above example, the first phase adjustment coefficient is 2.

[0041] After receiving the frequency division coefficient and the first phase adjustment coefficient, the data processing module 301 calculates the rising edge jump coefficient and the falling edge jump coefficient for realizing frequency division and phase adjustment at the same time according to the frequency division coefficient and the first phase adjustment coefficient. The specific calculation method of the rising edge jump coefficient and the falling edge jump coefficient is as follows: firstly calculate the initial rising edge jump coefficient and the initial falling edge jump coefficient when only frequency division is realized without phase adjustment, and then add the initial rising edge jump coefficient and the initial falling edge jump coefficient to the first phase adjustment coefficient respectively, so as to obtain the rising edge jump coefficient and the falling edge jump coefficient that can realize frequency division and phase adjustment at the same time.

[0042] When the clock phase adjustment circuit provided in this embodiment is started, it is necessary to count the rising edge and / or falling edge of the reference clock signal through the counting module 302 to obtain the edge count value of the reference clock signal, wherein the edge count value includes the rising edge count value obtained by counting the rising edge of the reference clock signal, and / or the falling edge count value obtained by counting the falling edge of the reference clock signal. Whether to count the rising edge or the falling edge of the reference clock signal, or to count both the rising edge and the falling edge, can be set according to actual needs.

[0043] When the counting module 302 counts the edges of the reference clock signal, it needs to send the edge count value to the control module 303. The control module 303 compares the edge count value of the reference clock signal with the rising edge jump coefficient and the falling edge jump coefficient. When the edge count value reaches the rising edge jump coefficient, it outputs a high level, and when the edge count value reaches the falling edge jump coefficient, it outputs a low level, thereby controlling the phase of the high level and low level output of the clock signal obtained by frequency division, and adjusting the clock phase. For the case where only one of the rising edge or the falling edge of the reference clock signal is counted, a frequency-divided clock signal will be obtained, and the frequency-divided clock signal is the target clock signal obtained after the first-level phase adjustment; for the case where both the rising edge and the falling edge of the reference clock signal are counted, two frequency-divided clock signals will be obtained, and the clock signal obtained after the logic OR operation or the logic AND operation of the two frequency-divided clock signals is the target clock signal obtained after the first-level phase adjustment.

[0044] In this embodiment, the accuracy of phase adjustment depends on the frequency of the reference clock signal, that is, the higher the frequency of the reference clock signal, the higher the accuracy of phase adjustment. In practical applications, a suitable reference clock signal can be selected for primary phase adjustment according to the clock that can be provided in the system and the actual adjustment accuracy requirements. Usually, there are clocks of multiple frequencies available in the system, so the clock phase adjustment method provided in this embodiment can accurately adjust the clock phase in most cases.

[0045] The clock phase adjustment method provided in this embodiment introduces a first phase adjustment coefficient in the process of calculating the rising edge jump coefficient and the falling edge jump coefficient, so that the phase adjustment of the target clock signal can be achieved through frequency division. The frequency division coefficient and the first phase adjustment coefficient are calculated by the data processing module 301 to obtain the rising edge jump coefficient and the falling edge jump coefficient, and the rising edge jump coefficient and the falling edge jump coefficient are input to the control module 303. The reference clock signal is input to the counting module 302, and the rising edge and / or falling edge of the reference clock signal are counted by the counting module 302 to obtain the rising edge count value and / or the falling edge count value, and the rising edge count value and / or the falling edge count value are input to the control module 303. The control module 303 compares the received rising edge count value and / or the falling edge count value with the rising edge jump coefficient and the falling edge jump coefficient, and controls the output of the high level and the low level according to the comparison result. The output result of the control module 303 is the target clock signal after the first-level phase adjustment. Through the content of this embodiment and Figure 2From the circuit shown, it can be seen that the clock phase adjustment method provided by this embodiment integrates phase adjustment into the frequency division process, does not require complex programming content, is easy to implement, and has a low amount of data processing operations and does not occupy too many system resources. In addition, the clock phase adjustment method provided by this embodiment can flexibly select the accuracy of phase adjustment by adjusting the frequency of the reference clock signal, can meet different clock phase adjustment requirements, and is convenient for multiplexing for different functional modules.

[0046] Further, in order to fully illustrate the implementation process of this embodiment, the specific implementation method of the above embodiment is refined and expanded below. Figure 3 In one embodiment, the clock phase adjustment circuit further includes a preprocessing module 300, the output end of the preprocessing module 300 is connected to the input end of the data processing module 301, and in step 101, before the data processing module 301 receives the frequency division coefficient and the first phase adjustment coefficient, the method further includes: the preprocessing module 300 determines a first phase adjustment step according to a preset first phase to be adjusted, determines the frequency of the reference clock signal according to the first phase adjustment step, determines the frequency division coefficient according to the frequency of the reference clock signal and a preset target frequency, and sends the frequency division coefficient to the data processing module 301, wherein the target frequency is the frequency of the target clock signal; the preprocessing module 300 calculates the first phase adjustment coefficient according to the first phase to be adjusted and the first phase adjustment step, and sends the first phase adjustment coefficient to the data processing module 301, wherein the first phase adjustment coefficient is less than the frequency division coefficient.

[0047] Among them, the first phase to be adjusted is the phase size that needs to be adjusted, the target frequency is the frequency of the input clock signal of the functional module that needs to perform clock phase adjustment in the system, that is, the frequency of the clock signal actually needed by the functional module, and the target frequency is a known quantity. The target clock signal in the embodiment of the present application is the input clock signal that matches the phase (timing) requirements of the functional module, that is, the target frequency is the frequency of the target clock signal in the embodiment of the present application.

[0048] In the above embodiment, the preprocessing module 300 receives the first phase to be adjusted, and determines the first phase adjustment step length through the first phase to be adjusted. Because the first phase adjustment step length is related to the period of the reference clock signal, the reference clock signal is a clock signal selected from the system clock signal. Therefore, the periods of all system clock signals or multiple commonly used system clock signals can be pre-calculated and stored as alternative first phase adjustment steps. After receiving the first phase to be adjusted, the first phase to be adjusted is divided by each alternative first phase adjustment step length, and the remainders corresponding to each alternative first phase adjustment step length are compared, and the alternative first phase adjustment step length corresponding to the smallest remainder is determined as the final first phase adjustment step length, thereby improving the accuracy of phase adjustment. The system clock signal corresponding to the first phase adjustment step length is determined as the reference clock signal. After determining the reference clock signal, the frequency division coefficient is calculated based on the frequency of the reference clock signal and the frequency of the target clock signal.

[0049] In the above embodiment, after determining the first phase to be adjusted and the first phase adjustment step, the first phase to be adjusted and the first phase adjustment step are divided to calculate the first phase adjustment coefficient. For example, if the first phase to be adjusted is 0.4ns and the first phase adjustment step is 0.1ns, the first phase adjustment coefficient is 4. It should be noted that the first phase adjustment coefficient is less than the frequency division coefficient, for example, if the frequency division coefficient is 10, the maximum value of the first phase adjustment coefficient is 9.

[0050] In the embodiment of the present application, the selection of the reference clock signal and the calculation of the frequency division coefficient and the first phase adjustment coefficient can be calculated by the preprocessing module 300, or can be manually set and directly input into the data processing module 301.

[0051] In the above embodiment, a suitable reference clock signal can be selected according to the size of the first phase to be adjusted, the frequency of the reference clock signal has a corresponding relationship with the first phase adjustment step, and one cycle of the reference clock signal is the step of the first phase adjustment. The smaller the remainder of the first phase to be adjusted and the first phase adjustment step, the higher the accuracy of the first-level phase adjustment of the target clock signal. In the same data processing system, the sizes of the first phase to be adjusted of different functional modules may be different. For different sizes of the first phase to be adjusted, reference clock signals of different frequencies can be flexibly selected to improve the accuracy of the phase adjustment.

[0052] In one embodiment, in step 101, the data processing module 301 calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, which can be specifically implemented in the following manner: obtaining a preset count initial value, and summing the count initial value and the first phase adjustment coefficient to obtain the rising edge jump coefficient; if the first phase adjustment coefficient is less than half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the result with the count initial value and the first phase adjustment coefficient to obtain the falling edge jump coefficient; if the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the result with the count initial value and the first phase adjustment coefficient, and then subtracting the frequency division coefficient to obtain the falling edge jump coefficient.

[0053] The counting initial value is the starting value for counting the edges of the reference clock signal, and the counting initial value is usually set to 0. In this embodiment, the first phase adjustment coefficient is introduced into the calculation process of the rising edge jump coefficient and the falling edge jump coefficient to achieve frequency division and phase adjustment at the same time. The rising edge jump coefficient can be obtained by summing the counting initial value and the first phase adjustment coefficient. For example, the calculation formula of the rising jump coefficient can be:

[0054] ;

[0055] in, is the rising edge jump coefficient, is the initial value of the count, is the first phase adjustment coefficient.

[0056] The falling edge jump coefficient is calculated in a corresponding manner according to the comparison relationship between the first phase adjustment coefficient and the half frequency division coefficient. When the first phase adjustment coefficient is less than half of the frequency division coefficient, the calculation formula of the falling edge jump coefficient can be:

[0057] ;

[0058] When the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, the calculation formula of the falling edge jump coefficient can be:

[0059] ;

[0060] In the above two formulas, is the falling edge jump coefficient, is the initial value of the count, is the frequency division coefficient, is the first phase adjustment coefficient.

[0061] For example, assuming the frequency division coefficient is 6 and the first phase adjustment coefficient is 2, the rising edge jump coefficient is 0+2=2, and the falling edge jump coefficient is 0+6 / 2+2=5. For another example, assuming the frequency division coefficient is 7 and the first phase adjustment coefficient is 5, the rising edge jump coefficient is 0+5=5, and the falling edge jump coefficient is 0+3+5-7=1.

[0062] In the above embodiment, the calculation method of the rising edge jump coefficient and the falling edge jump coefficient is set according to the law of odd-number frequency division and even-number frequency division and the size of the first phase adjustment coefficient. The first phase adjustment coefficient is introduced in the calculation of the rising edge jump coefficient and the falling edge jump coefficient, so that the control module 303 can control the high level and low level jump of the target clock signal through the rising edge jump coefficient and the falling edge jump coefficient, thereby achieving the first-level phase adjustment of the target clock signal while dividing the reference clock signal to obtain the target clock signal.

[0063] In one embodiment, the data processing module 301 is also connected to the counting module 302; before the counting module 302 counts the rising edge and / or falling edge of the reference clock signal in step 102, the clock phase adjustment method further includes: the data processing module 301 obtains a preset frequency division condition, obtains a frequency division indication signal according to the frequency division coefficient and the frequency division condition, and sends the frequency division indication signal to the counting module 302 and the control module 303, wherein the frequency division indication signal is used to indicate the counting module 302 to count the rising edge and / or falling edge of the reference clock signal, and is used to indicate The control module 303 performs frequency division processing and a first-level phase adjustment on the reference clock signal; wherein the frequency division condition includes a first frequency division condition and a second frequency division condition, the first frequency division condition requires that the duty cycle of the target clock signal is 50%, and the second frequency division condition does not require that the duty cycle of the target clock signal is 50%; when the frequency division coefficient is an odd number and the frequency division condition is the first frequency division condition, the frequency division indication signal is a first frequency division indication signal; when the frequency division coefficient is an odd number and the frequency division condition is the second frequency division condition, or when the frequency division coefficient is an even number, the frequency division indication signal is a second frequency division indication signal.

[0064] In the above embodiment, the frequency division coefficient determined according to the frequency of the reference clock signal and the frequency of the target clock signal includes two cases, odd and even. In practical applications, the requirements for the duty cycle of the target clock signal can also be divided into two cases. For example, for a functional module that samples based on the target clock signal, if only one of the rising edge or the falling edge of the target clock signal needs to be sampled, the duty cycle of the target clock signal may not be required to be 50%; if the rising edge and the falling edge of the target clock signal need to be sampled at the same time, the duty cycle of the target clock signal may be required to be 50%. In the steps where the counting module 302 counts the edges of the reference clock, and the control module 303 compares the edge count value with the rising edge jump coefficient and the falling edge jump coefficient, and then controls the high and low level output of the target clock signal, different processing methods may be required for the combination of the above different cases.

[0065] Specifically, when the frequency division coefficient is an even number, regardless of whether the duty cycle of the target clock signal is required to be 50%, the frequency division can be achieved by counting only one of the rising edge or the falling edge of the reference clock signal. When the frequency division coefficient is an odd number, for the case where the duty cycle of the target clock signal is not required to be 50%, the frequency division can also be achieved by counting only one of the rising edge or the falling edge of the reference clock signal. When the frequency division coefficient is an odd number, for the case where the duty cycle of the target clock signal is required to be 50%, both the rising edge and the falling edge of the reference clock signal need to be counted to meet the frequency division condition. Based on this, this embodiment distinguishes the frequency division strategies that need to be executed in different situations by setting a frequency division indication signal. For the counting module 302, the frequency division indication signal is used to indicate the counting module 302 to count the rising edge and / or falling edge of the reference clock signal; for the control module 303, the frequency division indication signal is used to indicate the control module 303 to perform frequency division processing and a first-level phase adjustment on the reference clock signal.

[0066] In the above embodiment, for the case where the frequency division coefficient is an odd number and the frequency division condition is to require the duty cycle of the target clock signal to be 50%, the corresponding frequency division indication signal is the first frequency division indication signal; for the case where the frequency division coefficient is an odd number and the frequency division condition is not to require the duty cycle of the target clock signal to be 50%, and for the case where the frequency division coefficient is an even number, the corresponding frequency division indication signal is the second frequency division indication signal. Among them, the parity of the frequency division coefficient can be obtained by calculation, whether the frequency division condition is to require the duty cycle of the target clock signal to be 50%, can be set according to actual needs, and input to the data processing module 301, and the frequency division indication signal can be obtained by logical operation according to the frequency division coefficient and the frequency division condition. For example, a parity indication signal can be set to characterize the parity of the frequency division coefficient. If the frequency division coefficient is an odd number, the parity indication signal is set to 1, and if the frequency division coefficient is an even number, the parity indication signal is set to 0. If the duty cycle of the target clock signal is required to be 50%, 1 can be input through the frequency division condition input port, and if the duty cycle of the target clock signal is not required to be 50%, 0 can be input through the frequency division condition input port. The parity indication signal and the frequency division condition are logically ANDed to obtain the frequency division indication signal. When the frequency division indication signal is 1, it corresponds to the first frequency division indication signal, and when the frequency division indication signal is 0, it corresponds to the second frequency division indication signal.

[0067] In the above embodiment, specifically, Figure 3 Taking the clock phase adjustment circuit shown as an example, the data processing module 301 receives the frequency division coefficient and the frequency division condition, performs logical operations on the frequency division coefficient and the frequency division condition, generates a frequency division indication signal, and inputs the frequency division indication signal to the counting module 302 and the control module 303. It is convenient for the counting module 302 and the control module 303 to execute the corresponding frequency division processing strategy according to the frequency division indication signal for the combination of the frequency division coefficient and the frequency division condition in different situations. In this way, the requirements for odd frequency division, even frequency division and the duty cycle of the target clock signal can be taken into account, which can provide more options compared to the method of only using even frequency division.

[0068] In one embodiment, in step 102, the counting module 302 counts the rising edge and / or falling edge of the reference clock signal to obtain the edge count value of the reference clock signal, and sends the edge count value to the control module 303, which can be specifically implemented in the following manner: if the frequency division indication signal is the first frequency division indication signal, the rising edge of the reference clock signal is counted to obtain a first rising edge count value, and the first rising edge count value is sent to the control module; and, the falling edge of the reference clock signal is counted to obtain a first falling edge count value, and the first falling edge count value is sent to the control module; if the frequency division indication signal is the second frequency division indication signal, the rising edge of the reference clock signal is counted to obtain a second rising edge count value, and the second rising edge count value is sent to the control module; or, the falling edge of the reference clock signal is counted to obtain a second falling edge count value, and the second falling edge count value is sent to the control module.

[0069] The counting module 302 may be provided with two counters, such as a rising edge counter and a falling edge counter, wherein the rising edge counter is used to count the rising edge of the reference clock signal, and the falling edge counter is used to count the falling edge of the reference clock. Specifically, the counting module 302 may calculate the count reset value according to the count initial value and the frequency division coefficient; when the frequency division indication signal is the first frequency division indication signal, the rising edge of the reference clock signal is counted from the count initial value by the rising edge counter to obtain the first rising edge count value, and the first rising edge count value is sent to the control module 303, wherein when the first rising edge count value reaches the count reset value, the rising edge counter is reset to the count initial value and counts again; and the falling edge of the reference clock signal is counted from the count initial value by the falling edge counter to obtain the first falling edge count value, and the first falling edge count value is sent to the control module 303, wherein when the first falling edge count value reaches the count reset value, the falling edge counter is reset to the count initial value and counts again. When the frequency division indication signal is the second frequency division indication signal, the rising edge of the reference clock signal is counted from the initial count value through the rising edge counter to obtain the second rising edge count value, and the second rising edge count value is sent to the control module 303, wherein when the second rising edge count value reaches the count reset value, the rising edge counter is reset to the initial count value and counted again; or, the falling edge of the reference clock signal is counted from the initial count value through the falling edge counter to obtain the second falling edge count value, and the second falling edge count value is sent to the control module 303, wherein when the second falling edge count value reaches the count reset value, the falling edge counter is reset to the initial count value and counted again.

[0070] In the above embodiment, the count reset value is a value used to indicate the reset of the edge count of the reference clock signal, that is, when the edge count value reaches the count reset value, the edge count value is reset to the count initial value in the next clock cycle, and the counting starts again from the count initial value. The count reset value can be calculated based on the count initial value and the frequency division coefficient, and the calculation formula is:

[0071] ;

[0072] in, is the count reset value, is the initial value of the count, is the frequency division coefficient.

[0073] In the above embodiment, the count initial value is usually set to 0, so the count reset value is usually set to the frequency division factor minus 1. For example, if the frequency division factor is 8, the edge count value starts from 0 and counts to 7, then resets to 0 and starts counting from 0 again.

[0074] In the above embodiment, if the frequency division indication signal is the first frequency division indication signal, it is necessary to count both the rising edge and the falling edge of the reference clock signal; if the frequency division indication signal is the second frequency division indication signal, it is only necessary to count one of the rising edge or the falling edge of the reference clock signal. Counting the edge of the reference clock signal can be implemented by the counting module 302. Specifically, two counters can be set in the counting module 302, one is a rising edge counter for counting the rising edge of the reference clock signal, and the other is a falling edge counter for counting the falling edge of the reference clock signal.

[0075] In the case where the frequency division indication signal is the first frequency division indication signal, it can be specifically implemented in the following manner: when the counting module 302 receives the first frequency division indication signal, it starts the rising edge counter and the falling edge counter. Using the rising edge counter, the rising edge of the reference clock signal is counted from the counting initial value to obtain the first rising edge count value. When the first rising edge count value reaches the counting reset value, the rising edge counter is reset to the counting initial value and the counting is restarted. At the same time, using the falling edge counter, the falling edge of the reference clock signal is counted from the counting initial value to obtain the first falling edge count value. When the first falling edge count value reaches the counting reset value, the falling edge counter is reset to the counting initial value and the counting is restarted. The counting module 302 also sends the first rising edge count value and the first falling edge count value to the control module 303, so that the control module 303 controls the high level and low level jump of the target clock signal based on the first rising edge count value and the first falling edge count value.

[0076] In the case where the frequency division indication signal is the second frequency division indication signal, it can be specifically implemented in the following manner: when the counting module 302 receives the second frequency division indication signal, it starts the rising edge counter, and uses the rising edge counter to count the rising edge of the reference clock signal from the counting initial value to obtain the second rising edge count value, and when the second rising edge count value reaches the counting reset value, the rising edge counter is reset to the counting initial value and the counting is restarted. The counting module 302 also sends the second rising edge count value to the control module 303, so that the control module 303 controls the high level and low level jump of the target clock signal based on the second rising edge count value. Alternatively, when the counting module 302 receives the second frequency division indication signal, it starts the falling edge counter, and uses the falling edge counter to count the falling edge of the reference clock signal from the counting initial value to obtain the second falling edge count value, and when the second falling edge count value reaches the counting reset value, the falling edge counter is reset to the counting initial value and the counting is restarted. The counting module 302 further sends the second falling edge count value to the control module 303 , so that the control module 303 controls the transition between the high level and the low level of the target clock signal based on the second falling edge count value.

[0077] In one embodiment, the control module 303 in step 103 performs frequency division processing and a first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain the target clock signal, which can be achieved in the following manner: if the frequency division indication signal is the first frequency division indication signal, the first rising edge count value and the first falling edge count value are obtained, a first frequency division clock signal is generated based on the first rising edge count value, and a second frequency division clock signal is generated based on the first falling edge count value; wherein, generating the first frequency division clock signal based on the first rising edge count value includes: when the first rising edge count value is equal to the rising edge jump coefficient, controlling the first frequency division clock signal to jump to a high level; when the first rising edge count value is equal to the falling edge jump coefficient, controlling the first frequency division clock signal to jump to a low level; generating the second frequency division clock signal based on the first falling edge count value includes: when the first falling edge count value is equal to the rising edge jump coefficient, controlling the first frequency division clock signal to jump to a low level; When the value is equal to the rising edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a high level; when the first falling edge count value is equal to the falling edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a low level; a logical operation is performed on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; if the frequency-dividing indication signal is the second frequency-dividing indication signal, the second rising edge count value or the second falling edge count value is obtained, and the target clock signal is generated based on the second rising edge count value or the second falling edge count value; wherein, the generating of the target clock signal based on the second rising edge count value or the second falling edge count value includes: when the second rising edge count value or the second falling edge count value is equal to the rising edge jump coefficient, the target clock signal is controlled to jump to a high level; when the second rising edge count value or the second falling edge count value is equal to the falling edge jump coefficient, the target clock signal is controlled to jump to a low level.

[0078] In the above embodiment, when the frequency division indication signal is the first frequency division indication signal and the frequency division indication signal is the second frequency division indication signal, the method of counting the edge of the reference clock signal is different, and the method of controlling the output of the target clock signal based on the edge count value of the reference clock signal is also different.

[0079] In the case where the frequency division indication signal is the first frequency division indication signal, it can be specifically implemented in the following manner: the control module 303 receives the first frequency division indication signal, obtains the first rising edge count value and the first falling edge count value sent by the counting module 302, and compares the first rising edge count value with the rising edge jump coefficient and the falling edge jump coefficient, and compares the first falling edge count value with the rising edge jump coefficient and the falling edge jump coefficient. Based on the first rising edge jump coefficient, the output of one signal is recorded as the first frequency division clock signal. Specifically, when the first rising edge count value reaches the rising edge jump coefficient, the first frequency division clock signal is controlled to output a high level, and when the first rising edge count value reaches the falling edge jump coefficient, the first frequency division clock signal is controlled to output a low level. Similarly, based on the first falling edge jump coefficient, another signal is controlled to output as the second frequency division clock signal. Specifically, when the first falling edge count value reaches the rising edge jump coefficient, the second frequency division clock signal is controlled to output a high level, and when the first falling edge count value reaches the falling edge jump coefficient, the second frequency division clock signal is controlled to output a low level. A logic operation is performed on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain a target clock signal.

[0080] See also Figure 4 , taking the frequency division coefficient as 5 as an example, when the first phase adjustment coefficient is 0, the rising edge jump coefficient is 0, and the falling edge jump coefficient is 2. The waveform of the first frequency-divided clock signal obtained by counting the rising edge of the reference clock signal and the waveform of the second frequency-divided clock signal obtained by counting the falling edge of the reference clock signal are shown in FIG. Figure 4 As shown, after obtaining the first frequency-divided clock signal and the second frequency-divided clock signal, a logical OR operation is performed on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain a target clock signal _fp0 with a duty cycle of 50%. The target clock signal _fp0 is the target clock signal calculated when the phase adjustment coefficient is 0. Similarly, if the first phase adjustment coefficient is set to 1, the waveform of the output target clock signal is Figure 4 If the first phase adjustment coefficient is set to 2, the waveform of the output target clock signal is Figure 4 The target clock signal _fp2 in.

[0081] For the case where the frequency division indication signal is the second frequency division indication signal, taking counting the rising edge of the reference clock signal as an example, it can be specifically implemented in the following manner: the control module 303 receives the second frequency division indication signal, obtains the second rising edge count value sent by the counting module 302, and compares the second rising edge count value with the rising edge jump coefficient and the falling edge jump coefficient, and directly outputs the target clock signal. Specifically, when the second rising edge count value reaches the rising edge jump coefficient, the target clock signal is controlled to output a high level, and when the second rising edge count value reaches the falling edge jump coefficient, the target clock signal is controlled to output a low level. The target signal output based on the second rising edge count value is the target clock signal after a first-level phase adjustment. In addition, the method of obtaining the target clock signal by counting the falling edge of the reference clock is similar to the method of counting the rising edge, and this embodiment will not be repeated here.

[0082] like Figure 5 As shown, taking the frequency division coefficient as 6 as an example, when the first phase adjustment coefficient is 0, the rising edge jump coefficient is 0, the falling edge jump coefficient is 3, and the waveform of the output target clock signal is Figure 5 The target clock signal _fp0 in the output; when the first phase adjustment coefficient is 1, the rising edge jump coefficient is 1, the falling edge jump coefficient is 4, and the waveform of the output target clock signal is Figure 5 The target clock signal in is _fp1. And so on, Figure 5 The target clock signal _fp2, target clock signal _fp3, target clock signal _fp4, and target clock signal _fp5 are waveform diagrams of the target clock signals output when the first phase adjustment coefficient is 2, 3, 4, and 5, respectively.

[0083] In the above embodiment, a clock phase adjustment method for different combinations of odd frequency division, even frequency division, 50% duty cycle, and non-50% duty cycle is provided. A suitable phase adjustment method can be selected according to the phase adjustment requirements in practical applications. The clock phase adjustment method provided in this embodiment can meet most phase adjustment requirements. For odd frequency division, there is no unified frequency division method of simultaneously counting the rising edge and falling edge of the reference clock signal, and then obtaining a 50% duty cycle target clock signal by calculating the two frequency division signals. Instead, two frequency division methods are provided based on the duty cycle requirements. When the duty cycle of the target clock signal is not required to be 50%, only one of the rising edge or the falling edge of the reference clock signal is counted, and the target clock signal is obtained through one frequency division signal. In this way, the amount of calculation can be reduced and the operating resources of the system can be saved.

[0084] In the above embodiment, the period of the reference clock signal is used as the first phase adjustment step. The accuracy of the first-level phase adjustment of the target clock signal can be changed by adjusting the frequency of the reference clock signal. The reference clock signal of appropriate frequency and the first phase adjustment coefficient can be flexibly selected according to the size of the first phase to be adjusted, thereby meeting most phase adjustment requirements.

[0085] In one embodiment, the clock phase adjustment circuit also includes a delay chain 304 constructed by connecting multiple inverters in series, and the delay chain 304 is connected to the control module 303, wherein the number of the inverters is calculated according to the period of the reference clock signal and the second phase adjustment step, and the second phase adjustment step is determined according to the delay duration of the inverter. The clock phase adjustment method also includes: the control module 303 inputs the target clock signal into the delay chain 304; the delay chain 304 delays the target clock signal according to the preset second phase adjustment coefficient to obtain the target clock signal after the secondary phase adjustment, wherein the second phase adjustment coefficient is calculated according to the second phase to be adjusted and the second phase adjustment step, and the second phase to be adjusted is calculated according to the first phase to be adjusted, the first phase adjustment step and the first phase adjustment coefficient.

[0086] In the above embodiment, the scheme of performing a first-level phase adjustment on the target clock signal based on the frequency division method can meet most clock phase adjustment requirements and can accurately perform phase adjustment. However, there may be errors. For example, if there is a remainder when the first phase to be adjusted is divided by the first phase adjustment step, and the phase error caused by this remainder after the first-level phase adjustment of the target clock signal exceeds the allowable error threshold, then the phase needs to be further adjusted to eliminate or reduce the error. For example, if the allowable error threshold is 0.02ns, assuming that the first phase to be adjusted is 1.14ns, the first phase adjustment step is 0.1ns, and the first phase adjustment coefficient is calculated to be 11, in this case, there will still be a phase error of 0.04ns after the first-level phase adjustment of the target clock signal, which exceeds the error threshold. Based on this, if Figure 3 As shown, the embodiment of the present application constructs a delay chain 304 to perform a second-level phase adjustment on the target clock signal after the first-level phase adjustment, so as to further improve the accuracy of the clock phase adjustment.

[0087] In the above embodiment, two inverters can be connected in series to obtain a delay unit, and multiple delay units can be connected in series to obtain a delay chain 304. The delay length of a delay unit is the second phase adjustment step, that is, the second phase adjustment step is twice the delay length of the inverter. The delay chain 304 composed of different numbers of delay units can achieve different ranges of phase adjustment. The range of phase adjustment of the target clock signal by the delay chain 304 should be able to cover the period of a reference clock signal. Based on this, the number of delay units can be calculated according to the frequency of the reference clock signal and the second phase adjustment step, and then the number of inverters can be obtained. For example, assuming that the frequency of the reference clock signal is 10MHz, the period of the reference clock signal is 0.1ns, and assuming that the second phase adjustment step is 20ps, the number of delay units is 5, and the number of inverters is 10. Figure 6 As an example, five delay units (10 inverters) are connected in series to obtain a delay chain 304 that matches the frequency of the reference clock signal. Figure 6 In the figure, p_s is the second phase adjustment step. After the first-level phase adjustment, the phase of the target clock signal increases by 1 p_s after passing through the first delay unit 51, and increases by 2 p_s after passing through the second delay unit 52. By analogy, after passing through the third delay unit 53, the fourth delay unit 54 and the fifth delay unit 55, the phase of the target clock signal increases by 3 p_s, 4 p_s and 5 p_s respectively.

[0088] After the delay chain 304 is constructed, the second phase to be adjusted is obtained by subtracting the product of the first phase adjustment step and the first phase adjustment coefficient from the first phase to be adjusted. The first phase to be adjusted is the total phase that needs to be adjusted for the target clock signal; the product of the first phase adjustment step and the first phase adjustment coefficient is the phase actually adjusted when the target clock signal is subjected to a first-level phase adjustment; the second phase to be adjusted is the phase that needs to be adjusted when the target clock signal is subjected to a second-level phase adjustment, that is, the total phase that needs to be adjusted minus the phase actually adjusted when the first-level phase adjustment is performed. After the second phase to be adjusted is calculated, the output length of the delay chain 304 is determined according to the second phase to be adjusted, that is, the target delay chain is obtained by selecting the target number of delay units in the delay chain 304. The output length is calculated according to the second phase to be adjusted and the second phase adjustment step, and the second phase to be adjusted is divided by the second phase adjustment step to obtain the second phase adjustment coefficient, and the second phase adjustment coefficient is the output length. For example, assuming that the second phase to be adjusted is 40 ps and the second phase adjustment step is 20 ps, ​​the second phase adjustment coefficient is 2, that is, the output length of the delay chain 304 is 2. At this time, the first two delay units in the delay chain 304 can be selected as the target delay chain. Figure 6Taking the delay chain 304 shown as an example, the target clock signal after the first-level phase adjustment is input to the first delay unit 51, then the first delay unit 51 and the second delay unit 52 can be selected as the target delay chain, and the target clock signal is subjected to the second-level phase adjustment through the target delay chain, and the output of the second delay unit 52 is the target clock signal after the second-level phase adjustment.

[0089] In the above embodiment, the second phase adjustment step is smaller than the first phase adjustment step, so the accuracy of the second phase adjustment is higher than that of the first phase adjustment. By constructing a delay chain 304 with a phase adjustment range that can cover the first phase adjustment step through an inverter, the target clock signal is subjected to a second phase adjustment, which can improve the accuracy of the clock phase adjustment and is easy to implement.

[0090] Further, as Figure 1 As well as the specific implementation of the method shown in the above embodiment, this embodiment provides a clock phase adjustment circuit, such as Figure 2 As shown, the circuit includes: a data processing module 301, a counting module 302, and a control module 303, wherein the data processing module 301 and the counting module 302 are connected to the control module 303 respectively.

[0091] The data processing module 301 may be used to receive a frequency division coefficient and a first phase adjustment coefficient, calculate a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and send the rising edge jump coefficient and the falling edge jump coefficient to the control module 303;

[0092] The counting module 302 may be used to receive a reference clock signal, count the rising edge and / or falling edge of the reference clock signal, obtain an edge count value of the reference clock signal, and send the edge count value to the control module 303;

[0093] The control module 303 can be used to perform frequency division processing and first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal.

[0094] In specific application scenarios, such as Figure 3As shown, the circuit further includes a preprocessing module 300, and the preprocessing module 300 is connected to the data processing module 301. Before the data processing module 301 receives the frequency division coefficient and the first phase adjustment coefficient, the preprocessing module 300 can be specifically used to determine the first phase adjustment step according to the preset first phase to be adjusted, determine the frequency of the reference clock signal according to the first phase adjustment step, determine the frequency division coefficient according to the frequency of the reference clock signal and the preset target frequency, and send the frequency division coefficient to the data processing module 301, wherein the target frequency is the frequency of the target clock signal; calculate the first phase adjustment coefficient according to the first phase to be adjusted and the first phase adjustment step, and send the first phase adjustment coefficient to the data processing module 301, wherein the first phase adjustment coefficient is less than the frequency division coefficient.

[0095] In a specific application scenario, the data processing module 301 calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient. The data processing module 301 can be specifically used to obtain a preset count initial value, and sum the count initial value and the first phase adjustment coefficient to obtain the rising edge jump coefficient; if the first phase adjustment coefficient is less than half of the frequency division coefficient, half of the frequency division coefficient is rounded down and summed with the count initial value and the first phase adjustment coefficient to obtain the falling edge jump coefficient; if the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, half of the frequency division coefficient is rounded down and summed with the count initial value and the first phase adjustment coefficient, and then the frequency division coefficient is subtracted to obtain the falling edge jump coefficient.

[0096] In specific application scenarios, such as Figure 3As shown, the data processing module 301 is also connected to the counting module 302; before the counting module 302 counts the rising edge and / or falling edge of the reference clock signal, the data processing module 301 can be specifically used to obtain a preset frequency division condition, obtain a frequency division indication signal according to the frequency division coefficient and the frequency division condition, and send the frequency division indication signal to the counting module 302 and the control module 303, wherein the frequency division indication signal is used to indicate the counting module 302 to count the rising edge and / or falling edge of the reference clock signal, and to indicate the control module 303 A method for performing frequency division processing and first-level phase adjustment on the reference clock signal; wherein the frequency division condition includes a first frequency division condition and a second frequency division condition, the first frequency division condition is to require that the duty cycle of the target clock signal is 50%, and the second frequency division condition is not to require that the duty cycle of the target clock signal is 50%; when the frequency division coefficient is an odd number and the frequency division condition is the first frequency division condition, the frequency division indication signal is a first frequency division indication signal; when the frequency division coefficient is an odd number and the frequency division condition is the second frequency division condition, or when the frequency division coefficient is an even number, the frequency division indication signal is a second frequency division indication signal.

[0097] In a specific application scenario, the counting module 302 counts the rising edge and / or falling edge of the reference clock signal to obtain the edge count value of the reference clock signal, and sends the edge count value to the control module 303. The counting module 302 can be specifically used to count the rising edge of the reference clock signal to obtain the first rising edge count value and send the first rising edge count value to the control module 303 if the frequency division indication signal is the first frequency division indication signal; and count the falling edge of the reference clock signal to obtain the first falling edge count value and send the first falling edge count value to the control module 303; if the frequency division indication signal is the second frequency division indication signal, count the rising edge of the reference clock signal to obtain the second rising edge count value and send the second rising edge count value to the control module 303; or count the falling edge of the reference clock signal to obtain the second falling edge count value and send the second falling edge count value to the control module 303.

[0098] In a specific application scenario, the control module 303 performs frequency division processing and a first-level phase adjustment on the reference clock signal according to the edge count value and the rising edge jump coefficient and the falling edge jump coefficient to obtain a target clock signal. The control module 303 can be specifically used to obtain the first rising edge count value and the first falling edge count value if the frequency division indication signal is the first frequency division indication signal, generate a first frequency-divided clock signal based on the first rising edge count value, and generate a second frequency-divided clock signal based on the first falling edge count value; generate the first frequency-divided clock signal based on the first rising edge count value, including: when the first rising edge count value is equal to the rising edge jump coefficient, control the first frequency-divided clock signal to jump to a high level; when the first rising edge count value is equal to the falling edge jump coefficient, control the first frequency-divided clock signal to jump to a low level; the generating the second frequency-divided clock signal based on the first falling edge count value includes: when the first falling edge count value is equal to the rising edge jump coefficient, control the first frequency-divided clock signal to jump to a low level; When the value is equal to the rising edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a high level; when the first falling edge count value is equal to the falling edge jump coefficient, the second frequency-divided clock signal is controlled to jump to a low level; a logical operation is performed on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; if the frequency-dividing indication signal is the second frequency-dividing indication signal, the second rising edge count value or the second falling edge count value is obtained, and the target clock signal is generated based on the second rising edge count value or the second falling edge count value; the generating of the target clock signal based on the second rising edge count value or the second falling edge count value includes: when the second rising edge count value or the second falling edge count value is equal to the rising edge jump coefficient, the target clock signal is controlled to jump to a high level; when the second rising edge count value or the second falling edge count value is equal to the falling edge jump coefficient, the target clock signal is controlled to jump to a low level.

[0099] In specific application scenarios, such as Figure 3As shown, the circuit also includes a delay chain 304 constructed by connecting a plurality of inverters in series, and the delay chain 304 is connected to the control module 303, wherein the number of the inverters is calculated according to the period of the reference clock signal and the second phase adjustment step, and the second phase adjustment step is determined according to the delay duration of the inverter. The control module 303 can also be used to input the target clock signal into the delay chain 304. The delay chain 304 can be used to delay the target clock signal according to a preset second phase adjustment coefficient to obtain the target clock signal after secondary phase adjustment, wherein the second phase adjustment coefficient is calculated according to the second phase to be adjusted and the second phase adjustment step, and the second phase to be adjusted is calculated according to the first phase to be adjusted, the first phase adjustment step and the first phase adjustment coefficient.

[0100] It should be noted that for other corresponding descriptions of the functional units involved in the clock phase adjustment circuit provided in this embodiment, reference can be made to Figure 1 As well as the corresponding descriptions in the above embodiments, they will not be repeated here.

[0101] Based on the above Figure 1 As well as the method shown in the above embodiment, correspondingly, this embodiment also provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the above Figure 1 The clock phase adjustment method shown in the above embodiment.

[0102] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product. The software product to be identified can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0103] Based on the above Figure 1 The method shown, and Figure 2 and Figure 3 In order to achieve the above-mentioned purpose, the clock phase adjustment circuit embodiment shown in FIG. Figure 7 As shown, this embodiment also provides a computer device for clock phase adjustment, which can be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program and an operating system; the processor is used to execute the computer program to implement the above-mentioned Figure 1 The method shown.

[0104] Optionally, the computer device may also include an internal memory, a communication interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, a display, an input device such as a keyboard, etc. Optionally, the communication interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0105] Those skilled in the art will appreciate that the computer device structure for clock phase adjustment provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0106] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the above-mentioned computer device hardware and the software resources to be identified, and supports the operation of the information processing program and other software and / or programs to be identified. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing computer device.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware. By applying the technical solution of the present application, a first phase adjustment coefficient is introduced in the calculation process of the rising edge jump coefficient and the falling edge jump coefficient, so that the phase of the target clock signal can be adjusted based on the frequency division. Compared with the prior art, by adjusting the clock phase in this way, the accuracy of the phase adjustment can be flexibly selected by adjusting the frequency of the reference clock signal, which can meet different clock phase adjustment requirements, facilitate multiplexing, and the solution design is simple and flexible, and easy to implement.

[0108] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0109] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A clock phase adjustment method, characterized in that: The method is applied to a clock phase adjustment circuit, the circuit comprising a data processing module, a counting module and a control module, wherein the data processing module and the counting module are respectively connected to the control module, and the method comprises: The data processing module receives a frequency division coefficient and a first phase adjustment coefficient, calculates a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and sends the rising edge jump coefficient and the falling edge jump coefficient to the control module; wherein, calculating the rising edge jump coefficient and the falling edge jump coefficient comprises: obtaining a preset count initial value, and summing the count initial value and the first phase adjustment coefficient to obtain the rising edge jump coefficient; if the first phase adjustment coefficient is less than half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the sum with the count initial value and the first phase adjustment coefficient to obtain the falling edge jump coefficient; if the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, rounding down half of the frequency division coefficient, summing the sum with the count initial value and the first phase adjustment coefficient, and then subtracting the frequency division coefficient to obtain the falling edge jump coefficient; The counting module receives a reference clock signal, counts rising edges and / or falling edges of the reference clock signal, obtains an edge count value of the reference clock signal, and sends the edge count value to the control module, wherein the edge count value includes a rising edge count value and / or a falling edge count value; For any one of the edge count values, the control module outputs a high level when the edge count value reaches the rising edge jump coefficient, and outputs a low level when the edge count value reaches the falling edge jump coefficient, wherein, if the frequency division coefficient is an odd number and the duty cycle of the target clock signal is required to be 50%, the control module generates a first frequency-divided clock signal according to the rising edge count value and generates a second frequency-divided clock signal according to the falling edge count value, and performs logical operations on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; otherwise, the control module generates the target clock signal according to the rising edge jump coefficient or the falling edge jump coefficient.

2. The method according to claim 1, characterized in that The clock phase adjustment circuit further includes a preprocessing module, and the preprocessing module is connected to the data processing module; Before the data processing module receives the frequency division coefficient and the first phase adjustment coefficient, the method further includes: The preprocessing module determines a first phase adjustment step according to a preset first phase to be adjusted, determines the frequency of the reference clock signal according to the first phase adjustment step, determines the frequency division coefficient according to the frequency of the reference clock signal and a preset target frequency, and sends the frequency division coefficient to the data processing module, wherein the target frequency is the frequency of the target clock signal; The preprocessing module calculates the first phase adjustment coefficient according to the first phase to be adjusted and the first phase adjustment step, and sends the first phase adjustment coefficient to the data processing module, wherein the first phase adjustment coefficient is smaller than the frequency division coefficient.

3. The method according to claim 1, characterized in that The data processing module is also connected to the counting module; before the counting module counts the rising edge and / or falling edge of the reference clock signal, the method further includes: The data processing module obtains a preset frequency division condition, obtains a frequency division indication signal according to the frequency division coefficient and the frequency division condition, and sends the frequency division indication signal to the counting module and the control module, wherein the frequency division indication signal is used to indicate the counting module how to count the rising edge and / or falling edge of the reference clock signal, and is used to indicate the control module how to perform frequency division processing and one-level phase adjustment on the reference clock signal; The frequency division condition includes a first frequency division condition and a second frequency division condition, the first frequency division condition requires that the duty cycle of the target clock signal is 50%, and the second frequency division condition does not require that the duty cycle of the target clock signal is 50%; When the frequency division coefficient is an odd number and the frequency division condition is the first frequency division condition, the frequency division indication signal is a first frequency division indication signal; When the frequency division coefficient is an odd number and the frequency division condition is the second frequency division condition, or when the frequency division coefficient is an even number, the frequency division indication signal is the second frequency division indication signal.

4. The method according to claim 3, characterized in that The counting module counts the rising edge and / or falling edge of the reference clock signal to obtain an edge count value of the reference clock signal, and sends the edge count value to the control module, including: If the frequency division indication signal is the first frequency division indication signal, counting the rising edge of the reference clock signal to obtain a first rising edge count value, and sending the first rising edge count value to the control module; and counting the falling edge of the reference clock signal to obtain a first falling edge count value, and sending the first falling edge count value to the control module; If the frequency division indication signal is the second frequency division indication signal, the rising edge of the reference clock signal is counted to obtain a second rising edge count value, and the second rising edge count value is sent to the control module; or, the falling edge of the reference clock signal is counted to obtain a second falling edge count value, and the second falling edge count value is sent to the control module.

5. The method according to claim 4, characterized in that If the frequency division coefficient is an odd number and the duty cycle of the target clock signal is required to be 50%, the control module generates a first frequency-divided clock signal and a second frequency-divided clock signal according to the rising edge count value and the falling edge count value, respectively, and performs a logic operation on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; Otherwise, the control module generates the target clock signal according to the rising edge jump coefficient or the falling edge jump coefficient, including: If the frequency division indication signal is the first frequency division indication signal, obtaining the first rising edge count value and the first falling edge count value, generating a first frequency division clock signal based on the first rising edge count value, and generating a second frequency division clock signal based on the first falling edge count value; Generating a first frequency-divided clock signal based on the first rising edge count value, comprising: when the first rising edge count value is equal to the rising edge jump coefficient, controlling the first frequency-divided clock signal to jump to a high level; when the first rising edge count value is equal to the falling edge jump coefficient, controlling the first frequency-divided clock signal to jump to a low level; The generating of the second frequency-divided clock signal based on the first falling edge count value comprises: when the first falling edge count value is equal to the rising edge jump coefficient, controlling the second frequency-divided clock signal to jump to a high level; when the first falling edge count value is equal to the falling edge jump coefficient, controlling the second frequency-divided clock signal to jump to a low level; Performing a logic operation on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; If the frequency division indication signal is the second frequency division indication signal, acquiring the second rising edge count value or the second falling edge count value, and generating the target clock signal based on the second rising edge count value or the second falling edge count value; The generating of the target clock signal based on the second rising edge count value or the second falling edge count value includes: when the second rising edge count value or the second falling edge count value is equal to the rising edge jump coefficient, controlling the target clock signal to jump to a high level; when the second rising edge count value or the second falling edge count value is equal to the falling edge jump coefficient, controlling the target clock signal to jump to a low level.

6. The method according to claim 2, characterized in that The clock phase adjustment circuit also includes a delay chain constructed by connecting a plurality of inverters in series, and the delay chain is connected to the control module, wherein the number of the inverters is calculated according to the period of the reference clock signal and the second phase adjustment step, and the second phase adjustment step is determined according to the delay time of the inverter; the method also includes: The control module inputs the target clock signal into the delay chain; The delay chain delays the target clock signal according to a preset second phase adjustment coefficient to obtain the target clock signal after secondary phase adjustment, wherein the second phase adjustment coefficient is calculated based on the second phase to be adjusted and the second phase adjustment step, and the second phase to be adjusted is calculated based on the first phase to be adjusted, the first phase adjustment step and the first phase adjustment coefficient.

7. A clock phase adjustment circuit, characterized in that: The circuit comprises: a data processing module, a counting module and a control module, wherein the data processing module and the counting module are respectively connected to the control module; The data processing module is used to receive a frequency division coefficient and a first phase adjustment coefficient, calculate a rising edge jump coefficient and a falling edge jump coefficient according to the frequency division coefficient and the first phase adjustment coefficient, and send the rising edge jump coefficient and the falling edge jump coefficient to the control module; wherein, calculating the rising edge jump coefficient and the falling edge jump coefficient comprises: obtaining a preset count initial value, and summing the count initial value and the first phase adjustment coefficient to obtain the rising edge jump coefficient; if the first phase adjustment coefficient is less than half of the frequency division coefficient, then rounding down half of the frequency division coefficient, summing the sum with the count initial value and the first phase adjustment coefficient to obtain the falling edge jump coefficient; if the first phase adjustment coefficient is greater than or equal to half of the frequency division coefficient, then rounding down half of the frequency division coefficient, summing the sum with the count initial value and the first phase adjustment coefficient, and then subtracting the frequency division coefficient to obtain the falling edge jump coefficient; The counting module is used to receive a reference clock signal, count the rising edge and / or falling edge of the reference clock signal, obtain an edge count value of the reference clock signal, and send the edge count value to the control module, wherein the edge count value includes a rising edge count value and / or a falling edge count value; The control module is used to output a high level when the edge count value reaches the rising edge jump coefficient, and output a low level when the edge count value reaches the falling edge jump coefficient for any one of the edge count values, wherein if the frequency division coefficient is an odd number and the duty cycle of the target clock signal is required to be 50%, the control module generates a first frequency-divided clock signal according to the rising edge count value and generates a second frequency-divided clock signal according to the falling edge count value, and performs logical operations on the first frequency-divided clock signal and the second frequency-divided clock signal to obtain the target clock signal; otherwise, the control module generates the target clock signal according to the rising edge jump coefficient or the falling edge jump coefficient.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.