A method and apparatus for fault detection based on a hardware event system

CN123030446APending Publication Date: 2026-11-03EDGELESS SEMICON CO LTD OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610965643.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

In existing technologies, hardware event systems are prone to signal loss when transmitting pulse signals, resulting in cumbersome and inefficient fault detection, making it impossible to achieve efficient fault location based on existing hardware.

Method used

By using a comparator and digital-to-analog converter integrated within the chip in the hardware event system, the voltage of the event signal is compared with the threshold voltage in real time to achieve fault detection and promptly trigger interrupts or alarms to report event loss.

Benefits of technology

It enables real-time monitoring of invisible event signals inside the chip, quickly distinguishes fault sources, reduces fault location time, and improves the repair efficiency of computers and auxiliary equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030446A_ABST
    Figure CN123030446A_ABST
Patent Text Reader

Abstract

The application provides a fault detection method and device based on a hardware event system, belongs to the technical field of next-generation information network industry of a new generation of information technology industry, and comprises the following steps: receiving an event signal sent by a first functional unit; sending the event signal to a second functional unit; inputting the voltage of the event signal into a first input end of a comparator and inputting a threshold voltage into a second input end of the comparator; obtaining a comparison result output by an output end of the comparator; and determining a fault detection result according to the comparison result. The method realizes real-time monitoring of an event signal that is invisible inside a chip, compares the voltage of the event signal with the threshold voltage by using the comparator when the event signal is transmitted, triggers an interruption or an alarm in time to feed back event loss when the signal voltage is lower than the threshold value, and can quickly distinguish a fault source according to the comparison result, thereby reducing fault positioning time and improving the efficiency of computer and auxiliary equipment repair in the next-generation information network industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of next-generation information network technology in the new generation of information technology industry, and in particular relates to a fault detection method and device based on a hardware event system. Background Technology

[0002] With the rapid development of next-generation information network technologies in the new generation of information technology industry, the requirements for internal data processing and communication capabilities of various intelligent terminals, communication equipment, and industrial control systems are constantly increasing. As the core control unit of the equipment, the signal transmission efficiency and reliability between different functional modules of the embedded system are key factors affecting the overall performance.

[0003] In embedded system design, a hardware event system (PES) serves as an internal signal transmission mechanism, replacing external pin connections to reduce signal transmission delay and interference, lower bus load, and achieve efficient communication between peripherals. Peripherals can send pulse signals to the PES, which can then receive and forward these signals. However, as an intermediary, the hardware event system may encounter pulse signal loss issues during signal transmission.

[0004] In existing technologies, when the loss of pulse signals causes abnormal system function, engineers can perform fault detection. During the fault analysis phase, engineers need to spend a lot of time locating the fault source by elimination, such as testing peripherals and software configurations, which is a cumbersome and inefficient process. Summary of the Invention

[0005] In view of the above problems, a fault detection method and apparatus based on a hardware event system are proposed to overcome or at least partially solve the above problems, comprising: In a first aspect, the present invention provides a fault detection method based on a hardware event system, wherein the hardware event system is used to transmit events between multiple functional units, wherein the functional units are integrated within a chip and connected to a central processing unit via a bus, and the method includes: Receive event signals sent by the first functional unit to the second functional unit; The event signal is sent to the second functional unit; The voltage of the event signal is input to the first input terminal of the comparator integrated inside the chip, and the threshold voltage output by the digital-to-analog converter integrated inside the chip is input to the second input terminal of the comparator. Obtain the comparison result output from the output terminal of the comparator; wherein, the comparison result is the comparison result between the voltage of the event signal and the threshold voltage; Based on the comparison results, the fault detection result of the hardware event system is determined.

[0006] Optionally, based on the comparison result, the fault detection result of the hardware event system is determined, including: If the comparison result indicates that the voltage of the event signal is greater than or equal to the threshold voltage, the hardware event system is determined to be working normally. If the comparison result indicates that the voltage of the event signal is less than the threshold voltage, it is determined that the hardware event system has experienced an event loss fault.

[0007] Optionally, the method further includes: If the hardware event system is determined to have experienced an event loss failure, an interrupt signal is generated to trigger the fault handling procedure.

[0008] Optionally, the threshold voltage output from the digital-to-analog converter integrated within the chip is input to the second input terminal of the comparator, including: Obtain the expected value of the threshold voltage and the reference voltage inside the chip; Based on the reference voltage and the desired value, the digital input code of the digital-to-analog converter integrated inside the chip is determined, and the digital input code is written into the data register of the digital-to-analog converter so that the digital-to-analog converter outputs the threshold voltage to the second input terminal of the comparator.

[0009] Optionally, obtaining the expected value of the threshold voltage includes: Determine the low-level voltage and high-level voltage of the event signal; Based on the low-level voltage and the high-level voltage, an expected value of the threshold voltage is determined; wherein the expected value is greater than the low-level voltage and less than the high-level voltage.

[0010] Optionally, before receiving the event signal sent by the first functional unit to the second functional unit, the method further includes: Configure the first functional unit as the host source of the hardware event system, and set the event type sent by the host source to the hardware event system; Configure the second functional unit as a slave source of the hardware event system, and set the slave source to receive event signals from a designated channel of the hardware event system; The comparator integrated within the chip is configured as the monitoring source of the hardware event system, and the monitoring source is set to obtain the voltage of the event signal from the designated channel as the first input and obtain the threshold voltage from the digital-to-analog converter integrated within the chip as the second input.

[0011] Optionally, the monitoring source is configured to obtain the voltage of the event signal acquired from the designated channel as a first input, and obtain a threshold voltage from the digital-to-analog converter integrated within the chip as a second input, including: The first input terminal of the comparator is connected to the designated channel to obtain the voltage of the event signal on the designated channel as the first input; The second input terminal of the comparator is connected to the output terminal of the digital-to-analog converter integrated inside the chip, so as to obtain the threshold voltage output by the digital-to-analog converter as the second input.

[0012] Optionally, the event types include pulse events and level events; wherein, the pulse event is a high level that lasts for one clock cycle and then automatically returns to a low level, and the level event is a high level that is maintained until a specified output low level is reached.

