Application-specific integrated circuit and watchdog circuit thereof

By designing a watchdog circuit for an application-specific integrated circuit (ASIC), comprehensive monitoring of clock synchronization, watchdog timing correctness, and instruction validity is achieved. This solves the problems of abnormal clock synchronization between the MCU and ASIC and insufficient flexibility in watchdog operation, thereby improving the operational reliability of the ASIC chip.

CN121166431AActive Publication Date: 2025-12-19CCORE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511705759.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2025-12-19
Estimated Expiration
2045-11-20

AI Technical Summary

Technical Problem

In existing technologies, there is insufficient detection of clock synchronization anomalies between MCU and ASIC, and the flexibility and security of the watchdog operation are insufficient, making it unable to meet the reliability requirements of different application scenarios.

Method used

A watchdog circuit based on a dedicated integrated circuit was designed, including a first watchdog module, a second watchdog module, a third watchdog module, a watchdog feeding instruction processing module, and an abnormal state processing module. By monitoring clock synchronization, watchdog feeding timing correctness, and instruction legality, and utilizing multiple watchdog architectures and instruction verification mechanisms, comprehensive monitoring is achieved.

Benefits of technology

It improves the operational reliability of ASIC chips in embedded systems, enhances clock synchronization and the flexibility and security of dog-feeding operations, and reduces the risk of misjudgment and false triggering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121166431A_ABST
    Figure CN121166431A_ABST
Patent Text Reader

Abstract

The invention discloses an application-specific integrated circuit and a watchdog circuit thereof, and relates to the technical field of integrated circuit design, the watchdog circuit comprises a first watchdog module, a second watchdog module, a third watchdog module, a dog feeding instruction processing module and an abnormal state processing module; the first watchdog module is used for monitoring the frequency relation between the external clock input by the micro-control unit of the upper computer and the internal clock of the application-specific integrated circuit, and the second watchdog module and the third watchdog module are used for monitoring the correctness of different dog feeding time sequences respectively. And the dog feeding instruction processing module is used for monitoring the legality of dog feeding instructions of the second watchdog module and the third watchdog module, so that all-directional monitoring on clock synchronization, dog feeding time sequence correctness and instruction legality is realized through cooperative work of all the modules, a blind area of a single monitoring dimension in related technologies is covered, and the accuracy of monitoring is improved. And the operation reliability of the ASIC chip in the embedded system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated circuit design technology, and in particular to an application-specific integrated circuit and its watchdog circuit. Background Technology

[0002] As a key module to ensure the stable operation of embedded systems, the watchdog circuit's core function is to periodically detect the system's operating status and trigger a reset mechanism to restore the system to normal operation when an abnormality occurs.

[0003] In related technologies, watchdog designs have several limitations: 1) They cannot detect clock synchronization anomalies between the host computer's MCU (Microcontroller Unit) and ASIC (Application Specific Integrated Circuit), which may lead to misjudgment or missed judgment when the clocks of the two are out of sync; 2) They use fixed instructions or a single sequence for watchdog feeding, which is not flexible enough and cannot adapt to the reliability requirements of different application scenarios; and they do not perform legality verification, which poses a risk of being triggered by random signals, making the watchdog feeding mechanism unsafe.

[0004] Therefore, how to provide a watchdog circuit design that can comprehensively monitor clock synchronization, watchdog timing correctness, and instruction validity, thereby improving the operational reliability of ASIC chips in embedded systems, is an urgent problem to be solved. Summary of the Invention

[0005] The purpose of this invention is to provide an application-specific integrated circuit and its watchdog circuit to achieve comprehensive monitoring of clock synchronization, watchdog timing correctness and instruction legality, thereby improving the operational reliability of ASIC chips in embedded systems.

[0006] To solve the above technical problems, the present invention provides a watchdog circuit for an application-specific integrated circuit, comprising: a first watchdog module, a second watchdog module, a third watchdog module, a watchdog feed instruction processing module, and an abnormal state processing module; The first watchdog module is used to monitor the frequency relationship between the external clock input to the microcontroller unit of the host computer and the internal clock of the application-specific integrated circuit; the second watchdog module is a window-type watchdog architecture, and the third watchdog module is a timeout-type watchdog architecture. The watchdog feeding instruction processing module is used to verify the legality of the target watchdog feeding instruction sent by the microcontroller unit; if the target watchdog feeding instruction is legal, the module controls the target watchdog module to perform the watchdog feeding operation; wherein, the target watchdog feeding instruction is the watchdog feeding instruction corresponding to the target watchdog module, and the target watchdog module is the second watchdog module or the third watchdog module. The abnormal state handling module is used to perform reset control on the dedicated integrated circuit and / or the microcontroller unit according to the abnormal signals of the first watchdog module, the second watchdog module and the third watchdog module respectively.

[0007] On the other hand, the first watchdog module includes: A bidirectional counter is used to cross-count the external clock and the internal clock; if the count value corresponding to any monitoring clock signal within a preset clock period is not within the corresponding pre-designed value range, an abnormal signal of the first watchdog module is sent to the abnormal state processing module; wherein, the monitoring clock signal includes the external clock and the internal clock.

[0008] On the other hand, the bidirectional counter includes a first counter and a second counter; The first counter is used to update the count value corresponding to the internal clock when the rising edge of the external clock is detected; after each preset clock cycle, a clearing operation is performed and the count value before clearing corresponding to the internal clock is detected; if the count value before clearing corresponding to the internal clock is not within the preset value range, an abnormal signal of the first watchdog module is sent to the abnormal state handling module. The second counter is used to update the count value corresponding to the external clock when the rising edge of the internal clock is detected; after each preset clock cycle, a clearing operation is performed and the count value before clearing corresponding to the external clock is detected; if the count value before clearing corresponding to the external clock is not within the preset value range, an abnormal signal of the first watchdog module is sent to the abnormal state handling module.

