Clock frequency measuring circuit and measuring method

By introducing a multi-channel clock counter and frequency discrimination calculation circuit into the clock frequency measurement circuit, the problem of insufficient detection accuracy is solved, high-precision measurement of clock frequency and timely abnormal triggering are achieved, ensuring the normal operation of the chip and having high portability. and low cost.

CN118837619AInactive Publication Date: 2024-10-25SHANGHAI WEIJING SEMICONDUCTOR CO LTD

Patent Information

Application Number
CN202410879398.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The detection accuracy of the existing clock frequency measurement circuit is insufficient, resulting in failure to trigger an exception in time when the clock frequency deviates from the normal range, which may cause the abnormal working state of the chip to spread and cause system-level damage.

Method used

Design a clock frequency measurement circuit, add a multi-channel clock counter and a frequency identification calculation circuit, compare the count values ​​to determine whether the clock frequency to be measured is within the preset range, output an indication signal to trigger anomalies in a timely manner, and improve detection accuracy and efficiency.

Benefits of technology

Through the design of multi-channel clock counters and frequency discrimination calculation circuits, the accuracy and detection efficiency of clock frequency measurement are improved, ensuring that the clock frequency is within the normal range, preventing system-level damage, and having high portability and low cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118837619A_ABST
    Figure CN118837619A_ABST
Patent Text Reader

Abstract

The invention discloses a clock frequency measuring circuit and method, and the circuit comprises a plurality of to-be-measured clock circuits and frequency discrimination calculation circuits corresponding to the to-be-measured clock circuits. The input end of the to-be-tested clock signal is connected with the to-be-tested clock signal, and the output end is connected with the frequency discrimination calculation circuit; the storage module is used for measuring and storing the pulse number of the to-be-measured clock signal in a preset sampling period; the frequency discrimination calculation circuit is used for judging whether the count value of the to-be-tested clock circuit is within a preset value range or not and outputting an indication signal. According to the digital clock frequency measurement circuit provided by the invention, the multi-channel clock counter and the frequency discrimination calculation circuit are added, so that the precision of the to-be-measured clock frequency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of clock signals, and in particular, to a clock frequency measurement circuit and a measurement method. Background Art

[0002] The clock frequency measurement circuit is a key circuit module widely used in high-security ASIC designs. Its main function is to monitor the clock signal frequency on the SOC chip in real time to ensure that it is within the normal range of chip operation and to support frequency anomaly alarms. Once the clock frequency measurement circuit detects inaccurate results, causing the clock frequency to deviate from the preset normal operating frequency range and not trigger an anomaly in time, the chip may be damaged at the system level due to the spread of abnormal working conditions. Therefore, how to improve the detection accuracy of the clock frequency measurement circuit is a difficult problem that needs to be solved. Summary of the invention

[0003] In order to solve the above technical problems, the present application provides a clock frequency measurement circuit and a measurement method. By adding a multi-channel clock counter and a frequency discrimination calculation circuit to the digital clock frequency measurement circuit provided in the present application, the accuracy and detection efficiency of the clock frequency to be measured can be improved.

[0004] Specifically, the technical solution of this application is as follows:

[0005] In a first aspect, the present application discloses a clock frequency measurement circuit, comprising:

[0006] A plurality of clock circuits to be tested and frequency discrimination calculation circuits corresponding to the clock circuits to be tested;

[0007] The input end of the clock signal to be measured is connected to the clock signal to be measured, and the output end is connected to the frequency discrimination calculation circuit; it is used to measure and store the number of pulses of the clock signal to be measured within a preset sampling period;

[0008] The frequency discrimination calculation circuit is used to determine whether the count value of the clock circuit to be tested is within a preset value range, and output an indication signal.

[0009] In some implementations, the frequency discrimination calculation circuit includes:

[0010] A plurality of comparators, respectively connected to the plurality of clock circuits to be tested, for determining whether the count values ​​measured on the corresponding clock circuits are within the respective preset value ranges; if so, outputting a low level signal; if not, outputting a high level signal;

[0011] A judgment circuit is connected to each of the comparators; when any of the comparators outputs a high level signal, the judgment circuit outputs an abnormal indication signal.