[0013] Optionally, the hardware event system adopts a single-master to multiple-slave working mode. In the single-master to multiple-slave working mode, the event signal is simultaneously received by the second functional unit and the comparator. The second functional unit performs service operations based on the received event signal, and the comparator performs fault detection based on the received event signal.

[0014] Secondly, the present invention provides a fault detection device based on a hardware event system, wherein the hardware event system is used to transmit events between multiple functional units, wherein the functional units are integrated within a chip and connected to a central processing unit via a bus, and the device includes: An event signal receiving module is used to receive event signals sent by the first functional unit to the second functional unit; An event signal forwarding control module is used to send the event signal to the second functional unit; The comparator input control module is used to input the voltage of the event signal into the first input terminal of the comparator integrated inside the chip, and to input the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator. The comparison result acquisition module is used to acquire the comparison result output by the output terminal of the comparator; wherein, the comparison result is the comparison result of the voltage of the event signal and the threshold voltage; The fault detection result determination module is used to determine the fault detection result of the hardware event system based on the comparison result.

[0015] Thirdly, the present invention provides an electronic device including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.

[0016] Fourthly, the present invention provides a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method described above.

[0017] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.

[0018] The embodiments of the present invention have the following advantages: In this embodiment of the invention, an event signal sent by a first functional unit to a second functional unit is received; the event signal is sent to the second functional unit; the voltage of the event signal is input to the first input terminal of a comparator integrated inside the chip, and the threshold voltage output by the digital-to-analog converter integrated inside the chip is input to the second input terminal of the comparator; the comparison result output by the comparator is obtained; wherein, the comparison result is the comparison result of the voltage of the event signal and the threshold voltage; based on the comparison result, the fault detection result of the hardware event system is determined, realizing real-time monitoring of event signals invisible inside the chip. When the event signal is transmitted, the comparator is used to compare the voltage of the event signal with the threshold voltage. When the signal voltage is lower than the threshold, an interrupt or alarm can be triggered in time to report the event loss. The fault source can be quickly identified based on the comparison result, thereby reducing the fault location time and improving the efficiency of computer and auxiliary equipment repair in the next-generation information network industry. Attached Figure Description

[0019] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of the steps of a fault detection method based on a hardware event system provided in some embodiments of the present invention; Figure 2 This is a schematic diagram of the structure of a comparator provided in some embodiments of the present invention; Figure 3 This is a schematic diagram of the input and output of a comparator provided in some embodiments of the present invention; Figure 4 This is a schematic diagram showing the connection between a hardware event system and functional units provided in some embodiments of the present invention; Figure 5 This is a diagram of an event monitoring architecture provided by some embodiments of the present invention; Figure 6This is a flowchart illustrating a second method for fault detection based on a hardware event system, provided in some embodiments of the present invention. Figure 7 This is a flowchart of the steps of a fault detection method based on a hardware event system provided in some embodiments of the present invention; Figure 8 This is a structural block diagram of a fault detection device based on a hardware event system provided in some embodiments of the present invention. Detailed Implementation

[0021] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0022] In embedded system design, PES (Pulse Signal Transmission) serves as an internal signal transmission mechanism that can replace external pin connections. PES reduces signal transmission delay and interference, lowers bus load, and enables communication between peripherals. Peripherals can send pulse events to PES, which can receive and forward these pulse signals.

[0023] Because PES is integrated inside the chip, the signals on its transmission channel are not visible to the outside and cannot be directly detected by external testing equipment such as oscilloscopes or multimeters. When using PES to transmit signals, pulse signal loss may occur.

[0024] In related technologies, pulse signal loss detection can be achieved through solutions such as signal redundancy design, error detection and correction mechanisms, and signal enhancement and filtering. However, these solutions require modifications to the module design, leading to increased chip area and power consumption. They also cannot be directly integrated into existing hardware event systems, resulting in low adaptability and flexibility.

[0025] Based on this, the present invention proposes to compare the input voltage using a comparator to determine whether a hardware event system has malfunctioned. This enables real-time fault detection and timely triggering of processing to avoid affecting the normal operation of the system. The present invention can directly reuse the comparator and digital-to-analog converter already integrated into the chip to complete fault detection, without modifying the original hardware event system design, adding extra external pins, or increasing chip area and power consumption, thus offering greater adaptability and flexibility.

[0026] Reference Figure 1The diagram illustrates a flowchart of a fault detection method based on a hardware event system according to some embodiments of the present invention. The hardware event system is used to transmit events between multiple functional units, which are integrated within a chip and connected to a central processing unit via a bus.

[0027] In some examples, the hardware event system can be a hardware module integrated within the chip, responsible for transmitting event signals between different functional units. The event signal can be a pulse waveform (such as a high level that lasts for one clock cycle and then automatically returns to a low level) or a level waveform (such as a high level that remains until it is changed by software).

[0028] The central processing unit (CPU) is an internal component of the chip responsible for executing software instructions, performing arithmetic and logical operations, and controlling the operation of other modules. The CPU can read program code stored in memory, execute it line by line, and read and write the control registers of each power unit based on the execution results.

[0029] The functional units can be various peripheral modules integrated within the chip. These functional units can be connected to the central processing unit (CPU) via an internal chip bus, such as an AHB (Advanced High-performance Bus) or APB (Advanced Peripheral Bus). The CPU can configure and access the functional units through this bus. Functional units may include Basic Interval Timer 2 (BTM2), a Real-Time Clock (RTC), a CPU, an LCD (Liquid Crystal Display) controller, an analog-to-digital converter, a comparator, etc.

[0030] In practical applications, when a functional unit (as the sender of the event) generates an event signal, the hardware event system can receive the event signal and forward it to one or more other functional units (as the receivers of the event); the entire transmission process can be completed automatically by the hardware without the participation of the central processing unit.

[0031] Specifically, it may include the following steps: Step 101: Receive the event signal sent by the first functional unit to the second functional unit.

[0032] In practical applications, the first functional unit can send an event signal to trigger the second functional unit to perform an operation, and the hardware event system can receive the event signal sent by the first functional unit to the second functional unit.

[0033] Step 102: Send the event signal to the second functional unit.

[0034] After receiving the event signal sent by the first functional unit, the hardware event system can send it to the second functional unit.

[0035] Step 103: Input the voltage of the event signal into the first input terminal of the comparator integrated inside the chip, and input the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator.