[0009] On the other hand, the second watchdog module includes a first incrementing counter, a low threshold register, and a high threshold register. Specifically, when the watchdog module receives a feeding signal corresponding to the feeding operation, if the count value of the first incrementing counter is not within a preset counting interval, it sends an abnormal signal of the second watchdog module to the abnormal state handling module. The low threshold register is used to store the lower limit value of the preset counting interval, and the high threshold register is used to store the upper limit value of the preset counting interval.

[0010] On the other hand, the third watchdog module includes a second incrementing counter and a fixed threshold register; specifically, when the watchdog module receives the dog-feeding signal corresponding to the dog-feeding operation, if the count value of the second incrementing counter is greater than or equal to the fixed threshold stored in the fixed threshold register, the third watchdog module sends an abnormal signal to the abnormal state handling module.

[0011] On the other hand, the abnormal state processing module is specifically used to count the received abnormal signals; when the count value of the received abnormal signals is greater than the error count threshold, the dedicated integrated circuit and / or the microcontroller unit are reset.

[0012] On the other hand, the reset control of the dedicated integrated circuit and / or the microcontroller unit when the count value of the received abnormal signal is greater than the error count threshold includes: When the count of received abnormal signals exceeds the error count threshold, check whether the configuration parameter in the reset enable configuration register is an enabled parameter. If so, the dedicated integrated circuit is reset and a reset signal is output to the microcontroller unit.

[0013] On the other hand, the watchdog instruction processing module includes a memory, a first sequence index counter, and a second sequence index counter; wherein, the memory is used to store n pairs of preset check sequences and preset response sequences, the preset check sequence including a preset check instruction and a sequence index, the preset response sequence including a preset response instruction and a sequence index, the sequence index in each pair of preset check sequences and preset response sequences is the same, and the sequence index in different pairs of preset check sequences is different; the first sequence index counter is used to store the current sequence index corresponding to the second watchdog module, and the second sequence index counter is used to store the current sequence index corresponding to the third watchdog module; The target watchdog feeding instruction includes a watchdog identifier and a feeding sequence instruction. Specifically, the feeding instruction processing module, when the target feeding instruction is valid, checks whether the target sequence index is the current sequence index in the target sequence index counter. If so, it controls the target watchdog module to perform a feeding operation, returns a target preset response sequence to the microcontroller unit, and updates the current sequence index in the target sequence index counter. The target sequence index is the sequence index in the feeding sequence instruction of the target feeding instruction. The target sequence index counter is the first or second sequence index counter corresponding to the target watchdog module, and the target watchdog module is the second or third watchdog module corresponding to the watchdog identifier. The target preset response sequence is a preset response sequence corresponding to a preset check sequence including the target sequence index.

[0014] On the other hand, updating the current sequence index in the target sequence index counter includes: The current sequence index in the target sequence index counter is updated to the next sequence index according to a preset cyclic increment order; wherein, the preset cyclic increment order is the cyclic increment order of the n sequence indices in the n pairs of preset check sequences and preset response sequences.

[0015] In addition, the present invention also provides an application-specific integrated circuit, including: a watchdog circuit of the application-specific integrated circuit as described above.

[0016] The present invention provides a watchdog circuit for an application-specific integrated circuit (ASIC), comprising: a first watchdog module, a second watchdog module, a third watchdog module, a watchdog feed instruction processing module, and an abnormal state processing module; wherein, the first watchdog module is used to monitor the frequency relationship between the external clock input by the microcontroller unit of the host computer and the internal clock of the ASIC; the second watchdog module is a window-type watchdog architecture, and the third watchdog module is a timeout-type watchdog architecture; the watchdog feed instruction processing module is used to verify the legality of the target watchdog feed instruction sent by the microcontroller unit; if the target watchdog feed instruction is legal, it controls the target watchdog module to perform the watchdog feed operation; wherein, the target watchdog feed instruction is the watchdog feed instruction corresponding to the target watchdog module, and the target watchdog module is the second watchdog module or the third watchdog module; the abnormal state processing module is used to perform reset control on the ASIC and / or the microcontroller unit according to the abnormal signals of the first watchdog module, the second watchdog module, and the third watchdog module respectively.

[0017] As can be seen, this invention utilizes a first watchdog module to monitor the frequency relationship between the external clock input to the microcontroller unit of the host computer and the internal clock of the application-specific integrated circuit (ASIC). It utilizes a second and third watchdog module to monitor the correctness of different watchdog timing sequences, and a watchdog instruction processing module to monitor the legality of the watchdog instructions from the second and third watchdog modules. Through the collaborative work of these modules, comprehensive monitoring of clock synchronization, watchdog timing correctness, and instruction legality is achieved, covering the blind spots of single-dimensional monitoring in related technologies and improving the operational reliability of ASIC chips in embedded systems. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a structural block diagram of a watchdog circuit for an application-specific integrated circuit provided in an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a watchdog circuit for another application-specific integrated circuit provided in an embodiment of the present invention; Figure 3 This is a structural diagram of a clock monitoring unit for a first watchdog module provided in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating an effective window of a second watchdog module and the generation of a watchdog feeding error, provided in an embodiment of the present invention. Figure 5 This is a schematic diagram illustrating the counting and feeding mechanism of two built-in counters in a second watchdog module provided in an embodiment of the present invention. Figure 6 This is a schematic diagram of feeding a dog in a third watchdog module provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the watchdog circuit feeding process provided in an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Please refer to Figure 1 , Figure 1 This is a structural block diagram of a watchdog circuit for a dedicated integrated circuit provided in an embodiment of the present invention. The watchdog circuit includes: a first watchdog module 10, a second watchdog module 20, a third watchdog module 30, a watchdog feed command processing module 40, and an abnormal state processing module 50; Among them, the first watchdog module 10 is used to monitor the frequency relationship between the external clock input of the microcontroller unit of the host computer and the internal clock of the application-specific integrated circuit; the second watchdog module 20 is a window-type watchdog architecture, and the third watchdog module 30 is a timeout-type watchdog architecture. The watchdog instruction processing module 40 is used to verify the legality of the target watchdog instruction sent by the microcontroller unit; if the target watchdog instruction is legal, it controls the target watchdog module to perform the watchdog operation; wherein, the target watchdog instruction is the watchdog instruction corresponding to the target watchdog module, and the target watchdog module is the second watchdog module 20 or the third watchdog module 30. The abnormal state handling module 50 is used to reset the application-specific integrated circuit and / or microcontroller unit according to the abnormal signals of the first watchdog module 10, the second watchdog module 20 and the third watchdog module 30.

