A high-efficiency clock phase measurement method and system
By employing bidirectional time-frequency modulation technology and signal processing methods, the problems of high cost and limited dynamic range of traditional clock phase measurement methods in high-frequency clock signals have been solved, achieving efficient and accurate clock phase difference measurement.
Patent Information
- Application Number
- CN202510840097.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2026-11-27
AI Technical Summary
Traditional clock phase measurement methods are costly and have limited dynamic range in high-frequency clock signal measurement. Furthermore, the uncertainty in the glitches leads to low measurement efficiency, making it difficult to achieve high-precision and high-efficiency phase difference measurement.
By employing bidirectional time-frequency modulation technology, high-density acquisition of the glitch interval is performed by periodically switching the frequency and period of the reference clock. Combined with signal processing methods such as averaging, sliding window filtering, Kalman filtering, and histogram analysis, the estimation accuracy and efficiency of edge position are improved.
While maintaining measurement resolution and accuracy, the measurement time was significantly shortened, the number of puncture interval sampling groups per unit time was increased, measurement errors were reduced, and measurement efficiency and accuracy were improved.
Smart Images

Figure CN123176330A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of clock phase measurement technology, and in particular to an efficient clock phase measurement method and system. Background Technology
[0002] In modern electronic systems, clock signals are the "heart" that coordinates the collaborative work of various modules. From base station synchronization in communication networks and pulse timing in radar systems to multi-clock domain coordination in integrated circuits (ICs) and timing consistency in computer systems, high-precision clock phase difference measurement is always a critical link in ensuring system performance. For example, in 5G communication, the clock phase error between base stations needs to be controlled at the nanosecond level, otherwise it will lead to signal demodulation errors; in radar phased array technology, the clock phase difference of each antenna element directly affects the beamforming accuracy; in system-on-a-chip (SoC) design, clock skew can cause timing violations, leading to chip malfunction.
[0003] Traditional phase measurement methods (such as direct sampling and time-to-digital conversion) face two major bottlenecks: (1) resolution limitation. When the frequency of the clock under test is extremely high (such as GHz), direct sampling requires an analog-to-digital converter (ADC) with picosecond precision, which is costly to implement in hardware; (2) dynamic range limitation. For synchronous clocks with similar frequencies (such as multiple clocks generated by crystal oscillator frequency division), small phase differences are difficult to capture directly with limited sampling points.
[0004] Digital Dual Mixer Time Measurement (DDMTD) is a technique for detecting the phase difference between two synchronous clock signals. It uses a reference clock with a slight frequency difference to sample the two clock signals to be tested.
[0005] Let the frequency of the clock to be measured be f. in The reference clock frequency is f s ≈|f in –Δf|(Δf< <f in Due to the frequency difference Δf, the sampling edge of the reference clock will "scan" the phase of the clock under test periodically at a relative speed Δf, resulting in a small offset of the phase of the clock under test corresponding to each sampling point.
[0006] After sampling the two clock signals under test, the phase difference between them is extracted using an XOR operation. At this point, the high-level width of the XOR output is no longer the original phase difference, but rather "amplified" by N = f. in / Δf times. By measuring the magnified time interval and scaling it down proportionally, the original phase difference can be obtained, and the measurement resolution dt is achieved. min and phase difference t phase The calculation formulas are as follows:
[0007]
[0008]
[0009] Where T XOR_high The number of XOR high-level duration cycles.
[0010] DDMTD has the following advantages in measuring clock phase: (1) Low cost and high precision: It does not rely on high-frequency sampling hardware and can achieve picosecond-level resolution through software algorithms; (2) Wide dynamic range: It is suitable for synchronous clocks with similar frequencies (such as a phase difference of 0.1%) and can measure phase differences from microseconds to picoseconds; (3) Digital implementation: It has a fully digital signal processing flow and is easy to integrate into programmable devices such as field programmable gate arrays (FPGAs) and digital signal processors (DSPs), with strong compatibility.
[0011] In the DDMTD technology system, when the reference clock sampling edge scans the phase of the clock under test (DUT) cycle by cycle with a relative frequency offset of Δf, the sampling result will exhibit a glitch interval containing uncertain states due to the inherent jitter between the DUT and the reference clock, as the sampling edge approaches the DUT edge. Specifically, when sampling at the rising edge, the probability of outputting logic 1 gradually changes from 0 to 1 with the number of scans; when sampling at the falling edge, the probability of outputting logic 1 gradually changes from 1 to 0 with the number of scans. If the phase difference is directly measured by the XOR value of the two DUT sampling signals, the uncertainty of the glitch interval will obscure the effective duration of the XOR high level, leading to a significant increase in the phase difference measurement error.
[0012] Although various algorithms exist for estimating the true edge position from the spur interval, the error in a single measurement is generally large due to noise interference. To suppress the influence of random errors, in practical applications, multiple measurements need to be statistically averaged to reduce uncertainty. According to the DDMTD principle and formula (1), its minimum measurement resolution is determined by the frequency amplification factor N (N = f s The time required to complete one clock cycle scan (1 / Δf) increases linearly as the value of N increases. Traditional measurement schemes employ a sequential scanning strategy, and if M independent measurements are performed, the total time consumption reaches M×N reference clock cycles. However, the glitch region, as a critical area carrying phase difference information, occupies only a very small portion of the entire scanning sampling sequence. Repeated scanning of a large number of constant 0 / constant 1 level regions leads to low time utilization of traditional methods, becoming the main bottleneck restricting the improvement of measurement efficiency. Summary of the Invention
[0013] The purpose of this invention is to provide an efficient clock phase measurement method and system for achieving efficient edge position estimation.
[0014] The objective of this invention can be achieved through the following technical solutions:
[0015] An efficient clock phase measurement method includes the following steps:
[0016] Set reference clock clk s The period is T s1 and T s2 The period T s1 and T s2 Regarding the clock period T under test in symmetry;
[0017] According to the period T s1 and T s2 Simultaneously, multiple local bidirectional scanning sampling processes are performed on the clocks clk1 and clk2 under test to obtain the edge positions of the clocks clk1 and clk2 under test, respectively.
[0018] Based on the edge positions of the clocks clk1 and clk2 under test, the phase difference between clk1 and clk2 under test is calculated, and the phase measurement process is completed.
[0019] Furthermore, the two clocks under test, clk1 and clk2, have the same frequency and are synchronized.
[0020] Furthermore, the steps to obtain the edge position of the clock clk1 under test include:
[0021] Reference clock clk s With period T s1 The clock clk1 under test is scanned and sampled to obtain the sampling result beat1. The initial edge position of the clock clk1 under test is detected based on beat1.
[0022] When the reference clock clk s After scanning to the initial edge position, switch to period T. s2 Perform reverse scanning sampling to obtain a new set of sampling results beat1;
[0023] Based on the preset number of scans, repeat all the above steps iteratively to obtain all group sampling results beat1, and obtain the edge position x1 of the clock clk1 under test from it.
[0024] Furthermore, the step of obtaining the edge position of the clock clk2 under test includes:
[0025] Reference clock clk s With period T s1The clock clk1 under test is scanned and sampled to obtain the sampling result beat2. The initial edge position of the clock clk2 under test is detected based on beat2.
[0026] When the reference clock clk s After scanning to the initial edge position, switch to period T. s2 Perform reverse scanning sampling to obtain a new set of sampling results beat2;
[0027] Based on the preset number of scans, repeat all the above steps iteratively to obtain all group sampling results beat2, and obtain the edge position x2 of the clock clk2 under test from them.
[0028] Furthermore, the corresponding edge position x1 or x2 is obtained from all sampling results beat1 or beat2 using signal processing methods, wherein the signal processing methods include one of averaging, sliding window filtering, Kalman filtering, and histogram analysis.
[0029] Furthermore, the expression for calculating the phase difference between the clocks clk1 and clk2 under test is as follows:
[0030] phase = x1 - x2
[0031] In the formula, phase is the phase difference, x1 is the edge position of the clock clk1 under test, and x2 is the edge position of the clock clk2 under test.
[0032] Furthermore, it also includes evaluating measurement efficiency for a single clock under test and two clocks under test, clk1 and clk2.
[0033] Furthermore, the steps for evaluating measurement efficiency include:
[0034] Set N to the number of sampling clock cycles required for scanning during the entire measurement process, and M to the number of sampling clock cycles required for the rising edge of the scan.
[0035] For measurement 2 n The number of clock cycles t required to calculate the traditional DDMTD method is based on the edge of a single clock under test. trad , is represented as:
[0036] t trad =N×(2 n -1)+M
[0037] Calculate the number of clock cycles t required for the multiple local bidirectional scan sampling method. bidir , is represented as:
[0038] t bidir =M×2 n
[0039] Compared to the traditional DDMTD method, the measurement speed factor of the multiple local bidirectional scanning sampling method is calculated and expressed as:
[0040]
[0041] In the formula, γ is the multiple of the measurement speed.
[0042] Furthermore, for the two clocks under test, clk1 and clk2, the steps for evaluating measurement efficiency include:
[0043] For measurement 2 n Let the phase difference between the two clocks clk1 and clk2 be Δt. Calculate the number of clock cycles T required by the traditional DDMTD method. trad , is represented as:
[0044] T trad =N×(2 n -1)+M+Δt
[0045] In the formula, N is the number of sampling clock cycles required for scanning during the entire measurement process, and M is the number of sampling clock cycles required for the rising edge of the scan.
[0046] Calculate the number of clock cycles T required for the multiple local bidirectional scan sampling method. bidir , is represented as:
[0047] T bidir =M×(2 n+1 -1)+Δt
[0048] Compared to the traditional DDMTD method, the measurement speed factor of the multiple local bidirectional scanning sampling method is calculated and expressed as:
[0049]
[0050] In the formula, η is the multiple of the measurement speed.
[0051] The present invention also provides a measurement system according to the above-described efficient clock phase measurement method, comprising a first three-stage cascaded flip-flop, a second three-stage cascaded flip-flop, a first de-glitch module, a second de-glitch module, a first edge calculation module, a second edge calculation module, a phase difference calculation module, a counter, a clock controller, and a clock generation unit.
[0052] The first three-stage cascaded flip-flops are connected sequentially to the first deglitching module and the first edge calculation module. The first three-stage cascaded flip-flops are used as a reference clock clk. s With period T s1The clock under test clk1 is iteratively scanned and sampled to obtain the sampling result beat1. The first de-glitch module is used to extract the edge position of the clock under test clk1 from beat1.
[0053] The second cascaded flip-flop is connected sequentially to the second deglitching module and the second edge calculation module. The second cascaded flip-flop is used as a reference clock clk. s With period T s1 The clock clk1 under test is iteratively scanned and sampled to obtain the sampling result beat2. The second edge calculation module is used to extract the edge position of the clock clk2 under test from beat2.
[0054] The phase difference calculation module is connected to the first edge calculation module and the second edge calculation module respectively, and is used to calculate the phase difference based on the edge position x1 of the finally extracted clock clk1 and the edge position x2 of the clock clk2.
[0055] The counter is connected between the first 3rd stage cascaded flip-flop and the first de-glitch module, and between the second 3rd stage cascaded flip-flop and the second de-glitch module. The counter is used to search for the edge position after each iteration of the scanning sampling of the clock clk1 and clk2 under test, and to count the scanning sampling time in a single direction, and send the counting result to the clock controller.
[0056] The clock controller is connected to the counter and the clock generation unit respectively, and the clock controller is used to control the clock generation unit according to the counting result;
[0057] The clock generation unit is used to generate a reference clock clk, with the clock under test clk2 as a reference. s And according to the control instructions of the clock controller, the reference clock clk is controlled in real time. s The frequency and period.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] (1) This invention uses bidirectional time-frequency modulation sampling technology to collect high-density data of the burr interval, thereby increasing the number of burr interval sampling groups per unit time, which increases the Fisher information of the burr interval per unit time and reduces the lower bound of Cramer-Rao, thus achieving efficient estimation of the edge position.
[0060] (2) By periodically switching the frequency and period of the reference clock, the present invention can complete the local scanning of the edge position without traversing the entire clock period under test. This achieves a significant reduction in measurement time and improves efficiency while maintaining the same measurement resolution and accuracy as the traditional DDMTD method.
[0061] (3) The present invention utilizes the symmetry of the sampling periods of forward and reverse scanning, and the cumulative phase increments of forward and reverse scanning are the same. The bidirectional sampling results can be fused to improve the accuracy of edge estimation.
[0062] (4) This invention innovatively switches the reference clock frequency, with hardware consumption comparable to that of the traditional DDMTD, improved measurement efficiency, and easy implementation using FPGA and Application-Specific Integrated Circuit (ASIC). Attached Figure Description
[0063] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0064] Figure 2 This is a timing diagram of the rising edge of the local bidirectional scanning clock under test according to an embodiment of the present invention;
[0065] Figure 3 This is a timing diagram illustrating the estimation of the rising edge position of the clock under test using bidirectional local scanning, according to an embodiment of the present invention.
[0066] Figure 4 This is a schematic diagram showing the sampling results of measuring the phase difference using the method of this embodiment of the invention and the conventional DDMTD method;
[0067] Figure 5 This is a schematic diagram of the system structure of the present invention. Detailed Implementation
[0068] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0069] Example 1
[0070] This embodiment provides an efficient clock phase measurement method, the main function of which is to use a frequency-switching reference clock clk. s The phase difference between two clocks under test (clk1 and clk2) is measured. The two clocks have the same frequency and are synchronized. Specifically, as follows: Figure 1 As shown, the method includes the following steps:
[0071] S1, Setting the reference clock period can be done in T s1 and T s2 Switching between them, where T s1 and T s2 Regarding T in Symmetrical, where T in The clock period to be measured is 1.
[0072] S2, Reference Clock clk s First, let's take the period T... s1 Scan clk1 to obtain beat1, and detect the approximate position of the edge from beat1.
[0073] S3. When the edge of clk1 is detected, switch clk. s The period is T s2 At this point, the scanning direction is reversed. After scanning the edge in reverse, a new set of beat1s is obtained, and clk is switched again. s The period is Ts1 for edge scanning, and so on, performing multiple local bidirectional scanning samples on the edge to obtain all the sampled results beat1.
[0074] S4. After completing the preset number of scans, obtain the position x1 of the edge of clk1 from all group sampling results beat1.
[0075] S5. Simultaneously with step S4, reference clock clk s Start scanning and sampling clk2, the sampling result is beat2, and detect the approximate position of the edge from beat2.
[0076] S6. When the edge of clk2 is detected, switch clk. s The period is T s2 At this point, the scanning direction is reversed. After scanning the edge in reverse, a new set of beat2s is obtained, and clk is switched again. s The period is T s1 The edge scanning is repeated, and multiple local bidirectional scanning samples are performed on the edge to obtain all the sampled results beat2.
[0077] S7. After completing the preset number of scans, obtain the position x2 of the edge of clk2 from all group sampling results beat2.
[0078] S8. The phase difference between the two clocks under test is phase = x1 - x2.
[0079] In steps S4 and S7, the method for obtaining the edge position from the sampling results is not limited to signal processing methods such as averaging, sliding window filtering, Kalman filtering, and histogram analysis.
[0080] To facilitate understanding of the bidirectional local scanning method proposed in this invention, Figure 2 This diagram illustrates the timing sequence for local bidirectional scanning of the rising edge of the clock under test. When the reference clock scans the rising edge of the clock under test in the forward direction, its period is T. s1 =T in +dt. When the reference clock is scanned in reverse to the rising edge of the clock under test, its period is T.s2 =T in -dt. Alternating sampling with forward and reverse scans to achieve local scanning of the rising edge of the clock under test.
[0081] To facilitate understanding of the bidirectional local scanning method for estimating edge positions proposed in this invention, Figure 3 This diagram illustrates the estimation of the rising edge position of the clock under test using bidirectional local scanning. Due to jitter in both the clock under test and the sampling reference clock, the sampled data corresponding to the rising edge has three characteristic regions: ① Sampling stability region before the rising edge (corresponding to sampling positions 0-3): Continuous acquisition of stable logic 0, forming a constant 0 level sequence; ② Sampling glitches region after the rising edge (corresponding to sampling positions 4-15): Affected by jitter, 0 / 1 signals appear randomly, and the probability of the sampling result being 1 increases with the forward scan and decreases with the subsequent scan; ③ Sampling stability region after the rising edge (corresponding to sampling positions 16-19): Continuous acquisition of stable logic 1, forming a constant 1 level sequence. Similarly, the sampled data before and after the falling edge has three characteristic regions: ① Sampling stable region before falling edge: continuous acquisition of stable logic 1, forming a constant 1 level sequence; ② Sampling glitch region before falling edge: affected by jitter, 0 / 1 signals appear randomly, and the probability of the sampling result being 1 decreases with the forward scan and increases with the subsequent scan; ③ Sampling stable region after falling edge: continuous acquisition of stable logic 0, forming a constant 0 level sequence.
[0082] Due to the symmetry of the sampling periods for forward and reverse scanning, the cumulative phase increments for both are the same. The bidirectional sampling results can be fused to improve the accuracy of edge estimation. Assuming the probability of a glitch interval being 1 follows a Gaussian cumulative distribution function, the variance of edge measurement estimated by bidirectional scanning data fusion is reduced by half compared to a single scan.
[0083] To facilitate understanding of the advantages of the method of the present invention in improving measurement efficiency, Figure 4 The diagram illustrates the sampling results of phase difference measurement using the method of this invention and the traditional DDMTD method. In the diagram, N represents the number of sampling clock cycles required to scan the entire test period, and M represents the number of sampling clock cycles required to scan the rising edge.
[0084] For measurement 2 n At the next clock edge, a traditional DDMTD requires t clock cycles. trad for
[0085] t trad =N×(2 n -1)+M
[0086] The method proposed in this invention requires t clock cycles. bidir for
[0087] t bidir=M×2 n
[0088] The method proposed in this invention improves the measurement speed by a factor γ compared to the traditional DDMTD method.
[0089]
[0090] When n is large enough
[0091] For measurement 2 n The phase difference between two clock cycles, assuming the phase difference is Δt, requires T clock cycles for a traditional DDMTD. trad for
[0092] T trad =N×(2 n -1)+M+Δt
[0093] The method proposed in this invention requires a clock cycle number T. bidir for
[0094] T bidir =M×(2 n+1 -1)+Δt
[0095] The method proposed in this invention improves the measurement speed by a factor η compared to the traditional DDMTD method.
[0096]
[0097] When n is large enough
[0098] Preferably, in order to obtain a higher measurement resolution dt min ,|dt min |=|T in -T s1 |=|T in -T s2 |,T s1 and T s2 The selection principle should be as close as possible to T. in .
[0099] In summary, this embodiment can achieve high-density acquisition of glitch intervals by employing bidirectional time-frequency modulation sampling technology, thereby increasing the number of glitch interval sampling groups per unit time, which in turn increases the amount of Fisher information in the glitch intervals per unit time, reduces the lower bound of Cramer-Rao, and thus achieves efficient estimation of edge positions.
[0100] Example 2
[0101] This embodiment provides a high-efficiency clock phase measurement system, such as Figure 5As shown, the system includes: a first 3-stage cascaded flip-flop 1, a second 3-stage cascaded flip-flop 2, a first deglitzer module 3, a second deglitzer module 4, a first edge calculation module 5, a second edge calculation module 6, a phase difference calculation module 7, a counter 8, a clock controller 9, and a clock generation unit 10. The first 3-stage cascaded flip-flop 1 is sequentially connected to the first deglitzer module 3, the first edge calculation module 5, and the phase difference calculation module 7. The second 3-stage cascaded flip-flop 2 is sequentially connected to the second deglitzer module 4, the second edge calculation module 6, and the phase difference calculation module 7. The counter 8 is connected between the first 3-stage cascaded flip-flop 1 and the first deglitzer module 3, and between the second 3-stage cascaded flip-flop 2 and the second deglitzer module 4. The clock controller 9 is connected to both the counter 8 and the clock generation unit 10.
[0102] The first three-stage cascaded flip-flop 1 is used to scan and sample the clock signal clk1 under test, and its sampling clock is clk. s Meanwhile, the three-stage cascade of the trigger is used to eliminate metastability, and the sampling result is beat1;
[0103] The second cascaded flip-flop 2 is used to scan and sample the clock signal clk2 under test, and its sampling clock is clk. s Meanwhile, the three-stage cascade of the trigger is used to eliminate metastability, and the sampling result is beat2;
[0104] The first deburring module 3 is used to extract the edge position of clk1 from the sampling result beat1 obtained from the first 3-stage cascaded trigger 1;
[0105] The second deburring module 4 is used to extract the edge position of clk2 from the sampling result beat2 obtained from the second 3rd stage cascaded trigger 2;
[0106] The first edge calculation module 5 is used to perform data post-processing on the edge position extracted by the first deburring module 3 in order to reduce measurement error and obtain a more accurate edge position x1.
[0107] The second edge calculation module 6 is used to perform data post-processing on the edge position extracted by the second deburring module 4 to reduce measurement error and obtain a more accurate edge position x2.
[0108] The phase difference calculation module 7 is used to calculate the phase difference between clk1 and clk2 based on the clk1 edge position x1 obtained by the first edge calculation module 5 and the clk2 edge position x2 calculated by the first edge calculation module 6, and to give phase = x1 - x2.
[0109] Counter 8 is used to search for the approximate positions of the edges of clk1 and clk2 and to count the scan sampling time in a single direction. The counting result is sent to the clock controller 9.
[0110] The clock controller 9 is used to control the clock generation unit 10 based on the counting result given by the counter 8.
[0111] Clock generation unit 10 is used to generate sampling clock clk with clk2 as reference clock. s And according to the instructions given by the clock controller 9, the clock frequency and period are controlled in real time.
[0112] Preferably, the clock generation unit 10 should have good phase continuity characteristics when switching output frequencies.
[0113] Furthermore, the various components of the efficient clock phase measurement system provided by the present invention do not necessarily have to be physically independent modules. Multiple modules can be integrated into the same module. For example, in the embodiment, the de-glitch module and the edge calculation module can be integrated into one module, or the counter 8, the clock controller 9 and the clock generation unit 10 can be integrated into one module.
[0114] The rest are as in Example 1.
[0115] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0116] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0117] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0120] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0121] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for efficient clock phase measurement, characterized in that, Includes the following steps: Set reference clock clk s The period is T s1 and T s2 The period T s1 and T s2 Regarding the clock period T under test in symmetry; According to the period T s1 and T s2 Simultaneously, multiple local bidirectional scanning sampling processes are performed on the clocks clk1 and clk2 under test to obtain the edge positions of the clocks clk1 and clk2 under test, respectively. Based on the edge positions of the clocks clk1 and clk2 under test, the phase difference between clk1 and clk2 under test is calculated, and the phase measurement process is completed.
2. The efficient clock phase measurement method according to claim 1, characterized in that, The two clocks under test, clk1 and clk2, have the same frequency and are synchronized.
3. The efficient clock phase measurement method according to claim 1, characterized in that, The steps to obtain the edge position of the clock clk1 under test include: Reference clock clk s With period T s1 The clock clk1 under test is scanned and sampled to obtain the sampling result beat1. The initial edge position of the clock clk1 under test is detected based on beat1. When the reference clock clk s After scanning to the initial edge position, switch to period T. s2 Perform reverse scanning sampling to obtain a new set of sampling results beat1; Based on the preset number of scans, repeat all the above steps iteratively to obtain all group sampling results beat1, and obtain the edge position x1 of the clock clk1 under test from it.
4. The efficient clock phase measurement method according to claim 1, characterized in that, The step of obtaining the edge position of the clock clk2 to be tested includes: Reference clock clk s With period T s1 The clock clk1 under test is scanned and sampled to obtain the sampling result beat2. The initial edge position of the clock clk2 under test is detected based on beat2. When the reference clock clk s After scanning to the initial edge position, switch to period T. s2 Perform reverse scanning sampling to obtain a new set of sampling results beat2; Based on the preset number of scans, repeat all the above steps iteratively to obtain all group sampling results beat2, and obtain the edge position x2 of the clock clk2 under test from them.
5. A high-efficiency clock phase measurement method according to claim 3 or 4, characterized in that, The corresponding edge position x1 or x2 is obtained from all sampling results beat1 or beat2 using signal processing methods, wherein the signal processing methods include one of averaging, sliding window filtering, Kalman filtering, and histogram analysis.
6. The efficient clock phase measurement method according to claim 1, characterized in that, The expression for calculating the phase difference between the clocks clk1 and clk2 under test is as follows: phase = x1 - x2 In the formula, phase is the phase difference, x1 is the edge position of the clock clk1 under test, and x2 is the edge position of the clock clk2 under test.
7. The efficient clock phase measurement method according to claim 1, characterized in that, It also includes evaluating measurement efficiency for a single clock under test and for two clocks under test, clk1 and clk2.
8. The efficient clock phase measurement method according to claim 7, characterized in that, For a single clock under test, the steps to evaluate measurement efficiency include: Set N to the number of sampling clock cycles required for scanning during the entire measurement process, and M to the number of sampling clock cycles required for the rising edge of the scan. For measurement 2 n The number of clock cycles t required to calculate the traditional DDMTD method is based on the edge of a single clock under test. trad , represented as: t trad =N×(2 n -1)+M Calculate the number of clock cycles t required for the multiple local bidirectional scan sampling method. bidir , is represented as: t bidir =M×2 n Compared to the traditional DDMTD method, the measurement speed factor of the multiple local bidirectional scanning sampling method is calculated and expressed as: In the formula, γ is the multiple of the measurement speed.
9. The efficient clock phase measurement method according to claim 7, characterized in that, For two clocks under test, clk1 and clk2, the steps to evaluate measurement efficiency include: For measurement 2 n Let the phase difference between the two clocks clk1 and clk2 be Δt. Calculate the number of clock cycles T required by the traditional DDMTD method. trad , is represented as: T trad =N×(2 n -1)+M+Δt In the formula, N is the number of sampling clock cycles required for scanning during the entire measurement process, and M is the number of sampling clock cycles required for the rising edge of the scan. Calculate the number of clock cycles T required for the multiple local bidirectional scan sampling method. bidir , is represented as: T bidir =M×(2 n+1 -1)+Δt Compared to the traditional DDMTD method, the measurement speed factor of the multiple local bidirectional scanning sampling method is calculated and expressed as: In the formula, η is the multiple of the measurement speed.
10. A measurement system for the efficient clock phase measurement method according to any one of claims 1-6, characterized in that, It includes a first 3-stage cascaded flip-flop (1), a second 3-stage cascaded flip-flop (2), a first degluing module (3), a second degluing module (4), a first edge calculation module (5), a second edge calculation module (6), a phase difference calculation module (7), a counter (8), a clock controller (9), and a clock generation unit (10). The first three-stage cascaded flip-flop (1) is connected in sequence to the first de-glitch module (3) and the first edge calculation module (5). The first three-stage cascaded flip-flop (1) is used as a reference clock clk. s With period T s1 The clock clk1 under test is iteratively scanned and sampled to obtain the sampling result beat1. The first de-glitch module (3) is used to extract the edge position of the clock clk1 under test from beat1. The second 3rd stage cascaded flip-flop (2) is connected in sequence to the second deglitching module (4) and the second edge calculation module (6). The second 3rd stage cascaded flip-flop (2) is used as a reference clock clk. s With period T s1 The clock clk1 under test is iteratively scanned and sampled to obtain the sampling result beat2. The second edge calculation module (6) is used to extract the edge position of the clock clk2 under test from beat2. The phase difference calculation module (7) is connected to the first edge calculation module (5) and the second edge calculation module (6) respectively, and is used to calculate the phase difference based on the edge position x1 of the finally extracted clock clk1 and the edge position x2 of the clock clk2. The counter (8) is connected between the first 3-stage cascaded flip-flop (1) and the first de-glitch module (3), and between the second 3-stage cascaded flip-flop (2) and the second de-glitch module (4). The counter (8) is used to search for the edge position after each iteration of the scanning sampling of the clock clk1 and clk2 under test, and to count the scanning sampling time in a single direction, and send the counting result to the clock controller (9). The clock controller (9) is connected to the counter (8) and the clock generation unit (10) respectively. The clock controller (9) is used to control the clock generation unit (10) according to the counting result. The clock generation unit (10) is used to generate a reference clock clk with the clock clk2 under test as a reference. s And according to the control instructions of the clock controller (9), the reference clock clk is controlled in real time. s The frequency and period.