[0036] In some examples, the comparator can be an analog comparator module integrated inside the chip; the comparator can have two analog voltage inputs, namely a positive input and a negative input. The first input can be a negative input, and the second input can be a positive input.

[0037] In some examples, the digital-to-analog converter (DAC) can be a digital-to-analog converter module integrated inside the chip; the DAC can receive digital input codes and output the corresponding threshold voltage.

[0038] In some examples, the threshold voltage can be an analog voltage value, which can be used to distinguish between valid high levels and invalid low levels of an event signal. The specific value of the threshold voltage can be between the low-level voltage and the high-level voltage of the event signal (e.g., low level 0V, high level 3.3V, threshold voltage can be 1.5V).

[0039] In practical applications, comparators require a threshold voltage to compare with the voltage of the event signal. If a fixed voltage source is used (such as obtaining it from the power supply voltage through a resistor divider), the threshold voltage is fixed during manufacturing and cannot be adjusted according to different application requirements. By using a digital-to-analog converter (DAC), the central processing unit can flexibly set different desired threshold voltage values ​​during initialization by writing different digital input codes, and then generate the corresponding threshold voltage according to the desired value to adapt to different high-level amplitudes of event signals (e.g., a 1.5V threshold for a 3.3V system and a 0.9V threshold for a 1.8V system).

[0040] In specific implementation, the first input end of the comparator can be connected to the designated channel of the hardware event system for transmitting event signals, so that when the event signal is transmitted to the second functional unit along the designated channel, the actual voltage value of the event signal can be acquired and input to the comparator; secondly, the second input end of the comparator can be connected to the output end of the digital-to-analog converter, so as to ensure that the threshold voltage output by the digital-to-analog converter can be stably input to the comparator.

[0041] As Figure 2 , the comparator may be ACMP1 (Analog Comparator 1). AC1_PSEL (positive input end selection) and AC1_NSEL (negative input end selection) are respectively used to select the two input signal sources of the comparator, by connecting DAC_OUT (the threshold voltage output by the digital-to-analog converter) to the positive input end, and connecting CHx (the designated channel signal of the hardware event system) to the negative input end. AC1_EN is the enable control end of the comparator, used to enable or disable the operation of the comparator. AC1_HYSSEL is used to set the hysteresis mode of the comparator to enhance anti-interference capability. After the comparator AC1 compares the voltages at the two input ends, it outputs the comparison result (high level or low level) through the output end AC1_OUT, and the comparison result can be read by the CPU or trigger an interrupt.

[0042] Step 104: acquiring the comparison result output by the output end of the comparator; wherein the comparison result is a comparison result between the voltage of the event signal and the threshold voltage.

[0043] In some examples, the comparison result may be a digital value, such as 0 or 1.

[0044] After the two input ends of the comparator respectively receive the voltage of the event signal and the threshold voltage, the analog comparison circuit inside the comparator can continuously compare the voltage of the event signal and the threshold voltage. The comparator can set its output end to a corresponding level according to the comparison result.

[0045] For example, if the voltage of the event signal is greater than or equal to the threshold voltage, the output end can be set to a low level (digital 0); if the voltage of the event signal is less than the threshold voltage, the output end can be set to a high level (digital 1). The level state of the output end can be latched in a status register. The central processing unit can read the value of the status register through the bus, so as to obtain the comparison result.

[0046] In some embodiments, the comparator is configured to compare the voltage values at the two input ends, that is, to compare the first input end (AC1_NSEL) and the second input end (AC1_PSEL). If AC1_NSEL < AC1_PSEL, the output end (AC1_OUT) of the comparator is equal to 1; if AC1_NSEL ≥ AC1_PSEL, AC1_OUT is equal to 0.

[0047] like Figure 3 DAC_OUT (the threshold voltage output by the digital-to-analog converter) is connected to the positive input (PSEL) of the comparator, and PES_CH1 (channel 1 signal of the hardware event system) is connected to the negative input (NSEL) of the comparator. After comparing these two inputs, the comparator outputs AC1_OUT as 0. This result indicates that the voltage at the negative input (the event signal voltage on PES_CH1) is greater than or equal to the voltage at the positive input (the threshold voltage of DAC_OUT), meaning the PES event signal is valid and has not been lost.

[0048] Step 105: Determine the fault detection result of the hardware event system based on the comparison result.

[0049] After obtaining the comparison result from the comparator, the result can be judged. When the comparison result is 0, it can be determined that the hardware event system is working normally. When the comparison result is 1, it can be determined that the hardware event system has experienced an event loss fault.

[0050] When the fault detection result indicates an event loss fault, fault handling operations can be triggered, such as generating a software alarm flag, recording a fault log, resetting the system, or displaying a fault code.

[0051] In this embodiment of the invention, an event signal sent by a first functional unit to a second functional unit is received; the event signal is sent to the second functional unit; the voltage of the event signal is input to the first input terminal of a comparator integrated inside the chip, and the threshold voltage output by the digital-to-analog converter integrated inside the chip is input to the second input terminal of the comparator; the comparison result output by the comparator is obtained; wherein, the comparison result is the comparison result of the voltage of the event signal and the threshold voltage; based on the comparison result, the fault detection result of the hardware event system is determined, realizing real-time monitoring of event signals invisible inside the chip. When the event signal is transmitted, the comparator is used to compare the voltage of the event signal with the threshold voltage. When the signal voltage is lower than the threshold, an interrupt or alarm can be triggered in time to report the event loss. The fault source can be quickly identified based on the comparison result, thereby reducing the fault location time and improving the efficiency of computer and auxiliary equipment repair in the next-generation information network industry.

[0052] In some embodiments of the present invention, before receiving the event signal sent by the first functional unit for the second functional unit, the method further includes: Step S1: Configure the first functional unit as the host source of the hardware event system, and set the event type sent by the host source to the hardware event system.

[0053] In some examples, the host source can be a configuration item in the hardware event system used to specify the event sender.

[0054] In practical applications, during the chip initialization phase, the central processing unit can access the control registers of the hardware event system via the bus. The first functional unit is configured as the host source of the hardware event system by writing its identifier into the host source selection field.

[0055] In some examples, the event types include pulse events and level events; where a pulse event is a high level that lasts for one clock cycle and then automatically returns to a low level, and a level event is a high level that remains until a specified output low level is reached.