[0022] It is understood that the first watchdog module 10 in this embodiment can serve as a clock synchronization monitoring unit, used to monitor the external clock (CLK_EXT, e.g., input from the microcontroller unit (MCU) of the host computer). Figure 2 The frequency relationship (i.e., clock synchronization) between the input clock of the host computer MCU and the internal clock (i.e., the internal reference clock) of the application-specific integrated circuit (ASIC) is defined as the correspondence between the frequencies of the external clock and the internal clock. This relationship is used to send a corresponding abnormal signal to the abnormal state handling module 50 when the frequency relationship is abnormal (e.g., the frequency change exceeds a threshold and / or the difference between the two frequencies exceeds a threshold). In other words, as... Figure 2 As shown, the two input terminals of the first watchdog module 10 (watchdog 1) can be connected to the external clock output terminal of the MCU of the host computer and the internal clock output terminal of the application-specific integrated circuit (ASIC), respectively, to receive the two clock signals: the external clock input from the MCU of the host computer and the internal clock generated by the ASIC. The output terminal of the first watchdog module 10 can be connected to the input terminal of the abnormal state handling module 50 to send the abnormal signal of the first watchdog module 10 (such as...) to the abnormal state handling module 50. Figure 2 Overflow and underflow signals in (the data).

[0023] Correspondingly, the specific structure of the first watchdog module 10 in this embodiment, that is, the specific method by which the first watchdog module 10 monitors the frequency relationship between the external clock and the internal clock, can be set by the designer according to the practical scenario and user needs. For example, the first watchdog module 10 can use a bidirectional counting mechanism to monitor the frequency relationship between the external clock and the internal clock to accurately detect the clock frequency offset. Compared with a single clock monitoring scheme (such as counting the external clock and the internal clock separately), it can significantly improve the clock synchronization reliability in heterogeneous systems. For example, the first watchdog module 10 may include: a bidirectional counter for cross-counting the external clock and the internal clock; if the count value corresponding to any monitored clock signal within a preset clock period is not within the corresponding pre-designed value range, an abnormal signal of the first watchdog module 10 is sent to the abnormal state processing module 50; wherein, the monitored clock signal includes the external clock and the internal clock.

[0024] Correspondingly, the bidirectional counter built into the first watchdog module 10 can cross-count two clock signals (i.e., external clock and internal clock), and the count value can be dynamically adjusted through the configuration register. The preset clock period can be a pre-set count value reset period, that is, when the count values ​​corresponding to both the external clock and the internal clock are within the pre-designed value range within the preset clock period, the count value can be reset; the preset clock period can be adjusted through programming. The pre-designed value range can be a preset threshold ± a preset percentage (e.g., 5%); when the count value corresponding to any monitoring clock signal is not within the corresponding pre-designed value range within the preset clock period, the bidirectional counter can generate an overflow or underflow signal, triggering the clock abnormality flag bit and sending an abnormal signal from the first watchdog module 10 to the abnormal state handling module 50.

[0025] The specific method by which the bidirectional counter performs cross-counting of the external and internal clocks can be set by the designer. For example, the bidirectional counter may include a first counter and a second counter. The first counter is used to update the count value corresponding to the internal clock when the rising edge of the external clock is detected. After each preset clock cycle, a clearing operation is performed and the count value before clearing corresponding to the internal clock is checked. If the count value before clearing corresponding to the internal clock is not within the preset value range, an abnormal signal of the first watchdog module 10 is sent to the abnormal state handling module 50. The second counter is used to update the count value corresponding to the external clock when the rising edge of the internal clock is detected. After each preset clock cycle, a clearing operation is performed and the count value before clearing corresponding to the external clock is checked. If the count value before clearing corresponding to the external clock is not within the preset value range, an abnormal signal of the first watchdog module 10 is sent to the abnormal state handling module 50.

[0026] For example, such as Figure 3 As shown, after power-on initialization, the first watchdog module 10 performs mutual frequency division (e.g., frequency reduction) and synchronization operations on the external clock (CLK_EXT) and internal clock (CLK_INT) respectively to facilitate subsequent cross-counting. The two built-in counters (i.e., the first counter and the second counter) of the first watchdog module 10 perform cross-counting of CLK_EXT and CLK_INT: when the rising edge of CLK_EXT arrives, CLK_INT is counted; when the rising edge of CLK_INT arrives, CLK_EXT is counted. Every T_CLR cycle (i.e., the preset clock cycle), the counter performs a clearing operation and checks the count value before clearing: if the count value exceeds the TH_CLK range (i.e., the pre-designed value range), the overflow (i.e., greater than the upper limit of the TH_CLK range) or underflow flag (i.e., less than the lower limit of the TH_CLK range) is set and sent to the abnormal state handling module 50.