[0012] In some embodiments, the clock frequency measurement circuit further includes a reference clock circuit, wherein the input end of the reference clock circuit is connected to the reference clock signal, and the output end is connected to the frequency discrimination calculation circuit; and is used to measure and store the number of pulses of the reference clock signal within a preset sampling period.

[0013] In some implementations, the frequency discrimination calculation circuit is further used to connect to the reference clock circuit to determine whether the count value of the reference clock circuit is within a second preset value range; if not, output an abnormal indication signal.

[0014] In some implementations, the clock circuit to be tested includes a first counter and a first register;

[0015] The reference clock circuit includes a second counter and a second register.

[0016] In some implementations, the reference clock circuit and the clock circuit to be tested further include a sampling signal access terminal for accessing a sampling signal so as to control the first / second counter to start counting;

[0017] When the sampling signal is input, the first register latches the first count value of the first counter, the first count value is cleared and starts to count again;

[0018] The second register latches a second count value of the second counter; the second count value is cleared and starts to count again.

[0019] In a second aspect, the present application further discloses a clock frequency measurement method, which is applied to a clock frequency measurement circuit described in any one of the above embodiments, comprising:

[0020] Measuring and storing the number of pulses of the clock signal to be tested within the preset sampling period by using a plurality of the clock circuits to be tested;

[0021] It is determined whether the count value of the clock circuit to be tested is within the preset value range, and the indication signal is output.

[0022] In some implementations, the clock frequency measurement method further includes:

[0023] Modifying the preset sampling period;

[0024] Measuring and storing the number of pulses of the clock signal to be measured at different preset sampling periods;

[0025] A comparator is used to determine whether the count value measured on the clock circuit to be tested is within the preset value range; if not, an abnormal indication signal is output.

[0026] In some implementations, the clock frequency measurement method further includes:

[0027] Connecting the first clock signal to the plurality of clock circuits to be tested;

[0028] Determine whether the count value measured on the corresponding clock circuit is within the respective preset value range through multiple comparators; if so, output a low level signal; if not, output a high level signal;

[0029] When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

[0030] In some implementations, the clock frequency measurement method further includes:

[0031] Connecting the first clock signal to the Nth clock signal to the plurality of clock circuits to be tested respectively;

[0032] Determine whether the count value measured on the corresponding clock circuit is within the respective preset value range through multiple comparators; if so, output a low level signal; if not, output a high level signal;

[0033] When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

[0034] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0035] 1. By adding a multi-channel clock counter and a frequency discrimination calculation circuit to the digital clock frequency measurement circuit provided in this application, the accuracy and detection efficiency of the clock frequency to be measured can be improved. Once the clock frequency is detected to deviate from the preset normal working frequency range, the module will immediately trigger an abnormality to protect the chip from system-level damage caused by the spread of abnormal working conditions in a timely manner.

[0036] 2. The frequency range of the clock to be measured is determined by comparing the count values ​​of the multi-channel clock counters through the frequency discrimination calculation circuit in this application. Not only can the multi-channel clock counters be used to measure the same clock to effectively improve the frequency measurement accuracy, but it also has the ability to support the simultaneous measurement of multiple clock frequencies to improve the efficiency of the clock frequency to be measured.

[0037] 3. The improvement in this application lies in the design of the circuit. Frequency measurement is achieved through a pure digital circuit. The method is simple, has nothing to do with the chip manufacturing process, has low cost, and is therefore highly portable. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present application.

[0039] Figure 1 A structural block diagram of an embodiment of a clock frequency measurement circuit of the present application;

[0040] Figure 2 This is a structural block diagram of another embodiment of a clock frequency measurement circuit of the present application. DETAILED DESCRIPTION

[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0042] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections.

[0043] In order to simplify the drawings, only the parts related to the invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0044] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0045] In this document, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0046] In a specific implementation, the terminal device described in the embodiments of the present application includes, but is not limited to, other portable devices such as mobile phones, laptop computers, tutoring machines, or tablet computers with touch-sensitive surfaces (e.g., touch screen displays and / or touch pads). It should also be understood that in some embodiments, the terminal device is not a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., touch screen displays and / or touch pads).

