Detection method and circuit for determining whether a clock signal is accurate

By introducing a reference clock signal and a counter, and using a digital comparison circuit to determine the cycle count value of the clock signal, the problem of reference current source offset and delay in the clock signal self-test analog verification circuit in the existing technology is solved, and the accuracy and accuracy of the test are improved. efficiency.

CN112532214BActive Publication Date: 2024-08-27CHENGDU MONOLITHIC POWER SYST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011265341.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-12
Publication Date
2024-08-27
Estimated Expiration
2040-11-12

AI Technical Summary

Technical Problem

The existing clock signal self-test simulation verification circuit has problems with reference current source offset and delay, which affects test accuracy.

Method used

The frequency of the introduced reference clock signal is the same as that of the detected clock signal, its cycles are counted through a counter, and the logical state of the counting signal is judged through a digital comparison circuit to generate a self-test signal to determine the accuracy of the clock signal.

Benefits of technology

This effectively avoids only confirming the detected clock signal and ignoring the correctness of the reference clock signal, and improves the accuracy and efficiency of clock signal testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112532214B
    Figure CN112532214B
Patent Text Reader

Abstract

Disclosed are a detection method and circuit for determining whether a clock signal is accurate. The detection method includes a detected clock signal and a reference clock signal, and the cycles of the two clock signals are counted simultaneously. When the cycle count value of one of the detected clock signal and the reference clock signal is equal to a preset maximum count value, it is determined whether the cycle count value of the other clock signal is between the preset maximum count value and the preset minimum count value. The detection method and circuit eliminate the error in the detection process caused by physical parameters in the analog verification circuit, and can realize the mutual detection of the detected clock signal and the reference clock signal, thereby ensuring the correctness of the detected clock signal and the reference clock signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an electronic circuit, and in particular but not limited to a self-testing method and circuit for a clock signal. Background Art

[0002] With the rapid development of computer technology and microelectronics technology, the complexity of chips is getting higher and higher. In the process of chip research and development, after the chip is designed, it is necessary to verify the function of the chip, that is, to verify whether the designed chip meets the expected requirements. Especially in the field of automotive electronics, in order to ensure that the electronic system is stable and has not failed, it is necessary to establish an internal self-test system to test whether the relevant modules are accurate. In many chips, the clock signal is the benchmark for many logic signals. Confirming whether the clock signal works correctly directly determines whether the chip itself can work correctly. Therefore, the verification of the chip often requires verification of the correctness of the behavior of the clock signal.

[0003] Figure 1 The circuit schematic diagram of an existing analog verification circuit 50 for self-testing a clock signal is shown. The analog verification circuit 50 converts the count value of the clock signal Clock into a voltage signal, and compares the voltage signal with a reference voltage signal Vref representing the standard count value of the clock signal Clock, thereby determining whether the clock signal Clock is accurate. However, in the analog verification circuit 50, the reference current source, the offset value of the comparator, etc. themselves need to be further calibrated and adjusted. At the same time, since it takes a certain amount of time to charge the capacitor, the verification circuit 50 also has a certain delay, thereby affecting the accuracy of the clock signal test.

[0004] Therefore, we hope to propose an efficient clock signal self-test method and circuit. Summary of the invention

[0005] On the one hand, the present invention provides a detection method for determining whether a clock signal is accurate, wherein the detection method includes: introducing a reference clock signal, the frequency of the reference clock signal is the same as the frequency of the detected clock signal; simultaneously counting the periods of the detected clock signal and the reference clock signal respectively; determining whether the period count values ​​of the detected clock signal and the reference clock signal are equal to a preset maximum count value; and if the period count value of one of the detected clock signal and the reference clock signal is equal to the preset maximum count value, determining whether the period count value of the other clock signal is within the interval between the preset maximum count value and the preset minimum count value.

[0006] On the other hand, the present invention provides a detection circuit for determining whether a clock signal is accurate, comprising: a detected clock signal; a reference clock signal, wherein the frequency of the reference clock signal is the same as the frequency of the detected clock signal; a first counter, receiving the detected clock signal, and counting a preset minimum count value and a preset maximum count value for the period of the detected clock signal, to generate a first count signal and a second count signal; and a second counter, receiving the reference clock signal, and counting a preset minimum count value and a preset maximum count value for the period of the reference clock signal, to generate a third count signal and a fourth count signal; and a digital comparison circuit, receiving the first count signal, the second count signal, the third count signal and the fourth count signal, and comparing the logical states of the first count signal, the second count signal, the third count signal and the fourth count signal to generate a self-test signal. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In order to better understand the present invention, the present invention will be described in detail according to the following drawings:

[0008] Figure 1 FIG. 5 is a schematic diagram of a conventional analog verification circuit 50 for self-testing a clock signal;

[0009] Figure 2 FIG. 1 is a schematic block diagram of a clock signal self-checking method 100 according to an embodiment of the present invention;

[0010] Figure 3 FIG. 2 is a schematic block diagram of a clock signal self-checking circuit 200 according to an embodiment of the present invention;

[0011] Figure 4 FIG. 2 is a circuit diagram of a first counter 21 according to an embodiment of the present invention;

[0012] Figure 5 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 A circuit diagram of an embodiment 500 of the digital comparison circuit 23 in the illustrated embodiment;

[0013] Figure 6 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 A circuit schematic diagram of another embodiment 600 of the digital comparison circuit 23 in the illustrated embodiment;

[0014] Figure 7 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 A circuit diagram of yet another embodiment 700 of the digital comparison circuit 23 in the illustrated embodiment.

[0015] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The same reference numerals throughout all the drawings represent the same or similar components or features. DETAILED DESCRIPTION

[0016] Specific embodiments of the present invention will be described in detail below. It should be noted that the embodiments described here are only used for illustration and are not intended to limit the present invention. In the following detailed description of the present invention, a large number of details are described in order to better understand the present invention. However, it will be appreciated by those skilled in the art that the present invention can be implemented without these specific details. In order to clearly describe the present invention, the detailed description of some specific structures and functions is simplified herein. In addition, similar structures and functions that have been described in detail in some embodiments will not be repeated in other embodiments. Although the various terms of the present invention are described one by one in conjunction with specific exemplary embodiments, these terms should not be construed as being limited to the exemplary implementations described herein.

[0017] Throughout the specification, references to "one embodiment", "an embodiment", "an example" or "an example" mean that a particular feature, structure or characteristic described in conjunction with the embodiment or example is included in at least one embodiment of the present invention. Therefore, the phrases "in one embodiment", "in an embodiment", "an example" or "an example" appearing in various places throughout the specification do not necessarily refer to the same embodiment or example. In addition, particular features, structures or characteristics may be combined in one or more embodiments or examples in any appropriate combination and / or sub-combination. In addition, it should be understood by those of ordinary skill in the art that the drawings provided herein are for illustrative purposes and that the drawings are not necessarily drawn to scale. It should be understood that when an "element" is said to be "connected to" or "coupled" to another element, it may be directly connected or coupled to another element or there may be an intermediate element. In contrast, when an element is said to be "directly connected to" or "directly coupled to" another element, there is no intermediate element. The same reference numerals indicate the same element. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0018] Figure 2 FIG. 1 is a schematic block diagram of a clock signal self-checking method 100 according to an embodiment of the present invention. Figure 2In the illustrated embodiment, two clock signals are introduced into the clock signal self-checking method 100: a first clock signal Clock1 and a second clock signal Clock2. The first clock signal Clock1 is a clock signal to be detected, and is used in applications where a clock signal is required inside a circuit system, such as signal synchronization, logic calculation, etc. The second clock signal Clock2 is a reference clock signal, and is used to detect whether the first clock signal Clock1 is correct, wherein the frequency of the second clock signal Clock2 is the same as the frequency of the first clock signal Clock1. The clock signal self-checking method 100 includes steps 101-105.

[0019] Step 101, count the cycles of the first clock signal Clock1 and the second clock signal Clock2 simultaneously. In one embodiment, the system will perform N counts and M counts on the cycle of the first clock signal Clock1, and perform N counts and M counts on the cycle of the second clock signal Clock2, respectively, wherein N is a preset maximum count value of the cycle counts of the first clock signal Clock1 and the second clock signal Clock2, and M is a preset minimum count value of the cycle counts of the first clock signal Clock1 and the second clock signal Clock2. In one embodiment, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 1 and less than N. In one embodiment, the difference between the preset minimum count value M and the preset maximum count value N represents an error range allowed for the counting cycle.