[0027] The specific number and type of abnormal signals sent by the first watchdog module 10 to the abnormal state handling module 50 when the frequency relationship between the external clock and the internal clock changes can be set by the designer according to the practical scenario and user requirements. For example, the abnormal signal of the first watchdog module 10 can be a synchronization abnormal signal, or it can include overflow and underflow signals. This embodiment does not impose any restrictions on this.

[0028] It should be noted that the second watchdog module 20 in this embodiment can be a window-type watchdog architecture, that is, when the second watchdog module 20 receives the feeding signal corresponding to the feeding operation, if the count value is not within the valid window (i.e., the preset counting interval, such as...) Figure 3 If the feeding window time is specified, then the second watchdog module 20 (e.g., during the exception handling module 50) is sent to the exception handling module 50. Figure 2 Abnormal signals from the watchdog (2) in the system. For example... Figure 2 As shown, the counting input terminal of the second watchdog module 20 (watchdog 2) can be connected to the internal clock (CLK_INT) output terminal of the dedicated integrated circuit to use the internal clock as the counting clock for its internal counter, and count based on the internal clock; the feeding signal input terminal of the second watchdog module 20 can be connected to the first feeding signal output terminal of the feeding instruction processing module 40 to receive the feeding signal corresponding to the feeding operation sent by the feeding instruction processing module 40 (such as...). Figure 2 The output of the second watchdog module 20 can be connected to the input of the abnormal state handling module 50 to send an abnormal signal (such as the watchdog 2 feeding signal) to the abnormal state handling module 50. Figure 2 Overflow and underflow signals in (the data).

[0029] Correspondingly, the specific structure of the second watchdog module 20 in this embodiment can be customized by the designer according to the practical scenario and user requirements. For example, the second watchdog module 20 may include a first increment counter, a low threshold register, and a high threshold register. Specifically, when the watchdog module 20 receives a watchdog signal corresponding to a watchdog feeding operation, if the count value of the first increment counter is not within a preset counting interval, it sends an exception signal of the second watchdog module 20 to the exception state handling module 50. The low threshold register is used to store the lower limit value of the preset counting interval, and the high threshold register is used to store the upper limit value of the preset counting interval. That is, the watchdog feeding signal can only effectively clear the first increment counter when it arrives within the interval COUNT_WIN∈[W_LOW, W_HIGH]. An underflow exception occurs before this interval, and an overflow exception occurs after this interval. COUNT_WIN can be the count value of the first increment counter. The interval [W_LOW, W_HIGH] can be the preset counting interval, where W_LOW and W_HIGH are the lower and upper limits of the preset counting interval, respectively.

[0030] Furthermore, in this embodiment, the second watchdog module 20 can adopt a dual-counter alternating reset design to further enhance the accuracy of watchdog timing monitoring and reduce the risk of misjudgment caused by a single counter malfunction. That is, the first incrementing counter can include a third counter and a fourth counter; the third counter is reset to zero when the number of watchdog signal received by the second watchdog module 20 is odd; the fourth counter is reset to zero when the number of watchdog signal received by the second watchdog module 20 is even. When the second watchdog module 20 receives a watchdog signal corresponding to a watchdog operation, if the third counter or the fourth counter is not within a preset counting range, it sends an abnormal signal to the abnormal state processing module 50. For example, if a watchdog command is received when the count value of the third counter or the fourth counter is less than W_LOW, an underflow abnormal signal is generated; if a watchdog command is not received when the count value of the third counter or the fourth counter is greater than W_HIGH, an overflow abnormal signal is generated.

[0031] For example, such as Figure 4 and Figure 5 As shown, after the second watchdog module 20 is initialized, counter 1 (i.e., the third counter) increments from 0, while counter 2 (i.e., the fourth counter) remains at 0. When the count reaches W_LOW, the watchdog module enters the active window; when it reaches W_HIGH, it exits the active window. After receiving the watchdog feed instruction corresponding to the second watchdog module 20 from the MCU of the host computer, the watchdog feed instruction processing module 40 verifies the validity of the instruction, generates and sends the corresponding watchdog feed signal (e.g., ...) to the second watchdog module 20. Figure 2The watchdog feeding signal of the watchdog 2 in ); The second watchdog module 20 clears the count value of the counter 1 when receiving the watchdog feeding signal for the first time, and starts the counter 2 to increment the count from 0; The second time it receives the watchdog feeding signal, it clears the count value of the counter 2, and the third time it clears the count value of the counter 1 again, and so on alternately; If a watchdog feeding signal is received when any of the count values in the counter 1 and the counter 2 is <W_LOW, an underflow exception signal is generated; If no corresponding watchdog feeding signal is received when any of the count values in the counter 1 and the counter is >W_HIGH, an overflow exception is generated, and the overflow or underflow flag is set correspondingly and sent to the exception status processing module 50.

[0032] Similarly, for the specific quantity and type of the exception signals of the second watchdog module 20 sent to the exception status processing module 50, the designer can set them according to the practical scenario and user requirements. For example, the exception signal of the second watchdog module 20 can be a watchdog feeding exception signal, and the exception signal of the second watchdog module 20 can also include an overflow exception signal and an underflow exception signal. This embodiment does not make any restrictions on this.