[0047] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0049] The clock frequency measurement circuit is a key circuit module widely used in the design of high-security ASIC (Application-Specific Integrated Circuit). Its main function is to monitor the on-chip clock signal frequency of the SOC (System on Chip) in real time to ensure that it is within the normal range of chip operation and support frequency anomaly alarms. Once the clock frequency measurement circuit detects inaccurate results, causing the clock frequency to deviate from the preset normal operating frequency range and not trigger an anomaly in time, the chip may be damaged at the system level due to the spread of abnormal working conditions. Therefore, how to improve the detection accuracy of the clock frequency measurement circuit is a difficult problem that needs to be solved.

[0050] Currently, most clock frequency detector implementations use two main design schemes:

[0051] 1. The core circuit is designed as an analog circuit. Although this traditional analog circuit design method has high accuracy, it also has some inherent defects and limitations, such as poor flexibility, weak programmability, and relatively high power consumption.

[0052] 2. Digital circuit design: Simply use the reference clock and the clock to be measured to input the frequency division counter, and then compare the counter results to estimate the frequency of the clock to be measured. This method has the advantages of good flexibility and easy transplantation, but has the disadvantages of low accuracy and can only measure one clock frequency to be measured at a time.

[0053] An embodiment of a clock frequency measurement circuit provided by the present application is shown in the attached specification. Figure 1 , which includes: a plurality of clock circuits to be tested and a frequency discrimination calculation circuit corresponding to the clock circuits to be tested.

[0054] The input end of the clock signal to be measured is connected to the clock signal to be measured, and the output end is connected to the frequency discrimination calculation circuit, which is used to measure and store the number of pulses of the clock signal to be measured within a preset sampling period.

[0055] Specifically, each clock circuit to be tested includes a counter and a register. The counter is used to record the number of clock pulses. Specifically, the counter records the number of pulses of the clock signal within a specific time interval (such as one cycle or multiple cycles). In this way, the counter can provide the value of the frequency of the clock signal. The clock frequency can be calculated by dividing the count result by the time interval.

[0056] The frequency discrimination calculation circuit is used to determine whether the count value of the clock circuit to be tested is within a preset value range, and output an indication signal.

[0057] Specifically, the frequency discrimination calculation circuit includes: a plurality of comparators and a judgment circuit.

[0058] A plurality of comparators are respectively connected to a plurality of the clock circuits to be tested, and are used to determine whether the count values ​​measured on the corresponding clock circuits are within the respective preset value ranges. If so, a low level signal is output. If not, a high level signal is output.

[0059] The judgment circuit is connected to each of the comparators. When any of the comparators outputs a high level signal, the judgment circuit outputs an abnormal indication signal. When multiple comparators output low level signals, the judgment circuit does not generate an abnormal indication signal.

[0060] Preferably, the indication signal includes an abnormal indication signal and a normal indication signal. When it is determined that the count values ​​of the clock circuit to be tested are all within a preset value range, that is, when multiple comparators output low-level signals, the frequency discrimination calculation circuit is used to output a normal indication signal.

[0061] Another embodiment of a clock frequency measurement circuit of the present application, based on an embodiment of the above method, further includes a reference clock circuit, the input end of the reference clock circuit is connected to the reference clock signal, and the output end is connected to the discrimination calculation circuit, for measuring and storing the number of pulses of the reference clock signal within a preset sampling period.

[0062] For details, please refer to the attached manual. Figure 2 As shown: In this embodiment, a clock frequency measurement circuit includes: a reference clock circuit and n clock circuits to be measured.

[0063] Specifically, it includes: 1 reference clock counter "Counter_0" and n clock counters to be tested: "Counter_1", "Counter_2" to "Counter_n". The number n of clock counters to be tested is determined by actual application requirements, that is, the number of concurrent measurements actually required.

[0064] It also includes: 1 register_0 of a reference clock counter and n count value sampling registers of the clock counters to be tested: "register_1", "register_2" to "register_n". The number n of the clock counters to be tested is determined by the actual application requirements, that is, the actual number of concurrent measurements required.

[0065] More preferably, in this embodiment, the frequency discrimination calculation circuit specifically includes: 1 comparator "Comparator_0" for the reference clock and n comparators "Comparator_1", "Comparator_2" to "Comparator_n" for the clocks to be measured.

[0066] In some implementations of this embodiment, the "comparator_0" in the frequency discrimination calculation circuit is used to connect to the reference clock circuit. It is also used to determine whether the count value of the reference clock circuit is within the second preset value range. If not, an abnormal indication signal is output.

