Phase-locked loop monitoring circuit, circuit board, and device
The phase-locked loop (PLL) monitoring circuit, constructed using digital logic circuits, utilizes a counter and state machine module to determine the PLL's locking state. This solves the problems of RC filter delay and device temperature drift in traditional PLL monitoring circuits, achieving faster and more stable PLL monitoring.
Patent Information
- Application Number
- CN202611152590.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-20
AI Technical Summary
Traditional phase-locked loop (PLL) monitoring circuits are composed of analog circuits, which have problems such as RC filter delay, device temperature drift, and judgment reference drift, resulting in slow response speed, poor stability, and easy misjudgment and missed judgment.
The system employs a first counter unit, a state machine module, a synchronization unit, a second counter unit, and a lock monitoring unit, all composed entirely of digital logic circuits. The lock status of the phase-locked loop is determined by counting and state switching, thus avoiding RC filter delay and device temperature drift.
It improves the response speed, stability and accuracy of phase-locked loop (PLL) monitoring, and avoids the shortcomings of traditional PLL monitoring circuits.
Smart Images

Figure CN123144752A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of semiconductor integrated circuit technology, and in particular to a phase-locked loop monitoring circuit, circuit board, and device. Background Technology
[0002] In the existing technology, with the advancement and development of semiconductor technology, the requirements for chip reliability and fault tolerance are becoming increasingly higher in special industrial and automotive environments. During the operation of the chip, the clock system is the pulse of the entire chip, providing a stable triggering rhythm for the timing logic within the chip, and its importance is as vital as the human heart.
[0003] In applications requiring high clock frequencies, the phase-locked loop (PLL) clock is chosen as the chip's system clock. If the PLL loses its lock due to frequency oscillation for some reason, it will lead to peripheral communication failure, PWM waveform not meeting expectations, or even chip failure, resulting in unpredictable consequences.
[0004] Traditional phase-locked loop (PLL) monitoring circuits are typically composed of analog circuits, which suffer from problems such as RC filter delay, device temperature drift, and judgment reference drift, resulting in slow response speed, poor stability, and easy misjudgment or missed judgment. Summary of the Invention
[0005] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a phase-locked loop (PLL) monitoring circuit, circuit board, and device, which can monitor the PLL through a first counter unit, state machine module, synchronization unit, second counter unit, and lock monitoring unit composed entirely of digital logic circuits. This avoids problems such as RC filter delay, device temperature drift, and judgment reference drift that are prone to occur in traditional analog circuits, thereby improving response speed, stability, and accuracy.
[0006] The phase-locked loop (PLL) monitoring circuit of a first aspect embodiment of this application includes: a first counter unit, a state machine module, a synchronization unit, a second counter unit, and a lock monitoring module. The clock terminal of the first counter unit is used to access the reference clock of the PLL, and the first counter unit is used to count the number of pulses of the reference clock to output a first counting result. The state machine module is connected to the first counter unit and is used to switch between multiple states based on the first counting result, wherein the multiple states include at least a sampling state and a comparison state. The state machine module is connected to the second counter unit through the synchronization unit. The clock terminal of the second counter unit is used to access the feedback clock of the PLL, and the second counter unit is used to count the number of pulses of the feedback clock when the state machine module is in the sampling state to output a second counting result. The lock monitoring module is connected to the second counter unit and the state machine module respectively. The lock monitoring module is used to output a lock signal or a lockout signal based on whether the second counting result is within a preset reference range when the state machine module is in the comparison state and the first counting result is a preset judgment threshold.
[0007] The phase-locked loop (PLL) monitoring circuit according to the embodiments of this application has at least the following beneficial effects: A first counter unit is used to record the number of pulses of the PLL reference clock, thereby outputting a corresponding first counting result. A state machine module is used to switch to the corresponding state based on the first counting result, thereby performing different tasks. For example, when the first counting result reaches a first threshold, the state machine module switches to a sampling state. At this time, the signal output by the state machine module drives the second counter unit to start counting operations. When the first counting result reaches a second threshold, the state machine module switches to a comparison state. When the first counting result reaches a judgment threshold, i.e., when the second counting structure is stable in the comparison state, the signal output by the state machine module drives the locking monitoring module to determine whether the phase difference between the reference clock and the feedback clock is within a preset error range, i.e., whether the second counting result is within a reference range. Since the clock terminal of the state machine module is connected to the reference clock, and the clock terminal of the second counter unit is connected to the feedback clock, and the feedback clock and the reference clock belong to the asynchronous clock domain... The output signal of the state machine module needs to be synchronized to the clock threshold of the feedback clock first, otherwise metastability is likely to occur. Therefore, a synchronization unit is set to achieve synchronization. The second counter is set to record the number of pulses of the PLL feedback clock. The lock monitoring module is set to determine whether the phase difference between the reference clock and the feedback clock is within the preset error range based on the second count result. That is, if the second count result is not within the reference range, it is considered that the phase difference exceeds the error range. At this time, the lock monitoring module outputs a lockout signal. If the second count result is within the reference range, it is considered that the phase difference is within the error range. At this time, the lock monitoring module outputs a lockout signal. Thus, the output of the lockout signal and the lockout signal can be used to determine whether the PLL is working properly. The first counter unit, the state machine module, the synchronization unit, the second counter unit, and the lock monitoring module are all composed of digital logic circuits, which helps to avoid the problems of RC filter delay, device temperature drift, and judgment reference drift that may occur in traditional PLL monitoring circuits, thereby improving the response speed, stability, and accuracy.
[0008] According to some embodiments of this application, the state machine module includes a state machine switching circuit and a state register circuit. The input terminal of the state machine switching circuit is connected to the output terminal of the first counter unit. The first output terminal of the state machine switching circuit is connected to the clear terminal of the first counter. The second output terminal of the state machine switching circuit is connected to the input terminal of the state register circuit. The output terminal of the state register circuit is connected to the input terminal of the synchronization unit and the input terminal of the state machine switching circuit, respectively. The clock terminal of the state register circuit is used to connect to the reference clock. The state machine switching circuit is used to output a state switching signal based on the first counting result and the current state of the state register circuit. The state register circuit is used to switch to the corresponding state based on the state switching signal and output the corresponding state signal to the synchronization unit.
[0009] According to some embodiments of this application, the synchronization unit includes a first flip-flop and a second flip-flop. The input terminal of the first flip-flop is connected to the output terminal of the state register circuit, the output terminal of the first flip-flop is connected to the input terminal of the second flip-flop, the output terminal of the second flip-flop is connected to the enable terminal of the second counter unit, and the clock terminals of both the first flip-flop and the second flip-flop are used to access the feedback clock.
[0010] According to some embodiments of this application, the locking monitoring module includes a window comparison circuit, a sampling decision circuit, and a locking flag generation circuit. The input terminal of the window comparison circuit is connected to the output terminal of the second counter unit. The input terminal of the sampling decision circuit is connected to the output terminal of the window comparison circuit and the output terminal of the first counter unit, respectively. The output terminal of the sampling decision circuit is connected to the input terminal of the locking flag generation circuit. The window comparison circuit is used to determine whether the second counting result is within the reference range. When the state machine module is in the comparison state, the sampling decision circuit is used to output a decision signal to the locking flag generation circuit based on the first counting result and the output of the window comparison circuit at the judgment threshold. The locking flag generation circuit is used to output a locking signal or a unlocking signal based on the decision signal.
[0011] According to some embodiments of this application, the sampling decision circuit includes a first AND gate, a second AND gate, a third AND gate, a fourth AND gate, a fifth AND gate, and a first NOT gate. The input terminal of the first AND gate is connected to the output terminal of the first counter. The input terminal of the second AND gate is connected to the output terminal of the state machine module. The output terminal of the first AND gate is connected to the first input terminal of the third AND gate. The output terminal of the second AND gate is connected to the second input terminal of the third AND gate. The output terminal of the third AND gate is connected to the first input terminal of the fourth AND gate and the first input terminal of the fifth AND gate. The output terminal of the window comparison circuit is connected to the input terminal of the first NOT gate and the second input terminal of the fifth AND gate. The output terminal of the first NOT gate is connected to the second input terminal of the fourth AND gate. The output terminal of the fourth AND gate is connected to the first input terminal of the lock flag generation circuit. The output terminal of the fifth AND gate is connected to the second input terminal of the lock flag generation circuit.
[0012] According to some embodiments of this application, the locking flag generation circuit includes a locking signal output unit and a unlocking signal output unit. The first input terminal of the locking signal output unit is connected to the output terminal of the fourth AND gate, and the second input terminal of the locking signal output unit is connected to the output terminal of the fifth AND gate. The output terminal of the locking signal output unit is used to output the locking signal. The output terminal of the locking signal output unit is also used to connect to the input terminal of the unlocking signal output unit. The output terminal of the unlocking signal output unit is used to output the unlocking signal. The clock terminals of both the locking signal output unit and the unlocking signal output unit are used to connect to the reference clock.
[0013] According to some embodiments of this application, the locking signal output unit includes a first selector, a second selector, and a third flip-flop. The selection terminal of the first selector is connected to the output terminal of the fifth AND gate. The second input terminal of the first selector is used to access a high level. The output terminal of the first selector is connected to the first input terminal of the second selector. The second input terminal of the second selector is used to access a low level. The selection terminal of the second selector is connected to the output terminal of the fourth AND gate. The output terminal of the second selector is connected to the input terminal of the third flip-flop. The output terminal of the third flip-flop is connected to the first input terminal of the first selector and the input terminal of the unlocking signal output unit. The clock terminal of the third flip-flop is used to access the reference clock. The output terminal of the third flip-flop is used to output the locking signal.
[0014] According to some embodiments of this application, the unlock signal output unit includes a fourth flip-flop, a fifth flip-flop, a sixth AND gate, a second NOT gate, and a third selector. The input terminal of the fourth flip-flop is connected to the output terminal of the lock signal output unit and the input terminal of the second NOT gate, respectively. The first input terminal of the sixth AND gate is connected to the output terminal of the fourth flip-flop, the second input terminal of the sixth AND gate is connected to the output terminal of the second NOT gate, and the output terminal of the sixth AND gate is connected to the selection terminal of the third selector. The second input terminal of the third selector is used to connect to a high level, the first input terminal of the third selector is connected to the output terminal of the fourth flip-flop, and the output terminal of the third selector is connected to the input terminal of the fifth flip-flop. The clock terminals of both the fourth and fifth flip-flops are used to connect to the reference clock, and the output terminal of the fifth flip-flop is used to output the unlock signal.
[0015] The circuit board according to the second aspect of this application includes: Phase-locked loop monitoring circuit according to the first aspect of this application.
[0016] The circuit board according to the embodiments of this application has at least the following beneficial effects: A first counter unit is used to record the number of pulses of the phase-locked loop reference clock, thereby outputting a corresponding first counting result. The state machine module is used to switch to the corresponding state according to the first counting result, thereby performing different tasks. For example, when the first counting result reaches a first threshold, the state machine module switches to a sampling state. At this time, the signal output by the state machine module drives the second counter unit to start counting operations. When the first counting result reaches a second threshold, the state machine module switches to a comparison state. When the first counting result reaches a judgment threshold, i.e., when the second counting structure is stable in the comparison state, the signal output by the state machine module drives the locking monitoring module to determine whether the phase difference between the reference clock and the feedback clock is within a preset error range, i.e., whether the second counting result is within a reference range. Since the clock terminal of the state machine module is connected to the reference clock, and the clock terminal of the second counter unit is connected to the feedback clock, and the feedback clock and the reference clock belong to the asynchronous clock domain, the output signal of the state machine module needs to be synchronized to the feedback clock first. A clock threshold is required; otherwise, metastability is likely to occur. Therefore, a synchronization unit is set to achieve synchronization. The second counter is used to record the number of pulses of the PLL feedback clock. The lock monitoring module is used to determine whether the phase difference between the reference clock and the feedback clock is within a preset error range based on the second count result. That is, if the second count result is not within the reference range, the phase difference is considered to exceed the error range, and the lock monitoring module outputs an unlock signal. If the second count result is within the reference range, the phase difference is considered to be within the error range, and the lock monitoring module outputs a lock signal. Thus, the output of the lock signal and the unlock signal can be used to determine whether the PLL is working properly. The first counter unit, state machine module, synchronization unit, second counter unit, and lock monitoring module are all composed of digital logic circuits, which helps to avoid problems such as RC filter delay, device temperature drift, and judgment reference drift that may occur in traditional PLL monitoring circuits, thereby improving the response speed, stability, and accuracy. By introducing the PLL monitoring circuit of this application, the response speed, stability, and accuracy of PLL monitoring are improved.
[0017] The device according to a third aspect embodiment of this application includes: The circuit board of the second aspect of this application.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1This is a schematic diagram of the phase-locked loop monitoring circuit according to an embodiment of this application; Figure 2 This is a circuit diagram of the first counter unit according to an embodiment of this application; Figure 3 This is a circuit diagram of the second counter unit according to an embodiment of this application; Figure 4 This is a schematic diagram of the state switching of the state register circuit in an embodiment of this application; Figure 5 This is a circuit structure diagram of the state register circuit in an embodiment of this application; Figure 6 This is a circuit structure diagram of the state switching circuit in an embodiment of this application; Figure 7 This is a circuit diagram of the synchronization unit in an embodiment of this application; Figure 8 This is a circuit structure diagram of the window comparison circuit according to an embodiment of this application; Figure 9 This is a circuit structure diagram of the decision circuit in an embodiment of this application; Figure 10 This is a circuit structure diagram of the locking flag generation circuit according to an embodiment of this application; Figure 11 This is a schematic diagram of each pulse when the locking flag generation circuit outputs the locking signal according to an embodiment of this application; Figure 12 This is a schematic diagram of each pulse when the locking flag generation circuit outputs the unlock signal in an embodiment of this application. Detailed Implementation
[0020] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0021] In the description of this application, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0022] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0023] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0024] Currently, with the advancement and development of semiconductor technology, the requirements for chip reliability and fault tolerance are becoming increasingly stringent in special industrial and automotive environments. During chip operation, the clock system acts as the pulse of the entire chip, providing a stable triggering rhythm for the chip's internal timing logic, and its importance is comparable to that of the human heart.
[0025] In applications requiring high clock frequencies, the phase-locked loop (PLL) clock is chosen as the chip's system clock. If the PLL loses its lock due to frequency oscillation for some reason, it will lead to peripheral communication failure, PWM waveform not meeting expectations, or even chip failure, resulting in unpredictable consequences.
[0026] Traditional phase-locked loop (PLL) monitoring circuits are typically composed of analog circuits, which suffer from problems such as RC filter delay, device temperature drift, and judgment reference drift, resulting in slow response speed, poor stability, and easy misjudgment or missed judgment.
[0027] Based on this, this application proposes a phase-locked loop (PLL) monitoring circuit, circuit board, and device, which aims to monitor the PLL by using a first counter unit, state machine module, synchronization unit, second counter unit, and lock monitoring unit composed entirely of digital logic circuits. This avoids problems such as RC filter delay, device temperature drift, and judgment reference drift that are common in traditional analog circuits, thereby improving response speed, stability, and accuracy.
[0028] It is understood that the phase-locked loop (PLL) monitoring circuit of the first aspect embodiment of this application includes a first counter unit, a state machine module, a synchronization unit, a second counter unit, and a lock monitoring module. The clock terminal of the first counter unit is used to access the reference clock of the PLL, and the first counter unit is used to count the number of pulses of the reference clock to output a first counting result. The state machine module is connected to the first counter unit and is used to switch between multiple states based on the first counting result, wherein the multiple states include at least a sampling state and a comparison state. The state machine module is connected to the second counter unit through the synchronization unit. The clock terminal of the second counter unit is used to access the feedback clock of the PLL, and the second counter unit is used to count the number of pulses of the feedback clock when the state machine module is in the sampling state to output a second counting result. The lock monitoring module is connected to the second counter unit and the state machine module respectively. The lock monitoring module is used to output a lock signal or a lockout signal based on whether the second counting result is within a preset reference range when the state machine module is in the comparison state and the first counting result is a preset judgment threshold.
[0029] The beneficial effects of the phase-locked loop (PLL) monitoring circuit in this embodiment are as follows: A first counter unit records the number of pulses of the PLL reference clock, thereby outputting a corresponding first counting result. The state machine module switches to the corresponding state based on the first counting result to perform different tasks. For example, when the first counting result reaches a first threshold, the state machine module switches to a sampling state. At this time, the signal output by the state machine module drives the second counter unit to start counting. When the first counting result reaches a second threshold, the state machine module switches to a comparison state. When the first counting result reaches a judgment threshold, i.e., when the second counting structure is stable in the comparison state, the signal output by the state machine module drives the locking monitoring module to determine whether the phase difference between the reference clock and the feedback clock is within a preset error range, i.e., whether the second counting result is within a reference range. Since the clock terminal of the state machine module is connected to the reference clock, and the clock terminal of the second counter unit is connected to the feedback clock, and the feedback clock and the reference clock belong to the asynchronous clock domain, the state... The output signal of the state machine module needs to be synchronized to the clock threshold of the feedback clock first, otherwise metastability is likely to occur. Therefore, a synchronization unit is set to achieve synchronization. The second counter is set to record the number of pulses of the PLL feedback clock. The lock monitoring module is set to determine whether the phase difference between the reference clock and the feedback clock is within the preset error range based on the second count result. That is, if the second count result is not within the reference range, it is considered that the phase difference exceeds the error range. At this time, the lock monitoring module outputs a lockout signal. If the second count result is within the reference range, it is considered that the phase difference is within the error range. At this time, the lock monitoring module outputs a lockout signal. Thus, the output of the lockout signal and the lockout signal can be used to determine whether the PLL is working properly. The first counter unit, state machine module, synchronization unit, second counter unit and lock monitoring module are all composed of digital logic circuits, which helps to avoid the problems of RC filter delay, device temperature drift and judgment reference drift that may occur in traditional PLL monitoring circuits, thereby improving response speed, stability and accuracy.
[0030] For example, in some embodiments, the clock output of the phase-locked loop (VCO) is set to PLLCLK, which is then divided by N to obtain the feedback clock. The VCO's reference clock has two source options: an external crystal clock (HSE) and an internal high-frequency oscillator clock (HSI). By introducing the VCO's reference clock and feedback clock into the VCO monitoring circuit, the frequency difference between the feedback clock and the reference clock is detected in real time to monitor the VCO's operating state (locked or unlocked). (Refer to...) Figure 1 , Figure 2 , Figure 3 and Figure 4In this embodiment, the clock terminal of the first counter unit is used to connect to the reference clock of the phase-locked loop to count the number of pulses of the reference clock, thereby outputting a first counting result. Multiple states include idle state, sampling state, comparison state, and reset state. The state machine module switches sequentially according to the first counting result, following the order of idle state – sampling state – comparison state – reset state. The clock terminal of the state machine module is connected to the reference clock. The state machine module is connected to the second counter unit through a synchronization unit, causing the second counter unit to count the number of pulses of the feedback clock when the state machine module is in the sampling state, thereby outputting a second counting result. The clock terminal of the synchronization unit is used to connect to the feedback clock. Since the state machine module outputs the result to the second counter unit under the reference clock and the feedback clock, and the reference clock and feedback clock belong to asynchronous clock domains, cross-domain sampling carries a metastability risk. Therefore, the synchronization unit synchronizes the result output by the state machine module to the feedback clock. The lock monitoring module is connected to both the second counter and the state machine module. When the state machine is in the comparison state and the first count result reaches a judgment threshold, it determines whether the second count result is within a preset reference range. If it is within the reference range, a lock signal is output; if it exceeds the reference range, an unlock signal is output. The reason for only making a judgment when the first count result reaches the judgment threshold is to ensure the stability of the second count result. That is, after the state machine module switches from the sampling state to the comparison state, it waits for a period of time for the second count result to stabilize before making a judgment, thereby further improving accuracy. The first timer unit includes the sixth flip-flop D6, the seventh flip-flop D7, the eighth flip-flop D8, the ninth flip-flop D9, the tenth flip-flop D10, the eleventh flip-flop D11, the twelfth flip-flop D12, the thirteenth flip-flop D13, the eighth AND gate Y8, the ninth AND gate Y9, the tenth AND gate Y10, the eleventh AND gate Y11, the twelfth AND gate Y12, the thirteenth AND gate Y13, the first XOR gate H1, the second XOR gate H2, the third XOR gate H3, the fourth XOR gate H4, the fifth XOR gate H5, the sixth XOR gate H6, the seventh XOR gate H7, and the third NOT gate F3. The reset terminals of flip-flops D9, D10, D11, D12, and D13 are all connected to a reset signal, and the clock terminals are all connected to a reference signal. The output terminal of the sixth flip-flop D6 is connected to the input terminal of the third NOT gate F3, the first input terminal of the eighth AND gate Y8, and the first input terminal of the first XOR gate H1, respectively. The output terminal of the third NOT gate F3 is connected to the input terminal of the sixth flip-flop D6. The output terminal of the eighth AND gate Y8 is connected to the first input terminal of the ninth AND gate Y9 and the first input terminal of the second XOR gate H2, respectively. The output terminal of the sixth flip-flop D6 is used to output the first count value stmCnt[0].The output of the seventh flip-flop D7 is connected to the second input of the first XOR gate H1 and the second input of the eighth AND gate Y8, respectively. The input of the seventh flip-flop D7 is used to connect to the output of the first XOR gate H1, and the output of the seventh flip-flop D7 is used to output the second count value stmCnt[1]. The output of the eighth flip-flop D8 is connected to the second input of the second XOR gate H2 and the second input of the ninth AND gate Y9, respectively. The input of the eighth flip-flop D8 is used to connect to the output of the second XOR gate H2, and the output of the ninth AND gate Y9 is connected to the first input of the tenth AND gate Y10 and the first input of the third XOR gate H3, respectively. The output of the eighth flip-flop D8 is used to output the third count value stmCnt[2]. The ninth flip-flop D9 The output terminals of the tenth AND gate Y10 are connected to the second input terminal of the third XOR gate H3 and the second input terminal of the tenth AND gate Y10, respectively. The input terminal of the ninth flip-flop D9 is used to connect to the output terminal of the third XOR gate H3. The output terminal of the tenth AND gate Y10 is connected to the first input terminal of the eleventh AND gate Y11 and the first input terminal of the fourth XOR gate H4, respectively. The output terminal of the ninth flip-flop D9 is used to output the fourth count value stmCnt[3]. The output terminal of the tenth flip-flop D10 is connected to the second input terminal of the fourth XOR gate H4 and the second input terminal of the eleventh AND gate Y11, respectively. The input terminal of the tenth flip-flop D10 is used to connect to the output terminal of the fourth XOR gate H4. The output terminal of the eleventh AND gate Y11 is connected to the first input terminal of the twelfth AND gate Y12 and the fifth XOR gate H5, respectively. The first input terminal of the eleventh flip-flop D11 is connected to the second input terminal of the fifth XOR gate H5 and the second input terminal of the twelfth AND gate Y12 respectively. The input terminal of the eleventh flip-flop D11 is connected to the output terminal of the fifth XOR gate H5. The output terminal of the twelfth AND gate Y12 is connected to the first input terminal of the thirteenth AND gate Y13 and the first input terminal of the sixth XOR gate H6 respectively. The output terminal of the eleventh flip-flop D11 is connected to the output terminal of the fifth XOR gate H5. The output terminal of the twelfth AND gate Y12 is connected to the first input terminal of the thirteenth AND gate Y13 and the first input terminal of the sixth XOR gate H6 respectively. The output terminal of the eleventh flip-flop D11 is connected to the second input terminal of the sixth XOR gate H6 and the second input terminal of the thirteenth AND gate Y13 respectively. The output terminal of the twelfth flip-flop D12 is connected to the second input terminal of the sixth XOR gate H6 and the second input terminal of the thirteenth AND gate Y13 respectively. The input terminal of the thirteenth AND gate Y13 is connected to the output terminal of the sixth XOR gate H6, the output terminal of the thirteenth AND gate Y13 is connected to the first input terminal of the seventh XOR gate H7, the output terminal of the twelfth flip-flop D12 is used to output the seventh count value stmCnt[6]; the output terminal of the thirteenth flip-flop D13 is connected to the second input terminal of the seventh XOR gate H7, the input terminal of the thirteenth flip-flop D13 is connected to the output terminal of the seventh XOR gate H7, the output terminal of the thirteenth flip-flop D13 is used to output the eighth count value stmCnt[7], the eighth count value, the seventh count value, the sixth count value, the fifth count value, the fourth count value, the third count value, the second count value and the first count value are arranged from left to right to form the first count result stmCnt[7,0].
[0031] The second timer unit includes the sixteenth flip-flop D16, the seventeenth flip-flop D17, the eighteenth flip-flop D18, the nineteenth flip-flop D19, the twentieth flip-flop D20, the twenty-first flip-flop D21, the twenty-second flip-flop D22, the twenty-third flip-flop D23, the twenty-fourth flip-flop D24, the thirty-third AND gate Y33, the thirty-fourth AND gate Y34, the thirty-fifth AND gate Y35, the thirty-sixth AND gate Y36, the thirty-seventh AND gate Y37, the thirty-eighth AND gate Y38, the thirty-ninth AND gate Y39, the eighth XOR gate H8, the ninth XOR gate H9, the tenth XOR gate H10, the eleventh XOR gate H11, the twelfth XOR gate H12, the thirteenth XOR gate H13, the fourteenth XOR gate H14, and the fifteenth XOR gate H15. The reset terminals of XOR gate H15 and the fourth NOT gate F4, the sixteenth flip-flop D16, the seventeenth flip-flop D17, the eighteenth flip-flop D18, the nineteenth flip-flop D19, the twentieth flip-flop D20, the twenty-first flip-flop D21, the twenty-second flip-flop D22, the twenty-third flip-flop D23, and the twenty-fourth flip-flop D24 are all connected to reset signals, and their clock terminals are all connected to reference signals. The output terminal of the sixteenth flip-flop D16 is connected to the input terminal of the fourth NOT gate F4, the first input terminal of the thirty-third AND gate Y33, and the first input terminal of the eighth XOR gate H8. The output terminal of the fourth NOT gate F4 is connected to the input terminal of the sixteenth flip-flop D16. The output terminal of the thirty-third AND gate Y33 is connected to the input terminal of the thirty-fourth AND gate Y34. The first input terminal is connected to the first input terminal of the ninth XOR gate H9, and the output terminal of the sixteenth flip-flop D16 is used to output the ninth count value lckCnt[0]; the output terminal of the seventeenth flip-flop D17 is connected to the second input terminal of the eighth XOR gate H8 and the second input terminal of the thirty-third AND gate Y33 respectively, and the input terminal of the seventeenth flip-flop D17 is used to access the output terminal of the eighth XOR gate H8, and the output terminal of the seventeenth flip-flop D17 is used to output the tenth count value lckCnt[1]; the output terminal of the eighteenth flip-flop D18 is connected to the second input terminal of the ninth XOR gate H9 and the second input terminal of the thirty-fourth AND gate Y34 respectively, and the input terminal of the eighteenth flip-flop D18 is used to access the output terminal of the ninth XOR gate H9, the third The output of the fourteenth AND gate Y34 is connected to the first input of the thirty-fifth AND gate Y35 and the first input of the tenth XOR gate H10 respectively. The output of the eighteenth flip-flop D18 is used to output the eleventh count value lckCnt[2]. The output of the nineteenth flip-flop D19 is connected to the second input of the tenth XOR gate H10 and the second input of the thirty-fifth AND gate Y35 respectively. The input of the nineteenth flip-flop D19 is used to connect to the output of the tenth XOR gate H10. The output of the thirty-fifth AND gate Y35 is connected to the first input of the thirty-sixth AND gate Y36 and the first input of the eleventh XOR gate H11 respectively. The output of the nineteenth flip-flop D19 is used to output the twelfth count value lckCnt[3].The output of the 20th flip-flop D20 is connected to the second input of the 11th XOR gate H11 and the second input of the 36th AND gate Y36, respectively. The input of the 20th flip-flop D20 is used to connect to the output of the 11th XOR gate H11. The output of the 36th AND gate Y36 is connected to the first input of the 37th AND gate Y37 and the first input of the 12th XOR gate H12, respectively. The output of the 20th flip-flop D20 is used to output the 13th count value lckCnt[4]. The output of the 21st flip-flop D21 is connected to the second input of the 12th XOR gate H12 and the second input of the 37th AND gate Y36, respectively. The second input terminal of 37 is connected, the input terminal of the twenty-first flip-flop D21 is used to connect to the output terminal of the twelfth XOR gate H12, the output terminal of the thirty-seventh AND gate Y37 is connected to the first input terminal of the thirty-eighth AND gate Y38 and the first input terminal of the thirteenth XOR gate H13 respectively, and the output terminal of the twenty-first flip-flop D21 is used to output the fourteenth count value lckCnt[5]; the output terminal of the twenty-second flip-flop D22 is connected to the second input terminal of the thirteenth XOR gate H13 and the second input terminal of the thirty-eighth AND gate Y38 respectively, and the input terminal of the twenty-second flip-flop D22 is used to connect to the thirteenth XOR gate H13. The output of the 38th AND gate Y38 is connected to the first input of the 14th XOR gate H14. The output of the 22nd flip-flop D22 is used to output the 15th count value lckCnt[6]. The output of the 23rd flip-flop D23 is connected to the second input of the 14th XOR gate H14 and the second input of the 39th AND gate Y39 respectively. The input of the 23rd flip-flop D23 is used to connect to the output of the 14th XOR gate H14. The output of the 39th AND gate Y39 is connected to the first input of the 15th XOR gate H15. The output of the 23rd flip-flop D23 is used to output the 15th count value lckCnt[6]. The sixteenth count value lckCnt[7]; the output of the twenty-fourth flip-flop D24 is connected to the second input of the fifteenth XOR gate H15. The input of the twenty-fourth flip-flop D24 is used to connect to the output of the fifteenth XOR gate H15. The output of the twenty-fourth flip-flop D24 is used to output the seventeenth count value lckCnt[8]. The seventeenth count value, the sixteenth count value, the fifteenth count value, the fourteenth count value, the thirteenth count value, the twelfth count value, the eleventh count value, the tenth count value, and the ninth count value are arranged from left to right to form the second counting result lckCnt[8,0].
[0032] It is understood that the state machine module includes a state machine switching circuit and a state register circuit. The input of the state machine switching circuit is connected to the output of the first counter unit. The first output of the state machine switching circuit is connected to the clear terminal of the first counter. The second output of the state machine switching circuit is connected to the input of the state register circuit. The output of the state register circuit is connected to the input of the synchronization unit and the input of the state machine switching circuit, respectively. The clock terminal of the state register circuit is used to input a reference clock. The state machine switching circuit is used to output a state switching signal based on the first counting result and the current state of the state register circuit. The state register circuit is used to switch to the corresponding state based on the state switching signal and output the corresponding state signal to the synchronization unit.
[0033] For example, in some embodiments, reference is made to Figure 4 , Figure 5 and Figure 6In this embodiment, the state register circuit switches sequentially in the order of idle state – sampling state – comparison state – reset state. The first output terminal of the state machine switching circuit is connected to the clear terminal of the first counter to clear the first counting result recorded by the first counting unit while the state register circuit switches states, preventing the first counting result from becoming too large and exceeding the value that the first counting unit can record. The input terminal of the state machine switching circuit is connected to the output terminal of the first counter unit and the output terminal of the state register circuit, thereby outputting a state switching signal based on the first counter result and the state signal representing the current state output by the state register circuit. The input terminal of the state register circuit is connected to the second output terminal of the state switching circuit, and the output terminal of the state register circuit is also connected to the input terminal of the synchronization unit, so that the state register circuit can switch to the corresponding state according to the state switching signal and output a state signal to the synchronization unit. For example, 00 represents the idle state and 01 represents the sampling state. After receiving the state switching signal, the state register circuit switches from the idle state to the sampling state, causing the state signal output to the synchronization unit to switch from 00 to 01. The state switching circuit includes fourteenth AND gate Y14, fifteenth AND gate Y15, sixteenth AND gate Y16, seventeenth AND gate Y17, eighteenth AND gate Y18, nineteenth AND gate Y19, twentieth AND gate Y20, twenty-first AND gate Y21, twenty-second AND gate Y22, twenty-third AND gate Y23, twenty-fourth AND gate Y24, twenty-fifth AND gate Y25, and a first OR gate L1. The first, second, and third inputs of the fourteenth AND gate Y14 are connected to the outputs of the sixth flip-flop D6, the seventh flip-flop D7, and the eighth flip-flop D8, respectively. The first, second, third, fourth, fifth, sixth, seventh, and eighth inputs of the sixteenth AND gate Y16 are connected to the sixth flip-flop D6, the seventh flip-flop D7, the eighth flip-flop D8, the ninth flip-flop D9, the tenth flip-flop D10, the eleventh flip-flop D11, and the twelfth flip-flop D11, respectively. Connect the output of flip-flop D13 to gate 2. Connect the first, second, third, and fourth inputs of gate Y18 to the outputs of flip-flops D6, D7, D8, and D9, respectively. Connect the first, second, and third inputs of gate Y20 to the outputs of flip-flops D6, D7, and D8, respectively. Connect the first input of gate Y22 to the output of gate Y14, and the second input to the output of gate Y15. Connect the first input of gate Y23 to the output of gate Y16, and the second input to the output of gate Y17. Connect the first input of gate Y24 to the output of gate Y18, and the second input to the output of gate Y19.The first input of AND gate Y25 is connected to the output of AND gate Y20, and the second input is connected to the output of AND gate Y21. The input of OR gate L1 is connected to the outputs of AND gates Y22, Y23, Y24, and Y25, respectively. The state switching signals include a first switching signal, a second switching signal, a third switching signal, and a fourth switching signal. AND gate Y22 outputs the first switching signal stv_s0, AND gate Y23 outputs the first switching signal stv_s1, AND gate Y24 outputs the first switching signal stv_s2, and AND gate Y25 outputs the first switching signal stv_s3. The state register circuit includes AND gates Y26 (26th), Y27 (27th), Y28 (28th), Y29 (29th), Y30 (30th), Y31 (31st), Y32 (32nd), OR gate L2 (2nd), OR gate L3 (3rd), flip-flop D14 (14th), and flip-flop D15 (15th). The first input of AND gate Y26 is connected to the first input of AND gate Y27, the first input of AND gate Y30, and the second input of flip-flop D15. The output terminals are connected as follows: the second input terminal of the 26th AND gate Y26 is connected to the second output terminal of the 14th flip-flop D14, the second input terminal of the 28th AND gate Y28, and the second input terminal of the 31st AND gate Y31, respectively; the third output terminal of the 26th AND gate Y26 is connected to the output terminal of the 22nd AND gate Y22, and the second input terminal of the 27th AND gate Y27 is connected to the first output terminal of the 14th flip-flop D14, the second input terminal of the 29th AND gate Y29, the second input terminal of the 30th AND gate Y30, and the second input terminal of the 32nd AND gate Y32, respectively; the output terminal of the 23rd AND gate Y23 is inverted by a NOT gate and connected to the third input terminal of the 27th AND gate Y27, i.e., signal ~stv_s1 is the inverted signal of the first switching signal stv_s1; the first input terminal of the 28th AND gate Y28 is connected to the first input terminal of the 29th AND gate Y29, the first input terminal of the 31st AND gate Y31, the first input terminal of the 32nd AND gate Y32, and the first output terminal of the 15th flip-flop D15, respectively. The third input of AND gate Y28 is connected to the output of AND gate Y24. The output of AND gate Y25, after being inverted by a NOT gate, is connected to the third input of AND gate Y29. The output of AND gate Y23 is connected to the third input of AND gate Y30. The output of AND gate Y24, after being inverted by a NOT gate, is connected to the third input of AND gate Y31. The output of AND gate Y25, after being inverted by a NOT gate, is connected to the third input of AND gate Y32.The first, second, third, and fourth inputs of the second OR gate L2 are connected to the outputs of the twenty-sixth AND gate Y26, the twenty-seventh AND gate Y27, the twenty-eighth AND gate Y28, and the twenty-ninth AND gate Y29, respectively. The first, second, and third inputs of the third OR gate L3 are connected to the outputs of the thirtieth AND gate Y30, the thirty-first AND gate Y31, and the thirty-second AND gate Y32, respectively. The output of the second OR gate L2 is connected to the output of the fourteenth flip-flop D14, and the output of the third OR gate L3 is connected to the input of the fifteenth flip-flop D15. The clock inputs of both the fourteenth and fifteenth flip-flops D14 are used to connect to a reference clock. The first output of the fourteenth flip-flop D14 is connected to the first input of the seventeenth AND gate Y17 and the twenty-first AND gate Y21, respectively. The second output of the fourteenth flip-flop D14 is connected to the first input of the fifteenth AND gate Y15 and the nineteenth AND gate Y19, respectively. The first output terminal of flip-flop D15 is connected to the second input terminal of the nineteenth AND gate Y19 and the second input terminal of the twenty-first AND gate Y21, respectively. The second output terminal of the fifteenth flip-flop D15 is connected to the second input terminal of the fifteenth AND gate Y15 and the second input terminal of the seventeenth AND gate Y17, respectively. The state signals include a first state signal, a second state signal, a third state signal and a fourth state signal. The first output terminal of the fourteenth flip-flop D14 is used to output the first state signal curSta[0]. The second output terminal of the fourteenth flip-flop D14 is used to output the second state signal ~curSta[0]. The first output terminal of the fifteenth flip-flop D15 is used to output the third state signal curSta[1]. The second output terminal of the fifteenth flip-flop D15 is used to output the fourth state signal ~curSta[1]. The second state signal ~curSta[0] is the inverted signal of the first state signal curSta[0]. The fourth state signal ~curSta[1] is the inverted signal of the third state signal curSta[1]. The principle is as follows: when curSta[1:0] equals "00", the state register circuit is in idle state; when curSta[1:0] equals "01", the state register circuit is in sampling state; when curSta[1:0] equals "10", the state register circuit is in comparison state; when curSta[1:0] equals "11", the state register circuit is in reset state. In the idle state, when stv_s0 is 1, it jumps to the sampling state; otherwise, it remains in idle state. In the sampling state, when stv_s1 is 1, it jumps to the comparison state; otherwise, it remains in sampling state. In the comparison state, when stv_s2 is 1, it jumps to the reset state; otherwise, it remains in comparison state. In the reset state, when stv_s3 is 1, it jumps to the idle state; otherwise, it remains in reset state. That is, when curSta[1:0] equals "00" and stv_s0 equals 1,When curSta[1:0] equals “01” and stv_s1 equals 0, or when curSta[1:0] equals “10” and stv_s2 equals 1, or when curSta[1:0] equals “11” and stv_s3 equals 0, nxtSta[0] equals 1, causing the first output of the fourteenth flip-flop D14 to generate curSta[0]; when curSta[1:0] equals “01” and stv_s1 equals 1, or when curSta[1:0] equals “10” and stv_s2 equals 0, or when curSta[1:0] equals “11” and stv_s3 equals 0, nxtSta[1] equals 1, causing the first output of the fifteenth flip-flop D15 to generate curSta[1]. When stmCnt[2:0] equals "111" and curSta[1:0] equals "00", stv_s0 equals 1; when stmCnt[7:0] equals "11111111" and curSta[1:0] equals "01", stv_s1 equals 1; when stmCnt[3:0] equals "1111" and curSta[1:0] equals "10", stv_s2 equals 1; when stmCnt[2:0] equals "111" and curSta[1:0] equals "11", stv_s3 equals 1. When stv_s0, stv_s1, stv_s2, or stv_s3 equals 1, stmClr equals 1.
[0034] It should be noted that: State transition reference Figure 4 In the idle state, the first counter unit counts 8 and switches to the sampling state; in the sampling state, the first counter unit counts 256 and switches to the comparison state; in the comparison state, the first counter unit counts 16 and switches to the reset state; in the reset state, the first counter unit counts 8 and switches back to the idle state.
[0035] It is understood that the synchronization unit includes a first flip-flop D1 and a second flip-flop D2. The input of the first flip-flop D1 is connected to the output of the state register circuit, the output of the first flip-flop D1 is connected to the input of the second flip-flop D2, the output of the second flip-flop D2 is connected to the enable terminal of the second counter unit, and the clock terminals of both the first flip-flop D1 and the second flip-flop D2 are used to access the feedback clock.
[0036] For example, in some embodiments, reference is made to Figure 7In this embodiment, both the first flip-flop D1 and the second flip-flop D2 are D flip-flops. The reset terminals of both the first flip-flop D1 and the second flip-flop D2 are used to receive the reset signal. The synchronization unit also includes a seventh AND gate Y7. The first output terminal of the fourteenth flip-flop D14 is connected to the first input terminal of the seventh AND gate Y7. The second output terminal of the fifteenth flip-flop D15 is connected to the second input terminal of the seventh AND gate Y7. The output terminal of the seventh AND gate Y7 is connected to the input terminal of the first flip-flop D1. The output terminal of the second flip-flop D2 is connected to the enable terminal of the second counter unit (so that the second counter unit can start working when the output terminal of the second flip-flop D2 outputs 1). The specific working principle is as follows: when the state signal curSta[1:0] output by the state register circuit is equal to "01", that is, when it is in the sampling state, the sampling window signal lckWinP output by the seventh AND gate Y7 is 1. Since the reference clock and the feedback clock belong to the asynchronous clock domain, there is a metastability risk in cross-domain sampling of the window gate signal. lckWinP is below the reference clock threshold and needs to be synchronized to the feedback clock threshold first. Essentially, the second counter unit only starts working when the state register circuit is in the sampling state. The duration of the sampling state is obtained by the first counter unit counting the reference clock pulses. Assuming the duration of the sampling state is set to require the first counter unit to count 256 reference clock pulses with an error range of ±6, the second count result output by the second counter unit must be between 250 and 262 in order to output a lock signal; otherwise, an unlock signal will be output.
[0037] It is understood that the lock monitoring module includes a window comparison circuit, a sampling decision circuit, and a lock flag generation circuit. The input of the window comparison circuit is connected to the output of the second counter unit. The input of the sampling decision circuit is connected to the output of the window comparison circuit and the output of the first counter unit, respectively. The output of the sampling decision circuit is connected to the input of the lock flag generation circuit. The window comparison circuit is used to determine whether the second counting result is within the reference range. When the state machine module is in the comparison state, the sampling decision circuit outputs a decision signal to the lock flag generation circuit based on the first counting result and the output of the window comparison circuit when judging the threshold. The lock flag generation circuit outputs a lock signal or a lockout signal based on the decision signal.
[0038] For example, in some embodiments, reference is made to Figure 8In this embodiment, the window comparison circuit includes 40 AND gate Y40, 41 AND gate Y41, 42 AND gate Y42, 43 AND gate Y43, 44 AND gate Y44, 45 AND gate Y45, 46 AND gate Y46, 47 AND gate Y47, 48 AND gate Y48, 49 AND gate Y49, 50 AND gate Y50, 51 AND gate Y51, 52 AND gate Y52 and a fourth OR gate L4. The input terminal of 40 AND gate Y40 is connected to the output terminals of 17 flip-flops D17, 19 flip-flops D19, 20 flip-flops D20, 21 flip-flops D21, 22 flip-flops D22 and 23 flip-flops D23, respectively. The 16th flip-flop D1... 6. The outputs of the 18th flip-flop D18 and the 24th flip-flop D24 are inverted by a NOT gate and then connected to the input of the 40th AND gate Y40. The input of the 41st AND gate Y41 is connected to the outputs of the 16th flip-flop D16, 17th flip-flop D17, 19th flip-flop D19, 20th flip-flop D20, 21st flip-flop D21, 22nd flip-flop D22, and 23rd flip-flop D23. The outputs of the 18th flip-flop D18 and the 24th flip-flop D24 are inverted by a NOT gate and then connected to the 41st AND gate Y41. The input of the 42nd AND gate Y42 is connected to the 18th flip-flop D18, 19th flip-flop D19, 20th flip-flop D20, and 21st flip-flop D21. The outputs of the 22nd flip-flop D22 and the 23rd flip-flop D23 are connected. The outputs of the 16th flip-flop D16, the 17th flip-flop D17, and the 24th flip-flop D24 are inverted by a NOT gate and then connected to the input of the 42nd AND gate Y42. The input of the 43rd AND gate Y43 is connected to the outputs of the 16th flip-flop D16, the 18th flip-flop D18, the 19th flip-flop D19, the 20th flip-flop D20, the 21st flip-flop D21, the 22nd flip-flop D22, and the 23rd flip-flop D23. The outputs of the 17th flip-flop D17 and the 24th flip-flop D24 are inverted by a NOT gate and then connected to the input of the 43rd flip-flop. The input of the 44th AND gate Y44 is connected to the outputs of the 16th flip-flop D16, the 18th flip-flop D18, the 19th flip-flop D19, the 20th flip-flop D20, the 21st flip-flop D21, the 22nd flip-flop D22, and the 23rd flip-flop D23. The outputs of the 17th flip-flop D17 and the 24th flip-flop D24 are inverted by a NOT gate and then connected to the input of the 43rd flip-flop. The outputs of flip-flops D17 (17th), D18 (18th), D19 (19th), D20 (20th), D21 (21st), D22 (22nd), and D23 (23rd) are connected. The outputs of flip-flops D16 (16th) and D24 (24th) are inverted by NOT gates and then connected to the input of AND gate Y44 (44th). The input of AND gate Y45 (45th) is connected to the outputs of flip-flops D16 (16th), D17 (17th), D18 (18th), D19 (19th), D20 (20th), D21 (21st), D22 (22nd), D23 (23rd), and D24 (24th).The input of AND gate Y46 (46th AND gate) is connected to the outputs of flip-flops D16, D17, D18, D19, D20, D21, D22, and D23 (23rd AND gate). The output of flip-flop D24 (24th AND gate) is inverted by a NOT gate and connected to the input of AND gate Y45 (45th AND gate). The input of AND gate Y46 (46th AND gate) is connected to the output of flip-flop D16 (46th AND gate). The output of the quad flip-flop D24 is inverted by a NOT gate and connected to the input of the 46th AND gate Y46. The input of the 47th AND gate Y47 is connected to the outputs of the 16th flip-flop D16 and the 24th flip-flop D24. The outputs of the 17th flip-flop D17, 18th flip-flop D18, 19th flip-flop D19, 20th flip-flop D20, 21st flip-flop D21, 22nd flip-flop D22, and 23rd flip-flop D23 are inverted by a NOT gate and connected to the input of the 47th AND gate Y47. The input of the 48th AND gate Y48 is connected to the outputs of the 17th flip-flop D17 and the 24th flip-flop D24. The outputs of the 16th flip-flop D16, 18th flip-flop D18, 19th flip-flop D19, 20th flip-flop D20, 21st flip-flop D21, 22nd flip-flop D22, and 23rd flip-flop D23 are inverted by a NOT gate and connected to the input of the 47th AND gate Y47. 9. The outputs of the 20th flip-flop D20, 21st flip-flop D21, 22nd flip-flop D22, and 23rd flip-flop D23 are inverted by a NOT gate and connected to the input of the 48th AND gate Y48; the input of the 49th AND gate Y49 is connected to the outputs of the 16th flip-flop D16, 17th flip-flop D17, and 24th flip-flop D24, respectively; the outputs of the 18th flip-flop D18, 19th flip-flop D19, 20th flip-flop D20, 21st flip-flop D21, 22nd flip-flop D22, and 23rd flip-flop D23 are inverted by a NOT gate and connected to the input of the 49th AND gate Y49; the input of the 50th AND gate Y50 is connected to the 18th flip-flop D18 and 24th flip-flop D23, respectively. The output of flip-flop D16, flip-flop D17, flip-flop D19, flip-flop D20, flip-flop D21, flip-flop D22, and flip-flop D23 are inverted by a NOT gate and then connected to the input of flip-flop Y50. The input of flip-flop Y51 is connected to the output of flip-flop D16, flip-flop D18, and flip-flop D24. The output of flip-flop D17, flip-flop D19, flip-flop D20, flip-flop D21, flip-flop D22, and flip-flop D23 are inverted by a NOT gate and then connected to the input of flip-flop Y51.The input of AND gate Y52 (52) is connected to the outputs of flip-flops D17 (17), D18 (18), and D24 (24), respectively. The outputs of flip-flops D16 (16), D19 (19), D20 (20), D21 (21), D22 (22), and D23 (23) are inverted by NOT gates and then connected to the input of AND gate Y52 (52). The input of OR gate L4 (4) is connected to the outputs of AND gates Y52 (40 to 52), respectively. The output of OR gate L4 (4) outputs the lckTag signal. Since the reference clock and the feedback clock are asynchronous, the synchronization of the window enable signal across clock domains will cause a counting offset. At the same time, power supply, temperature, and VCO noise will introduce a small amount of cumulative cycle deviation when the PLL is in steady state. The maximum deviation after the two types of errors are superimposed is 6 clock cycles. Therefore, this application sets the allowable cumulative phase difference error range between the reference clock and the feedback clock to be -6 to +6 clock cycles within the observation period of 256 reference clock cycles. That is, when the count of lckCnt[8:0] is greater than or equal to 250 and less than or equal to 262, the lckTag signal is set to 1, that is, the phase difference is within ±6. That is, when lckCnt[8:0] equals "011111010", "011111011", "011111100", "011111101", "011111110", "011111111", "100000000", "100000001", "100000010", "100000011", "100000100", "100000101", or "100000110", lckTag equals 1.
[0039] It is understood that the sampling decision circuit includes a first AND gate Y1, a second AND gate Y2, a third AND gate Y3, a fourth AND gate Y4, a fifth AND gate Y5, and a first NOT gate F1. The input of the first AND gate Y1 is connected to the output of the first counter. The input of the second AND gate Y2 is connected to the output of the state machine module. The output of the first AND gate Y1 is connected to the first input of the third AND gate Y3. The output of the second AND gate Y2 is connected to the second input of the third AND gate Y3. The output of the third AND gate Y3 is connected to the first input of the fourth AND gate Y4 and the first input of the fifth AND gate Y5, respectively. The output of the window comparison circuit is connected to the input of the first NOT gate F1 and the second input of the fifth AND gate Y5, respectively. The output of the first NOT gate F1 is connected to the second input of the fourth AND gate Y4. The output of the fourth AND gate Y4 is connected to the first input of the lock flag generation circuit. The output of the fifth AND gate Y5 is connected to the second input of the lock flag generation circuit.
[0040] For example, in some embodiments, reference is made to Figure 2 and Figure 9In this embodiment, the output of the sixth flip-flop D6 is inverted by a NOT gate and connected to the first input of the first AND gate Y1; the output of the seventh flip-flop D7 is inverted by a NOT gate and connected to the second input of the first AND gate Y1; the output of the eighth flip-flop D8 is connected to the third input of the first AND gate Y1; the output of the ninth flip-flop D9 is connected to the fourth input of the first AND gate Y1; the first input of the second AND gate Y2 is connected to the second output of the fourteenth flip-flop D14; and the second input of the second AND gate Y2 is connected to the first input of the fifteenth flip-flop D15. This causes the lckRdy signal to be set to 1 if lckTag is equal to 1 (i.e., in the comparison state) and stmCnt[7,0] is equal to 00001100 (i.e., the judgment threshold is 12) when curSta[1:0] is equal to "10" (i.e., in the comparison state) and stmCnt[7,0] is equal to 00001100 (i.e., the judgment threshold is 12), and if lckTag is equal to 1, then lckRdy signal is set to 1; if lckTag is equal to 0, then lckMis signal is set to 1. Since the comparison state requires counting to 16 before jumping to the reset state, the pulse data when the count is 12 is already relatively stable and will not become unstable due to the recent state switch.
[0041] It should be noted that "~" is the inverted signal of the signal, such as ~curSta[1] is the inverted signal of curSta[1].
[0042] It is understood that the lock flag generation circuit includes a lock signal output unit and a unlock signal output unit. The first input terminal of the lock signal output unit is connected to the output terminal of the fourth AND gate Y4, and the second input terminal of the lock signal output unit is connected to the output terminal of the fifth AND gate Y5. The output terminal of the lock signal output unit is used to output a lock signal. The output terminal of the lock signal output unit is also used to connect to the input terminal of the unlock signal output unit. The output terminal of the unlock signal output unit is used to output an unlock signal. The clock terminals of both the lock signal output unit and the unlock signal output unit are used to connect to a reference clock.
[0043] For example, in this embodiment, when the signal lckRdy output from the output terminal of the fifth AND gate Y5 is 1, it proves that the second counting result is within the reference range and the phase difference between the feedback clock and the reference clock is within the error range. At this time, the lock signal output unit outputs a lock signal. When the signal lckMis output from the output terminal of the fourth AND gate Y4 is 1, it proves that the second counting result is outside the reference range and the phase difference between the feedback clock and the reference clock is outside the error range. At this time, the unlock signal output unit outputs an unlock signal. The operator can then determine the current state of the phase-locked loop by using the unlock signal and the lock signal.
[0044] It is understood that the lock signal output unit includes a first selector X1, a second selector X2, and a third flip-flop D3. The selection terminal of the first selector X1 is connected to the output terminal of the fifth AND gate Y5. The second input terminal of the first selector X1 is used to input a high level. The output terminal of the first selector X1 is connected to the first input terminal of the second selector X2. The second input terminal of the second selector X2 is used to input a low level. The selection terminal of the second selector X2 is connected to the output terminal of the fourth AND gate Y4. The output terminal of the second selector X2 is connected to the input terminal of the third flip-flop D3. The output terminal of the third flip-flop D3 is connected to the first input terminal of the first selector X1 and the input terminal of the unlock signal output unit. The clock terminal of the third flip-flop D3 is used to input a reference clock. The output terminal of the third flip-flop D3 is used to output a lock signal.
[0045] For example, in some embodiments, reference is made to Figure 10 In this embodiment, the selection signal of the first selector X1 is lckRdy output from the output of the fifth AND gate Y5. When lckRdy is 0, the first selector X1 outputs the value of its first input, which is the output signal of the third flip-flop D3. When lckRdy is 1, the first selector X1 outputs the value of its second input, i.e., output 1. The selection signal of the second selector X2 is lckMis output from the output of the fourth AND gate Y4. When lckMis is 0, the second selector X2 outputs the value of its first input, which is the output signal of the first selector X1. When lckMis is 1, the second selector X2 outputs the value of its second input, i.e., output 0. The clock signal of the third flip-flop D3 is a reference clock and is triggered on the rising edge. The reset signal is REFCLK and is a low-level reset. The signal pIILock output from the output of the third flip-flop D3 is the lock signal.
[0046] It is understood that the unlock signal output unit includes a fourth flip-flop D4, a fifth flip-flop D5, a sixth AND gate Y6, a second NOT gate F2, and a third selector X3. The input of the fourth flip-flop D4 is connected to the output of the lock signal output unit and the input of the second NOT gate F2. The first input of the sixth AND gate Y6 is connected to the output of the fourth flip-flop D4, the second input of the sixth AND gate Y6 is connected to the output of the second NOT gate F2, and the output of the sixth AND gate Y6 is connected to the selection terminal of the third selector X3. The second input of the third selector X3 is used to input a high level, the first input of the third selector X3 is connected to the output of the fourth flip-flop D4, and the output of the third selector X3 is connected to the input of the fifth flip-flop D5. The clock terminals of both the fourth flip-flop D4 and the fifth flip-flop D5 are used to input a reference clock, and the output of the fifth flip-flop D5 is used to output the unlock signal.
[0047] For example, in some embodiments, reference is made to Figure 10In this embodiment, the output of the third flip-flop D3 is connected to the input of the fourth flip-flop D4. The selection signal of the third selector X3 is the signal pIILosV output by the sixth AND gate Y6. When pIILosV is 0, the third selector X3 outputs the value of the first input, which is the output signal of the fifth flip-flop D5; when pIILosV is 1, the third selector X3 outputs the value of the second input, i.e., the output is 1. The signal pIILose output by the fifth flip-flop D5 is the unlock signal.
[0048] It should be noted that all the triggers in this application are rising edge triggered, and the reset signal is REFCLK and is a low-level reset.
[0049] The general working principle of this application is as follows: The first counter unit counts the number of pulses of the phase-locked loop reference clock, thereby outputting the first counting result. The state machine switching circuit outputs a state switching signal based on the first counting result and the current state of the state register circuit, and clears the first counter unit. For example, assuming the sampling state is set to 256 reference signal pulses, if the state machine switching circuit detects that the first counting result is 256 and the current state of the state register circuit is the sampling state, it outputs the state switching signal and clears the first counter unit so that the first counter unit can start the next stage of counting. After the state register circuit detects the state switching signal, it switches from the sampling state to the comparison state. The synchronization unit is used to synchronize the signal output by the state register circuit to the feedback clock domain. The window comparison circuit is used to determine whether the second counting result is within the reference range. The reference range is set based on the reference signal pulses that the first counter unit needs to sample in the sampling state. For example, if the first counter unit requires 256 reference signal pulses to sample in the sampling state, and the allowable error range is ±6, then the reference range is set to 250 to 262. The window comparison circuit is used to determine whether the second counting result is within this range, thereby determining whether the phase difference between the reference clock and the feedback clock is within the error range. The sampling decision circuit is used to output a decision signal to the lock flag generation circuit based on the first counting result when the state machine is in the comparison state, at the judgment threshold. For example, assuming there are 16 pulses in the comparison state, the decision signal is output to the lock flag generation circuit at the 12th pulse (i.e., the judgment threshold) based on the first counting result. This ensures the accuracy of the decision signal when the window comparison circuit output is stable. The lock flag generation circuit then outputs an unlock signal or a lock signal based on the decision signal. The operator can determine the current state of the phase-locked loop based on the output unlock signal or lock signal. For specific pulse signal diagrams of the unlock signal and lock signal, please refer to [reference needed]. Figure 11 and Figure 12As can be seen, the phase-locked loop monitoring circuit of this application is entirely composed of digital logic circuits, which avoids the problems of RC filter delay, device temperature drift, and judgment reference drift that are prone to occur in traditional analog circuits, thereby improving response speed, stability and accuracy.
[0050] The circuit board according to the second aspect embodiment of the application includes the phase-locked loop monitoring circuit of the first aspect embodiment of the application described above.
[0051] According to the phase-locked loop (PLL) monitoring circuit of this application embodiment, the application uses a first counter unit to record the number of pulses of the PLL reference clock, thereby outputting a corresponding first counting result. A state machine module switches to a corresponding state based on the first counting result to perform different tasks. For example, when the first counting result reaches a first threshold, the state machine module switches to a sampling state. At this time, the signal output by the state machine module drives the second counter unit to start counting. When the first counting result reaches a second threshold, the state machine module switches to a comparison state. When the first counting result reaches a judgment threshold, i.e., when the second counting structure is stable in the comparison state, the signal output by the state machine module drives the locking monitoring module to determine whether the phase difference between the reference clock and the feedback clock is within a preset error range, i.e., whether the second counting result is within a reference range. Since the clock terminal of the state machine module is connected to the reference clock, and the clock terminal of the second counter unit is connected to the feedback clock, and the feedback clock and the reference clock belong to the asynchronous clock domain, the state machine... The module's output signal must first be synchronized to the clock threshold of the feedback clock; otherwise, metastability is likely to occur. Therefore, a synchronization unit is set up to achieve synchronization. The second counter is used to record the number of pulses of the PLL feedback clock. The lock monitoring module is used to determine whether the phase difference between the reference clock and the feedback clock is within the preset error range based on the second count result. That is, if the second count result is not within the reference range, the phase difference is considered to exceed the error range, and the lock monitoring module outputs an unlock signal. If the second count result is within the reference range, the phase difference is considered to be within the error range, and the lock monitoring module outputs a lock signal. Thus, the output of the lock signal and the unlock signal can be used to determine whether the PLL is working properly. The fact that the first counter unit, state machine module, synchronization unit, second counter unit, and lock monitoring module are all composed of digital logic circuits helps to avoid problems such as RC filter delay, device temperature drift, and judgment reference drift that may occur in traditional PLL monitoring circuits, thereby improving response speed, stability, and accuracy.
[0052] The device according to the third aspect of the application includes the circuit board of the second aspect of the application described above.
[0053] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0054] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0055] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0056] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0057] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0058] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0059] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0060] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0061] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0062] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part 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 multiple 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0063] Furthermore, it should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent will be obtained first. Moreover, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. Additionally, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user will be obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent will the necessary user-related data for the proper functioning of these embodiments be acquired.
[0064] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A phase-locked loop monitoring circuit, characterized in that, include: The first counter unit has a clock terminal for connecting to the reference clock of the phase-locked loop and is used to count the number of pulses of the reference clock to output a first counting result. A state machine module is connected to the first counter unit. The state machine module is used to switch between multiple states based on the first counting result, wherein the multiple states include at least a sampling state and a comparison state. Synchronization unit; The second counter unit is connected to the state machine module through the synchronization unit. The clock terminal of the second counter unit is used to access the feedback clock of the phase-locked loop. The second counter unit is used to count the number of pulses of the feedback clock when the state machine module is in the sampling state, so as to output a second counting result. A lock monitoring module is connected to the second counter unit and the state machine module respectively. The lock monitoring module is used to output a lock signal or a lockout signal based on whether the second count result is within a preset reference range when the state machine module is in the comparison state and the first count result is a preset judgment threshold.
2. The phase-locked loop monitoring circuit according to claim 1, characterized in that, The state machine module includes a state machine switching circuit and a state register circuit. The input terminal of the state machine switching circuit is connected to the output terminal of the first counter unit. The first output terminal of the state machine switching circuit is connected to the clear terminal of the first counter. The second output terminal of the state machine switching circuit is connected to the input terminal of the state register circuit. The output terminal of the state register circuit is connected to the input terminal of the synchronization unit and the input terminal of the state machine switching circuit, respectively. The clock terminal of the state register circuit is used to connect to the reference clock. The state machine switching circuit is used to output a state switching signal based on the first counting result and the current state of the state register circuit. The state register circuit is used to switch to the corresponding state based on the state switching signal and output the corresponding state signal to the synchronization unit.
3. The phase-locked loop monitoring circuit according to claim 2, characterized in that, The synchronization unit includes a first flip-flop and a second flip-flop. The input terminal of the first flip-flop is connected to the output terminal of the state register circuit, the output terminal of the first flip-flop is connected to the input terminal of the second flip-flop, and the output terminal of the second flip-flop is connected to the enable terminal of the second counter unit. The clock terminals of both the first and second flip-flops are used to access the feedback clock.
4. The phase-locked loop monitoring circuit according to claim 1, characterized in that, The locking monitoring module includes a window comparison circuit, a sampling decision circuit, and a locking flag generation circuit. The input terminal of the window comparison circuit is connected to the output terminal of the second counter unit. The input terminal of the sampling decision circuit is connected to the output terminal of the window comparison circuit and the output terminal of the first counter unit, respectively. The output terminal of the sampling decision circuit is connected to the input terminal of the locking flag generation circuit. The window comparison circuit is used to determine whether the second counting result is within the reference range. When the state machine module is in the comparison state, the sampling decision circuit is used to output a decision signal to the locking flag generation circuit based on the first counting result and the output of the window comparison circuit at the judgment threshold. The locking flag generation circuit is used to output a locking signal or a unlocking signal based on the decision signal.
5. The phase-locked loop monitoring circuit according to claim 4, characterized in that, The sampling decision circuit includes a first AND gate, a second AND gate, a third AND gate, a fourth AND gate, a fifth AND gate, and a first NOT gate. The input of the first AND gate is connected to the output of the first counter. The input of the second AND gate is connected to the output of the state machine module. The output of the first AND gate is connected to the first input of the third AND gate. The output of the second AND gate is connected to the second input of the third AND gate. The output of the third AND gate is connected to the first input of the fourth AND gate and the first input of the fifth AND gate. The output of the window comparison circuit is connected to the input of the first NOT gate and the second input of the fifth AND gate. The output of the first NOT gate is connected to the second input of the fourth AND gate. The output of the fourth AND gate is connected to the first input of the lock flag generation circuit. The output of the fifth AND gate is connected to the second input of the lock flag generation circuit.
6. The phase-locked loop monitoring circuit according to claim 5, characterized in that, The locking flag generation circuit includes a locking signal output unit and a unlocking signal output unit. The first input terminal of the locking signal output unit is connected to the output terminal of the fourth AND gate, and the second input terminal of the locking signal output unit is connected to the output terminal of the fifth AND gate. The output terminal of the locking signal output unit is used to output the locking signal. The output terminal of the locking signal output unit is also used to connect to the input terminal of the unlocking signal output unit. The output terminal of the unlocking signal output unit is used to output the unlocking signal. The clock terminals of both the locking signal output unit and the unlocking signal output unit are used to connect to the reference clock.
7. The phase-locked loop monitoring circuit according to claim 6, characterized in that, The locking signal output unit includes a first selector, a second selector, and a third flip-flop. The selection terminal of the first selector is connected to the output terminal of the fifth AND gate. The second input terminal of the first selector is used to receive a high level. The output terminal of the first selector is connected to the first input terminal of the second selector. The second input terminal of the second selector is used to receive a low level. The selection terminal of the second selector is connected to the output terminal of the fourth AND gate. The output terminal of the second selector is connected to the input terminal of the third flip-flop. The output terminal of the third flip-flop is connected to the first input terminal of the first selector and the input terminal of the unlocking signal output unit. The clock terminal of the third flip-flop is used to receive the reference clock. The output terminal of the third flip-flop is used to output the locking signal.
8. The phase-locked loop monitoring circuit according to claim 6, characterized in that, The unlock signal output unit includes a fourth flip-flop, a fifth flip-flop, a sixth AND gate, a second NOT gate, and a third selector. The input of the fourth flip-flop is connected to the output of the lock signal output unit and the input of the second NOT gate, respectively. The first input of the sixth AND gate is connected to the output of the fourth flip-flop, the second input of the sixth AND gate is connected to the output of the second NOT gate, and the output of the sixth AND gate is connected to the selection terminal of the third selector. The second input of the third selector is used to connect to a high level, the first input of the third selector is connected to the output of the fourth flip-flop, and the output of the third selector is connected to the input of the fifth flip-flop. The clock terminals of both the fourth and fifth flip-flops are used to connect to the reference clock, and the output of the fifth flip-flop is used to output the unlock signal.
9. A circuit board, characterized in that, include: The phase-locked loop monitoring circuit according to any one of claims 1 to 8.
10. A device, characterized in that, include: The circuit board as described in claim 9.