[0033] Among them, the third watchdog module 30 in this embodiment can be a timeout watchdog architecture, that is, when the third watchdog module 30 receives the watchdog feeding signal corresponding to the watchdog feeding operation, if the count value is greater than the preset threshold (i.e., the fixed threshold), it sends an exception signal of the third watchdog module 30 (such as Figure 2 the watchdog 3 in ). Such as Figure 2 As shown, the count input end of the third watchdog module 30 (watchdog 3) can be connected to the output end of the internal clock (CLK_INT) of the application-specific integrated circuit to use the internal clock as the counting clock of its internal counter and perform counting based on the internal clock; The watchdog feeding signal input end of the third watchdog module 30 can be connected to the second watchdog feeding signal output end of the watchdog feeding instruction processing module 40 to receive the watchdog feeding signal corresponding to the watchdog feeding operation sent by the watchdog feeding instruction processing module 40 (such as Figure 2 the watchdog 3 feeding signal in ); The output end of the third watchdog module 30 can be connected to the input end of the exception status processing module 50 to send an exception signal of the third watchdog module 3 to the exception status processing module 50.

[0034] Correspondingly, for the specific structure of the third watchdog module 30 in this embodiment, it can be set by the designer according to the practical scenario and user requirements. For example, the third watchdog module 30 may include a second increment counter and a fixed threshold register. Specifically, the third watchdog module 30 is configured to, when receiving a watchdog feeding signal corresponding to a watchdog feeding operation, if the count value of the second increment counter is greater than or equal to the fixed threshold stored in the fixed threshold register, send an exception signal of the third watchdog module 30 to the exception status processing module 50. That is to say, the watchdog feeding signal needs to arrive when COUNT_FIX < T_FIX to effectively clear the second increment counter; when no valid watchdog feeding instruction is detected when COUNT_FIX ≥ T_FIX, an overflow exception signal (i.e., the exception signal of the third watchdog module 30) is generated; COUNT_FIX may be the count value of the second increment counter; T_FIX may be the fixed threshold.

[0035] For example, Figure 6 As shown, after the third watchdog module 30 is initialized, the count value (COUNT_FIX) of the second increment counter starts incrementing from 0; after verifying the watchdog feeding instruction corresponding to the third watchdog module 30 sent by the MCU, the watchdog feeding instruction processing module 40 generates and sends a watchdog feeding signal corresponding to the watchdog feeding operation to the third watchdog module 30 (such as Figure 2 the watchdog 3 feeding signal in); if the watchdog feeding signal is received when COUNT_FIX < T_FIX, the second increment counter is cleared; if no valid watchdog feeding signal is received when COUNT_FIX reaches T_FIX, an overflow exception is generated, and the overflow flag is set and sent to the exception status processing module 50.

[0036] It can be understood that the watchdog feeding instruction processing module 40 in this embodiment can perform legality verification on the watchdog feeding instruction sent by the MCU of the upper computer for controlling the second watchdog module 20 to perform a watchdog feeding operation and the watchdog feeding instruction for controlling the third watchdog module 30 to perform a watchdog feeding operation. When the watchdog feeding instruction is legal, it controls the corresponding watchdog module (i.e., the second watchdog module 20 or the third watchdog module 30) to perform a watchdog feeding operation. That is to say, the MCU of the upper computer can send a watchdog feeding instruction for controlling the second watchdog module 20 to perform a watchdog feeding operation to the watchdog feeding instruction processing module 40, so as to control the second watchdog module 20 to perform a watchdog feeding operation after the watchdog feeding instruction processing module 40 verifies that the watchdog feeding instruction is legal; the MCU of the upper computer can also send a watchdog feeding instruction for controlling the third watchdog module 30 to perform a watchdog feeding operation to the watchdog feeding instruction processing module 40, so as to control the third watchdog module 30 to perform a watchdog feeding operation after the watchdog feeding instruction processing module 40 verifies that the watchdog feeding instruction is legal.

[0037] Correspondingly, the specific method by which the watchdog instruction processing module 40 verifies the legality of a certain watchdog instruction (i.e., the target watchdog instruction) sent by the microcontroller unit can be set by the designer according to the practical scenario and user needs. For example, the target watchdog instruction may include a watchdog identifier and a fixed watchdog instruction. The watchdog instruction processing module 40 can determine that the target watchdog instruction is legal when the fixed watchdog instruction in the target watchdog instruction is a preset watchdog instruction, or when the fixed watchdog instruction is a preset watchdog instruction and the watchdog identifier is any preset identifier; otherwise, it determines that the target watchdog instruction is illegal. Among them, the watchdog identifier can be used to distinguish whether the instruction is used to control the watchdog operation of the second watchdog module 20 or the third watchdog module 30. That is, the preset identifier may include the identifier (such as address or ID code) corresponding to the second watchdog module 20 and the identifier corresponding to the third watchdog module 30.

[0038] Furthermore, the watchdog feeding instruction processing module 40 can adopt a multi-pair (i.e., n pairs) rotating check-response sequence mechanism. Compared with the fixed instruction watchdog feeding method, this can significantly reduce the risk of false triggering caused by random interference and improve the security of the watchdog feeding operation. For example, the watchdog feeding instruction processing module 40 includes a memory, a first sequence index counter, and a second sequence index counter. The memory is used to store n pairs of preset check sequences and preset response sequences. The preset check sequence includes a preset check instruction and a sequence index, and the preset response sequence includes a preset response instruction and a sequence index. The sequence indexes in each pair of preset check sequences and preset response sequences are the same, and the sequence indices in different pairs of preset check sequences are different. The first sequence index counter is used to store the current sequence index corresponding to the second watchdog module 20, and the second sequence index counter is used to store the current sequence index corresponding to the third watchdog module 30. n is a positive integer greater than or equal to 2.