[0020] Step 102 , determining whether the cycle count value of one of the clock signals (eg, the first clock signal Clock1 ) is equal to N. If the cycle count value of one of the clock signals is equal to N, go to step 103 ; otherwise, continue to execute step 102 .

[0021] Step 103, determine whether the cycle count value of another clock signal (for example, the second clock signal Clock2) is within the range of a preset minimum count value M to a preset maximum count value N. If the cycle count value of another clock signal is within the count range of the preset minimum count value M to the preset maximum count value N, go to step 104; otherwise, execute step 105. Within the scope of protection of the present invention, it can be determined by various methods and circuits whether the cycle count value of another clock signal is within the count range of the preset minimum count value M to the preset maximum count value N.

[0022] For example, in one embodiment, step 103 includes steps 1031-1034. In step 1031, the system will generate a first interval count signal representing the interval from the M cycle count value to the N cycle count value of the first clock signal Clock1 according to the N cycle count signal and the M cycle count signal of the first clock signal Clock1. In step 1032, the system will generate a second interval count signal representing the interval from the M cycle count value to the N cycle count value of the second clock signal Clock2 according to the N cycle count signal and the M cycle count signal of the second clock signal Clock2. Step 1033, determine whether the N cycle count value of the second clock signal Clock2 is located in the interval from the M cycle count value to the N cycle count value of the first clock signal Clock1. In one embodiment, when the first interval count signal is logically valid (e.g., logical high), determine whether the N cycle count signal of the second clock signal Clock2 is logically valid (e.g., logical high). For example, when the first interval count signal is logically high, the N cycle count signal of the second clock signal Clock2 is also logically high, indicating that the second clock signal Clock2 is normal. Step 1034, determine whether the N-cycle count value of the first clock signal Clock1 is within the interval between the M-cycle count value and the N-cycle count value of the second clock signal Clock2. In one embodiment, when the second interval count signal is logically valid (e.g., logically high), determine whether the N-cycle count signal of the first clock signal Clock1 is logically valid (e.g., logically high). For example, when the second interval count signal is logically high, the N-cycle count signal of the first clock signal Clock1 is also logically high, indicating that the first clock signal Clock1 is normal. It should be noted that although step 1032 is indicated to be after step 1031 and step 1034 is indicated to be after step 1033, in fact, step 1032 and step 1031 can be performed simultaneously, and step 1033 and step 1034 can also be performed simultaneously.

[0023] In another embodiment, step 103 may include steps 1035 to 1038. It should be noted that steps 1035 to 1038 are another implementation of step 103, and are independent of steps 1031 to 1034. In step 1035, when the N-cycle count signal of the first clock signal Clock1 is valid (e.g., logic high), it is determined whether the M-cycle count signal of the second clock signal Clock2 is valid (e.g., logic high). In step 1036, when the M-cycle count signal of the first clock signal Clock1 is valid (e.g., logic high), it is determined whether the N-cycle count signal of the second clock signal Clock2 is invalid (e.g., logic low). In step 1037, when the N-cycle count signal of the second clock signal Clock2 is valid (e.g., logic high), it is determined whether the M-cycle count signal of the first clock signal Clock1 is valid (e.g., logic high). In step 1038, when the M-cycle count signal of the second clock signal Clock2 is valid (e.g., logic high), it is determined whether the N-cycle count signal of the first clock signal Clock1 is invalid (e.g., logic low). For example, when the N-cycle count signal of the first clock signal Clock1 is valid, the M-cycle count signal of the second clock signal Clock2 is valid, and when the M-cycle count signal of the first clock signal Clock1 is valid, the N-cycle count signal of the second clock signal Clock2 is invalid, which indicates that the first clock signal Clock1 and the second clock signal Clock2 are normal and the test is passed. Similarly, if when the N-cycle count signal of the second clock signal Clock2 is valid, the M-cycle count signal of the first clock signal Clock1 is valid, and when the M-cycle count signal of the second clock signal Clock2 is valid, the N-cycle count signal of the first clock signal Clock1 is invalid, which indicates that the first clock signal Clock1 and the second clock signal Clock2 are normal and the test is passed. It should be noted that although steps 1037-1038 are illustrated as being performed after steps 1035-1036, in fact, step 1035 and step 1037 can be performed simultaneously.