[0067] In some other implementations of this embodiment, when the count value of the reference clock circuit is within the second preset value range, the corresponding comparator in the discrimination calculation circuit outputs a low level signal. The judgment circuit does not output the abnormal indication signal, or outputs a normal indication signal. When the count value of the reference clock circuit is not within the second preset value range, the corresponding comparator in the discrimination calculation circuit outputs a high level signal, and the judgment circuit outputs the abnormal indication signal.

[0068] Specifically, the frequency of the clock to be measured is not related to the frequency of the reference clock. In this case, if the frequency of either the clock to be measured or the reference clock is abnormal, it can be detected. Such a design increases the robustness of the solution.

[0069] Preferably, the frequency of the reference clock is known, and under normal circumstances, the count value of the reference clock circuit must be within the second preset value range. If the count value of the reference clock circuit is not within the second preset value range, it can be considered that the counter circuit has failed. Then the measurement result of the clock circuit to be measured is unreliable. It is necessary to re-measure after checking the fault. The possibility of measurement errors caused by other reasons is reduced.

[0070] Another embodiment of a clock frequency measurement circuit of the present application is based on an embodiment of the above method, wherein the clock circuit to be measured includes a first counter and a first register, and the reference clock circuit includes a second counter and a second register.

[0071] The reference clock circuit and the clock circuit to be measured also include a sampling signal access terminal for accessing a sampling signal so as to control the first / second counter to start counting.

[0072] When the sampling signal is input, the first register latches the first count value of the first counter, and the first count value is cleared and starts to count again.

[0073] The second register latches a second count value of the second counter, and the second count value is cleared and starts to count again.

[0074] Specifically, the sampling signal is a periodic pulse signal, which is used to input into the digital clock frequency measurement circuit to trigger the counter to start counting. The period of the signal is determined by the user. When each pulse is input, Figure 2 The register shown in will latch the value of the corresponding counter once, and all counters in the block diagram will be reset to zero and start counting again from 0.

[0075] The so-called latch means that when a pulse signal arrives, its own value is refreshed to the value of the current input signal, and then remains unchanged until the next pulse signal arrives, and its own value is refreshed to the value of its own input signal at that time.

[0076] In this embodiment, all counters have the same structure, and the only difference is the counting clocks used. For example, the counting clock of "Counter_0" is the "reference clock", the counting clock of "Counter_1" is the "clock to be measured 1", and the counting clock of "Counter_n" is the "clock to be measured n". When the pulse of "sampling signal" is input, "Counter_" is reset to zero, and then starts counting again from 0 under the action of the corresponding clock.

[0077] All registers have the same structure, the only difference is the counter object they latch. For example, "Register_0" latches "Counter_0", "Register_1" latches "Counter_1", and "Register_n" latches "Counter_n". When the pulse of "Sampling Signal" is input, "Register_" latches the value of "Counter_" once, and it will latch the value of "Counter_" again when the pulse of "Sampling Signal" is input next time.

[0078] All comparators have similar structures. Each comparator contains two water limit registers (upper water limit and lower water limit). When the value of "Counter Value Register_" is between the upper water limit and the lower water limit, the output signal of "Comparator_" is low. When the value of "Counter Value Register_" is not between the upper water limit and the lower water limit, the output signal of "Comparator_" is high, indicating that the corresponding clock frequency does not meet expectations. There is nothing special about the structure of the comparator. It can be implemented using Verilog logic similar to the following.

[0079] always@(*)begin

[0080] if(register>=lower water limit&&value<=upper water limit)

[0081] Comparator output = 1'b0;

[0082] else

[0083] Comparator output = 1'b1;

[0084] End

[0085] Based on the same technical concept, the present application also discloses a clock frequency measurement method, which is applied to a clock frequency measurement circuit described in any one of the above embodiments. Specifically, an embodiment of a clock frequency measurement method of the present application includes:

[0086] S1. Measure and store the number of pulses of the clock signal to be measured within the preset sampling period by using a plurality of the clock circuits to be measured.

[0087] S2. Determine whether the count value of the clock circuit to be tested is within the preset value range, and output the indication signal.

[0088] More preferably, implementation mode 1 of this embodiment:

[0089] S11. Accuracy analysis of single measurement frequency:

[0090] If the reference clock frequency is f0.

[0091] Assume that the frequency of measurement clock 2 is f2.