[0056] In some examples, the event type can refer to the waveform shape of the event signal, including pulse events and level events. A pulse event can be a waveform that remains high for one clock cycle and then automatically returns to a low level. A level event can be a waveform that remains high until the software specifies a low output level.

[0057] In practical applications, configuration values ​​for the event types generated by the first functional unit can be written into the control register of the hardware event system. The hardware event system can then identify and process the received event signals based on these configuration values.

[0058] Once configured, the event signals generated by the first functional unit during operation can be recognized by the hardware event system according to the set event type.

[0059] Step S2: Configure the second functional unit as a slave source of the hardware event system, and set the slave source to receive event signals from a designated channel of the hardware event system.

[0060] In some examples, the slave source can refer to a configuration item in the hardware event system used to specify the event receiver. The specified channel can be a signal transmission path within the hardware event system. The hardware event system can contain multiple channels (such as CH0, CH1, CH2, CH3, CH4), each capable of independently transmitting event signals.

[0061] In practical applications, during the chip initialization phase, the central processing unit (CPU) can access the control registers of the hardware event system via the bus. The second functional unit is configured as a slave source of the hardware event system by writing its identifier into the slave source selection field. The channel number can also be written into the channel selection field to specify which channel the second functional unit receives event signals from. After configuration, when the hardware event system detects an event signal on that channel, it can automatically send the event signal to the second functional unit. Upon receiving the signal, the second functional unit can execute pre-defined hardware operations.

[0062] Step S3: Configure the comparator integrated inside the chip as the monitoring source of the hardware event system, and set the voltage of the event signal obtained by the monitoring source from the designated channel as the first input, and the threshold voltage obtained from the digital-to-analog converter integrated inside the chip as the second input.

[0063] In some examples, the monitoring source can be a configuration item in the hardware event system used to specify the event monitor. For instance, when a comparator is configured as a monitoring source, it can receive signals from the hardware event system and use them to detect whether events have been transmitted correctly.

[0064] In practical applications, during the chip initialization phase, the central processing unit can access the control register of the hardware event system via the bus and configure the comparator as a monitoring source by writing the comparator's identifier into the monitoring source selection field.

[0065] After configuring the monitoring source, the central processing unit (CPU) can access the comparator's input selection register to select the first input source of the comparator as a designated channel of the hardware event system (such as CH0), and the second input source of the comparator as the output of the digital-to-analog converter (DAC). The CPU can then write a digital code to the DAC's data register via the bus, causing the DAC to output a threshold voltage (such as 1.5V).

[0066] After configuration, the comparator can begin operation. Its first input continuously receives the real-time voltage from a specified channel, while its second input continuously receives a fixed threshold voltage output from the digital-to-analog converter. The comparator's internal circuitry compares these two voltage values ​​in real time and outputs the comparison result to the comparator's output terminal.

[0067] In some examples, the hardware event system adopts a single-master to multiple-slave operating mode. In this mode, the event signal is received by both the second functional unit and the comparator. The second functional unit performs service operations based on the received event signal, and the comparator performs fault detection based on the received event signal.

[0068] The single-master, multi-slave operating mode can be a hardware event system with only one master source (event sender) but multiple slave sources (event receivers) simultaneously receiving the same event signal. Service operations can refer to operations related to the normal functioning of the chip, such as updating the display content of the LCD controller, outputting analog voltage from the digital-to-analog converter, or starting a timer count. Fault detection refers to the operation of determining whether an event signal has been lost.

[0069] In practical applications, the hardware event system can be configured to operate in a mode where one master source corresponds to multiple slave sources. In the single-master to multiple-slave mode, when the master source generates an event signal, the hardware event system can simultaneously send the event signal to all configured slave sources.

[0070] For example, a timer can be used as the master source, while the LCD controller and comparator act as slave sources. The timer generates a pulse event every 1 millisecond, and the hardware event system can simultaneously forward this pulse to both the LCD controller and the comparator. Upon receiving the pulse, the LCD controller can immediately perform a display refresh operation (i.e., a service operation). Upon receiving the same pulse, the comparator can compare the pulse's voltage with a threshold voltage to determine if the pulse has reached a valid high level (i.e., fault detection). This parallel operation allows service operations and fault detection to occur simultaneously without interference.

[0071] like Figure 4 The overall architecture of the PES (Peripheral Event System) is demonstrated. On the left, multiple hosts (host 1 to host n) act as senders of event signals, while on the right, multiple slave devices (slave 1 to slave n) act as receivers of event signals. The PES module internally contains multiple transmission channels (CH0 to CH4). Event signals generated by the hosts are transmitted to the PES through designated channels. The PES then forwards the signals to one or more corresponding slave devices through the same or different channels, enabling hardware-level event communication between peripherals without the need for central processing unit intervention.

[0072] like Figure 5 The master unit, acting as the event sender, sends the event signal to the PES. The PES transmits the event signal simultaneously to the slave unit and the negative input (AC1_NSEL) of the analog comparator (ACMP1) via channel CHx. The output DAC_OUT of the digital-to-analog converter is connected to the positive input (AC1_PSEL) of ACMP1. ACMP1 compares the voltages at the two inputs and outputs the result AC1_OUT. The slave unit can perform normal service operations, while the comparator can monitor in parallel whether the event signal voltage on the CHx channel is below a threshold, thereby detecting event loss. In the above embodiments, by configuring the master source, slave source, and monitoring source respectively, an event transmission and monitoring link can be established in the hardware event system. Through the cooperation between the master source, slave source, and monitoring source, both the normal transmission of event signals and the parallel monitoring of the same event signal can be guaranteed.

[0073] Secondly, since the configuration operation can be completed in one go during the initialization phase, the hardware event system can work independently during runtime without consuming the resources of the central processing unit. When the comparator detects that the event signal voltage is lower than the threshold, it can immediately output a high level and notify the central processing unit via interrupt or polling.

[0074] The above embodiments can be applied to various scenarios that require high reliability of internal communication within the chip, including but not limited to: industrial control chips, mobile smart terminal main control chips, IoT wireless microcontrollers, radar signal processing chips, smart medical device chips, RFID reader chips, and other integrated circuit product manufacturing fields that require high reliability of internal communication.