[0039] The target watchdog instruction includes a watchdog identifier and a watchdog sequence instruction. The watchdog instruction processing module 40 is specifically used to, when the target watchdog instruction is valid, check whether the target sequence index is the current sequence index in the target sequence index counter; if so, it controls the target watchdog module to perform the watchdog operation and returns a target preset response sequence (such as...) to the microcontroller unit. Figure 2The system returns a response sequence to the host MCU and updates the current sequence index in the target sequence index counter. The target sequence index is the sequence index in the watchdog feed instruction. The target sequence index counter is the first or second sequence index counter corresponding to the target watchdog module. The target watchdog module is the second watchdog module 20 or the third watchdog module 30 corresponding to the watchdog identifier. The target preset response sequence is the preset response sequence corresponding to the preset check sequence that includes the target sequence index. For example, when n is 8, the memory in the dog feeding instruction processing module 40 can store 8 pairs of preset check sequences (CHECK_WORD [0 to 7]) and preset response sequences (RESPONSE_WORD [0 to 7]), namely CHECK_WORD [0] and RESPONSE_WORD [0], ..., CHECK_WORD [7] and RESPONSE_WORD [7]; the count value (INDEX2, i.e., the current sequence index) stored in the first sequence index counter can be any value from 0 to 7; the count value (INDEX3, i.e., the current sequence index) stored in the second sequence index counter can be any value from 0 to 7; CHECK_WORD can be a preset check instruction, and RESPONSE_WORD can be a preset response instruction.

[0040] Correspondingly, when the target sequence index is not the current sequence index in the target sequence index counter, the dog-feeding instruction processing module 40 can send an exception signal (e.g., ...) to the exception state processing module 50. Figure 2 (Watchdog 2 sequence error signal or watchdog 3 sequence error signal in the watchdog). The abnormal state processing module 50 can be used to reset the application-specific integrated circuit and / or microcontroller unit according to the abnormal signals of the first watchdog module 10, the second watchdog module 20, the third watchdog module 30 and the watchdog feeding instruction processing module 40.

[0041] Correspondingly, the specific method for updating the current sequence index in the target sequence index counter, i.e., the specific looping method of the count values ​​in the first and second sequence index counters, can be set by the designer according to the practical scenario and user needs. For example, the current sequence index in the target sequence index counter can be updated to the next sequence index according to the preset cyclic incrementing order; where the preset cyclic incrementing order is the cyclic incrementing order of n sequence indices in the preset check sequence and preset response sequence.

[0042] For example, when n is 8, the memory in the watchdog feed instruction processing module 40 can be two independent register sequences: storing CHECK_WORD [0 to 7] and RESPONSE_WORD [0 to 7]; the watchdog feed instruction processing module 40 can maintain independent sequence index counters for watchdog 2 and watchdog 3 respectively: a first sequence index counter and a second sequence index counter, with an initial index value of 0 and a maximum value of 7; the watchdog feed instruction processing module 40 can distinguish whether the instruction controls the watchdog 2 or 3 feed operation based on the address (i.e., watchdog identifier) ​​in the target watchdog feed instruction sent by the MCU of the host computer; the MCU of the host computer sends CHECK_WORD [INDEXm] to the watchdog feed instruction processing module 40 to control the corresponding watchdog m (n=2 or 3); after receiving the corresponding watchdog feed, watchdog m returns RESPONSE_WORD [INDEXm], and the target sequence index counter (i.e., the first sequence index counter or the second sequence index counter) corresponding to watchdog m automatically increments: INDEXm=(INDEXm + 1) When INDEXm is 7, the value will be 0 after the next increment; when the sequence index (i.e. the target sequence index) in the received dog feed sequence instruction does not match the current sequence index (INDEXm) in the target sequence index counter, an instruction sequence error signal (i.e., the abnormal signal of the dog feed instruction processing module 40) is generated.

[0043] It should be noted that the abnormal state handling module 50 in this embodiment can be responsible for error counting and reset control. That is, the abnormal state handling module 50 can perform reset control on the dedicated integrated circuit and / or microcontroller unit based on the abnormal signals received from the first watchdog module 10, the second watchdog module 20, the third watchdog module 30, and the watchdog feeding command processing module 40, such as... Figure 2 As shown, the ASIC reset signal is output to control the reset of the dedicated integrated circuit, and a reset signal (host computer MCU reset signal) is output to the microcontroller unit to control the MCU reset.

[0044] Correspondingly, the specific method for error counting and reset control by the abnormal state handling module 50 in this step can be set by the designer according to the practical scenario and user needs. For example, the abnormal state handling module 50 can be specifically used to count the received abnormal signals; when the count value of the received abnormal signal is greater than the error count threshold, the application-specific integrated circuit and / or microcontroller unit is reset. In other embodiments, the abnormal state handling module 50 can also count different types of abnormal signals (such as abnormal signals sent by different modules) separately; when the count value of a certain type of abnormal signal is greater than the corresponding error count threshold, the corresponding processing operation (such as reset control) is triggered; so as to realize a hierarchical error response mechanism by using independent error counting and cumulative judgment logic, avoiding system overreaction caused by a single error, and realizing accurate error management. For example, the abnormal state handling module 50 may include three error counters (i.e., a first error counter, a second error counter, and a third error counter). The first error counter records the number of times abnormal signals sent by the first watchdog module 10 are received. The second error counter records the number of times abnormal signals sent by the second watchdog module 20 and the number of times sequence error signals of the second watchdog module 20 sent by the abnormal state handling module 50 are received. The third error counter records the number of times abnormal signals sent by the third watchdog module 30 and the number of times sequence error signals of the third watchdog module 30 sent by the abnormal state handling module 50 are received. The abnormal state handling module 50 may perform a reset control on the application-specific integrated circuit and / or microcontroller unit when the count value of any error counter exceeds the error count threshold. This embodiment does not impose any limitations on this.