[0024] Step 104, count and reset the first clock signal Clock1 and the second clock signal Clock2, and start the next counting cycle. In one embodiment, the count and reset of the first clock signal Clock1 and the second clock signal Clock2 are achieved by resetting the counter. It should be noted that the counter for counting the first clock signal Clock1 and the second clock signal Clock2 will overflow and reset after reaching their respective maximum overflow count values, and restart a new cycle count. In one embodiment, the maximum overflow count value of the counter is greater than the preset maximum count value N. In another embodiment, the maximum overflow count value of the counter is greater than the preset maximum count value N, and the maximum overflow count value may be a multiple of the preset maximum count value N. In yet another embodiment, the maximum overflow count value of the counter may be equal to the preset maximum count value N.

[0025] Step 105: Send an error report.

[0026] Figure 2 The clock signal self-checking method 100 shown can realize the mutual check of the reference clock signal and the detected clock signal. That is, once any one of the reference clock signal and the detected clock signal has an error, it can be discovered. It avoids that in some application scenarios, only the correctness of the detected clock signal is confirmed, but the correctness of the reference clock signal cannot be verified. In this case, if the reference clock signal itself has an error, it is impossible to correctly verify whether the detected clock signal is wrong. For example, in some application scenarios, the frequency of the detected clock signal decreases, while the frequency of the reference clock signal increases. When the frequency of the erroneous reference clock signal becomes twice the frequency of the erroneous detected clock signal, the cycle count value of the erroneous reference clock signal reaches the maximum preset value and then a new round of counting is performed again. At this time, the cycle count value of the erroneous detected clock signal is still equal to the cycle count value of the erroneous reference clock signal. Therefore, at this time, only by comparing the cycle count value of the detected clock signal with the cycle count value of the erroneous reference clock signal, it cannot be determined that the frequency of the detected clock signal is reduced.

[0027] Figure 3 FIG. 2 is a schematic block diagram of a clock signal self-checking circuit 200 according to an embodiment of the present invention. Figure 3 As shown, the clock signal self-check circuit 200 includes a first counter 21 , a second counter 22 and a digital comparison circuit 23 .

[0028] The first counter 21 receives the first clock signal Clock1, and counts the cycles of the first clock signal Clock1 to generate a first counting signal C1M and a second counting signal C1N. The first counting signal C1M represents the count value of M cycles of the first clock signal Clock1; the second counting signal C1N represents the count value of N cycles of the first clock signal Clock1. In one embodiment, the first counting signal C1M and the second counting signal C1N are logic high and low level signals. In one embodiment, when the cycles of the first clock signal Clock1 are counted M times, the first counting signal C1M changes from invalid (e.g., logic low) to valid (e.g., logic high); when the cycles of the first clock signal Clock1 are counted N times, the second counting signal C1N changes from invalid (e.g., logic low) to valid (e.g., logic high).

[0029] The second counter 22 receives the second clock signal Clock2, and counts the cycles of the second clock signal Clock2 to generate a third counting signal C2M and a fourth counting signal C2N. The third counting signal C2M represents the count value of M cycles of the second clock signal Clock2; the fourth counting signal C2N represents the count value of N cycles of the second clock signal Clock2. In one embodiment, the third counting signal C2M and the fourth counting signal C2N are logic high and low level signals. In one embodiment, when the cycles of the second clock signal Clock2 are counted M times, the third counting signal C2M changes from invalid (e.g., logic low) to valid (e.g., logic high); when the cycles of the second clock signal Clock2 are counted N times, the fourth counting signal C2N changes from invalid (e.g., logic low) to valid (e.g., logic high).

[0030] The digital comparison circuit 23 receives the first counting signal C1M, the second counting signal C1N, the third counting signal C2M and the fourth counting signal C2N, and compares the logic states of the first counting signal C1M, the second counting signal C1N, the third counting signal C2M and the fourth counting signal C2N to generate a self-test signal D BIST . Self-test signal D BIST is a digital high-low level signal. In one embodiment, when the self-test signal D BIST When the self-test signal D is logic high, the logic high state indicates that the first clock signal Clock1 and the second clock signal Clock2 have passed the mutual test. BIST It is valid when it is logic low. At this time, the logic low state represents that the first clock signal Clock1 and the second clock signal Clock2 have passed the mutual detection. In one embodiment, the digital comparison circuit is a logic circuit, which is composed of a plurality of logic modules.