[0092] The count value register_0 obtained in a certain measurement is n0, and the count value register_2 is n2.

[0093] Then, the measured estimated frequency of the measurement clock 2 is f2'=f0*n2 / n0. The measurement error is about f0*1 / n0.

[0094] Implementation method 2 of this embodiment includes:

[0095] S21, connecting a first clock signal to the plurality of clock circuits to be tested.

[0096] S12, using a plurality of comparators to determine whether the count values ​​measured on the corresponding clock circuits are within respective preset value ranges, if yes, outputting a low level signal, if no, outputting a high level signal.

[0097] S13. When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

[0098] Specifically, when multiple branches are measured simultaneously, the test results are unified and the output is a low level, then it is considered that the test results are highly reliable.

[0099] Implementation method 3 of this embodiment includes:

[0100] S31, respectively connect the first clock signal to the Nth clock signal to the plurality of clock circuits to be tested.

[0101] S32, using a plurality of comparators to determine whether the count value measured on the corresponding clock circuit is within the respective preset value range, if yes, output a low level signal, if no, output a high level signal.

[0102] S33. When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

[0103] Specifically, there is no relationship between the first clock signal to the Nth clock signal. Based on this, multiple clock signals can be measured simultaneously, thereby improving measurement efficiency.

[0104] Implementation method 4 of this embodiment includes:

[0105] S41, respectively connect the first clock signal to the Nth clock signal to the plurality of clock circuits to be tested.

[0106] S42, using a plurality of comparators to determine whether the count value measured on the corresponding clock circuit is within the respective preset value range, if yes, output a low level signal, if no, output a high level signal.

[0107] S43. When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

[0108] Specifically, there is a certain relationship between the first clock signal to the Nth clock signal, assuming that the reference clock frequency is f0.

[0109] Assume that the frequency of measurement clock 2 is f2.

[0110] It is known that the frequency of measurement clock 6 is 1 / 2 of the frequency of measurement clock 2, that is, f6=f2 / 2.

[0111] The count value register_0 obtained in a certain measurement is n0, the count value register_2 is n2, and the count value register_6 is n6.

[0112] The measured estimated frequency of the measurement clock 6 is f6'=f0*n6 / n0. The measurement error is approximately f0*1 / n0.

[0113] Considering that the actual frequency ratio of measurement clock 2 to measurement clock 6 is f2:f6=2:1, the measurement accuracy of f2 is improved to f0*1 / (n0*2), that is, the measurement error of f2 is reduced to 1 / 2 of the original single measurement.

[0114] Implementation method 5 of this embodiment includes:

[0115] S51: Modify the preset sampling period.

[0116] S52: Measure and store the number of pulses of the clock signal to be measured under different preset sampling periods.

[0117] S53, judging by a comparator whether the count value measured on the clock circuit to be tested is within the preset value range, and if not, outputting an abnormality indication signal.

[0118] Specifically, in this implementation, multiple counting methods are used to measure a clock simultaneously.

[0119] Assume that the reference clock frequency is f0.

[0120] Assume that the frequency of measurement clock 2 is f2.

[0121] Assume that two frequency measurements are implemented by modifying the period of the sampling signal, and the values ​​of the count value register_0 obtained by the two measurements are n0' and n0", respectively, and the values ​​of the count value register_2 obtained by the two measurements are n2' and n2".

[0122] Then, the measured estimated frequency of the first measurement clock 2 is f2'=f0*n2' / n0'.

[0123] The measured and estimated frequency of clock 2 for the second measurement is f2"=f0*n2" / n0".

[0124] The combined error of the two measurements is reduced to |n2” / n0”-n2' / n0'|.

[0125] Compared with the prior art, the several implementation methods provided in this embodiment can improve the detection accuracy of the clock frequency. The improvement in this application lies in the design of the circuit, which realizes the frequency measurement through a pure digital circuit. The method is simple, has nothing to do with the chip manufacturing process, has a low cost, and is therefore highly portable.

[0126] The clock frequency measured by the clock frequency measurement circuit and measurement method of the present application can be applied to intelligent driving assistance chips to provide an effective clock failure diagnosis mechanism; it can also be applied to certain time precision sensitive applications, such as high-precision navigation, where accurate clock frequency can help users determine the frequency drift of the clock, thereby helping relevant technicians to calibrate the clock frequency themselves.