[0075] In some embodiments of the present invention, in step S3 above, setting the monitoring source to obtain the voltage of the event signal from the designated channel as the first input and the threshold voltage from the digital-to-analog converter integrated inside the chip as the second input includes: setting the first input terminal of the comparator to connect to the designated channel to obtain the voltage of the event signal on the designated channel as the first input; setting the second input terminal of the comparator to connect to the output terminal of the digital-to-analog converter integrated inside the chip to obtain the threshold voltage output by the digital-to-analog converter as the second input.

[0076] In practical applications, the central processing unit (CPU) can access the comparator's input selection register via the bus. For the selection field of the first input, the CPU can write an encoded value representing the "designated channel of the hardware event system," thereby enabling the internal multiplexer to connect the physical signal line of that channel to the comparator's first input.

[0077] For the selection field of the second input terminal, the central processing unit can write an encoded value representing the "digital-to-analog converter output terminal", thereby enabling the internal multiplexer to connect the output terminal of the digital-to-analog converter to the second input terminal of the comparator.

[0078] After setup, the real-time voltage on the specified channel can be continuously applied to the first input of the comparator, and the threshold voltage output by the digital-to-analog converter can be continuously applied to the second input of the comparator. Upon receiving the voltage, the analog circuitry inside the comparator can start working and automatically compare the magnitudes of the two voltages.

[0079] In some embodiments of the present invention, step 103 above, which involves inputting the threshold voltage output by the digital-to-analog converter integrated within the chip into the second input terminal of the comparator, includes: Sub-step 31: Obtain the expected value of the threshold voltage and the reference voltage inside the chip.

[0080] In some examples, the desired threshold voltage can be a pre-set analog voltage value (e.g., a desired value of 1.5V). The internal reference voltage can be a stable voltage source generated within the chip, such as 0.8V output from a bandgap reference voltage source; the reference voltage can serve as a reference source for the digital-to-analog converter (DAC) to determine the DAC's output voltage range.

[0081] In practical applications, the central processing unit can obtain the reference voltage value by reading the chip's read-only register, which stores the reference voltage value calibrated at the factory.

[0082] In its implementation, the chip internally contains a bandgap reference source that outputs a stable 0.8V reference voltage. The value of this reference voltage is stored in a read-only register, VREF_REG, at address 0x40023000. After power-on reset, the central processing unit (CPU) can execute a read instruction to read the reference voltage from address 0x40023000. After reading the reference voltage, the CPU can retrieve the desired value of a custom threshold voltage from a user-configured threshold parameter table to obtain both the desired value and the internal reference voltage.

[0083] Sub-step 32: Based on the reference voltage and the expected value, determine the digital input code of the digital-to-analog converter integrated inside the chip, and write the digital input code into the data register of the digital-to-analog converter so that the digital-to-analog converter outputs the threshold voltage to the second input terminal of the comparator.

[0084] In some examples, the numeric input code can be a binary value written to the digital-to-analog converter's data register. The range of values ​​for the numeric input code can be determined by the resolution of the digital-to-analog converter; for example, the range is 0 to 63 for a 6-bit resolution.

[0085] In practical applications, the digital input code that needs to be written into the digital-to-analog converter can be derived from the reference voltage value and the expected value using a proportional calculation formula.

[0086] In some implementations, after obtaining the desired value of the threshold voltage, since the digital-to-analog converter cannot directly identify the desired value, the digital input code corresponding to the desired value can be calculated and written into the data register of the digital-to-analog converter to determine the amplitude of the output voltage of the digital-to-analog converter, thereby outputting the threshold voltage.

[0087] For example, the formula for calculating the output voltage of a digital-to-analog converter (DAC) is DAC_OUT = (DAV_CODE / 64) * VREF. Here, DAC_OUT refers to the actual threshold voltage output by the DAC; DAV_CODE refers to the digital input code written to the DAC's data register, with a value ranging from 0 to 63 (because the DAC's resolution is 6 bits); and VREF refers to the DAC's reference voltage, which can be a fixed internal voltage source (e.g., 0.8V) or an externally input reference voltage.

[0088] By transforming the formula for calculating the output voltage of the digital-to-analog converter, DAV_CODE can be calculated, i.e., DAV_CODE=(DAC_OUT / VREF)×64.

[0089] In practical applications, the expected value can be used as the threshold voltage of the actual output of the digital-to-analog converter. By substituting it into the above formula, the digital input code can be calculated.

[0090] In some embodiments of the present invention, obtaining the expected value of the threshold voltage in sub-step 31 above includes: determining the low-level voltage and high-level voltage of the event signal; determining the expected value of the threshold voltage based on the low-level voltage and high-level voltage; wherein the expected value is greater than the low-level voltage and less than the high-level voltage.

[0091] In some examples, a low-level voltage can refer to the voltage value when the event signal is in a logic 0 state. In typical digital circuits, a low-level voltage can be close to 0V (e.g., 0V or 0.1V). A high-level voltage can refer to the voltage value when the event signal is in a logic 1 state, and the high-level voltage can be determined by the chip's supply voltage, such as 3.3V, 5V, or 1.8V.

[0092] After determining the low-level and high-level voltages of the event signal, a suitable expected value can be determined. For example, the expected value can be calculated as (low-level voltage + high-level voltage) / 2, or the expected value can be calculated as high-level voltage × 0.5.

[0093] The selected expected value must be greater than the low-level voltage and less than the high-level voltage to ensure that when the event signal is high, the voltage of the event signal is greater than the expected value, and when the event signal is low, the voltage of the event signal is less than the expected value. After determining the expected value, it can be used to calculate the digital input code of the digital-to-analog converter (DAC), so that the DAC can determine the amplitude of the output voltage of the DAC based on the digital input code, thereby outputting the threshold voltage.

[0094] In some embodiments of the present invention, determining the fault detection result of the hardware event system in step 105 based on the comparison result includes: determining that the hardware event system is working normally when the comparison result indicates that the voltage of the event signal is greater than or equal to the threshold voltage; and determining that the hardware event system has an event loss fault when the comparison result indicates that the voltage of the event signal is less than the threshold voltage.

[0095] In practical applications, a comparison result of 0 indicates that the voltage of the event signal is greater than or equal to the threshold voltage, which means the hardware event system is working normally. A comparison result of 1 indicates that the voltage of the event signal is less than the threshold voltage, which means the hardware event system has experienced an event loss fault.