[0045] Furthermore, in this embodiment, the abnormal state handling module 50 can determine whether to perform reset control based on the configuration parameter (RST_EN) in the reset enable configuration register. As described above, the process of resetting the dedicated integrated circuit and / or microcontroller unit when the count value of the received abnormal signal exceeds the error count threshold can include: when the count value of the received abnormal signal exceeds the error count threshold, detecting whether the configuration parameter in the reset enable configuration register is an enabled parameter; if yes, controlling the dedicated integrated circuit to reset and outputting a reset signal to the microcontroller unit; if no, the process can end to continue counting the received abnormal signals.

[0046] For example, the abnormal state handling module 50 may include an error counter and a reset enable configuration register; the abnormal state handling module 50 may trigger an error reset flag when the count value of the error counter is greater than 3; based on the error reset flag, it may detect the configuration parameters in the reset enable configuration register and decide whether to perform reset control on the dedicated integrated circuit and the microcontroller unit. If the configuration parameter is an enable parameter (such as 1), the dedicated integrated circuit and the microcontroller unit will be reset; if the configuration parameter is not an enable parameter (such as 1), the process will end and the dedicated integrated circuit and the microcontroller unit will not be reset.

[0047] For example, such as Figure 7As shown, the watchdog circuit's watchdog sequence verification process and exception handling process are as follows, including: 1) During initialization, INDEX2 and INDEX3 are both set to 0; 2) The host computer's MCU needs to send a CHECK_WORD [0] carrying the address for the first watchdog feed, i.e., a watchdog feed instruction; 3) The watchdog feed instruction processing module 40 will determine whether the instruction is applied to watchdog 2 (i.e., the second watchdog module 20) or watchdog 3 (i.e., the third watchdog module 30) based on the address carried by the watchdog feed instruction (i.e., the target watchdog feed instruction) sent by the host computer's MCU; 4) The watchdog feed instruction processing module 40 determines whether the watchdog feed sequence instruction is correct, i.e., whether it is equal to the preset CHECK_WORD. [0]; If an error occurs, the sequence error of watchdog 2 or 3 is set and output to the exception state handling module 50; If correct, the watchdog feeding operation is performed; 5) When the watchdog feeding instruction processing module 40 performs the watchdog 2 feeding operation, it determines whether the watchdog 2 counter is within the valid window. If not, an overflow or underflow error is generated and output to the exception state handling module 50; If it is, the watchdog is fed correctly and the counter is cleared; When the watchdog feeding instruction processing module 40 performs the watchdog 3 feeding operation, it determines whether the watchdog 3 counter is greater than the fixed threshold. If it is greater, an overflow error is generated and output to the exception state handling module 50; If it is not greater, the watchdog is fed correctly and the counter is cleared; 6) After the watchdog feeding is completed, INDEXm is incremented by 1, and the watchdog feeding instruction processing module 40 returns the target preset response sequence, such as RESPONSE_WORD [0]. Subsequent watchdog feedings need to send the corresponding CHECK_WORD in the INDEXm loop order. [INDEXm]; When INDEXm is 7, the value will be 0 after the next increment; If the transmission sequence does not match, an instruction error will be generated, and the error will be counted in the error counter of the corresponding watchdog; 7) The abnormal state handling module 50 monitors abnormal signals in real time, including: overflow and underflow errors of watchdog 1 (i.e., the first watchdog), overflow and underflow errors and sequence errors of watchdog 2 and overflow and sequence errors of watchdog 3; When any abnormal signal is detected, the corresponding error counter is incremented by 1; When the cumulative error count of any error counter is >3, if the configuration parameter in the reset enable configuration register is an enable parameter, the ASIC chip is reset and a reset signal is output to the MCU; After the system returns to normal, the error counter can be reset by writing clear command.

[0048] In this embodiment, the present invention utilizes a first watchdog module 10 to monitor the frequency relationship between the external clock input to the microcontroller unit of the host computer and the internal clock of the application-specific integrated circuit (ASIC). It utilizes a second watchdog module 20 and a third watchdog module 30 to monitor the correctness of different watchdog timing sequences, and a watchdog instruction processing module 40 to monitor the legality of the watchdog instructions from the second and third watchdog modules 20 and 30. Through the collaborative work of these modules, comprehensive monitoring of clock synchronization, watchdog timing correctness, and instruction legality is achieved, covering the blind spots of single-dimensional monitoring in related technologies and improving the operational reliability of ASIC chips in embedded systems.

[0049] Corresponding to the watchdog circuit embodiment above, this embodiment of the invention also provides an application-specific integrated circuit (ASIC). The ASIC described below and the watchdog circuit of the ASIC described above can be referred to in correspondence.

[0050] An application-specific integrated circuit (ASIC) includes a watchdog circuit for the ASIC as described in the above embodiments.

[0051] The application-specific integrated circuit provided in this embodiment can be an ASIC chip.

[0052] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the application-specific integrated circuits disclosed in the embodiments, since they correspond to the watchdog circuits disclosed in the embodiments, the description is relatively simple; relevant parts can be found in the method section.

[0053] The present invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of these embodiments are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the present invention.

Claims

