Circuit and method for diagnosing clock glitches, clock circuit, chip and radar
By designing a circuit for diagnosing clock glitches in the radar system, detecting and eliminating glitches in the clock signal, the problem of unstable clock signal is solved and the reliability and safety of the radar system are improved.
Patent Information
- Application Number
- CN202210802642.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-09
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-07-09
AI Technical Summary
Clock signals may cause burrs in radar systems due to interference or device aging, affecting radar functions and failing to ensure the personal safety and property safety of users. The existing technology lacks effective monitoring and analysis solutions.
A circuit for diagnosing clock glitches is designed, including at least two detection units and an abnormal range diagnostic unit. By detecting the clock signal, the glitch location in a specific frequency range is determined, and the diagnostic signal is output to eliminate glitches and improve the reliability of the clock signal.
It realizes rapid detection and elimination of clock signals, improves the reliability of clock signals, and ensures user personal safety and property safety, especially in key application scenarios such as autonomous driving.
Smart Images

Figure CN115085701B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a circuit and method for diagnosing clock glitches, a clock circuit, a chip and a radar. Background Art
[0002] With the rapid development of computer technology and information technology, circuits play an increasingly important role in users' daily lives and work. Clock signals can play the role of timers in circuits, ensuring that related electronic components can operate synchronously, thereby realizing the preset functions of the circuits.
[0003] Taking autonomous driving technology as an example, radar can collect environmental information so that the autonomous driving decision-making system can adopt a driving strategy that is compatible with the environmental information, such as obstacle avoidance. The clock generation unit of the radar's main control chip is responsible for providing the main control chip and at least part of the functional circuit with the clock signal required for work. Therefore, the clock signal is an important signal that multiple digital circuit functions rely on. The applicant found that the clock generation unit may physically generate clock glitches due to interference or device aging factors, resulting in abnormal radar function and failure to ensure the personal safety and property safety of users. Summary of the invention
[0004] In order to solve or partially solve the problems existing in the related art, the present application provides a circuit and method for diagnosing clock glitches, a clock circuit, a chip and a radar, which can diagnose clock glitches, improve the reliability of clock signals, and thereby improve the personal safety and property safety of users.
[0005] In a first aspect, the present application provides a circuit for diagnosing clock glitches, comprising: at least two detection units, each of the at least two detection units being configured to detect a test signal having a specific delay duration based on a clock signal to be detected, and obtain a glitch detection result for a specific frequency range of the clock signal to be detected, wherein there is a corresponding relationship between the specific delay duration and the specific frequency range; an abnormal range diagnosis unit, respectively coupled to the at least two detection units, and configured to output a diagnosis signal for a specific frequency range, wherein the specific frequency range is a frequency range corresponding to the detection unit for which the glitch detection result is abnormal.
[0006] The second aspect of the present application provides a clock circuit, comprising a first clock generating unit and a circuit for diagnosing clock glitches as shown above. The first clock generating unit is configured to output a first clock signal. The circuit for diagnosing clock glitches is connected to the first clock generating unit and is configured to detect the clock signal.
[0007] The third aspect of the present application provides a chip, comprising a functional circuit and at least one of the following: a clock circuit or a circuit for diagnosing clock glitches as described above, wherein the functional circuit is configured to implement a specific function based on a clock signal or a backup clock signal.
[0008] A fourth aspect of the present application provides a board, comprising a circuit, a clock circuit or a chip for diagnosing clock glitches as described above.
[0009] A fifth aspect of the present application provides a radar, comprising at least one of the circuits, clock circuits, chips or boards for diagnosing clock glitches as described above.
[0010] In a sixth aspect, the present application provides a method for diagnosing clock glitches, comprising: detecting a test signal having a specific delay duration based on a clock signal to be detected, and obtaining a glitch detection result for a specific frequency range of the clock signal to be detected, wherein there is a corresponding relationship between the specific delay duration and the specific frequency range; determining a diagnostic signal for the specific frequency range based on the glitch detection result, wherein the specific frequency range is a frequency range corresponding to a detection unit for which the glitch detection result is abnormal.
[0011] A seventh aspect of the present application provides an electronic device, comprising: a processor; and a memory, on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method as described above.
[0012] An eighth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor executes the above method.
[0013] A ninth aspect of the present application provides a computer program product, comprising an executable code, which implements the above method when the executable code is executed.
[0014] The technical solution provided by this application may have the following beneficial effects:
[0015] In certain embodiments of the present application, multiple detection units each detect a test signal with a specific delay duration based on the same clock signal to be detected, and obtain a detection unit with an abnormal detection result. In this way, it can be determined that a sampling abnormality will occur when a test signal with a specific delay duration is sampled based on the clock signal to be detected. There is a corresponding relationship between the specific delay duration and the specific frequency range, based on which a burr detection result for a specific frequency range of the clock signal to be detected can be obtained. Based on this, the abnormal range diagnosis unit can output a specific frequency range corresponding to the burr. This makes it easy to directly and quickly determine: when the test signal has a certain delay duration, the burr in the clock can be detected, and then it is easy to determine the position of the burr in the clock. This embodiment can help to achieve burr detection and elimination, improve the reliability of the clock signal, and thus improve the personal safety and property safety of users.
[0016] In some embodiments of the present application, the first sampling unit and the second sampling unit respectively sample test signals with different delay durations based on the clock signal to be detected to obtain a first sampling result and a second sampling result. This may result in the test signal being unable to be correctly sampled during the burr period of the clock signal, causing the first sampling result and the second sampling result to be different. The clock signal is detected by comparing the first sampling result and the second sampling result. In these embodiments, it is possible to detect whether there are glitches in the clock signal, so as to perform abnormal detection on the clock circuit, improve the reliability of the clock signal, and help improve the personal safety and property safety of users.
[0017] In some embodiments of the present application, when a glitch is detected in a clock signal, a backup clock signal may be replaced to improve system reliability.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0020] Figure 1 It is a schematic diagram of an application scenario of a circuit and method for diagnosing clock glitches, a clock circuit, a chip, and a radar shown in an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of another application scenario of a circuit and method for diagnosing clock glitches, a clock circuit, a chip, and a radar shown in an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram showing that a clock glitch causes abnormal sampling results for test signals with different delays according to an embodiment of the present application;
[0023] Figure 4 is a block diagram of a circuit for diagnosing clock glitches according to an embodiment of the present application;
[0024] Figure 5 is a block diagram of a detection unit shown in an embodiment of the present application;
[0025] Figure 6 is a block diagram of a first sampling unit and a second sampling unit shown in an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of setup time and hold time shown in an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of line clock delay shown in an embodiment of the present application;
[0028] Fig. 9 is a block diagram of a first sampling unit and a second sampling unit shown in another embodiment of the present application;
[0029] Fig.10 is a schematic diagram of a first delay selection unit shown in an embodiment of the present application;
[0030] Fig.11 is a block diagram of a first sampling unit and a second sampling unit shown in another embodiment of the present application;
[0031] Fig.12 is a signal timing diagram shown in an embodiment of the present application;
[0032] Fig.13 is a circuit diagram of a test unit shown in an embodiment of the present application;
[0033] Fig.14 is a circuit diagram of a test unit shown in another embodiment of the present application;
[0034] Fig.15 is a block diagram of a circuit for diagnosing clock glitches according to an embodiment of the present application;
[0035] Fig.16 is a flow chart of a method for diagnosing clock glitches according to an embodiment of the present application;
[0036] Fig.17 is a schematic structural diagram of a device for diagnosing clock glitches according to an embodiment of the present application;
[0037] Fig.18is a schematic diagram of the structure of a radar shown in an embodiment of the present application;
[0038] Fig.19 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0040] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "an" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0041] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0042] In order to facilitate the understanding of the present application, some concepts involved in the present application are first explained.
[0043] Crystal oscillators are mechanical vibrations with the characteristics of mechanical vibrations, which are related to shape, geometric dimensions, mass, etc. These parameters determine the vibration frequency. Taking quartz crystal oscillators as an example, the vibration frequency of the crystal is related to the area, thickness, cutting orientation, etc. of the quartz crystal.
[0044] Vehicle-mounted laser radar: By emitting outgoing light (such as a laser beam) with a wavelength of about 900nm, the outgoing light will be reflected by the obstacle after encountering it. The processing unit calculates the distance between the obstacle and the vehicle-mounted laser radar based on the time difference between the reflected light and the outgoing light. In addition, the processing unit can also estimate the reflectivity of the target based on the cross-section of the reflected light signal obtained after receiving the reflected light. Vehicle-mounted laser radar has a small size and a high degree of integration.
[0045] In the autonomous driving scenario, the system architecture suitable for the autonomous driving scenario may include mobile devices, networks, and the cloud. The cloud may include a server cluster or a distributed system consisting of multiple physical servers. Electronic devices such as sensors may be provided on the mobile device to obtain information about obstacles in the surrounding environment of the mobile device. Electronic devices may include: radars (including lidars), image sensors, etc. A variety of electronic devices require clock signals during operation or communication.
[0046] The embodiments of the present application provide a circuit and method for diagnosing clock glitches, a clock circuit, a chip, and a radar, wherein at least two test paths use the same test pattern (test signal), and each test path has a different delay duration. When there are glitches in the clock, some test paths with specific delay durations may make mistakes when sampling the same test pattern, and some test paths with other specific delay durations may not make mistakes when sampling the test pattern. This embodiment can detect where the glitches exist in the clock, so as to eliminate the glitches in the clock and ensure the reliability of the clock signal. This can improve the reliability of the circuit, thereby ensuring the personal safety and property safety of users in scenarios such as using assisted / autonomous driving.
[0047] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0048] Figure 1 It is a schematic diagram of an application scenario of a circuit and method for diagnosing clock glitches, a clock circuit, a chip, and a radar shown in an embodiment of the present application.
[0049] Figure 1 The hardware structure of a vehicle 10 supporting assisted driving or automatic driving functions is shown. For example, at least one Light Detection and Ranging (LIDAR) 11 is mounted on the roof and / or the side of the vehicle body of the vehicle 10. The detection area of the LIDAR 11 can be fixed, such as a certain LIDAR 11 can be used only to detect a preset area. The detection area of the LIDAR 11 can be adjustable, such as the LIDAR on the vehicle body can scan multiple detection areas by adjusting the posture, etc., or by adjusting the field of view angle range of the LIDAR itself.
[0050] In addition, the vehicle 10 may be equipped with a plurality of millimeter wave radars in a manner surrounding the vehicle 10. For example, the vehicle 10 may be equipped with four millimeter wave radars to detect the left side in front of the vehicle, the right side in front of the vehicle, the left side behind the vehicle, and the right side behind the vehicle. The millimeter wave radars can detect the distance of an object in each detection area, and can detect the relative speed between the object and the vehicle 10.
[0051] Furthermore, the vehicle 10 may also be equipped with a positioning device 12 , such as a Beidou positioning device, a Global Positioning System (GPS), etc. The current position of the vehicle 10 can be determined by the positioning device 12 .
[0052] In addition, the vehicle 10 may also be equipped with an electronic control unit (ECU). The detection signal of at least one of the above-mentioned LIDAR 11, millimeter wave radar and positioning device 12 is sent to the ECU. The ECU can detect and identify obstacles (such as roadblocks, moving objects, trees, adjacent vehicles, etc. around the vehicle 10) based on these signals. In addition, the ECU can be physically divided into multiple units according to their functions, and this application will collectively refer to them as ECUs.
[0053] It should be noted that although the movable device is described as a car, such description is not restrictive and is applicable to a variety of movable devices, such as land robots, water robots, etc.
[0054] Figure 2 It is a schematic diagram of another application scenario of a circuit and method for diagnosing clock glitches, a clock circuit, a chip, and a radar shown in an embodiment of the present application.
[0055] Figure 2 The aircraft 20 shown may be an aircraft with an assisted driving function and an automatic driving function. The aircraft 20 may include a sensor system 21 and a power mechanism 22 .
[0056] The sensing system 21 may include one or more sensors to sense at least one of the surrounding obstacles, spatial orientation, speed or acceleration of the aircraft 20. The types of sensors include, but are not limited to, ranging sensors, position sensors, motion sensors, inertial sensors or image sensors. The sensing data provided by the sensing system 21 can be used to control the spatial orientation, speed and / or acceleration of the aircraft 20. The sensing system 21 is used to collect relevant information of the aircraft 20. Different types of sensors can sense different types of signals or sense signals from different sources. For example, the sensor includes a radar, an inertial sensor, a GPS sensor, or a visual / image sensor (such as a camera).
[0057] The circuit, method, and clock circuit for diagnosing clock glitches according to the embodiment of the present application can be applied to Figure 1 or Figure 2 Any one or more electronic devices such as the LIDAR 11, millimeter wave radar, positioning device 12, ECU, sensor system 21 or communication system shown need to use a clock.
[0058] In the above-mentioned application scenarios such as assisted driving, autonomous driving, and smart transportation, quickly and accurately sensing the surrounding environment of movable equipment is a key point. Here, the vehicle's autonomous driving scenario is used as an example for illustrative explanation. According to the vehicle position information, obstacle information, and road information perceived by the sensing system, road signal control is coordinated to improve the quality and efficiency of road management. Specifically, the corresponding autonomous driving vehicle decision can be determined based on the information perceived by the sensing system, and the safe distance between autonomous driving vehicles can be adjusted, so that the vehicle can be driven safely and reliably on the road.
[0059] As one of the most important sensors for autonomous driving, LiDAR can provide the decision-making system with important information such as the location, size, and movement of traffic participants in the fields of smart transportation, assisted driving, and autonomous driving. LiDAR is like a person's eyes to autonomous vehicles. How to protect the security of LiDAR data collection and transmission is particularly important, as it is directly related to the personal safety, property safety, and even life safety of the drivers and passengers of the vehicle.
[0060] The main control chip of the laser radar is the core component of the laser radar. The main control chip is responsible for collecting, processing and transmitting at least part of the laser radar information. The crystal oscillator device is responsible for providing the clock source for the main control chip. It is the source of all clocks and is very important for system stability. The clock of the main control chip is responsible for providing the clock source required for the relevant functional circuits to work. It is the basis for realizing the functions of the relevant digital circuits. The stability of the clock signal is very important for laser radars and devices that need to use laser radar data.
[0061] However, the applicant found that the crystal oscillator device may fail physically due to interference or device aging, generating unqualified clocks, such as clock glitch signals. In addition, the crystal oscillator is a device located outside the chip. Hackers can control the crystal oscillator outside the chip or replace the crystal oscillator with a signal generator to provide a clock signal to the lidar chip, causing glitches on the clock. If the glitches occur when the main control chip jumps or runs key commands, the chip security system will crash.
[0062] In the field of LiDAR technology, the related technologies lack hardware monitoring solutions or defense strategies for clock generation modules (such as crystal oscillator circuits), or can only rely on more complex analog circuits to implement them, but cannot analyze the location of glitches in the clock. The related technologies lack solutions for monitoring and analyzing the underlying hardware of the chip, resulting in the need to improve the monitoring and analysis strategies.
[0063] Based on the above reasons, the present application aims to provide a technical solution that can conveniently and at a relatively low cost realize functions such as monitoring, analyzing and exception handling of a clock generation unit.
[0064] Figure 3 It is a schematic diagram showing that a clock glitch causes abnormal sampling results for test signals with different delays according to an embodiment of the present application.
[0065] See also Figure 3 , using the clock signal output by the clock generating unit, the test signal d1 and the test signal d2 which have been processed with different delays are sampled respectively. Figure 3 There is a Figure 3 The delay shown. Glitches exist in both clock clk1 and clock clk2, but the positions of the two glitches are different. For example, in the same cycle, the position of the glitch in clock clk1 is later than the position of the glitch in clock clk2. If errors occur when sampling the test signal d1 and / or the test signal d2 due to the glitches in the clock, it can be determined that there are glitches in the clock based on the different sampling results.
[0066] In addition, reference Figure 3 , the same test signal with different delay durations (such as having the same period and the same pattern) can be sampled separately. According to the delay duration of the test signal in which the burr is detected, the position of the burr in the clock is judged. For example, it can be analyzed that the position of the burr in clk1 is later than the position of the burr in clk2. Alternatively, it can be analyzed that the burr in clk1 corresponds to a delay duration of 500MHz, while the burr in clk1 corresponds to a delay duration of 100MHz. This makes it easy to analyze the causes of the burrs, and then eliminate the abnormalities, improve the reliability of the clock signal output by the clock generation unit, so as to better realize the safe operation of the lidar, and then improve the personal safety and property safety of users.
[0067] In addition, in some embodiments, after a glitch is detected in the clock, an interrupt signal or a reset signal may be issued so that the system can protect and handle the clock generation unit.
[0068] Figure 4 It is a block diagram of a circuit for diagnosing clock glitches according to an embodiment of the present application.
[0069] See also Figure 4 The circuit 300 for diagnosing clock glitches may include at least two detection units 310a, 310b, ... 310x, and an abnormal range diagnosis unit 320. Wherein, x is a positive integer greater than or equal to 2.
[0070] Each detection unit 310 of at least two detection units 310a, 310b, ... 310x is configured to detect a test signal with a specific delay duration based on a clock signal to be detected, and obtain a burr detection result for a specific frequency range of the clock signal to be detected, and there is a corresponding relationship between the specific delay duration and the specific frequency range. The corresponding relationship can be obtained by calibration, calculation, etc. For example, for a high-frequency test signal, the delay duration can be characterized by frequency, such as KHz, MHz or GHz.
[0071] The abnormal range diagnosis unit 320 is coupled to at least two detection units respectively, and is configured to output a diagnosis signal for a specific frequency range, where the specific frequency range is a frequency range corresponding to the detection unit for which the glitch detection result is abnormal. Specifically, the abnormal range diagnosis unit can determine the position information of the glitch in the clock according to the specific frequency range corresponding to the detection unit for which the glitch is detected.
[0072] It should be noted that each detection unit 310 may have a preset specific delay duration. For example, the specific delay duration corresponding to the detection unit 310a may be characterized by 50 MHz, the specific delay duration corresponding to the detection unit 310b may be characterized by 100 MHz, and the specific delay duration corresponding to the detection unit 310x may be characterized by 500 MHz, etc.
[0073] See also Figure 5 The detection unit 310 may include: a first sampling unit 410 , a second sampling unit 420 and a testing unit 430 .
[0074] The first sampling unit 410 is configured to sample the first test signal based on the clock signal to obtain a first sampling result. Specifically, the test signal can be sampled using a register. When the test signal is a test pattern (TestPattern), the test pattern can be sampled using a register group.
[0075] The second sampling unit 420 is configured to sample the second test signal based on the clock signal to obtain a second sampling result. Specifically, the test signal can be sampled using a register. When the test signal is a test pattern, the test pattern can be sampled using a register group.
[0076] The delay duration of the first test signal relative to the third test signal is different from the delay duration of the second test signal relative to the third test signal. For example, the circuits of the first sampling unit 410 and / or the second sampling unit 420 can be designed so that after the third test signal is processed by the first sampling unit 410 and / or the second sampling unit 420, the first test signal and the second test signal as well as the sampling results for each are obtained. The first test signal and the second test signal have different delay durations relative to the third test signal.
[0077] It should be noted that when the test signal is processed by the circuit, such as when it is transmitted in the wire, there is inevitably a time delay. For example, the longer the signal transmission distance, the longer the time delay. For low-frequency signals, the above time delay can be ignored. However, for high-frequency signals, the above time delay cannot be ignored. Therefore, the duration of the time delay of the first test signal relative to the third test signal can be the duration of the unavoidable time delay caused by reasons such as the circuit layout in the first sampling unit. Alternatively, the duration of the time delay of the second test signal relative to the third test signal can be the duration of the unavoidable time delay caused by reasons such as the circuit layout in the second sampling unit.
[0078] In addition, the duration of the above-mentioned unavoidable delay may be inappropriate, which is not conducive to the detection of glitches in the clock. In order to solve the above problems, the first sampling circuit and / or the second sampling circuit can be specially designed so that there is a preset delay duration between the first test signal and the second test signal. For example, a delay circuit (such as a delay line, etc.) can be set in at least one sampling circuit to implement delay processing on the third test signal to obtain a first test signal or a second test signal with a specific delay duration relative to the third test signal. For example, the first test signal can be set to have a specific delay duration corresponding to 50MHz relative to the third test signal. For example, the first test signal can be set to have a specific delay duration corresponding to 500MHz relative to the third test signal.
[0079] In some embodiments, in order to further increase the convenience of testing, such as facilitating sampling of multiple test signals with required delay durations based on a clock, the delay duration may be adjustable. Specifically, the delay duration of the first test signal relative to the third test signal may be adjusted, and / or the delay duration of the second test signal relative to the third test signal may be adjusted.
[0080] In some embodiments, the first sampling unit includes a first signal delay circuit, which is configured to delay and output the first test signal according to a first set of delay values to sample the delayed first test signal. The first signal delay circuit may include at least one signal delay unit.
[0081] The signal delay unit can be composed of a variety of components, such as a delay line, a series inverter, etc. For example, a charge coupled device (CCD) delay line is a MOS integrated circuit. MOS devices can be equivalent to capacitors, and a large number of capacitors are closely arranged to form a capacitive coupling device. Capacitors can store charge packets representing information, which are directed and transferred between adjacent capacitors under the control of clock pulses to achieve time delay. In addition, digital technology can also be used to achieve signal time delay. For example, the pulse signal is converted into a discrete digital signal through analog-to-digital conversion, and then a multi-stage shift register is used as a delay circuit. The signal is shifted step by step under the drive of the clock signal, and the signal is delayed.
[0082] In some embodiments, the second sampling unit includes a second signal delay circuit configured to delay and output the second test signal to sample the delayed second test signal. The structure of the second signal delay circuit may refer to the first signal delay circuit.
[0083] In some embodiments, the first sampling unit includes a first signal delay circuit configured to delay and output the first test signal according to a first set of delay values to sample the delayed first test signal. The second sampling unit includes a second signal delay circuit configured to delay and output the second test signal to sample the delayed second test signal.
[0084] The test unit 430 is coupled to the first sampling unit and the second sampling unit respectively, and is configured to compare the first sampling result and the second sampling result to obtain a detection result.
[0085] Specifically, the test unit 430 may include a numerical comparator, such as comparing whether the sampling results are consistent. In addition, the test unit 430 may include a logic operation unit, which performs a logic operation on the first sampling result and the second sampling result, and counts the results of the logic operation, such as comparing the values of the same bit to determine whether the first sampling result and the second sampling result are the same.
[0086] Please also see Figure 3 , there is a glitch in the clock clk2. When the test data d1 and the test data d2 are sampled based on the clock clk2, different sampling results may be obtained. In this way, it can be determined that there is a glitch in the clock clk2 based on the different sampling results.
[0087] In some embodiments, a test signal / test pattern can be generated based on a built-in self-test (BIST) technology to detect the clock. BIST is a technology that implants relevant functional circuits in a circuit during design to provide a self-test function, thereby reducing the degree of dependence of device testing on automatic test equipment (ATE). BIST can be applied to almost all circuits and is therefore widely used in the semiconductor industry. For example, at least one of a test pattern generation circuit, a timing circuit, a mode selection circuit, and a debugging test circuit can be implanted in the circuit.
[0088] The BIST circuit may include: a test pattern generator (TPG), an output response analyzer (ORA), and a built-in self-test controller (BIST controller). The test pattern generator is used to automatically generate test vectors and inject them into the input pins of the circuit under test (CUT). The output response analyzer is used to compress and compare the output of the circuit under test to determine whether the circuit has errors. The built-in self-test controller is used to control when and which test pattern is input to the circuit under test, control the clock of the circuit under test, and determine when to read the expected response. The built-in self-test can implement at least some operations such as loading, reading, and comparing the test pattern.
[0089] The first sampling unit and the second sampling unit are respectively described exemplarily below.
[0090] See also Figure 6 The first sampling unit includes a first register group (register group 1), a first signal delay circuit (Delay line 1) and a second register group (register group 2) which are connected in series in sequence.
[0091] Among them, the register group is composed of multiple registers. Registers are small storage areas used to store data, such as temporarily storing data involved in operations and operation results. Registers are essentially a sequential logic circuit, but this sequential logic circuit only contains storage circuits. The storage circuit of the register is composed of latches or flip-flops (Flip-Flop, abbreviated as FF). A latch or flip-flop can store 1 binary number, and N latches or flip-flops can form an N-bit register group. The register group can be designed according to the number of bits of a byte in the computer, for example, an 8-bit register group, a 16-bit register group, etc.
[0092] Latches and flip-flops are both logic circuits with storage functions and are the basic logic units that constitute sequential circuits. Latches are circuits that are sensitive to pulse levels and change their states under a certain level. Flip-flops are circuits that are sensitive to the edge of clock pulses and change their states under the rising or falling edge of clock pulses. Flip-flops are classified by logic function into D flip-flops, JK flip-flops, T flip-flops, and SR flip-flops.
[0093] The second sampling unit includes a third register group (register group 3), a first signal delay circuit (high-frequency timing constraint path) and a fourth register group (register group 4) which are sequentially connected in series.
[0094] Accordingly, the specific delay duration corresponding to the detection unit 310 can be characterized by the delay duration difference between Delay line 1 and the high-frequency timing constraint path. It should be noted that when the delay duration of the high-frequency timing constraint path is much smaller than the delay duration of Delay line 1, the delay duration of Delay line 1 can be used to approximately characterize the specific delay duration corresponding to the detection unit 310.
[0095] The following is an exemplary description using a D flip-flop as an example.
[0096] The flip-flop is sensitive to pulse edges, and its state changes only at the rising or falling edge of the clock pulse. A flip-flop, also called a bistable gate or a bistable flip-flop, is a digital logic circuit that can operate in two states. The flip-flops maintain their state until they receive an input pulse, also called a trigger. When an input pulse is received, the flip-flop output changes state according to the rules, and then maintains this state until another trigger is received. The flip-flop has the following characteristics: the clock is valid later than the data, which means that the data signal is established first, the clock signal is established later, and is stored in the flip-flop at the valid edge (such as the rising edge or the falling edge).
[0097] For ease of understanding, the signal timing of the D flip-flop and the like are exemplarily described.
[0098] Figure 7 It is a schematic diagram of setup time and hold time shown in an embodiment of the present application.
[0099] See also Figure 7, setup time (tsu for short) and hold time (th for short) are the time requirements between the input signal and the clock of the sequential logic circuit. Setup time refers to the time that the input data signal remains unchanged before the rising edge of the trigger clock signal arrives. If the setup time is not enough, the data will not be entered (stored in) the trigger at this clock rising edge. Hold time refers to the time that the input data signal remains unchanged after the rising edge of the trigger clock arrives. If the hold time is not enough, the data cannot be entered into the trigger. If these two time requirements are not met, the output of the circuit may be an indefinite value, that is, the circuit is in a metastable state.
[0100] Specifically, the setup time refers to the time required for the data to go from unstable to stable before the clock edge arrives. If the setup time does not meet the requirements, the data will not be stably entered into the trigger at this clock rising edge. The hold time refers to the time the data is held after it is stable. If the hold time does not meet the requirements, the data will also not be stably entered into the trigger. For example, if Figure 7 The data arrives at the flip-flop after the start time tsu, or, Figure 7 If the data stops entering the trigger before the end time of th, there is no guarantee that the data will be successfully stored in the trigger.
[0101] Figure 8 It is a schematic diagram of line clock delay shown in an embodiment of the present application.
[0102] See also Figure 8 , shows the data transmission between two flip-flops. The register includes a data input terminal D, a clock terminal clk, and a data output terminal Q. The data of register A (RA) is driven by clock clk and output to register B (RB). RB collects data on the rising edge of clk, and the clock source is the same clock clk output by the system clock. Figure 8 There are several time periods as shown below.
[0103] TclkA: Line clock delay from the clock on the pad to the RA.
[0104] Tco: The delay from the clock input D to the clock output Q in RA.
[0105] Tdelay: The clock delay on the line from the Q end of RA to the D end of RB.
[0106] The time it takes for data to arrive at the RB can be obtained through the above parameters.
[0107] TclkB: Line clock delay from pad clock to RB.
[0108] Assume that the clock cycle is T_cycle and the setup time threshold is tsu: it indicates the shortest time that the data remains stable before the clock sampling edge comes.
[0109] The required data time required by the sampling clock can be obtained through tsu.
[0110] The setup time margin (setupslack) required for stable data acquisition can be obtained from the required data time, and the calculation formula shown in formula (1) can be obtained.
[0111] setup slack=T_cycle+TclkB-Tco-Tdelay-tsu–TclkA Formula (1)
[0112] Among them, when setup slack is 0, T_cycle is the minimum, and the data arrival time is equal to the required data time. If the frequency is further increased, the setup time margin is negative. That is, before the clock sampling edge arrives, the data stabilization time is less than tsu, resulting in received data errors. Therefore, when the clock frequency is higher than a certain value, the chip cannot work normally. In this embodiment, the clock can be detected by adjusting the delay duration of Tdelay, and whether there is a burr in the clock can be determined based on the sampling result.
[0113] In some embodiments, the second sampling unit includes a third register group, a second signal delay circuit, and a fourth register group connected in series in sequence. The structure of the third register group can refer to the first register group, the structure of the second signal delay circuit can refer to the first signal delay circuit, and the structure of the fourth register group can refer to the second register group.
[0114] Fig. 9 It is a block diagram of a circuit for diagnosing clock glitches according to another embodiment of the present application.
[0115] See also Fig. 9 The third register group (register group 3) is configured to receive the third test signal at the input end and output the second sub-sampling result to the second signal delay circuit at the output end.
[0116] The second signal delay circuit (eg, a high-frequency timing constraint path) is configured to delay the second sub-sampling result and output it to the fourth register group according to a preset delay value.
[0117] The fourth register group (register group 4) is configured to receive the second sub-sampling result at an input terminal and output the second sub-sampling result to the test unit at an output terminal.
[0118] The third register group and the fourth register group receive clock signals at clock ends respectively.
[0119] In some embodiments, the first sampling unit includes a first register group (register group 1), a first signal delay circuit, and a second register group (register group 2) connected in series. The second sampling unit includes a third register group, a second signal delay circuit, and a fourth register group connected in series.
[0120] Specifically, the first register group is configured to receive the third test signal at an input terminal and output the first sub-sampling result to the first signal delay circuit at an output terminal. For example, the third test signal is a BIST pattern.
[0121] The first signal delay circuit is configured to delay the first sub-sampling result and output it to the second register group according to a selected delay value in the first group of delay values.
[0122] The second register group is configured to receive the first sub-sampling result at an input terminal and output the first sub-sampling result to the test unit at an output terminal.
[0123] The first register group and the second register group receive clock signals at clock ends respectively.
[0124] See also Fig. 9 The first signal delay circuit includes at least two parallel clock delay sub-circuits, and each of the at least two parallel clock delay sub-circuits has a different delay duration for the first sub-sampling result.
[0125] Accordingly, the above circuit may further include: a first delay selection unit. The first delay selection unit is coupled to the first signal delay circuit, and is used to receive configuration data, generate a configuration signal, and determine a target clock delay subcircuit from at least two parallel clock delay subcircuits based on the configuration signal, so as to use the test signal output by the target clock delay subcircuit as the delayed first test signal.
[0126] See also Fig. 9 , four register groups are shown, each register group includes multiple flip-flops (FF). Each flip-flop (FF) has a data input terminal D, a clock input terminal CK, and a data output terminal Q. The input data at the D terminal is latched at the rising edge of the clock, and then the latched data is output to the Q terminal.
[0127] Fig. 9The first sampling unit includes a first signal delay circuit, which includes a plurality of parallel clock delay subcircuits, and each clock delay subcircuit can implement a specific delay duration for the third test information. For example, each clock delay subcircuit can be a delay line (Delayline). The delay line can be implemented by continuous inverters or other standard units, and the goal is to increase the delay on the timing path. Among them, the delay duration of each of the different clock delay subcircuits can be a preset duration, such as the delay duration of the first delay line (Delay line1) is 50MHz, the delay duration of the second delay line (Delay line2) is 100MHz, the delay duration of the third delay line (Delay line3) is 150MHz, ... The delay duration of the Nth delay line (Delay line N) is 500MHz, etc.
[0128] Fig. 9 The second sampling unit includes a second signal delay circuit, which can be a connecting line between register group 3 and register group 4. When the circuit is laid out, register group 3 and register group 4 need to be connected by wires. The circuit between register group 3 and register group 4 will inevitably cause the test signal transmitted from the data output terminal Q of register group 3 to the data input terminal D of register group 4 to be delayed relative to the test signal received by the data input terminal D of register group 3. It should be noted that the second signal delay circuit can also be composed of an inverter, etc., but the delay duration of the second signal delay circuit for the third test signal needs to be different from the delay duration of the first signal delay circuit for the third test signal.
[0129] The first delay selection unit can select a target clock delay subcircuit from a plurality of parallel clock delay subcircuits and output an output test signal of the target clock delay subcircuit. For example, if the user wishes to delay the third test signal by 100 MHz, the second clock delay subcircuit can be selected. Specifically, the first delay selection unit can be a multiplexer (MUX for short). The multiplexer is respectively connected to a plurality of clock delay subcircuits and is configured to select a target clock delay subcircuit from a plurality of clock delay subcircuits.
[0130] Fig.10 It is a schematic diagram of a delay selection unit shown in an embodiment of the present application.
[0131] See also Fig.10 The multiplexer may be a multiple-choice selector. It should be noted that, in order to switch the path of the clock delay sub-circuit, at least one of a wiring switch, a look-up table (LUT) circuit, etc. may also be used.
[0132] For example, the implementation logic of the two-choice MUX can be shown as formula (2).
[0133]
[0134] Among them, Y is the signal output by MUX, S is the control signal, NOT S, A and B are the two signals input to the MUX. In addition, a buffer (such as a single NOT gate) can be connected to the output of the multiplexer to provide a positive logic output (logic "1", high) at one terminal and a complementary negative logic output (logic "0", low) at the buffer output.
[0135] In some embodiments, in order to reduce the chip area occupied by the first signal delay circuit and the first delay selection unit and improve the signal processing speed, it can be achieved by sharing the delay components in different clock delay sub-circuits. For example, in the previous embodiment, each clock delay sub-circuit has its own exclusive delay component, but only one of the clock delay sub-circuits will be used at the same time, and the remaining clock delay sub-circuits will be idle. By improving the circuits of the first signal delay circuit and the first delay selection unit and sharing at least some components of multiple clock delay sub-circuits, the chip area occupied by the first signal delay circuit and the first delay selection unit can be effectively reduced.
[0136] For example, the circuit for diagnosing clock glitches may further include: a second delay selection unit. The second delay selection unit is coupled to the first signal delay circuit and is used to receive configuration data and generate a configuration signal.
[0137] Accordingly, the first signal delay circuit includes: a plurality of delay groups, configured to output a delayed first test signal in response to a configuration signal, any of the plurality of delay groups including a first multiplexer and a delay device, the delay device being coupled to the first multiplexer of the corresponding delay group. In this way, a desired number of delay groups can be selected from the plurality of delay groups to form a signal delay circuit having a desired delay duration, effectively reducing the number of components (such as inverters) in an idle state. The delay device includes, but is not limited to, at least one of a delay line and a delay element. For example, the delay element includes an inverter or at least two inverters connected in series.
[0138] In some embodiments, multiple delay groups are cascaded, the delay device of each of the multiple delay groups is configured to receive a first input signal and output a delayed first input signal, and the first multiplexer of each of the multiple delay groups is configured to receive the delayed first input signal and the undelayed first input signal output by the delay device in the delay group.
[0139] Fig.11 It is a block diagram of a circuit for diagnosing clock glitches according to another embodiment of the present application.
[0140] See also Fig.11 , the first signal delay circuit may include a configuration register, an encoder and a plurality of delay groups. Wherein, each delay group includes a paired inverter and a multiplexer. The input of the current-stage inverter is connected to the output of the multiplexer of the previous-stage delay group, and the input of the current-stage inverter is connected to the input of the multiplexer of the current-stage delay group. The control end of the multiplexer in each delay group is connected to a specific bit of the encoder, and the input of the encoder is connected to the output of the configuration register. For example, the second delay selection unit may include a configuration register and an encoder. Alternatively, the second delay selection unit may include a configuration register, an encoder and a plurality of multiplexers.
[0141] For example, the inverters in the eight delay groups can all achieve a delay effect of 50MHz. If the configuration information stored in the configuration register represents 150MHz, the data output by the encoder can be 8-bit data including three bits as 1, such as 11100000, 01110000, 00111000, 01010100, 10000011, 00000111, etc. The multiplexer of the delay group corresponding to the three bits of the encoder as 1 selects the channel with the inverter to be turned on. The multiplexers of the delay groups corresponding to the remaining bits of the encoder select the channel without the inverter to be turned on. In this way, a signal delay circuit consisting of three inverters is constructed, so that the delay duration of the first signal delay circuit is 150MHz.
[0142] For example, the inverters in the eight delay groups can each achieve a delay effect of 10MHz, 20MHz, 40MHz, 80MHz, 160MHz, 320MHz, 640MHz, and 1280MHz. If the configuration information stored in the configuration register represents 500MHz, the data output by the encoder may include at least one scheme, such as 01001100. The multiplexer of the delay group corresponding to the bit position of the encoder with the bit position of 1 selects the channel with the inverter to be turned on. The multiplexers of the delay groups corresponding to the remaining bits of the encoder respectively select the channel without the inverter to be turned on. In this way, a signal delay circuit composed of multiple inverters is constructed, so that the delay duration of the first signal delay circuit is 500MHz.
[0143] To facilitate understanding that whether a clock includes a glitch can be detected by adjusting the delay duration of the signal delay circuit, a timing diagram of a circuit for diagnosing a clock glitch is exemplarily described below.
[0144] Fig.12 This is a signal timing diagram shown in an embodiment of the present application. Please also refer to Fig. 9 and 12 , the clock CLK includes glitches. The first signal delay circuit is a path with a delay line (delay_line). The second signal delay circuit is a path without a delay line (delay_line). The test signal may be a BIST pattern (Pattern), which may include test patterns D0 to D5, etc., wherein each test pattern, such as test pattern D0, may include multiple bits of test data, for example, an 8-bit test signal 00000000, 11111111 or 11001100...etc.
[0145] Fig.12 The delay of the path with delay_line can be referred to Figure 8 For details about Tdelay, refer to the following. Figure 8 The delay component of the path with delay_line includes the delay introduced by the first signal delay circuit, which is greater than the delay of the path without delay_line. The delay of the path without delay_line can be an unavoidable delay introduced by factors such as circuit layout, which can be small and even negligible in some cases.
[0146] Please also see Fig.11 and Fig.12 , Fig.12 Due to the presence of glitches in the clock, the presence of glitches causes the setup time (Set_up) of the test pattern D3 transmitted in the path with delay_line to be shorter than the setup time required by register group 2 to store the test pattern, and it is impossible to ensure that the test pattern D3 can be correctly stored in register group 2. This may cause the test pattern stored in register group 2 to be different from the actual test pattern D3.
[0147] In contrast, the glitch in the clock may not cause the setup time (Set_up) of the test pattern D3 transmitted in the path without delay_line to be less than the setup time required for register group 4 to store the test pattern. That is, the setup time requirement of register group 4 is met. Therefore, the test pattern D3 can be correctly stored in register group 4.
[0148] The above situation will cause the first sampling result based on the path with delay_line and the second sampling result based on the path without delay_line to be different. Therefore, by comparing whether the first sampling result and the second sampling result are the same, it can be detected whether the clock has a glitch.
[0149] It should be noted that the above only shows the situation of considering the setup time, and the sampling result may also be affected by, for example, the hold time. For example, although the setup time requirements of register group 2 and / or register group 4 are met, the hold time requirements of register group 2 and / or register group 4 are not met. This may also cause abnormal sampling results, and further lead to inconsistent comparison results.
[0150] In a specific embodiment, the circuit for diagnosing clock glitches includes two data paths (register group 1 (FF1) -> register group 2 (FF2) and register group 3 (FF3) -> register group 4 (FF4)), wherein the highest frequency on the FF1->FF2 path is delayed by delay_line, so that the frequency that meets the setup_time becomes lower (can be controlled to 50MHz, 100MHz to 500MHz, etc.), and the other path only adjusts the hold_time so that its setup_time can run higher (for example, 3GHz). Then, the test pattern (sampling data) is multi-bit (for example, 8 bits or 16 bits), from 8 bits 01010101->8 bits b10101010->8 bits 01010101, so that each bit performs a 0 to 1 cycle.
[0151] When the clock generated based on the crystal oscillator is correct (such as 24MHz or 26MHz), both data paths are captured correctly and the comparator will compare through.
[0152] When a glitch occurs, the glitch frequency is greater than 50M, and a sampling error may occur in the register group 3 capture in the data path FF1->FF2.
[0153] Because the capture of FF3->FF4 can support higher frequency, if it is correct. Therefore, as long as FF1->FF2 has a sampling error of 1 bit, and FF3->FF4 is sampled correctly, the comparator will fail. Or if FF1->FF2 has a sampling error of 1 bit, and FF3->FF4 also has a probabilistic sampling error, it will also be judged as a comparison failure, and the comparator will also fail.
[0154] Even if the glitch frequency is higher than 3G, the comparator will fail if both FF1->FF2 and FF3->FF4 fail. This allows the clock to be detected including the glitch when the comparator fails.
[0155] The automatic detection design method provided in this embodiment can automatically detect whether abnormal glitches appear on the crystal oscillator clock signal.
[0156] In some embodiments, the test unit includes a numerical comparator, which is coupled to the first sampling unit and the second sampling unit respectively and is configured to compare the first sampling result and the second sampling result to obtain the detection result.
[0157] Fig.13 is a circuit diagram of a test unit according to an embodiment of the present application.
[0158] See also Fig.13 , the first sampling result of the first sampling unit can be 01011101, and the second sampling result of the second sampling unit can be 00100110. By comparing the first sampling result and the second sampling result, it can be known that the first sampling result and the second sampling result are different. For example, an XOR logic operation can be performed on the first sampling result and the second sampling result. If the logic operation result is not 0, it can be determined that the first sampling result and the second sampling result are different.
[0159] In some embodiments, the test unit includes an XOR logic operation unit and a counter, the XOR logic operation unit is coupled to the first sampling unit, the second sampling unit and the counter, respectively, and the test unit is configured to perform statistics on bits with different values in the first sampling result and the second sampling result to obtain a detection result.
[0160] Fig.14 is a circuit diagram of a test unit according to another embodiment of the present application.
[0161] See also Fig.14 After performing an XOR logic operation on the first sampling result and the second sampling result, the XOR logic operation result can be processed based on a counter or the like to obtain bits with different values in the first sampling result and the second sampling result. Fig.13 If the first bit (bit1) to the fourth bit (bit4) are not 1, and the sixth bit (bit6) and the seventh bit (bit6) are not 1, it indicates that the first bit (bit1) to the fourth bit (bit4), the sixth bit (bit6), and the seventh bit (bit7) in the first sampling result and the second sampling result have different values. It can be further determined that the clock includes glitches.
[0162] Taking the adder counter as an example, a binary adder counter can be constructed using a trigger. In addition, a subtraction counter can also be used for calculation. Taking counting by software as an example, the operation: n&(n–1) can be repeatedly performed until n becomes 0. Among them, the function of the operation: n&(n–1) is to remove the last 1 of n, that is, the last 1 of n becomes 0. For example, let n=11111, the calculation process is as follows: n=11110, the count is 1; n=11100, the count is 2; n=11000, the count is 3; n=10000, the count is 4; n=00000, the count is 5.
[0163] It should be noted that Fig.13 and Fig.14 The logic operation circuits and their combinations shown in are only illustrative examples and are not limited here. It should be noted that the logic operation includes but is not limited to: "OR", "AND", "NOT", "NOR", "NAND", "XOR", etc. In order to compare whether two values are the same, a combination of multiple logic operation circuits can be used to achieve it. Accordingly, a combination of multiple logic operation circuits can be used to achieve it, which is not limited here.
[0164] The abnormal range diagnosis unit is exemplarily described below.
[0165] The abnormal range diagnosis unit is connected to the test unit and is configured to output a diagnosis signal corresponding to the configuration data in response to a detection result being abnormal.
[0166] refer to Fig.12 It can be learned from the relevant content that the comparison will fail only when the clock glitch causes the sampling circuit with a larger delay duration to have a sampling abnormality. The clock glitch may not cause the sampling circuit with a smaller delay duration to have a sampling abnormality. Therefore, the location of the glitch in the clock can be judged based on the delay duration of the sampling circuit with abnormal sampling results. For example, when the glitch is closer to the previous falling edge of the clock, the sampling circuit with a larger delay duration may have a sampling abnormality. For example, when the glitch is closer to the next falling edge of the clock, the sampling circuit with a smaller delay duration may have a sampling abnormality.
[0167] Specifically, the approximate position of the glitch in the clock may be determined by comparison or the like.
[0168] For example, refer to Fig. 9, the sampling results of the paths where the 500MHz delay line and the 400MHz delay line are located are inconsistent, but the sampling results of the paths where the 400MHz delay line and the 300MHz delay line are located are consistent. It can be preliminarily determined that the glitch occurs at the position of the clock corresponding to the duration of the 500MHz delay.
[0169] For another example, a mapping relationship between the delay duration and the position of the glitch in the clock can be pre-built, so that when the sampling results between the two paths are different, the approximate position of the glitch in the clock can be obtained by looking up a table or the like.
[0170] In some embodiments, the circuit for diagnosing clock glitches may further perform exception processing when a clock glitch exists, so as to improve clock reliability.
[0171] Fig.15 It is a block diagram of a circuit for diagnosing clock glitches according to an embodiment of the present application.
[0172] See also Fig.15 The circuit for diagnosing clock glitches may include: an exception handling unit. The exception handling unit may include at least one of an interrupt signal generating module and / or a reset signal generating module.
[0173] The interrupt signal generating module is connected to the plurality of detection units and is configured to output a clock signal interrupt signal when the detection result is abnormal. Specifically, the above-mentioned device for diagnosing clock glitches may further include a first configuration unit for configuring a first threshold. Accordingly, the interrupt signal generating module is configured to output a clock signal interrupt signal when the number of glitch detections of the glitch detection result exceeds the first threshold.
[0174] The reset signal generating module is connected to a plurality of detection units (such as detection unit a, detection unit b, detection unit c, etc.), and is configured to output a clock signal reset signal when the detection result is abnormal. Specifically, the above-mentioned device for diagnosing clock glitches may further include a second configuration unit for configuring a second threshold. Accordingly, the reset signal generating module is configured to output a clock signal reset signal when the number of glitch detections of the glitch detection result exceeds the second threshold.
[0175] For example, a reset signal is a signal output when a glitch is included for a short period of time (such as one or several clock cycles), and is used to improve the quality of the clock by resetting and restarting. If the clock generation circuit is affected by external interference and other factors, resulting in the output of glitches in a short period of time, in order to improve the quality of the clock signal, the reset signal generation module can output a reset signal to a functional circuit such as a central processing unit (CPU).
[0176] For example, an interrupt signal is a signal output when glitches continue to appear for a long time (such as clock cycles exceeding a specific number of counts). For example, after a reset process is performed based on a reset signal, the clock signal still has glitches or the number of glitches is large and does not meet the requirements. In order to improve the personal safety and property safety of users, the interrupt signal generation module can output an interrupt signal to a control unit such as a central processing unit (CPU) to control the clock generation unit to stop outputting the clock signal, or switch to a backup clock signal, etc.
[0177] In some embodiments, the abnormal range diagnosis unit includes a comparator, which is configured to compare a count value (such as a count of clock cycles with glitches) with a first threshold value, and / or compare the count value with a second threshold value, so as to detect abnormalities in the clock signal, wherein the first threshold value and the second threshold value are different. For example, the first threshold value and the second threshold value may be set based on expert experience, usage effects, etc.
[0178] In a specific embodiment, when the clock is correct, both data paths are correctly captured and the comparator will pass the comparison. When a glitch occurs, the glitch frequency is greater than the timing constraint frequency, and the sampling in the data path FF1->FF2 will have a probability of sampling error.
[0179] The detection frequency range of each detection unit is different. The burr frequency range judgment unit determines the burr frequency range by judging the detection unit number where the error occurs and the detection frequency range of each detection unit, and then outputs the burr frequency range for failure behavior analysis.
[0180] In order to prevent extremely rare non-hacker attacks, for example, glitches generated by board-level interference may cause the detector to falsely trigger a reset, a count of the number of comparison failures is made in the reset interrupt generation unit. When the number of glitches reaches or exceeds the false trigger threshold setting, an interrupt and reset are triggered.
[0181] It should be noted that the first threshold and the second threshold may each include multiple levels: a low-quality threshold level and an abnormal threshold level, etc. Among them, when the clock frequency of the first clock is greater than the abnormal threshold level and less than the low-quality threshold level, a reset signal can be output. The quality of the clock is improved by the reset signal. It should be noted that the above conditions for outputting the reset signal are only exemplary and cannot be understood as limitations on the present application. Specifically, the reset signal will reset the main circuit and clear the key information. When the clock frequency of the first clock is greater than the abnormal threshold level and greater than the low-quality threshold level, an interrupt signal can be output.
[0182] It should be noted that the above conditions for outputting an interrupt signal are only exemplary and cannot be understood as a limitation of the present application. The potential risks brought to users by abnormal clocks are reduced by interrupt signals. Specifically, an interrupt signal can be sent to a central processing unit (CPU) so that the CPU can respond to the interrupt signal and perform corresponding processing according to the interrupt type, such as destroying important information, restarting, shutting down the first clock generating unit, etc. In addition, in addition to reset, interrupt processing, etc., other processing methods can also be introduced: such as changing the clock generating unit channel, alarming, etc., which are not limited here.
[0183] In some embodiments, a backup clock generating unit for generating a backup clock signal may be further provided in the circuit for diagnosing clock glitches.
[0184] The frequency of the reference clock signal (hereinafter referred to as the second clock signal) generated by the standby clock generating unit may be the same as or different from the frequency of the clock signal. For example, a crystal oscillator with the same oscillation frequency as that in the first clock generating unit may be set in the second clock generating unit, such as the second clock generating unit may include a crystal oscillator, a crystal oscillator control chip and a capacitor. For example, an oscillation circuit may be set in the second clock generating unit to reduce the cost of generating the second clock signal.
[0185] The circuit for diagnosing clock glitches provided in the present application can be applied to multiple fields such as accurate three-dimensional (3D) modeling, detection, home improvement, unmanned driving, and drones.
[0186] The circuit for diagnosing clock glitches provided in the present application can automatically detect whether glitches (such as high-frequency glitches) appear in the clock signal output by the clock generation unit, and after detection, send out interrupt and reset signals to notify the system to protect and dispose of the main control chip.
[0187] Another aspect of the present application also provides a clock circuit.
[0188] The clock circuit may include a first clock generating unit and a circuit for diagnosing clock glitches.
[0189] The first clock generating unit is configured to output a first clock signal. The circuit for diagnosing clock glitches is shown in the above related content, which is connected to the first clock generating unit and is configured to detect the first clock signal. For example, the first clock generating unit may include a quartz crystal oscillator and other devices.
[0190] In some embodiments, the circuit for diagnosing clock glitches may further include a second clock generating unit and a second multiplexer.
[0191] The second clock generating unit is configured to output a backup clock signal.
[0192] The second multiplexer is connected to the circuit for diagnosing clock glitches, and is configured to output the clock signal when the clock of the clock signal is normal, or to output the backup clock signal when a glitches exist in the clock of the clock signal.
[0193] The second multiplexer may be a two-to-one selector. It should be noted that, in order to achieve the change of the path of the clock signal, at least one of a wiring switch, a look-up table (LUT) circuit, etc. may also be used.
[0194] The second multiplexer provided in this embodiment is configured to switch the functional circuit clock to the reference clock when it is determined that the current clock signal has glitches, so as to prevent the functional circuit from operating on the clock with glitches. When the clock signal is normal, the path corresponding to the first clock generating unit is used. This ensures that the function based on the clock signal can be realized, thereby improving the personal safety and property safety of users.
[0195] Another aspect of the present application also provides a chip. The chip may include a clock circuit as described above, and a functional circuit that implements a specific function based on a clock signal output by the clock circuit. The functional circuit includes but is not limited to: a processor, a transmitter, a receiver, etc.
[0196] In a possible implementation, another aspect of the present application further provides a board, which includes a storage device, an interface device, a control device and the above-mentioned chip. The chip is connected to the storage device, the control device and the interface device respectively. The storage device is configured to store data. The interface device is configured to realize data transmission between the artificial intelligence chip and the external device. The control device is configured to monitor the status of the artificial intelligence chip.
[0197] Another aspect of the present application provides a method for diagnosing clock glitches.
[0198] Fig.16 It is a flowchart of a method for diagnosing clock glitches according to an embodiment of the present application.
[0199] See also Fig.16 , the method for diagnosing a clock glitch may include operations S1610 to S1630.
[0200] In operation S1610, a test signal having a specific delay duration is detected based on the clock signal to be detected to obtain a glitch detection result for a specific frequency range of the clock signal to be detected, and there is a corresponding relationship between the specific delay duration and the specific frequency range.
[0201] In operation S1620, a diagnosis signal for a specific frequency range is determined based on the glitch detection result, the specific frequency range being a frequency range corresponding to a detection unit for which the glitch detection result is abnormal.
[0202] In some embodiments, the sampling process may be as follows.
[0203] First, the first test signal is sampled based on the clock signal to obtain a first sampling result. Specifically, the related operations performed by the first sampling unit 410 can be referred to. And, the second test signal is sampled based on the clock signal to obtain a second sampling result. Specifically, the related operations performed by the second sampling unit 420 can be referred to.
[0204] Then, the first sampling result and the second sampling result are compared to obtain a detection result. Specifically, reference may be made to the related operations performed by the detection unit 430.
[0205] The first test signal and the second test signal are generated based on the third test signal, and a delay duration of the first test signal with respect to the third test signal is different from a delay duration of the second test signal with respect to the third test signal.
[0206] In some embodiments, the delay duration of the first test signal relative to the third test signal can be adjusted, and / or the delay duration of the second test signal relative to the third test signal can be adjusted.
[0207] In some embodiments, the test pattern may be sampled on a clock basis through a register set.
[0208] In some embodiments, the test signal may be delayed by a signal delay circuit.
[0209] In some embodiments, in response to the detection result being abnormal, a diagnosis signal corresponding to the configuration data is output.
[0210] In some embodiments, the delay duration of the test signal generated by the signal delay circuit can be adjusted by configuring data.
[0211] Another aspect of the present application provides a device for diagnosing clock glitches.
[0212] Fig.17 It is a structural schematic diagram of a device for diagnosing clock glitches shown in an embodiment of the present application.
[0213] See also Fig.17 The apparatus 1700 for diagnosing clock glitches may include a frequency determination module 1710 and a diagnosis module 1720 .
[0214] The frequency determination module 1710 is used to detect a test signal with a specific delay duration based on the clock signal to be detected, and obtain a burr detection result for a specific frequency range of the clock signal to be detected. There is a corresponding relationship between the specific delay duration and the specific frequency range.
[0215] The diagnosis module 1720 is used to determine a diagnosis signal for a specific frequency range based on the burr detection result, where the specific frequency range is a frequency range corresponding to the detection unit for which the burr detection result is abnormal.
[0216] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0217] Another aspect of the present application further provides a radar. The radar may include the chip or board as described above.
[0218] Fig.18 It is a schematic diagram of the structure of a radar shown in an embodiment of the present application.
[0219] See also Fig.18 The radar 1800 may include a chip or a board as shown above, and the chip and / or the board may include a clock circuit as described above. Specifically, the clock circuit may include a circuit for diagnosing clock glitches as shown above. The clock circuit may be provided on a board 1810, and a plurality of chips, such as a central control chip, may be provided on the board 1810. The board 1810 may be provided in a housing 1820.
[0220] The radar may be a laser radar, a millimeter wave radar, an ultrasonic radar, etc. The radar may be a scanning radar or a non-scanning radar.
[0221] Another aspect of the present application also provides an electronic device, which includes the above-mentioned artificial intelligence chip. The electronic device includes a data processing device, a robot, a radar, a computer, a printer, a scanner, a tablet computer, a smart terminal, a mobile phone, a driving recorder, a navigator, a sensor, a camera, a server, a cloud server, a camera, a video camera, a projector, a watch, a headset, a mobile storage, a wearable device, a means of transportation, a household appliance, and / or a medical device. The means of transportation include an airplane, a ship and / or a vehicle. Household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods. Medical equipment includes an MRI, an ultrasound machine, and / or an electrocardiograph.
[0222] Fig.19 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0223] See also Fig.19The electronic device 1900 may include a memory 1910 and a processor 1920. In addition, the electronic device 1900 may be provided with at least one of a clock generating circuit, a circuit for diagnosing clock glitches, or a radar.
[0224] The processor 1920 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0225] The memory 1910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 1920 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 1910 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 1910 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0226] The memory 1910 stores executable codes, and when the executable codes are processed by the processor 1920 , the processor 1920 can execute part or all of the methods described above.
[0227] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0228] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0229] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A circuit for diagnosing clock glitches, characterized in that: include: At least two detection units, each of the at least two detection units is configured to detect a test signal having a specific delay duration based on a clock signal to be detected, and obtain a burr detection result for a specific frequency range of the clock signal to be detected, and there is a corresponding relationship between the specific delay duration and the specific frequency range; an abnormal range diagnosis unit, coupled to the at least two detection units respectively, and configured to output a diagnosis signal for a specific frequency range, wherein the specific frequency range is a frequency range corresponding to the detection unit for which the burr detection result is abnormal; Wherein, the detection unit comprises: A first sampling unit is configured to sample a first test signal having a first delay duration based on a clock signal to obtain a first sampling result; A second sampling unit is configured to sample a second test signal having a second delay duration based on the clock signal to obtain a second sampling result; a testing unit, coupled to the first sampling unit and the second sampling unit respectively, and configured to compare the first sampling result and the second sampling result to obtain the burr detection result; The difference between the first delay duration and the second delay duration is related to the specific delay duration.
2. The circuit according to claim 1, characterized in that: The first sampling unit comprises a first register group, a first signal delay circuit and a second register group connected in series in sequence; and / or The second sampling unit includes a third register group, a second signal delay circuit and a fourth register group which are sequentially connected in series.
3. The circuit according to claim 2, characterized in that The first delay duration includes a delay duration of the first test signal relative to a third test signal, and the second delay duration includes a delay duration of the second test signal relative to the third test signal.
4. The circuit according to claim 3, characterized in that: The first register group is configured to receive the third test signal at an input terminal and output a first sub-sampling result to the first signal delay circuit at an output terminal; The first signal delay circuit is configured to delay outputting the first sub-sampling result to the second register group according to a first delay duration; The second register group is configured to receive the first sub-sampling result at an input end and output the first sub-sampling result to the test unit at an output end; The first register group and the second register group receive the clock signal at the clock end respectively; and / or The third register group is configured to receive the third test signal at an input terminal and output the second sub-sampling result to the second signal delay circuit at an output terminal; The second signal delay circuit is configured to delay the second sub-sampling result and output it to the fourth register group according to a second delay duration; The fourth register group is configured to receive the second sub-sampling result at an input terminal and output the second sub-sampling result to the test unit at an output terminal; The third register group and the fourth register group receive the clock signal at clock ends respectively.
5. The circuit according to any one of claims 1 to 4, characterized in that: The test unit includes a numerical comparator, which is coupled to the first sampling unit and the second sampling unit respectively and is configured to compare the first sampling result and the second sampling result to obtain the burr detection result; or The test unit includes an exclusive OR logic operation unit and a counter, wherein the exclusive OR logic operation unit is coupled to the first sampling unit, the second sampling unit and the counter respectively, and the test unit is configured to perform statistics on bits with different values in the first sampling result and the second sampling result to obtain the glitch detection result.
6. The circuit according to any one of claims 1 to 4, characterized in that: Also includes: A first configuration unit is configured to configure a first threshold. an interrupt signal generating module, configured to output a clock signal interrupt signal when the number of glitch detections of the glitch detection result exceeds the first threshold; and / or A second configuration unit is configured to configure a second threshold. The reset signal generating module is configured to output a clock signal reset signal when the number of glitch detection times of the glitch detection result exceeds the second threshold.
7. A clock circuit, characterized in that: include: A first clock generating unit, configured to output the clock signal; The circuit for diagnosing clock glitches according to any one of claims 1 to 6 is connected to the first clock generating unit and is configured to detect the clock signal.
8. The clock circuit according to claim 7, characterized in that: Also includes: A second clock generating unit is configured to output a backup clock signal; The second multiplexer is connected to the circuit for diagnosing clock glitches and is configured to output the clock signal when the clock of the clock signal is normal, or to output the backup clock signal when the clock of the clock signal is abnormal.
9. A chip, characterized in that: include: A circuit for diagnosing clock glitches according to any one of claims 1 to 6, or a clock circuit according to claim 7 or 8; The functional circuit is configured to implement a specific function based on the clock signal or the backup clock signal. 10 . A radar comprising the circuit for diagnosing clock glitches according to any one of claims 1 to 6 , or the clock circuit according to claim 7 or 8 , or the chip according to claim 9 .
11. A method for diagnosing clock glitches, characterized in that: include: Detecting a test signal having a specific delay duration based on a clock signal to be detected, and obtaining a burr detection result for a specific frequency range of the clock signal to be detected, wherein there is a corresponding relationship between the specific delay duration and the specific frequency range; Determining a diagnostic signal for a specific frequency range based on the burr detection result, the specific frequency range being a frequency range corresponding to a detection unit for which the burr detection result is abnormal; The step of detecting a test signal having a specific delay duration based on a clock signal to be detected to obtain a burr detection result for a specific frequency range of the clock signal to be detected includes: Sampling a first test signal having a first delay duration based on a clock signal to obtain a first sampling result; Sampling a second test signal having a second delay duration based on the clock signal to obtain a second sampling result; Comparing the first sampling result with the second sampling result to obtain the burr detection result; The difference between the first delay duration and the second delay duration is related to the specific delay duration.