[0096] In some embodiments of the present invention, the method further includes: generating an interrupt signal to trigger a fault handling procedure when it is determined that the hardware event system has experienced an event loss fault.

[0097] In practical applications, the output of the comparator can be used to determine whether an event loss fault has occurred in the hardware event system. When the comparator output is high (digit 1), it indicates that the voltage of the event signal is lower than the threshold voltage, and an event loss fault can be determined.

[0098] In the event of a lost event fault, the central processing unit can perform an interrupt enable operation, allowing the comparator's output signal to be connected to the interrupt controller as an interrupt source. A level transition at the comparator output (such as from low to high) can automatically trigger the interrupt controller to generate an interrupt request signal.

[0099] After receiving an interrupt request, the central processing unit can pause the currently running program and jump to the pre-set interrupt service routine entry address to begin execution. The interrupt service routine is a fault handling routine in which fault response code can be written, such as saving the system state to non-volatile memory, illuminating a fault indicator light, outputting a fault code through the communication interface, performing a software reset, or switching to standby operating mode.

[0100] Through the above embodiments, once a fault is detected, the hardware can automatically generate an interrupt without the central processing unit polling the comparator status, thereby reducing the load on the central processing unit while ensuring real-time response.

[0101] like Figure 6The present invention provides a flowchart for implementing event loss monitoring using PES (Hardware Event System) and comparator ACMP1. After the process starts, initialization configuration can be performed to configure the host source of PES, such as selecting a timer as the host source, and setting the event type (such as pulse event or level event) sent by the host source to PES.

[0102] After setting the master source, you can configure the slave source (such as an LCD controller) to receive PES events through a specified channel CHx, enabling the slave to respond to event signals. Alternatively, you can select the same channel CHx as the input source for the negative input (AC1_NSEL) of the analog comparator ACMP1, allowing the comparator to acquire the real-time voltage on the PES channel.

[0103] Based on the high-level voltage of the PES event (e.g., 3.3V), the threshold voltage (e.g., 1.5V) can be calculated. Then, the digital input code of the digital-to-analog converter (DAC) can be calculated based on the threshold voltage, yielding the DAC_OUT value. DAC_OUT is then selected as the input source for the positive input terminal (AC1_PSEL) of comparator ACMP1, providing a reference voltage for the comparator.

[0104] After configuration, the PES master source begins sending events. The event signal is transmitted simultaneously to the slave device and the negative input of the comparator via the CHx channel. Comparison can be initiated via software triggering ACMP1. The comparator compares the negative input (CHx voltage) with the positive input (DAC_OUT threshold): if the CHx voltage is greater than or equal to the threshold, the comparator outputs a low level, indicating a normal PES event with no abnormalities; if the CHx voltage is less than the threshold, the comparator outputs a high level, indicating a lost PES event, which can trigger an alarm (such as an interrupt or polling alarm).

[0105] The above embodiments can be applied to various embedded system products, such as computer manufacturing, computer component manufacturing such as handheld tablet computer display devices, computer peripheral manufacturing such as human-computer interaction devices and graphics output devices, industrial control computer and system manufacturing, cloud platform and Internet of Things and other computer manufacturing, mobile smart terminal manufacturing, radar and supporting equipment manufacturing, intelligent medical system and RFID and other electronic equipment manufacturing.

[0106] In these technological fields, hardware event systems can be responsible for transmitting event signals between peripherals. Utilizing the existing analog comparators and digital-to-analog converters within the chip, the signal voltage on the PES channel is monitored in real time: when the signal voltage falls below a preset threshold, it is determined that an event has been lost, triggering an interrupt or polling alarm. This monitoring mechanism can promptly detect internal signal transmission faults without adding external pins or modifying existing peripheral modules.

[0107] For example, in handheld tablet displays, this invention can monitor the transmission status of LCD refresh events, preventing display anomalies due to event loss. In the manufacturing of industrial control computers and systems, it can ensure reliable transmission of control signals between peripherals, improving system stability. In the manufacturing of radar and related equipment, it helps maintain the integrity of the signal processing link, reducing the risk of frame loss in data acquisition or processing. In intelligent medical systems, it can meet the high reliability requirements of internal communication, providing support for the safe operation of medical equipment. In the fields of mobile intelligent terminals, IoT devices, and RFID devices, this invention can reduce the time cost of fault location and improve product maintainability.

[0108] By integrating this invention into the core chip of products in the aforementioned technical field, continuous monitoring of the transmission quality of hardware event systems can be achieved without increasing hardware overhead, thereby improving the reliability and fault response capability of the equipment.

[0109] Secondly, in computer and auxiliary equipment repair scenarios, repair personnel can utilize the PES (Hardware Event System), analog comparators, and digital-to-analog converters integrated within the main control chip of the device under repair. By writing the corresponding values ​​to the chip's configuration register through debugging interfaces such as JTAG (Joint Test Action Group) or serial debugging interfaces, the event signal voltage monitoring function of the PES channel can be enabled. When peripherals (i.e., functional units, such as LCD controllers and touch screen controllers) fail to respond as expected, repair personnel can read the comparator's output status: if the comparator output indicates that the event signal voltage is below the threshold, the fault can be located in the PES signal transmission link inside the chip; if the comparator output indicates that the event signal voltage is normal, the PES fault can be ruled out, and external circuits or software configurations can be checked. This allows repair personnel to utilize the chip's built-in monitoring capabilities without modifying the hardware, simply by configuring the registers, thus improving troubleshooting efficiency.

[0110] Reference Figure 7 The diagram illustrates a flowchart of another fault detection method based on a hardware event system provided by some embodiments of the present invention, which may specifically include the following steps: Step 701: Configure the first functional unit as the host source of the hardware event system, and set the event type sent by the host source to the hardware event system.

[0111] Step 702: Configure the second functional unit as a slave source of the hardware event system, and set the slave source to receive event signals from a designated channel of the hardware event system.

[0112] Step 703: Configure the comparator integrated inside the chip as the monitoring source of the hardware event system, and set the voltage of the event signal obtained by the monitoring source from the designated channel as the first input, and the threshold voltage obtained from the digital-to-analog converter integrated inside the chip as the second input.