1. A watchdog circuit for a special-purpose integrated circuit, characterized by The application relates to a watchdog module for a micro control unit (MCU) and a special integrated circuit (ASIC), and belongs to the field of watchdog technology. The watchdog module comprises a first watchdog module, a second watchdog module, a third watchdog module, a watchdog feeding instruction processing module and an abnormal state processing module. The first watchdog module is used for monitoring the frequency relationship between the external clock input by the MCU and the internal clock of the ASIC; the second watchdog module is a window type watchdog architecture, and the third watchdog module is a timeout type watchdog architecture. The watchdog feeding instruction processing module is used for verifying the legality of the target watchdog feeding instruction sent by the MCU; if the target watchdog feeding instruction is legal, the target watchdog module is controlled to execute the watchdog feeding operation; the target watchdog feeding instruction is the watchdog feeding instruction corresponding to the target watchdog module, and the target watchdog module is the second watchdog module or the third watchdog module. The abnormal state processing module is used for resetting the MCU and / or the ASIC according to the abnormal signals of the first watchdog module, the second watchdog module and the third watchdog module.

2. A watchdog circuit for a special-purpose integrated circuit as recited in claim 1, wherein, The first watchdog module comprises a bidirectional counter. The bidirectional counter comprises a first counter and a second counter.

3. A watchdog circuit for a special-purpose integrated circuit as recited in claim 2, wherein, The first counter is used for updating the count value corresponding to the internal clock when the rising edge of the external clock is detected; the zero clearing operation is executed and the count value before zero clearing corresponding to the internal clock is detected every preset clock period; if the count value before zero clearing corresponding to the internal clock is not in the preset count value range, the abnormal signal of the first watchdog module is sent to the abnormal state processing module. The second counter is used for updating the count value corresponding to the external clock when the rising edge of the internal clock is detected; the zero clearing operation is executed and the count value before zero clearing corresponding to the external clock is detected every preset clock period; if the count value before zero clearing corresponding to the external clock is not in the preset count value range, the abnormal signal of the first watchdog module is sent to the abnormal state processing module. The second watchdog module comprises a first incrementing counter, a low threshold register and a high threshold register; the second watchdog module is specifically used for sending the abnormal signal of the second watchdog module to the abnormal state processing module if the count value of the first incrementing counter is not in the preset count interval when the watchdog feeding signal corresponding to the watchdog feeding operation is received; the low threshold register is used for storing the lower limit value of the preset count interval, and the high threshold register is used for storing the upper limit value of the preset count interval.

4. The dedicated integrated circuit watchdog circuit of claim 1, wherein, ​ 5. The dedicated integrated circuit watchdog circuit of claim 1, wherein, The third watchdog module comprises a second incrementing counter and a fixed threshold register; the third watchdog module is specifically configured to, when a feed dog signal corresponding to the feed dog operation is received, send an exception signal of the third watchdog module to the exception state processing module if a count value of the second incrementing counter is greater than or equal to a fixed threshold value stored in the fixed threshold register.

6. The dedicated integrated circuit watchdog circuit of claim 1, wherein, The exception state processing module is specifically configured to count the received exception signals; and when a count value of the received exception signals is greater than an error times threshold value, perform reset control on the application specific integrated circuit and / or the micro control unit.

7. A watchdog circuit for a special-purpose integrated circuit as recited in claim 6, wherein, The reset control on the application specific integrated circuit and / or the micro control unit when the count value of the received exception signals is greater than the error times threshold value comprises: When the count value of the received exception signals is greater than the error times threshold value, detecting whether a configuration parameter in a reset enable configuration register is an enable parameter; If yes, controlling the application specific integrated circuit to reset and outputting a reset signal to the micro control unit.

8. A watchdog circuit for a special-purpose integrated circuit as defined in any one of claims 1 to 7, characterized by The feed dog instruction processing module comprises a memory, a first sequence index counter and a second sequence index counter; the memory is configured to store n pairs of preset check sequences and preset response sequences, the preset check sequence comprises a preset check instruction and a sequence index, the preset response sequence comprises a preset response instruction and a sequence index, the sequence indexes in each pair of the preset check sequence and the preset response sequence are the same, and the sequence indexes in different pairs of the preset check sequence are different; the first sequence index counter is configured to store a current sequence index corresponding to the second watchdog module, and the second sequence index counter is configured to store a current sequence index corresponding to the third watchdog module. The target feed dog instruction comprises a watchdog identifier and a feed dog sequence instruction; the feed dog instruction processing module is specifically configured to, when the target feed dog instruction is legal, detect whether a target sequence index is a current sequence index in a target sequence index counter; if yes, control the target watchdog module to perform a feed dog operation, return a target preset response sequence to the micro control unit, and update the current sequence index in the target sequence index counter; the target sequence index is a sequence index in the feed dog sequence instruction in the target feed dog instruction; the target sequence index counter is a first sequence index counter or a second sequence index counter corresponding to the target watchdog module; the target watchdog module is a second watchdog module or a third watchdog module corresponding to the watchdog identifier; and the target preset response sequence is a preset response sequence corresponding to a preset check sequence comprising the target sequence index.

9. A watchdog circuit for a special-purpose integrated circuit as recited in claim 8, wherein, The updating of the current sequence index in the target sequence index counter comprises: updating the current sequence index in the target sequence index counter to a next sequence index in a preset cyclic incrementing order; the preset cyclic incrementing order is a cyclic incrementing order of n sequence indexes in the n pairs of preset check sequences and preset response sequences.

10. An application specific integrated circuit, comprising: The application specific integrated circuit comprises: The watchdog circuit of the application specific integrated circuit according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for detecting exceptions of application layers of android systems

    CN108304275A

  • Watchdog circuit

    CN116431377A

  • Processing method and device for preventing internal process of hardware from running away based on watchdog

    CN116521421A

  • Watchdog feeding method, device and equipment and medium

    CN117093249A

  • Watchdog timer device

    US20230236914A1