[0127] The clock frequency measurement circuit and the measurement method of the present application have the same technical concept, and the technical details of the embodiments of the two are applicable to each other. In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described or recorded in detail in a certain embodiment, refer to the relevant description of other embodiments. In order to reduce repetition, it will not be repeated this time.

[0128] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed with hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0129] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0130] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A clock frequency measurement circuit, characterized in that: include: A plurality of clock circuits to be tested and frequency discrimination calculation circuits corresponding to the clock circuits to be tested; The input end of the clock signal to be measured is connected to the clock signal to be measured, and the output end is connected to the frequency discrimination calculation circuit; Used to measure and store the number of pulses of the clock signal to be measured within a preset sampling period; The frequency discrimination calculation circuit is used to determine whether the count value of the clock circuit to be tested is within a preset value range, and output an indication signal.

2. A clock frequency measurement circuit as claimed in claim 1, characterized in that: The frequency discrimination calculation circuit comprises: A plurality of comparators, respectively connected to the plurality of clock circuits to be tested, for determining whether the count values ​​measured on the corresponding clock circuits are within the respective preset value ranges; if so, outputting a low level signal; if not, outputting a high level signal; A judgment circuit is connected to each of the comparators; when any of the comparators outputs a high level signal, the judgment circuit outputs an abnormal indication signal.

3. A clock frequency measurement circuit as claimed in claim 1, characterized in that: It also includes a reference clock circuit, wherein the input end of the reference clock circuit is connected to the reference clock signal, and the output end is connected to the frequency discrimination calculation circuit; Used to measure and store the number of pulses of the reference clock signal within a preset sampling period.

4. A clock frequency measurement circuit as claimed in claim 3, characterized in that: The frequency discrimination calculation circuit is also used to connect to the reference clock circuit to determine whether the count value of the reference clock circuit is within a second preset value range; if not, output an abnormal indication signal.

5. A clock frequency measurement circuit as claimed in claim 3, characterized in that: The clock circuit to be tested includes a first counter and a first register; The reference clock circuit includes a second counter and a second register.

6. A clock frequency measurement circuit as claimed in claim 5, characterized in that: The reference clock circuit and the clock circuit to be tested also include a sampling signal access terminal for accessing a sampling signal so as to control the first / second counter to start counting; When the sampling signal is input, the first register latches the first count value of the first counter, the first count value is cleared and starts to count again; The second register latches a second count value of the second counter; the second count value is cleared and starts to count again.

7. A clock frequency measurement method, applied to a clock frequency measurement circuit according to any one of claims 1 to 6, characterized in that: include: Measuring and storing the number of pulses of the clock signal to be tested within the preset sampling period by using a plurality of the clock circuits to be tested; It is determined whether the count value of the clock circuit to be tested is within the preset value range, and the indication signal is output.

8. A clock frequency measurement method as claimed in claim 7, characterized in that: include: Modifying the preset sampling period; Measuring and storing the number of pulses of the clock signal to be measured at different preset sampling periods; A comparator is used to determine whether the count value measured on the clock circuit to be tested is within the preset value range; if not, an abnormal indication signal is output.

9. A clock frequency measurement method as claimed in claim 7, characterized in that: include: Connecting the first clock signal to the plurality of clock circuits to be tested; Determine whether the count value measured on the corresponding clock circuit is within the respective preset value range through multiple comparators; if so, output a low level signal; if not, output a high level signal; When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

10. A clock frequency measurement method as claimed in claim 7, characterized in that: include: Connecting the first clock signal to the Nth clock signal to the plurality of clock circuits to be tested respectively; Determine whether the count value measured on the corresponding clock circuit is within the respective preset value range through multiple comparators; if so, output a low level signal; if not, output a high level signal; When any one of the comparators outputs a high level signal, an abnormality indication signal is output.

Citation Information

Patent Citations

  • Clock frequency detector

    CN102692563A

  • High-precision frequency measurement method, device and system based on beat sampling

    CN114878910A

  • SOC integrated chip, frequency measurement circuit and frequency measurement method

    CN117110707A

  • Decision circuit for clock frequency applicable to smart card

    CN1447205A

  • Clock-locked frequency deviation detecting device

    CN1642010A

Cited By

  • Clock signal frequency determination method and chip

    CN119556765A