Method, device, storage medium and equipment for setting compensation value of full digital phase-locked loop
By obtaining the sampling result number of the time-to-digital converter in the all-digital phase-locked loop, verifying and adjusting the compensation value of the delay compensation module, the problem of difficulty in measuring the delay compensation module is solved, and the timing stability and stability of the all-digital phase-locked loop are achieved. Work reliability.
Patent Information
- Application Number
- CN202410940596.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-15
AI Technical Summary
In nanoscale process production, the compensation value of the delay compensation module of the all-digital phase-locked loop is difficult to measure, resulting in unstable timing, which in turn affects the working status of the all-digital phase-locked loop. The existing technology relies on external measurement instruments, which is costly and difficult to implement. Effective compensation.
By setting the compensation value of the delay compensation module in the fully digital phase-locked loop, and obtaining the number of sampling results of the time-to-digital converter in the locked state, it is determined whether the compensation value is qualified, ensuring timing margin, and avoiding the phase-locked loop losing lock.
Without relying on external measuring instruments, the compensation value of the delay compensation module can be effectively verified and adjusted to ensure the stability of the all-digital phase-locked loop timing and improve the working reliability and efficiency of the phase-locked loop.
Smart Images

Figure CN118473397B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of integrated circuit technology, and in particular to a method, device, storage medium and equipment for setting a compensation value of a fully digital phase-locked loop. Background Art
[0002] The cost of traditional analog integrated phase-locked loops is getting higher and higher in advanced processes, while the performance is saturated. Therefore, in nano-scale process production, all-digital phase-locked loops (ADPLL) have more advantages than traditional analog phase-locked loops. All-digital phase-locked loops essentially still work on phase signals, and phase signals are analog signals. Therefore, all-digital phase-locked loops usually use time-to-digital converters (TDCs) to convert phase signals into digital signals. Since the time-to-digital converter consumes a lot of power, a snapshot circuit module is usually set to make the time-to-digital converter work at the reference frequency to reduce power consumption.
[0003] The snapshot circuit module involves the conversion from the high-frequency clock domain to the low-frequency clock domain, where the high-frequency clock domain refers to the digital oscillator (DCO) frequency and the low-frequency clock domain refers to the reference clock frequency. There is usually a phase difference between the path corresponding to the high-frequency clock domain and the path corresponding to the low-frequency clock domain, so a delay compensation module needs to be set to compensate for the phase difference between the two paths. The compensation value of the delay compensation module directly affects the working state of the fully digital phase-locked loop.
[0004] Since the delay time caused by the snapshot circuit module is usually in the picosecond level, it is difficult to measure its timing with instruments, or the measurement cost is too high. Therefore, how to set the compensation value of the delay compensation module without relying on external measuring instruments to ensure the timing margin of the snapshot circuit module corresponding to the delay compensation, so as to ensure the timing stability of the full digital phase-locked loop and enable it to work stably, has become a difficult problem that technicians in this field are concerned about. Summary of the invention
[0005] The object of the present invention is to provide a method, device, storage medium and equipment for setting a compensation value of a fully digital phase-locked loop, so as to at least partially improve the above-mentioned problem.
[0006] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0007] In a first aspect, an embodiment of the present invention provides a method for setting a compensation value of a fully digital phase-locked loop, the method comprising: after setting the compensation value of a delay compensation module in a fully digital phase-locked loop, controlling the fully digital phase-locked loop to operate; when the fully digital phase-locked loop reaches a locked state within a preset time length, controlling the fully digital phase-locked loop to switch to an open-loop state; obtaining a first sampling result number and a second sampling result number of the fully digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of a time-to-digital converter in the fully digital phase-locked loop in a phase advance stage, and the second sampling result number represents the number of sampling results of the time-to-digital converter in a phase lag stage; determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number.
[0008] In a second aspect, an embodiment of the present invention provides a device for setting a compensation value of a fully digital phase-locked loop, the device comprising: a first processing unit, used to set the compensation value of a delay compensation module in a fully digital phase-locked loop; the first processing unit is also used to control the operation of the fully digital phase-locked loop, and when the fully digital phase-locked loop reaches a locked state within a preset time length, the fully digital phase-locked loop is controlled to switch to an open-loop state; the first processing unit is also used to obtain a first sampling result number and a second sampling result number of the fully digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of a time-to-digital converter in the fully digital phase-locked loop in a phase advance stage, and the second sampling result number represents the number of sampling results of the time-to-digital converter in a phase lag stage; the second processing unit is used to determine whether the current compensation value is qualified based on the first sampling result number and the second sampling result number.
[0009] In a third aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, and the computer program implements the above method when executed by a processor.
[0010] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory is used to store one or more programs; when the one or more programs are executed by the processor, the above method is implemented.
[0011] Compared with the prior art, the embodiments of the present invention provide a method, device, storage medium and equipment for setting the compensation value of a fully digital phase-locked loop. Without relying on external measuring instruments, the compensation value of the delay compensation module is verified by the number of sampling results of the time-to-digital converter in the fully digital phase-locked loop, thereby ensuring that the compensation value of the delay compensation module is qualified, thereby ensuring the timing margin of the snapshot circuit module corresponding to the delay compensation, thereby ensuring the timing stability of the fully digital phase-locked loop and enabling it to work stably.
[0012] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0014] Figure 1 A schematic diagram of the structure of a fully digital phase-locked loop provided by the present invention;
[0015] Figure 2 A timing diagram corresponding to the all-digital phase-locked loop provided by the present invention;
[0016] Figure 3 A schematic diagram of the output of the time-to-digital converter provided by the present invention;
[0017] Figure 4 A schematic diagram of the connection between the control system and the full digital phase-locked loop provided by the present invention;
[0018] Figure 5 A schematic diagram of the structure of a control system provided by the present invention;
[0019] Figure 6 One of the flow charts of the method for setting the compensation value of the full digital phase-locked loop provided by the present invention;
[0020] Figure 7 A second flow chart of the method for setting the compensation value of a fully digital phase-locked loop provided by the present invention;
[0021] Figure 8 The third flowchart of the method for setting the compensation value of the all-digital phase-locked loop provided by the present invention;
[0022] Fig. 9 A fourth flow chart of the method for setting the compensation value of a fully digital phase-locked loop provided by the present invention;
[0023] Fig.10 A fifth flow chart of the method for setting the compensation value of a full digital phase-locked loop provided by the present invention;
[0024] Fig.11 A schematic diagram of the number of sampling results provided by the present invention;
[0025] Fig.12 A sixth flow chart of the method for setting the compensation value of a fully digital phase-locked loop provided by the present invention;
[0026] Fig.13 A unit schematic diagram of a device for setting a compensation value of a fully digital phase-locked loop provided by the present invention.
[0027] In the figure: 10-processor; 11-memory; 12-bus; 13-communication interface; 100-control system; 200-all-digital phase-locked loop; 201-time digital converter; 202-digital oscillator; 203-delay compensation module; 204-snapshot circuit module; 301-first processing unit; 302-second processing unit; START-first end of the time digital converter; STOP-second end of the time digital converter; Output-output end of the time digital converter; t1-compensation value; t2-first time interval; t3-second time interval; t4-third time interval. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0031] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0032] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "disposed" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0033] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0034] The present invention provides a method for setting a compensation value of a fully digital phase-locked loop, the object of which is a fully digital phase-locked loop, specifically, a method for setting a compensation value of a delay compensation module in the fully digital phase-locked loop. In order to better understand the technical effect of the present invention, the structure of the fully digital phase-locked loop is first described below, please refer to Figure 1 , Figure 1 This is a schematic diagram of the structure of the all-digital phase-locked loop provided by the present invention.
[0035] The fully digital phase-locked loop 200 includes a delay compensation module 203 , a snapshot circuit module 204 , a digital oscillator 202 and a time-to-digital converter 201 .
[0036] The input end of the delay compensation module 203 is used to access the reference clock signal, and the output end of the delay compensation module 203 is connected to the first end (START shown in the figure) of the time-to-digital converter 201 .
[0037] The first input of the snapshot circuit module 204 is used to access the reference clock signal, the second input of the snapshot circuit module 204 is connected to the output of the digital oscillator 202, and the output of the snapshot circuit module 204 is connected to the second end of the time-to-digital converter 201 (STOP shown in the figure).
[0038] Please refer to Figure 2 , Figure 2 The timing diagram corresponding to the all-digital phase-locked loop provided by the present invention is shown below. Figure 2 right Figure 1 This section introduces the various modules in the.
[0039] The delay compensation module 203 is used to perform delay processing based on the set compensation value t1 (also called offset delay) when receiving the rising edge of the reference clock signal, and perform synchronization processing when receiving the falling edge of the reference clock signal to obtain a reference delay signal, and transmit the reference delay signal to the time-to-digital converter 201. Figure 2 As shown, the time length of the delay of the rising edge of the initial reference delay signal 1 relative to the rising edge of the reference clock signal is t1.
[0040] The snapshot circuit module 204 is used to convert the high-frequency clock signal output by the digital oscillator 202 after receiving the rising edge of the reference clock signal to obtain a low-frequency clock signal with the same frequency as the reference clock signal, and transmit the low-frequency clock signal to the time-to-digital converter 201.
[0041] The low frequency in the low-frequency clock signal and the high frequency of the high-frequency clock signal here are not used to specifically limit the frequency of the clock signal, but are only used for comparison and explanation: the low-frequency clock signal output by the snapshot circuit module 204 has a lower frequency than the high-frequency clock signal output by the digital oscillator 202. Specifically, after receiving the rising edge of the reference clock signal, the snapshot circuit module 204 samples the high-frequency clock signal output by the digital oscillator 202. At the first rising edge of the high-frequency clock signal output by the digital oscillator 202, the snapshot circuit module 204 switches the low-frequency clock signal to a high level after a first time interval t2 (also called snapshot delay), and maintains it at a high level until the snapshot circuit module 204 receives the falling edge of the reference clock signal, and then synchronously switches the low-frequency clock signal to a low level, thereby obtaining a low-frequency clock signal with the same frequency as the reference clock signal. Figure 2 As shown, the time length of the delay of the rising edge of the initial low-frequency clock signal 1 and the first rising edge of the high-frequency clock signal after the rising edge of the reference clock signal is t2.
[0042] The time-to-digital converter 201 is used to perform phase detection according to the received reference delay signal and the low-frequency clock signal, and output a phase deviation value when the phase deviation between the two is within its measurement range.
[0043] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the output of the time-to-digital converter provided by the present invention. Figure 3 START means Figure 1 The first terminal of the time-to-digital converter 201, STOP indicates Figure 1 The second terminal of the time-to-digital converter 201, Output represents Figure 1 After a second time interval t3 has elapsed since the first end of the time digital converter 201 received the reference delay signal, and after a third time interval t4 has elapsed since the second end of the time digital converter 201 received the low frequency clock signal, Figure 1 The fully digital phase-locked loop shown achieves a locked state. Figure 2 The reference delay signal 2 in the figure represents the reference delay signal after alignment. Figure 2 The low-frequency clock signal 2 in represents the aligned low-frequency clock signal. The interval between the reference delay signal 2 and the reference delay signal 1 is the second time interval t3, and the interval between the low-frequency clock signal 2 and the low-frequency clock signal 1 is the third time interval t4. The phase deviation value output by the time-to-digital converter 201 represents the deviation between the reference delay signal and the low-frequency clock signal. In an optional embodiment, the time-to-digital converter 201 outputs a decimal digital code, and the control system 100 decodes the digital code output by the time-to-digital converter 201 after obtaining it to determine the corresponding phase deviation value. Wherein, N represents the range of the time-to-digital converter 201, x represents the phase deviation value output by the time-to-digital converter 201, and 0≤x≤N. Optionally, the phase deviation value output by the time-to-digital converter 201 is a decimal output value.
[0044] The all-digital phase-locked loop 200 adjusts the high-frequency clock signal output by the digital oscillator 202 according to the phase deviation value output by the time-to-digital converter 201 , so as to align the reference delay signal with the low-frequency clock signal.
[0045] The reference clock signal may be provided by an external reference unit (not shown in the figure).
[0046] It should be noted that Figure 1 The structure shown is only a schematic diagram of a portion of the full digital phase-locked loop. The full digital phase-locked loop 200 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0047] Figure 1 The snapshot circuit module 204 in the fully digital phase-locked loop 200 shown in FIG. 2 will cause a delay time, which corresponds to Figure 2 The first time interval t2 in the delay compensation module 203. Therefore, the delay time needs to be compensated by the delay compensation module 203, and the compensation value t1 set by the delay compensation module 203 directly affects the working state of the full digital phase-locked loop. Since the delay time caused by the snapshot circuit module 204 is usually in the picosecond level, it is difficult to measure its timing with an instrument, or the measurement cost is too high, which brings great trouble to the compensation value t1 set by the delay compensation module 203. If the compensation value t1 is set unreasonably, the timing margin of the snapshot circuit module corresponding to the delay compensation will be insufficient, which will lead to the instability of the timing of the full digital phase-locked loop. In the case of unstable timing of the full digital phase-locked loop, the problem of phase-locked loop loss of lock is prone to occur.
[0048] The method for setting the compensation value of the fully digital phase-locked loop provided by the present invention sets the compensation value of the delay compensation module without relying on external measuring instruments to ensure the timing margin of the snapshot circuit module corresponding to the delay compensation, so as to ensure the timing stability of the fully digital phase-locked loop, enable it to work stably, and avoid the phase-locked loop losing lock due to timing problems.
[0049] The method for setting the compensation value of the all-digital phase-locked loop provided by the present invention can be applied to, but not limited to, control systems. Figure 4 , Figure 4 The control system 100 is connected to the delay compensation module 203 and the time-to-digital converter 201 in the all-digital phase-locked loop 200 respectively.
[0050] The control system 100 is used to set the compensation value of the delay compensation module 203 .
[0051] The control system 100 is also used to sample the phase deviation value output by the time-to-digital converter 201, and execute a method for setting the full digital phase-locked loop compensation value based on the sampling result, thereby ensuring the timing stability of the full digital phase-locked loop 200 so that it can work stably.
[0052] The embodiment of the present invention provides an electronic device, which may be a terminal device including a control system and a full digital phase-locked loop, such as a mobile phone, a computer, a server, etc., and may also refer to a control system in a terminal device. Figure 5 , Figure 5 The control system provided by the present invention is a schematic diagram of the structure. The control system includes a processor 10, a memory 11, and a bus 12. The processor 10 and the memory 11 are connected via the bus 12, and the processor 10 is used to execute an executable module stored in the memory 11, such as a computer program.
[0053] The processor 10 may be an integrated circuit chip having signal processing capability. In the implementation process, each step of the method for setting the compensation value of the full digital phase-locked loop may be completed by an integrated logic circuit of hardware in the processor 10 or by instructions in the form of software. The above-mentioned processor 10 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0054] The memory 11 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0055] The bus 12 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. Figure 5 Although only one bidirectional arrow is used in the figure, it does not mean that there is only one bus 12 or only one type of bus 12 .
[0056] The memory 11 is used to store programs, such as a program corresponding to the device for setting the compensation value of a full digital phase-locked loop. The device for setting the compensation value of a full digital phase-locked loop includes at least one software function module that can be stored in the memory 11 in the form of software or firmware or fixed in the operating system (OS) of the control system. After receiving the execution instruction, the processor 10 executes the program to implement the method for setting the compensation value of the full digital phase-locked loop.
[0057] Optionally, the control system provided by the embodiment of the present invention further includes a communication interface 13. The communication interface 13 is connected to the processor 10 via a bus.
[0058] It should be understood that Figure 5The structure shown is only a schematic diagram of the structure of part of the control system. The control system may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown. Figure 5 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0059] A method for setting a compensation value of a full digital phase-locked loop provided by an embodiment of the present invention can be applied to, but not limited to, Figure 5 For the specific process of the control system shown in the figure, please refer to Figure 6 The method for setting the compensation value of the full digital phase-locked loop includes: step 101, step 102, step 106, step 107 and step 108, which are specifically described as follows.
[0060] Step 101, setting a compensation value of a delay compensation module in a fully digital phase-locked loop.
[0061] Step 102, after setting the compensation value of the delay compensation module in the full digital phase-locked loop, control the full digital phase-locked loop to work.
[0062] Optionally, before controlling the operation of the all-digital phase-locked loop, the frequency control word (Frequency Control Word, fcw) of the all-digital phase-locked loop can also be set. It should be noted that if the frequency control word is set to a small value, a frequency deviation will occur in each cycle, making it more difficult to lock the all-digital phase-locked loop. In order to avoid this problem, it can be set to a positive integer value, which can be but is not limited to 200.
[0063] Step 106: When the full digital phase-locked loop reaches a locked state within a preset time length, the full digital phase-locked loop is controlled to switch to an open-loop state.
[0064] After the full digital phase-locked loop is switched to an open-loop state, the loop parameters of the full digital phase-locked loop are not updated, that is, the output of the digital oscillator will not change with the output of the time digital converter.
[0065] Step 107, obtaining a first sampling result number and a second sampling result number of the all-digital phase-locked loop.
[0066] The first sampling result number indicates the number of sampling results of the time-to-digital converter in the all-digital phase-locked loop in the phase advance phase, and the second sampling result number indicates the number of sampling results of the time-to-digital converter in the phase lag phase.
[0067] Step 108: Determine whether the current compensation value is qualified based on the first sampling result number and the second sampling result number.
[0068] It should be understood that, in the case where the current compensation value is unqualified, the compensation value of the delay compensation module in the full digital phase-locked loop may be reset until the current compensation value is qualified.
[0069] In summary, the present invention provides a method for setting a compensation value of a fully digital phase-locked loop, including: after setting the compensation value of the delay compensation module in the fully digital phase-locked loop, controlling the fully digital phase-locked loop to work; when the fully digital phase-locked loop reaches a locked state within a preset time length, controlling the fully digital phase-locked loop to switch to an open-loop state; obtaining a first sampling result number and a second sampling result number of the fully digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of the time digital converter in the phase advance stage in the fully digital phase-locked loop, and the second sampling result number represents the number of sampling results of the time digital converter in the phase lag stage; determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number. Without relying on an external measuring instrument, the compensation value of the delay compensation module is verified by the sampling result number of the time digital converter in the fully digital phase-locked loop to ensure that the compensation value of the delay compensation module is qualified, so as to ensure the timing margin of the snapshot circuit module corresponding to the delay compensation, so as to ensure the timing stability of the fully digital phase-locked loop, so that it can work stably.
[0070] exist Figure 5 On this basis, regarding how to quickly and accurately determine whether the current compensation value is qualified to ensure the setting efficiency and accuracy of the full digital phase-locked loop compensation value, the embodiment of the present invention also provides an optional implementation method, please refer to the following. Step 108, the step of determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number, includes: step 108-1 and step 108-2, which are specifically described as follows.
[0071] Step 108 - 1 : When both the first sampling result number and the second sampling result number are not 0, it is determined that the current compensation value is qualified.
[0072] When both the first sampling result number and the second sampling result number are not 0, it means that the timing margin of the full digital phase-locked loop is sufficient, and it can be determined that the current compensation value is qualified.
[0073] Step 108 - 2 : when the first sampling result number or the second sampling result number is 0, it is determined that the current compensation value is unqualified.
[0074] When the first sampling result number or the second sampling result number is 0, it means that the timing margin of the full digital phase-locked loop is insufficient, and it can be determined that the current compensation value is unqualified.
[0075] In the case where the current compensation value is unqualified, it is necessary to adjust the current compensation value to obtain a new compensation value and reset the compensation value of the delay compensation module in the full digital phase-locked loop. If the compensation value is adjusted only by relying on the experience of the engineer, the adjustment process of the compensation value may be uncontrollable due to the different levels of experience of the engineers. For example, an experienced engineer may be able to set the compensation value of the delay compensation module in the full digital phase-locked loop to be qualified in a few adjustments, but an engineer who lacks experience in this area may need to repeat the setting many times, resulting in inefficient setting of the compensation value of the full digital phase-locked loop.
[0076] In order to improve the problem of relying on the experience of engineers to adjust the compensation value, the embodiment of the present invention also provides an optional implementation method, which determines the adjustment direction (increase or decrease) according to the first sampling result number and the second sampling result number. When the adjustment direction is determined, the number of times the compensation value is adjusted can be greatly reduced, thereby improving the efficiency of setting the compensation value of the full digital phase-locked loop. For details, please refer to Figure 7 When the current compensation value is unqualified, the method for setting the full digital phase-locked loop compensation value further includes: step 110, step 111 and step 115, which are specifically described as follows.
[0077] Step 110: when the number of the first sampling results is greater than 0 and the number of the second sampling results is 0, the current compensation value is reduced by the first target length to obtain a new compensation value.
[0078] The first target length may be a preset fixed length, or may be flexibly set based on the first sampling result number and the second sampling result number.
[0079] Step 111 , when the number of the first sampling results is 0 and the number of the second sampling results is greater than 0, the current compensation value is increased by the first target length to obtain a new compensation value.
[0080] Step 115: reset the compensation value of the delay compensation module in the full digital phase-locked loop based on the new compensation value.
[0081] After executing step 115 to reset the compensation value of the delay compensation module in the full digital phase-locked loop, the process returns to step 102 to control the full digital phase-locked loop to work, and repeats the above steps until the current compensation value after reset is qualified.
[0082] exist Figure 7On the basis of, whether the adjustment length of the compensation value (i.e., the first target length) is reasonable will also affect the number of times the compensation value is adjusted. If the first target length is determined based on the experience of engineers, it may require many repeated settings, resulting in low efficiency in setting the compensation value of the full digital phase-locked loop. In order to improve this problem, the embodiment of the present invention also provides an optional implementation method, which introduces the phase advance direction margin and the phase lag direction margin to obtain the accurate adjustment length of the compensation value, thereby improving the efficiency of setting the compensation value of the full digital phase-locked loop. Among them, the phase advance direction margin represents Figure 1 The phase lag direction margin indicates the maximum time length that the low frequency clock signal received at the second end of the time-to-digital converter 201 can lead the reference delay signal received at the first end of the time-to-digital converter 201. The phase lag direction margin indicates the maximum time length that the reference delay signal received at the first end of the time-to-digital converter 201 can lead the low frequency clock signal received at the second end of the time-to-digital converter 201.
[0083] Specifically, please refer to Figure 8 When the current compensation value is unqualified, the method for setting the full digital phase-locked loop compensation value further includes: step 109, which is specifically described as follows.
[0084] Step 109: determining a first target length based on the target margin.
[0085] Among them, when the number of first sampling results is greater than 0 and the number of second sampling results is 0, the target margin is the margin in the phase advance direction; when the number of first sampling results is 0 and the number of second sampling results is greater than 0, the target margin is the margin in the phase lag direction.
[0086] It should be noted that the first sampling result number corresponds to the phase advance direction margin, and the second sampling result number corresponds to the phase lag direction margin. When the first sampling result number is 0, the phase advance direction margin is also 0; when the second sampling result number is 0, the phase lag direction margin is also 0. Conversely, when both the first sampling result number and the second sampling result number are not 0, both the phase advance direction margin and the phase lag direction margin are not 0.
[0087] Optionally, the result of multiplying the target margin by a first preset coefficient may be used as the first target length. The value range of the first preset coefficient is 0.35 to 0.65, and the first preset coefficient may be 0.5.
[0088] After executing step 109 to determine the first target length, the possibility of determining a new compensation value that is qualified by executing step 110 or step 111 is higher, thereby improving the efficiency of setting the compensation value of the full digital phase-locked loop.
[0089] Optionally, the formulas for calculating the phase advance direction margin and the phase lag direction margin are:
[0090]
[0091]
[0092] in, Represents the phase advance direction margin, It represents the phase lag direction margin, represents the target frequency, represents the number of the first sampling results, b represents the number of the third sampling results, represents the second sampling result number, the third sampling result number represents the number of sampling results of the time-to-digital converter in the phase detection stage, and the target frequency is the product of the frequency of the reference clock signal and the frequency control word.
[0093] Phase advance direction margin expression Figure 1 The maximum value of the time length that the low-frequency clock signal received at the second end of the time-to-digital converter 201 can lead the reference delay signal received at the first end of the time-to-digital converter 201. The phase lag direction margin represents the maximum value of the time length that the reference delay signal received at the first end of the time-to-digital converter 201 can lead the low-frequency clock signal received at the second end of the time-to-digital converter 201. After the phase advance direction margin and the phase lag direction margin are determined, when the time length that the low-frequency clock signal leads the reference delay signal is less than the phase advance direction margin, or when the time length that the reference delay signal leads the low-frequency clock signal is less than the phase lag direction margin, Figure 1 The time-to-digital converter 201 in the fully digital phase-locked loop 200 shown can perform phase detection normally.
[0094] exist Figure 5 On this basis, regarding how to quickly and accurately determine whether the current compensation value is qualified to ensure the setting efficiency and accuracy of the full digital phase-locked loop compensation value, the embodiment of the present invention also provides an optional implementation method, please refer to the following. Step 108, the step of determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number, includes: step 108-3, step 108-4 and step 108-5, which are specifically described as follows.
[0095] Step 108 - 3 , determining a phase advance direction margin and a phase lag direction margin based on the first sampling result number and the second sampling result number.
[0096] Optionally, the phase advance direction margin and the phase lag direction margin may be determined in combination with the above formula.
[0097] Step 108-4: When the phase advance direction margin and the phase lag direction margin meet the first condition and the second condition, determine that the current compensation value is qualified.
[0098] Step 108-5: When the phase advance direction margin and the phase lag direction margin do not meet the first condition or the second condition, determine that the current compensation value is unqualified.
[0099] Among them, the first condition is that the phase advance direction margin and the phase lag direction margin are not 0, and the second condition is that the absolute value of the difference between the phase advance direction margin and the phase lag direction margin is less than or equal to the first threshold. The value of the first threshold can be but is not limited to 30 picoseconds.
[0100] In order to ensure the performance of the fully digital phase-locked loop, the phase advance direction margin and the phase lag direction margin must not be 0, and the phase advance direction margin and the phase lag direction margin must be as close or equal as possible. Therefore, the first and second conditions are used to determine whether the current compensation value is qualified.
[0101] In the case where the current compensation value is unqualified, it is necessary to adjust the current compensation value to obtain a new compensation value, and reset the compensation value of the delay compensation module in the full digital phase-locked loop. In order to improve the problem of relying on the experience of engineers to adjust the compensation value, the embodiment of the present invention also provides an optional implementation method, which determines the adjustment direction (increase or decrease) according to the phase advance direction margin and the phase lag direction margin. When the adjustment direction is determined, the number of times the compensation value is adjusted can be greatly reduced, thereby improving the efficiency of setting the compensation value of the full digital phase-locked loop. For details, please refer to Fig. 9 When the current compensation value is unqualified, the method for setting the full digital phase-locked loop compensation value further includes: step 113, step 114 and step 115, which are specifically described as follows.
[0102] Step 113: when the margin in the phase advance direction is greater than the margin in the phase lag direction, the current compensation value is reduced by a second target length to obtain a new compensation value.
[0103] The first target length may be a preset fixed length, or may be flexibly set based on a phase advance direction margin and a phase lag direction margin.
[0104] Step 114: when the margin in the phase advance direction is less than the margin in the phase lag direction, the current compensation value is increased by a second target length to obtain a new compensation value.
[0105] Step 115: reset the compensation value of the delay compensation module in the full digital phase-locked loop based on the new compensation value.
[0106] exist Fig. 9On this basis, whether the adjustment length of the compensation value (i.e., the second target length) is reasonable will also affect the number of times the compensation value is adjusted. If the second target length is determined based on the engineer's experience, it may require many repeated settings, resulting in low efficiency in setting the full digital phase-locked loop compensation value. In order to improve this problem, an embodiment of the present invention also provides an optional implementation method, which introduces a phase advance direction margin and a phase lag direction margin to obtain an accurate adjustment length of the compensation value, thereby improving the efficiency of setting the full digital phase-locked loop compensation value. Specifically, please refer to Fig.10 When the current compensation value is unqualified, the method for setting the full digital phase-locked loop compensation value further includes: step 112, which is specifically described as follows.
[0107] Step 112: determining a second target length based on the absolute value of the difference between the margin in the phase advance direction and the margin in the phase lag direction.
[0108] After executing step 112 to determine the second target length, the possibility of determining a new compensation value that is qualified by executing step 113 or step 114 is higher, thereby improving the efficiency of setting the compensation value of the full digital phase-locked loop.
[0109] Please continue to refer to Figures 7 to 10 After executing step 108, it is determined whether the current compensation value is qualified based on the first sampling result number and the second sampling result number. If qualified, the process ends; if not qualified, the subsequent steps are executed, such as Figure 7 Step 110, step 111; or Figure 8 step 109 in; or Fig. 9 Step 113, step 114; or Fig.10 Step 112 in .
[0110] exist Figure 6 On the basis of how to accurately and quickly obtain the first sampling result number and the second sampling result number, the present invention also provides an optional implementation method, please refer to the following. Step 107, the step of obtaining the first sampling result number and the second sampling result number of the full digital phase-locked loop, includes: step 107-1, step 107-2 and step 107-3, which are specifically described as follows.
[0111] Step 107 - 1 , obtaining the number of sampling results of the time-to-digital converter in the phase advance phase and the phase lag phase in M sampling periods.
[0112] Among them, 1≤M.
[0113] Step 107 - 2 , taking the average of the number of sampling results of the time-to-digital converter in the phase advance stage in M sampling periods as the first number of sampling results.
[0114] Step 107 - 3 , taking the average of the number of sampling results of the time-to-digital converter in the phase lag phase in M sampling periods as the second number of sampling results.
[0115] Optionally, step 107, the step of obtaining the first sampling result number and the second sampling result number of the all-digital phase-locked loop, may further include: step 107-4, which is specifically described as follows.
[0116] Step 107-4, obtaining the number of sampling results of the time digital converter in the phase detection phase in M sampling periods; and taking the average of the number of sampling results of the time digital converter in the phase detection phase in M sampling periods as the third sampling result number.
[0117] Please refer to Fig.11 , Fig.11 A schematic diagram of the number of sampling results provided by the present invention. Fig.11 The ordinate in represents the phase deviation value output by the time-to-digital converter. Fig.11 The horizontal axis in represents the number of sampling times. Figure 3 It can be seen that N represents Figure 1 In the range of the time digital converter 201, x represents the phase deviation value output by the time digital converter 201, and 0≤x≤N. The control system can sample the phase deviation value output by the time digital converter, and when entering a new sampling period, the sampling result is reduced from N to 0 or other values. Based on this, the number of sampling periods counted can be determined. Fig.11 middle represents the number of the first sampling results, b represents the number of the third sampling results, Indicates the second sampling result number. The first sampling result number indicates the number of sampling results (0) of the time digital converter in the phase advance stage in the all-digital phase-locked loop, the second sampling result number indicates the number of sampling results (N) of the time digital converter in the phase lag stage, and the third sampling result number indicates the number of sampling results (between 0 and N) of the time digital converter in the phase detection stage.
[0118] When the all-digital phase-locked loop is in an open-loop state, the output frequency of the digital oscillator will have a frequency deviation from the target frequency, so the phase difference will continue to accumulate until a sampling period is accumulated, and the phase deviation value output by the time-to-digital converter will re-accumulate from 0. When the second threshold is taken as the target frequency × 0.1%, the frequency deviation is less than 0.1% when the loop is locked, and the margin can be directly calculated by the number of sampling results within 1 sampling period. Since the digital sampling frequency is sampled at a slower frequency, in the present invention, the frequency of the reference clock signal can be used for sampling. When the second threshold is greater than the target frequency × 0.1%, the frequency deviation can be greater than 0.1% when the loop is locked, and each sampling result is too large relative to the previous phase accumulation. There will be a large error in the statistics of the first sampling result number, the second sampling result number, and the third sampling result number. It is necessary to sample multiple times to count the results and calculate the average value before the timing margin of the snapshot circuit delay compensation time size design value can be accurately calculated.
[0119] exist Figure 6 On the basis of how to determine whether the full digital phase-locked loop reaches a locked state, the embodiment of the present invention also provides an optional implementation method, please refer to Fig.12 In step 102, after the full digital phase-locked loop is controlled to work, the method for setting the compensation value of the full digital phase-locked loop also includes: step 103, step 104 and step 105, which are specifically described as follows.
[0120] Step 103, determining whether the target frequency deviation is less than or equal to a second threshold value within a preset time length. If yes, proceed to step 105; if no, proceed to step 104.
[0121] Among them, the target frequency deviation is the frequency deviation between the current output frequency and the target frequency, the current output frequency is the frequency corresponding to the clock signal output by the digital oscillator in the fully digital phase-locked loop, and the second threshold can take any value between the target frequency×0.1% and the target frequency×0.5%.
[0122] Optionally, target frequency deviation = (current output frequency - target frequency) ÷ target frequency.
[0123] If the target frequency deviation is less than or equal to the second threshold, it means that the target frequency deviation reaches the second threshold within the preset time length, and step 105 is executed; if the target frequency deviation is always greater than the second threshold, it means that the target frequency deviation does not reach the second threshold within the preset time length, and step 104 is executed.
[0124] Step 104: determine whether the fully digital phase-locked loop fails to reach a locked state within a preset time length.
[0125] Step 105, determining whether the fully digital phase-locked loop reaches a locked state within a preset time length.
[0126] In an optional implementation, the number M of sampling cycles may be determined by the second threshold, and the number M of sampling cycles is positively correlated with the second threshold, that is, when the second threshold increases, the number M of sampling cycles increases. Optionally, when the second threshold is set to target frequency × 0.1%, the number M of sampling cycles = 1, and when the second threshold is set to target frequency × 0.5%, the number M of sampling cycles = 5.
[0127] See also Fig.13 , Fig.13 An embodiment of the present invention provides a device for setting a compensation value of a full digital phase-locked loop. Optionally, the device for setting a compensation value of a full digital phase-locked loop is applied to the control system described above.
[0128] The setting of the full digital phase-locked loop compensation value includes: a first processing unit 301 and a second processing unit 302 .
[0129] The first processing unit 301 is used to set the compensation value of the delay compensation module in the full digital phase-locked loop;
[0130] The first processing unit 301 is also used to control the operation of the full digital phase-locked loop. When the full digital phase-locked loop reaches a locked state within a preset time length, the full digital phase-locked loop is controlled to switch to an open-loop state.
[0131] The first processing unit 301 is further used to obtain a first sampling result number and a second sampling result number of the all-digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of the time digital converter in the all-digital phase-locked loop in the phase advance phase, and the second sampling result number represents the number of sampling results of the time digital converter in the phase lag phase;
[0132] The second processing unit 302 is used to determine whether the current compensation value is qualified based on the first sampling result number and the second sampling result number.
[0133] Optionally, the first processing unit 301 may execute the above step 108 , and the second processing unit 302 may execute the above steps 101 to 107 and 109 to 115 .
[0134] It should be noted that the device for setting the compensation value of the all-digital phase-locked loop provided in this embodiment can execute the method flow shown in the above method flow embodiment to achieve the corresponding technical effect. For the sake of brief description, for the parts not mentioned in this embodiment, please refer to the corresponding contents in the above embodiment.
[0135] The embodiment of the present invention further provides a storage medium, which stores computer instructions and programs, which, when read and run, execute the method for setting the compensation value of the full digital phase-locked loop in the above embodiment. The storage medium may include a memory, a flash memory, a register, or a combination thereof.
[0136] The following provides an electronic device, which may be a terminal device including a control system and a full digital phase-locked loop, such as a mobile phone, a computer, a server, etc., and may also refer to a control system in a terminal device. The electronic device includes Figure 5 The control system shown can implement the above-mentioned method for setting the compensation value of the full digital phase-locked loop; specifically, the control system includes: a processor 10, a memory 11, and a bus 12. The processor 10 can be a CPU. The memory 11 is used to store one or more programs. When the one or more programs are executed by the processor 10, the method for setting the compensation value of the full digital phase-locked loop in the above-mentioned embodiment is executed.
[0137] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0138] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A method for setting a compensation value of a fully digital phase-locked loop, characterized in that: The method comprises: After setting the compensation value of the delay compensation module in the full digital phase-locked loop, controlling the full digital phase-locked loop to work; When the all-digital phase-locked loop reaches a locked state within a preset time length, controlling the all-digital phase-locked loop to switch to an open-loop state; Acquire a first sampling result number and a second sampling result number of the all-digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of a time-to-digital converter in the all-digital phase-locked loop in a phase advance phase, and the second sampling result number represents the number of sampling results of the time-to-digital converter in a phase lag phase; Determine whether a current compensation value is qualified based on the first sampling result number and the second sampling result number; The step of determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number includes: when the first sampling result number and the second sampling result number are both not 0, determining that the current compensation value is qualified; when the first sampling result number or the second sampling result number is 0, determining that the current compensation value is unqualified; when the current compensation value is unqualified, the method for setting the compensation value of the full digital phase-locked loop also includes: when the first sampling result number is greater than 0 and the second sampling result number is 0, reducing the current compensation value by a first target length to obtain a new compensation value; when the first sampling result number is 0 and the second sampling result number is greater than 0, increasing the current compensation value by a first target length to obtain a new compensation value; based on the new compensation value, resetting the compensation value of the delay compensation module in the full digital phase-locked loop; Alternatively, the step of determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number includes: determining a phase advance direction margin and a phase lag direction margin based on the first sampling result number and the second sampling result number; when the phase advance direction margin and the phase lag direction margin meet a first condition and a second condition, determining that the current compensation value is qualified; when the phase advance direction margin and the phase lag direction margin do not meet the first condition or the second condition, determining that the current compensation value is unqualified; the first condition is that both the phase advance direction margin and the phase lag direction margin meet a first condition or a second condition. is not 0, and the second condition is that the absolute value of the difference between the phase advance direction margin and the phase lag direction margin is less than or equal to a first threshold; when the current compensation value is unqualified, the method for setting the compensation value of the full digital phase-locked loop also includes: when the phase advance direction margin is greater than the phase lag direction margin, reducing the current compensation value by a second target length to obtain a new compensation value; when the phase advance direction margin is less than the phase lag direction margin, increasing the current compensation value by a second target length to obtain a new compensation value; based on the new compensation value, resetting the compensation value of the delay compensation module in the full digital phase-locked loop.
2. The method for setting the compensation value of a full digital phase-locked loop according to claim 1, characterized in that: When the current compensation value is unqualified, the method further includes: determining the first target length based on a target margin; Among them, when the first sampling result number is greater than 0 and the second sampling result number is 0, the target margin is the phase advance direction margin; when the first sampling result number is 0 and the second sampling result number is greater than 0, the target margin is the phase lag direction margin.
3. The method for setting the compensation value of a fully digital phase-locked loop according to claim 1 or 2, characterized in that: The formulas for the phase advance direction margin and the phase lag direction margin are: in, represents the phase advance direction margin, represents the phase lag direction margin, represents the target frequency, represents the number of the first sampling results, b represents the number of the third sampling results, represents the second sampling result number, and the third sampling result number represents the number of sampling results of the time-to-digital converter in the phase detection stage.
4. The method for setting a compensation value of a fully digital phase-locked loop as claimed in claim 1, wherein: When the current compensation value is unqualified, the method further includes: The second target length is determined based on an absolute value of a difference between the phase advance direction margin and the phase lag direction margin.
5. The method for setting the compensation value of a full digital phase-locked loop according to claim 1, characterized in that: The step of obtaining the first sampling result number and the second sampling result number of the all-digital phase-locked loop comprises: Obtaining the number of sampling results of the time-to-digital converter in the phase advance phase and the phase lag phase in M sampling periods; Taking the average of the number of sampling results of the time-to-digital converter in the phase advance stage in M sampling periods as the first sampling result number; An average value of the number of sampling results of the time-to-digital converter in the phase lag phase during M sampling periods is used as the second sampling result number.
6. The method for setting the compensation value of a full digital phase-locked loop according to claim 1, wherein: After controlling the fully digital phase-locked loop to work, the method further includes: Within the preset time length, determining whether the target frequency deviation is less than or equal to a second threshold; Wherein, the target frequency deviation is the frequency deviation between the current output frequency and the target frequency, and the current output frequency is the frequency corresponding to the clock signal output by the digital oscillator in the all-digital phase-locked loop; If the target frequency deviation reaches the second threshold within the preset time length, it is determined that the full digital phase-locked loop reaches a locked state within the preset time length; If the target frequency deviation does not reach the second threshold within the preset time length, it is determined that the full digital phase-locked loop cannot reach a locked state within the preset time length.
7. A device for setting a compensation value of a fully digital phase-locked loop, characterized in that: The device comprises: A first processing unit, used for setting a compensation value of a delay compensation module in a fully digital phase-locked loop; The first processing unit is further used to control the operation of the full digital phase-locked loop, and when the full digital phase-locked loop reaches a locked state within a preset time length, control the full digital phase-locked loop to switch to an open-loop state; The first processing unit is further used to obtain a first sampling result number and a second sampling result number of the all-digital phase-locked loop, wherein the first sampling result number represents the number of sampling results of the time-to-digital converter in the all-digital phase-locked loop in a phase advance phase, and the second sampling result number represents the number of sampling results of the time-to-digital converter in a phase lag phase; A second processing unit, configured to determine whether a current compensation value is qualified based on the first sampling result number and the second sampling result number; The determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number includes: when both the first sampling result number and the second sampling result number are not 0, determining that the current compensation value is qualified; when the first sampling result number or the second sampling result number is 0, determining that the current compensation value is unqualified; When the current compensation value is unqualified, the setting device of the compensation value of the full digital phase-locked loop is used to reduce the current compensation value by a first target length to obtain a new compensation value when the first sampling result number is greater than 0 and the second sampling result number is 0; when the first sampling result number is 0 and the second sampling result number is greater than 0, increase the current compensation value by the first target length to obtain a new compensation value; based on the new compensation value, reset the compensation value of the delay compensation module in the full digital phase-locked loop; Alternatively, the determining whether the current compensation value is qualified based on the first sampling result number and the second sampling result number includes: determining a phase advance direction margin and a phase lag direction margin based on the first sampling result number and the second sampling result number; when the phase advance direction margin and the phase lag direction margin meet a first condition and a second condition, determining that the current compensation value is qualified; when the phase advance direction margin and the phase lag direction margin do not meet the first condition or the second condition, determining that the current compensation value is unqualified; the first condition is that both the phase advance direction margin and the phase lag direction margin are not 0, and the second condition is that the absolute value of the difference between the phase advance direction margin and the phase lag direction margin is less than or equal to a first threshold; When the current compensation value is unqualified, the setting device of the compensation value of the full digital phase-locked loop is used to reduce the current compensation value by a second target length to obtain a new compensation value when the phase advance direction margin is greater than the phase lag direction margin; when the phase advance direction margin is less than the phase lag direction margin, increase the current compensation value by a second target length to obtain a new compensation value; based on the new compensation value, reset the compensation value of the delay compensation module in the full digital phase-locked loop.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store one or more programs; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