[0031] Figure 4FIG. 2 is a circuit diagram of a first counter 21 according to an embodiment of the present invention. Figure 4 In the illustrated embodiment, the first counter 21 includes K D flip-flops D1-DK, M count selection circuits 211 and N count selection circuits 212, wherein the relationship between K and N is: K Greater than or equal to N. For example, if the first clock signal Clock1 and the second clock signal Clock2 are counted with N equal to 64, K must be at least equal to 6. For another example, if the first clock signal Clock1 and the second clock signal Clock2 are counted with N equal to 100, K must be at least equal to 7.

[0032] Each D flip-flop has a data input terminal D, a trigger input terminal CP, a first input terminal Q, a second output terminal , a set terminal SD and a reset terminal RD. The data input terminal D of each D flip-flop is coupled to its second output terminal ; The set terminal SD of each D flip-flop receives a set signal for setting the initial value of the count; the reset terminal RD of each D flip-flop receives a reset signal for clearing the counter count; the output terminal Q of each D flip-flop outputs a count signal (Q1, Q2, ... or QK). Except for the input terminal CP of the first flip-flop receiving the first clock signal Clock1, the input terminals CP of the other D flip-flops are sequentially coupled to the second output terminal of the previous D flip-flop .

[0033] The M count selection circuit 211 receives the count signals (Q1, Q2, ... and QK) outputted from the output terminal Q of each D flip-flop, selects the corresponding count signal for logic operation according to the M value to be counted, and outputs the first count signal C1M.

[0034] The N count selection circuit 212 receives the count signals (Q1, Q2, ... and QK) outputted from the output terminal Q of each D flip-flop, selects the corresponding count signal for logic operation according to the N value to be counted, and outputs the second count signal C1N.

[0035] For example, when the system selects N as 60 and M as 56, the minimum value of the number K of D flip-flops can be selected as 6. Assuming that D flip-flops D1-D6 are selected, the first to sixth counting signals Q1-Q6 are output at their first output terminals respectively. When the fourth counting signal Q4, the fifth counting signal Q5 and the sixth counting signal Q6 become valid (for example, change from logic low to logic high), the first counting signal C1M of the M counting selection circuit 211 becomes valid (for example, change from logic low to logic high). At this time, the first counting signal C1M becomes valid, which means that the period count value of the first clock signal Clock1 of the counter 21 reaches the minimum value M. When the third counting signal Q3, the fourth counting signal Q4, the fifth counting signal Q5 and the sixth counting signal Q6 become valid (for example, change from logic low to logic high), the second counting signal C1N of the N counting selection circuit 212 becomes valid (for example, change from logic low to logic high). At this time, the second counting signal C1N becomes valid, which means that the period count value of the first clock signal Clock1 of the counter 21 reaches the maximum value N.

[0036] Those skilled in the art can understand that the circuit schematic diagram of the second counter 22 has the same structure as the circuit schematic diagram of the first counter 21. When the trigger counting terminal CP of the first D flip-flop in the second counter 22 receives the second clock signal Clock2, the second counter 22 will generate a third counting signal C2M and a fourth counting signal C2N. This will not be described again.

[0037] Figure 5 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 The circuit diagram of an embodiment 500 of the digital comparison circuit 23 in the embodiment shown in FIG. Figure 5 As shown, the digital comparison circuit 500 includes a first XOR gate 501 , a second XOR gate 502 , a first latch 503 , a second latch 504 and an OR gate 505 .

[0038] The first XOR gate 501 receives the first counting signal C1M and the second counting signal C1N, performs a logic operation on the first counting signal C1M and the second counting signal C1N, and outputs a first interval counting signal C1M-N. The first interval counting signal C1M-N is a logic high-low level signal. In one embodiment, when the logic states of the first counting signal C1M and the second counting signal C1N are different, the first interval counting signal C1M-N is logic high.

[0039] The second XOR gate 502 receives the third counting signal C2M and the fourth counting signal C2N, performs a logic operation on the third counting signal C2M and the fourth counting signal C2N, and outputs a second interval counting signal C2M-N. The second interval counting signal C2M-N is a logic high-low level signal. In one embodiment, when the logic states of the third counting signal C2M and the fourth counting signal C2N are different, the second interval counting signal C2M-N is logic high.