[0113] Step 704: Receive the event signal sent by the first functional unit to the second functional unit.

[0114] Step 705: Send the event signal to the second functional unit.

[0115] Step 706: Input the voltage of the event signal into the first input terminal of the comparator integrated inside the chip, and input the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator.

[0116] Step 707: Obtain the comparison result output by the output terminal of the comparator; wherein, the comparison result is the comparison result between the voltage of the event signal and the threshold voltage.

[0117] Step 708: Determine the fault detection result of the hardware event system based on the comparison result.

[0118] In this embodiment of the invention, a first functional unit is configured as the host source of a hardware event system, and the event type sent by the host source to the hardware event system is set; a second functional unit is configured as the slave source of the hardware event system, and the slave source is set to receive event signals from a designated channel of the hardware event system; a comparator integrated within the chip is configured as the monitoring source of the hardware event system, and the monitoring source is set to obtain the voltage of the event signal from the designated channel as the first input and obtain the threshold voltage from the digital-to-analog converter integrated within the chip as the second input; the first functional unit sends an event signal to the second functional unit; the event signal is sent to the second functional unit; and the voltage of the event signal is input to the first input of the comparator integrated within the chip. The input terminal is used to input the threshold voltage output by the integrated digital-to-analog converter within the chip into the second input terminal of the comparator; the comparison result output by the comparator is obtained; the comparison result is the comparison result between the voltage of the event signal and the threshold voltage; based on the comparison result, the fault detection result of the hardware event system is determined, realizing real-time monitoring of event signals invisible inside the chip. During event signal transmission, the comparator compares the voltage of the event signal with the threshold voltage. When the signal voltage is lower than the threshold, an interrupt or alarm can be triggered in time to report the event loss. The fault source can be quickly identified based on the comparison result, thereby reducing fault location time and improving the efficiency of computer and auxiliary equipment repair in the next-generation information network industry.

[0119] In some embodiments of the present invention, determining the fault detection result of the hardware event system based on the comparison result includes: determining that the hardware event system is working normally when the comparison result indicates that the voltage of the event signal is greater than or equal to the threshold voltage; and determining that the hardware event system has an event loss fault when the comparison result indicates that the voltage of the event signal is less than the threshold voltage.

[0120] In some embodiments of the present invention, the method further includes: generating an interrupt signal to trigger a fault handling procedure when it is determined that the hardware event system has experienced an event loss fault.

[0121] In some embodiments of the present invention, inputting the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator includes: obtaining the expected value of the threshold voltage and the reference voltage inside the chip; determining the digital input code of the digital-to-analog converter integrated inside the chip according to the reference voltage and the expected value, and writing the digital input code into the data register of the digital-to-analog converter, so that the digital-to-analog converter outputs the threshold voltage to the second input terminal of the comparator.

[0122] In some embodiments of the present invention, obtaining the expected value of the threshold voltage includes: determining the low-level voltage and the high-level voltage of the event signal; determining the expected value of the threshold voltage based on the low-level voltage and the high-level voltage; wherein the expected value is greater than the low-level voltage and less than the high-level voltage.

[0123] In some embodiments of the present invention, setting the monitoring source to obtain the voltage of the event signal from the designated channel as a first input and obtain the threshold voltage from the digital-to-analog converter integrated inside the chip as a second input includes: setting the first input terminal of the comparator to connect to the designated channel to obtain the voltage of the event signal on the designated channel as the first input; setting the second input terminal of the comparator to connect to the output terminal of the digital-to-analog converter integrated inside the chip to obtain the threshold voltage output by the digital-to-analog converter as the second input.

[0124] In some embodiments of the present invention, the event types include pulse events and level events; wherein, the pulse event is a high level that lasts for one clock cycle and then automatically returns to a low level, and the level event is a high level that is maintained until a specified output low level is reached.

[0125] In some embodiments of the present invention, the hardware event system adopts a single-master to multiple-slave working mode. In the single-master to multiple-slave working mode, the event signal is simultaneously received by the second functional unit and the comparator. The second functional unit performs service operations based on the received event signal, and the comparator performs fault detection based on the received event signal.

[0126] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0127] Reference Figure 8 The diagram shows a structural schematic of a fault detection device based on a hardware event system provided by some embodiments of the present invention. The hardware event system is used to transmit events between multiple functional units, which are functional units integrated inside the chip and connected to the central processing unit via a bus.

[0128] Specifically, it can include the following modules: The event signal receiving module 801 is used to receive the event signal sent by the first functional unit to the second functional unit; The event signal forwarding control module 802 is used to send the event signal to the second functional unit; The comparator input control module 803 is used to input the voltage of the event signal into the first input terminal of the comparator integrated inside the chip, and to input the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator. The comparison result acquisition module 804 is used to acquire the comparison result output by the output terminal of the comparator; wherein, the comparison result is the comparison result of the voltage of the event signal and the threshold voltage; The fault detection result determination module 805 is used to determine the fault detection result of the hardware event system based on the comparison result.

[0129] In some embodiments of the present invention, the fault detection result determination module 805 is used for: If the comparison result indicates that the voltage of the event signal is greater than or equal to the threshold voltage, the hardware event system is determined to be working normally. If the comparison result indicates that the voltage of the event signal is less than the threshold voltage, it is determined that the hardware event system has experienced an event loss fault.

[0130] In some embodiments of the present invention, the apparatus further includes: An interrupt device is used to generate an interrupt signal to trigger a fault handling procedure when it is determined that the hardware event system has experienced an event loss failure.

[0131] In some embodiments of the present invention, the comparator input control module 803 is used for: Obtain the expected value of the threshold voltage and the reference voltage inside the chip; Based on the reference voltage and the desired value, the digital input code of the digital-to-analog converter integrated inside the chip is determined, and the digital input code is written into the data register of the digital-to-analog converter so that the digital-to-analog converter outputs the threshold voltage to the second input terminal of the comparator.

[0132] In some embodiments of the present invention, obtaining the expected value of the threshold voltage includes: Determine the low-level voltage and high-level voltage of the event signal; Based on the low-level voltage and the high-level voltage, an expected value of the threshold voltage is determined; wherein the expected value is greater than the low-level voltage and less than the high-level voltage.