[0040] The first latch 503 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the first latch 503 receives the first interval counting signal C1M-N, the clock input terminal CP of the first latch 503 receives the fourth counting signal C2N, and outputs the first self-test signal D at the output terminal. BIST1 In one embodiment, the first latch 503 is a rising edge triggered D latch DFF. When the rising edge of the fourth counting signal C2N comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the fourth counting signal C2N comes, the first self-test signal D BIST1 The same logic state as the first interval counting signal C1M-N. In one embodiment, when the first self-test signal D BIST1 When it is logic high, it represents that the N-cycle count value of the second clock signal Clock2 is located between the cycle count interval MN of the first clock signal Clock1.

[0041] The second latch 504 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the second latch 504 receives the second interval counting signal C2M-N, the clock input terminal CP of the second latch 504 receives the second counting signal C1N, and outputs the second self-test signal D at the output terminal. BIST2 In one embodiment, the second latch 504 is a rising edge triggered D latch DFF. When the rising edge of the second counting signal C1N comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the second counting signal C1N comes, the second self-test signal D BIST2 The second interval counting signal C2M-N has the same logic state. BIST2 When it is logic high, it represents that the N-cycle count value of the first clock signal Clock1 is located between the cycle count interval MN of the second clock signal Clock2.

[0042] OR gate 505 receives the first self-test signal D BIST1 and the second self-test signal D BIST2 , and the first self-test signal D BIST1 and the second self-test signal D BIST2Perform logical operations and output self-test signal D BIST . Self-test signal D BIST is a logic high or low level signal. In one embodiment, when the first self-test signal D BIST1 and the second self-test signal D BIST2 When any one of them is logic high, the self-test signal D BIST It is logic high, indicating that the first clock signal Clock1 and the second clock signal Clock2 are accurate and the self-test is passed.

[0043] Figure 6 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 The circuit schematic diagram of an embodiment 600 of the digital comparison circuit 23 in the embodiment shown in FIG. Figure 6 As shown, the digital comparison circuit 600 includes a third latch 601 , a fourth latch 602 , an inverter 603 and an AND gate 604 .

[0044] The third latch 601 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the third latch 601 receives the third counting signal C2M, the clock input terminal CP of the third latch 601 receives the second counting signal C1N, and outputs the third self-test signal D at the output terminal. BIST3 In one embodiment, the third latch 601 is a rising edge triggered D latch DFF. When the rising edge of the second counting signal C1N comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the second counting signal C1N comes, the third self-test signal D BIST3 The same logic state as the third counting signal C2M.

[0045] The fourth latch 602 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the fourth latch 602 receives the fourth counting signal C2N, the clock input terminal CP of the fourth latch 602 receives the first counting signal C1M, and outputs the fourth self-test signal D at the output terminal. BIST4 In one embodiment, the fourth latch 602 is a rising edge triggered D latch DFF. When the rising edge of the first counting signal C1M comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the first counting signal C1M comes, the fourth self-test signal D BIST4 The same logic state as the fourth counting signal C2N.

[0046] The inverter 603 receives the fourth self-test signal D BIST4 , and the fourth self-test signal D BIST4 Perform inverting logic operation and output the fifth self-test signal D BIST5 .

[0047] AND gate 604 receives the third self-test signal D BIST3 and the fifth self-test signal D BIST5 , and the third self-test signal D BIST3 and the fifth self-test signal D BIST5 Perform logical operations and output self-test signal D BIST . Self-test signal D BIST is a logic high or low level signal. In one embodiment, when the third self-test signal D BIST3 and the fifth self-test signal D BIST5 When both are logic high, the self-test signal D BIST It is logic high, indicating that the first clock signal Clock1 and the second clock signal Clock2 are accurate and pass the self-test. That is to say, when the rising edge of the second counting signal C1N comes, the third counting signal C2M is logic high, and when the rising edge of the first counting signal C1M comes, the fourth counting signal C2N is logic low, which means that the first clock signal Clock1 and the second clock signal Clock2 pass the self-test.

[0048] Figure 7 FIG. 1 is a block diagram of an embodiment of the present invention. Figure 3 The circuit schematic diagram of an embodiment 700 of the digital comparison circuit 23 in the embodiment shown in FIG. Figure 7 As shown, the digital comparison circuit 700 includes a fifth latch 701 , a sixth latch 702 , an inverter 703 and an AND gate 704 .