[0133] In some embodiments of the present invention, the apparatus further includes: The first configuration module is used to configure the first functional unit as the host source of the hardware event system and to set the event type sent by the host source to the hardware event system. The second configuration module is used to configure the second functional unit as a slave source of the hardware event system, and to set the slave source to receive event signals from a designated channel of the hardware event system. The third configuration module is used to configure the comparator integrated inside the chip as the monitoring source of the hardware event system, and to set the voltage of the event signal obtained by the monitoring source from the designated channel as the first input, and the threshold voltage obtained from the digital-to-analog converter integrated inside the chip as the second input.

[0134] In some embodiments of the present invention, the third configuration module is used for: The first input terminal of the comparator is connected to the designated channel to obtain the voltage of the event signal on the designated channel as the first input; The second input terminal of the comparator is connected to the output terminal of the digital-to-analog converter integrated inside the chip, so as to obtain the threshold voltage output by the digital-to-analog converter as the second input.

[0135] In some embodiments of the present invention, the event types include pulse events and level events; wherein, the pulse event is a high level that lasts for one clock cycle and then automatically returns to a low level, and the level event is a high level that is maintained until a specified output low level is reached.

[0136] In some embodiments of the present invention, the hardware event system adopts a single-master to multiple-slave working mode. In the single-master to multiple-slave working mode, the event signal is simultaneously received by the second functional unit and the comparator. The second functional unit performs service operations based on the received event signal, and the comparator performs fault detection based on the received event signal.

[0137] Some embodiments of the present invention also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.

[0138] Some embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, and which, when executed by a processor, implements the method described above.

[0139] Some embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the method described above.

[0140] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0142] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0143] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0144] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0147] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0148] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the aforementioned element.

[0149] The above provides a detailed description of a fault detection method and apparatus based on a hardware event system. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A fault detection method based on a hardware event system, characterized in that, The hardware event system is used to transmit events between multiple functional units, wherein the functional units are integrated within the chip and connected to the central processing unit via a bus, and the method includes: Receive event signals sent by the first functional unit to the second functional unit; The event signal is sent to the second functional unit; The voltage of the event signal is input to the first input terminal of the comparator integrated inside the chip, and the threshold voltage output by the digital-to-analog converter integrated inside the chip is input to the second input terminal of the comparator. Obtain the comparison result output from the output terminal of the comparator; wherein, the comparison result is the comparison result between the voltage of the event signal and the threshold voltage; Based on the comparison results, the fault detection result of the hardware event system is determined.

2. The method according to claim 1, characterized in that, Based on the comparison results, the fault detection results of the hardware event system are determined, including: If the comparison result indicates that the voltage of the event signal is greater than or equal to the threshold voltage, the hardware event system is determined to be working normally. If the comparison result indicates that the voltage of the event signal is less than the threshold voltage, it is determined that the hardware event system has experienced an event loss fault.

3. The method according to claim 2, characterized in that, The method further includes: If the hardware event system is determined to have experienced an event loss failure, an interrupt signal is generated to trigger the fault handling procedure.

4. The method according to claim 1, characterized in that, The threshold voltage output from the digital-to-analog converter integrated within the chip is input to the second input terminal of the comparator, including: Obtain the expected value of the threshold voltage and the reference voltage inside the chip; Based on the reference voltage and the desired value, the digital input code of the digital-to-analog converter integrated inside the chip is determined, and the digital input code is written into the data register of the digital-to-analog converter so that the digital-to-analog converter outputs the threshold voltage to the second input terminal of the comparator.

5. The method according to claim 4, characterized in that, Obtain the expected value of the threshold voltage, including: Determine the low-level voltage and high-level voltage of the event signal; Based on the low-level voltage and the high-level voltage, an expected value of the threshold voltage is determined; wherein the expected value is greater than the low-level voltage and less than the high-level voltage.

6. The method according to any one of claims 1-5, characterized in that, Before receiving the event signal sent by the first functional unit to the second functional unit, the method further includes: Configure the first functional unit as the host source of the hardware event system, and set the event type sent by the host source to the hardware event system; Configure the second functional unit as a slave source of the hardware event system, and set the slave source to receive event signals from a designated channel of the hardware event system; The comparator integrated within the chip is configured as the monitoring source of the hardware event system, and the monitoring source is set to obtain the voltage of the event signal from the designated channel as the first input and obtain the threshold voltage from the digital-to-analog converter integrated within the chip as the second input.

7. The method according to claim 6, characterized in that, The monitoring source is configured to obtain the voltage of the event signal acquired from the designated channel as the first input, and obtain the threshold voltage from the digital-to-analog converter integrated within the chip as the second input, including: The first input terminal of the comparator is connected to the designated channel to obtain the voltage of the event signal on the designated channel as the first input; The second input terminal of the comparator is connected to the output terminal of the digital-to-analog converter integrated inside the chip, so as to obtain the threshold voltage output by the digital-to-analog converter as the second input.

8. The method according to claim 6, characterized in that, The event types include pulse events and level events; wherein, the pulse event is a high level that lasts for one clock cycle and then automatically returns to a low level, and the level event is a high level that is maintained until a specified output low level is reached.

9. The method according to claim 1, characterized in that, The hardware event system adopts a single-master to multiple-slave working mode. In this mode, the event signal is simultaneously received by the second functional unit and the comparator. The second functional unit performs service operations based on the received event signal, and the comparator performs fault detection based on the received event signal.

10. A fault detection device based on a hardware event system, characterized in that, The hardware event system is used to transmit events between multiple functional units, wherein the functional units are integrated within the chip and connected to the central processing unit via a bus. The device includes: An event signal receiving module is used to receive event signals sent by the first functional unit to the second functional unit; An event signal forwarding control module is used to send the event signal to the second functional unit; The comparator input control module is used to input the voltage of the event signal into the first input terminal of the comparator integrated inside the chip, and to input the threshold voltage output by the digital-to-analog converter integrated inside the chip into the second input terminal of the comparator. The comparison result acquisition module is used to acquire the comparison result output by the output terminal of the comparator; wherein, the comparison result is the comparison result between the voltage of the event signal and the threshold voltage; The fault detection result determination module is used to determine the fault detection result of the hardware event system based on the comparison result.

11. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method as described in any one of claims 1 to 9.

13. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 9.