[0049] The fifth latch 701 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the fifth latch 701 receives the first counting signal C1M, the clock input terminal CP of the fifth latch 701 receives the fourth counting signal C2N, and outputs the sixth self-test signal D at the output terminal. BIST6 In one embodiment, the fifth latch 701 is a rising edge triggered D latch DFF. When the rising edge of the fourth counting signal C2N comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the fourth counting signal C2N comes, the sixth self-test signal D BIST6 The same logic state as the first counting signal C1M.

[0050] The sixth latch 702 has a data input terminal D, a clock input terminal CP and an output terminal. The data input terminal D of the sixth latch 702 receives the second counting signal C1N, the clock input terminal CP of the sixth latch 702 receives the third counting signal C2M, and outputs the seventh self-test signal D at the output terminal. BIST7In one embodiment, the sixth latch 702 is a rising edge triggered D latch DFF. When the rising edge of the third counting signal C2M comes, the D latch DFF outputs the data received by the data input terminal D at the output terminal, that is, when the rising edge of the third counting signal C2M comes, the seventh self-test signal D BIST7 The logic state is the same as the second counting signal C1N.

[0051] The inverter 703 receives the seventh self-test signal D BIST7 , and the seventh self-test signal D BIST7 Perform inverting logic operation and output the eighth self-test signal D BIST8 .

[0052] AND gate 704 receives the seventh self-test signal D BIST7 and the eighth self-test signal D BIST8 , and the seventh self-test signal D BIST7 and the eighth self-test signal D BIST8 Perform logical operations and output self-test signal D BIST . Self-test signal D BIST is a logic high or low level signal. In one embodiment, when the seventh self-test signal D BIST7 and the eighth self-test signal D BIST8 When both are logic high, the self-test signal D BIST It is logic high, indicating that the first clock signal Clock1 and the second clock signal Clock2 are accurate and pass the self-test. That is to say, when the rising edge of the fourth counting signal C2N comes, the first counting signal C1M is logic high, and when the rising edge of the third counting signal C2M comes, the second counting signal C1N is logic low, which means that the first clock signal Clock1 and the second clock signal Clock2 pass the self-test.

[0053] Although the present invention has been described with reference to several typical embodiments, it should be understood that the terms used are illustrative and exemplary, rather than restrictive. Since the present invention can be embodied in a variety of forms without departing from the spirit or essence of the invention, it should be understood that the above embodiments are not limited to any of the foregoing details, but should be interpreted broadly within the spirit and scope defined by the appended claims, so all changes and modifications falling within the scope of the claims or their equivalents should be covered by the appended claims.

Claims

1. A detection method for determining whether a clock signal is accurate, wherein: The detection method comprises: Introducing a reference clock signal, the frequency of the reference clock signal being the same as the frequency of the detected clock signal; Simultaneously, the cycles of the detected clock signal and the reference clock signal are counted respectively; Determining whether the cycle count values ​​of the detected clock signal and the reference clock signal are equal to a preset maximum count value; and If the cycle count value of one of the detected clock signal and the reference clock signal is equal to the preset maximum count value, determine whether the cycle count value of the other clock signal is within the interval between the preset maximum count value and the preset minimum count value, wherein the preset minimum count value is greater than or equal to 1 and less than the preset maximum count value, and the detection method is used to realize mutual detection of the detected clock signal and the reference clock signal.

2. The detection method according to claim 1, wherein The steps of simultaneously counting the detected clock signal and the reference clock signal respectively include: Counting a preset minimum count value and a preset maximum count value respectively on the period of the detected clock signal to generate a first count signal and a second count signal; and The preset lowest count value and the preset highest count value are respectively counted for the period of the reference clock signal to generate a third count signal and a fourth count signal.

3. The detection method according to claim 2, wherein: The step of determining whether the cycle count value of another clock signal is within the interval between a preset maximum count value and a preset minimum count value comprises: Generate a first interval counting signal according to the first counting signal and the second counting signal, wherein the first interval counting signal represents an interval between a preset maximum counting value and a preset minimum counting value of the detected clock signal period; Generate a second interval counting signal according to the third counting signal and the fourth counting signal, wherein the second interval counting signal represents an interval between a preset maximum counting value and a preset minimum counting value of a reference clock signal period; When the fourth counting signal changes from invalid to valid, determining whether the first interval counting signal is valid; and When the second counting signal changes from invalid to valid, it is determined whether the second interval counting signal is valid.

4. The detection method according to claim 2, wherein: The step of determining whether the cycle count value of another clock signal is within the interval between a preset maximum count value and a preset minimum count value comprises: When the second counting signal changes from invalid to valid, determining whether the third counting signal is valid; and When the first counting signal changes from invalid to valid, it is determined whether the fourth counting signal is invalid.

5. The detection method according to claim 2, wherein: The step of determining whether the cycle count value of another clock signal is within an interval between a preset maximum count value and a preset minimum count value comprises: When the fourth counting signal is valid, determining whether the first counting signal is valid; and When the third counting signal is valid, it is determined whether the second counting signal is invalid.

6. The detection method according to claim 1, further comprising: When the cycle count value of another clock signal is within the interval between a preset maximum count value and a preset minimum count value, the counting of the detected clock signal and the reference clock signal is restarted.

7. A detection circuit for determining whether a clock signal is accurate, comprising: A detected clock signal; A reference clock signal, wherein the frequency of the reference clock signal is the same as the frequency of the detected clock signal; A first counter receives a detected clock signal, and counts a preset minimum count value and a preset maximum count value of a period of the detected clock signal to generate a first count signal and a second count signal; a second counter receiving a reference clock signal, and counting a preset minimum count value and a preset maximum count value for a period of the reference clock signal, respectively, to generate a third count signal and a fourth count signal, wherein the first counter and the second counter start counting at the same time; and The digital comparison circuit receives a first counting signal, a second counting signal, a third counting signal and a fourth counting signal, compares the logic states of the first counting signal, the second counting signal, the third counting signal and the fourth counting signal, and generates a self-checking signal.

8. The detection circuit according to claim 7, wherein: The digital comparison circuit comprises: A first XOR gate receives the first counting signal and the second counting signal, performs a logic XOR operation on the first counting signal and the second counting signal, and outputs a first interval counting signal; a second XOR gate, receiving the third counting signal and the fourth counting signal, performing a logic XOR operation on the third counting signal and the fourth counting signal, and outputting a second interval counting signal; A first latch having a data input terminal, a clock input terminal and an output terminal, wherein the data input terminal of the first latch receives the first interval counting signal, the clock input terminal of the first latch receives the fourth counting signal, and the first latch outputs a first self-test signal at the output terminal; a second latch having a data input terminal, a clock input terminal and an output terminal, the data input terminal of the second latch receiving the second interval counting signal, the clock input terminal of the second latch receiving the second counting signal, and the second latch outputting a second self-test signal at the output terminal; and The OR gate receives the first self-test signal and the second self-test signal, performs a logic OR operation on the first self-test signal and the second self-test signal, and outputs a self-test signal.

9. The detection circuit according to claim 7, wherein: The digital comparison circuit comprises: A third latch having a data input terminal, a clock input terminal and an output terminal, wherein the data input terminal of the third latch receives a third counting signal, the clock input terminal of the third latch receives a second counting signal, and the third latch outputs a third self-test signal at the output terminal; a fourth latch having a data input terminal, a clock input terminal and an output terminal, wherein the data input terminal of the fourth latch receives a fourth counting signal, the clock input terminal of the fourth latch receives the first counting signal, and the fourth latch outputs a fourth self-test signal at the output terminal; a first inverter, receiving a fourth self-test signal, performing an inverting logic operation on the fourth self-test signal, and outputting a fifth self-test signal; and The AND gate receives the third self-test signal and the fifth self-test signal, performs a logic AND operation on the third self-test signal and the fifth self-test signal, and outputs a self-test signal.

10. The detection circuit according to claim 7, wherein: The digital comparison circuit comprises: a fifth latch having a data input terminal, a clock input terminal and an output terminal, wherein the data input terminal of the fifth latch receives the first counting signal, the clock input terminal of the fifth latch receives the fourth counting signal, and the fifth latch outputs a sixth self-test signal at the output terminal; a sixth latch having a data input terminal, a clock input terminal and an output terminal, wherein the data input terminal of the sixth latch receives the second counting signal, the clock input terminal of the sixth latch receives the third counting signal, and the sixth latch outputs a seventh self-test signal at the output terminal; an inverter, receiving the seventh self-test signal, performing an inverting logic operation on the seventh self-test signal, and outputting an eighth self-test signal; and The AND gate receives the seventh self-test signal and the eighth self-test signal, performs a logic operation on the seventh self-test signal and the eighth self-test signal, and outputs a self-test signal.