Chip abnormal state processing device and method and chip
By designing an abnormal signal detection and processing module in the chip, monitoring and handling abnormal states in real time, the problem that the chip cannot quickly obtain the cause of abnormality in the locked state is solved, and the abnormality processing efficiency is improved.
Patent Information
- Application Number
- CN202411158025.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-29
AI Technical Summary
When an exception occurs, especially when an ARM core-based chip occurs in a locked state during HardFault or NMI processing, it cannot quickly obtain the cause of the abnormal state, resulting in low processing efficiency.
Design a chip abnormal state processing device, including an abnormal signal detection module and an abnormal state processing module, obtain abnormal state flag data through the detection module, perform abnormal detection, and send the results to the processing module for processing, real-time abnormal state monitoring and processing .
It can obtain chip abnormal state data in a timely manner, improve the efficiency of abnormal state processing, and avoid processor freezing problems caused by locked state.
Smart Images

Figure CN119046046A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of chip design and application technology, and in particular, to a chip abnormal state processing device, method, chip, medium and program. Background Art
[0002] Due to the complexity of chip manufacturing and use as well as the influence of various external environmental factors, it is very easy for chips to have anomalies when processing data.
[0003] At present, when an abnormality occurs in the chip during operation, the common exception handling method is to obtain the cause of the abnormal state of the chip through debugging interfaces such as SWD (Serial Wire Debug). Alternatively, the chip reset can be directly triggered to quickly restore the chip to normal.
[0004] In the process of implementing the present invention, the inventor found that the prior art has the following defects: Considering the needs of chip manufacturing, some chips do not set debugging interfaces, so when such chips are abnormal, the reason why the chip is in an abnormal state cannot be obtained by debugging. Although the method of directly triggering chip reset can quickly handle chip abnormalities, it is impossible to obtain the reason why the chip is in an abnormal state. In addition, for chips based on the ARM (Advanced RISC Machines, a computer processor architecture) core, if another error interrupt occurs during HardFault (hardware error) processing, or an error interrupt occurs during NMI (Non-Maskable Interrupt) interrupt processing, the processor of the chip will enter a locked state, i.e., a Lockup state. This is because during the execution of these two exception processing, the priority does not allow the error processing to be preempted. In the locked state, registers and memories are "frozen", the value of PC (Program Counter Register) is forced to 0xFFFF_FFFx, and it keeps looping in instruction fetching. When the chip is in a locked state, it is difficult to obtain the reason why the chip is abnormal. Summary of the invention
[0005] The embodiments of the present invention provide a chip abnormal state processing device, method, chip, medium and program, which can obtain chip abnormal state data in a timely manner and improve the processing efficiency of the chip abnormal state.
[0006] According to one aspect of the present invention, a chip abnormal state processing device is provided, which is configured on a chip and includes an abnormal signal detection module and an abnormal state processing module, wherein the abnormal signal detection module and the abnormal state processing module are communicatively connected, wherein:
[0007] The abnormal signal detection module is used to obtain current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, obtain an abnormal signal detection result, and send the abnormal signal detection result to the abnormal state processing module;
[0008] The abnormal state processing module is used to perform an abnormal state processing operation according to the abnormal signal detection result.
[0009] According to another aspect of the present invention, a chip abnormal state processing method is provided, which is applied to a chip, comprising:
[0010] Acquire current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, and obtain an abnormal signal detection result;
[0011] An abnormal state processing operation is performed according to the abnormal signal detection result.
[0012] According to another aspect of the present invention, there is provided a chip, comprising at least one processor;
[0013] A memory communicatively connected to the at least one processor, and a chip abnormal state processing device as described in any embodiment of the present invention.
[0014] According to another aspect of the present invention, an electronic device is provided, comprising the chip described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the chip abnormal state processing method described in any embodiment of the present invention when executed.
[0016] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the chip abnormal state processing method described in any embodiment of the present invention is implemented.
[0017] The embodiment of the present invention uses an abnormal signal detection module and an abnormal state processing module to form an abnormal state processing device suitable for a chip, so as to obtain the current abnormal state flag data through the abnormal signal detection module, perform abnormal detection on the current abnormal state flag data, and after obtaining the abnormal signal detection result, send the abnormal signal detection result to the abnormal state processing module. The abnormal state processing module can perform abnormal state processing operations according to the abnormal signal detection result, solve the problem that the existing chip cannot quickly obtain the chip abnormal state data, can obtain the chip abnormal state data in time, and improve the processing efficiency of the chip abnormal state.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a structural schematic diagram of a chip abnormal state processing device provided by an embodiment of the present invention;
[0021] Figure 2 It is a structural schematic diagram of a chip abnormal state processing device provided by an embodiment of the present invention;
[0022] Figure 3 It is a structural diagram of a digital logic hardware design inside an abnormal signal input unit provided by an embodiment of the present invention;
[0023] Figure 4 It is a structural diagram of a digital logic hardware design inside an abnormal signal matching unit provided by an embodiment of the present invention;
[0024] Figure 5 is a flow chart of a chip abnormal state processing method provided by an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of the structure of a chip provided by an embodiment of the present invention;
[0026] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "include", "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatus.
[0029] It is understandable that the causes of the chip abnormal state may include but are not limited to the modification or destruction of the homepage vector table of the user program, partial failure of the chip memory leading to user program execution errors, and user program logic errors, etc. Table 1 is a processor abnormal state list provided by an embodiment of the present invention.
[0030] Table 1 Processor abnormal status column
[0031]
[0032] Figure 1 1 is a schematic diagram of the structure of a chip abnormal state processing device provided by an embodiment of the present invention, and the chip abnormal state processing device is configured in the chip. Figure 1 As shown, the structure of the chip abnormal state processing device includes an abnormal signal detection module 110 and an abnormal state processing module 120, and the abnormal signal detection module 110 and the abnormal state processing module 120 are communicatively connected, wherein:
[0033] The abnormal signal detection module 110 is used to obtain the current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, obtain the abnormal signal detection result, and send the abnormal signal detection result to the abnormal state processing module 120. The abnormal state processing module 120 is used to perform abnormal state processing operations according to the abnormal signal detection result.
[0034] Among them, the abnormal signal detection module 110 can be used to detect and match the abnormal signal of the chip. The abnormal state processing module 120 can be used to promptly handle the abnormality currently occurring in the chip. The current abnormal state flag data can be the flag data of various abnormal signals emitted by the chip received by the abnormal signal detection module 110. The abnormal signal detection result can be the abnormal detection result output by the abnormal signal detection module 110, which can determine which specific abnormal types of the chip currently occurs.
[0035] In an embodiment of the present invention, the chip can send the current abnormal state flag data to the abnormal signal detection module 110 in real time. The current abnormal state flag data can use multiple bits to identify the status of various abnormal signals. Exemplarily, it is assumed that the current abnormal state flag data has a total of 3 bits, which are used to identify HardFault exception, Lockup exception and NMI exception respectively. If the current abnormal state flag data is 111, it means that the chip currently has HardFault exception, Lockup exception and NMI exception at the same time. If the current abnormal state flag data is 110, it means that the chip currently has HardFault exception and Lockup exception at the same time.
[0036] The abnormal signal detection module 110 can receive the current abnormal status flag data sent by the chip in real time, and perform abnormality detection based on the acquired current abnormal status flag data, such as specifically judging which abnormal types have occurred based on the values of each bit of the current abnormal status flag data, thereby obtaining the abnormal signal detection result, and sending the abnormal signal detection result to the abnormal status processing module 120.
[0037] After receiving the abnormal signal detection result, the abnormal state processing module 120 can perform abnormal state processing operations as needed, such as saving and outputting abnormal state data, and post-processing the current abnormal state, so as to avoid or resolve chip abnormalities in a timely manner.
[0038] In an optional embodiment of the present invention, the abnormal signal detection result may include but is not limited to the current abnormal state; the current abnormal state may include but is not limited to at least one of NMI, HardFault, Lockup and user-specified abnormality. Among them, the user-specified abnormality may be an abnormality type pre-configured by the user for the chip. When the user-specified abnormality is a specified program address, the specific program address needs to be set in the corresponding configuration.
[0039] Optionally, the abnormal signal detection module 110 can be implemented using a digital logic circuit structure. The abnormal state processing module can be implemented using a digital logic circuit structure, or a software program can be used to implement the corresponding function. The chip configured with the chip abnormal state processing device can be a chip having at least one processor such as a CPU (Central Processing Unit, central processing unit), etc., and having data storage capabilities and interactive communication capabilities. The processor in the chip follows the ARM architecture, RISC-V (Reduced Instruction Set Computer Fifth Generation Architecture, Reduced Instruction Set Fifth Generation Architecture) architecture or other custom architectures and instruction sets. The chip has a power-off volatile memory RAM (Random Access Memory, Random Access Memory), and optionally, it can also have one or more non-power-off volatile memories such as NVM (Non-Volatile Memory), OTP (One Time Programmable Memory, One Time Programmable) or ROM (Read-Only Memory).
[0040] Optionally, the chip abnormal state processing device can be integrated inside the chip processor. Or the chip abnormal state processing device can also be integrated inside the chip and communicate with the chip processor to exchange data. The embodiment of the present invention does not limit the configuration method of the chip to the chip abnormal state processing device.
[0041] It can be seen that the above-mentioned chip abnormal state processing device can monitor the current abnormal state of the chip in real time by configuring the abnormal signal detection module for the chip, and can promptly perform abnormal processing on the chip after the abnormal signal detection module detects that the chip is abnormal by configuring the abnormal state processing module. In the absence of other debugging means, it can support the chip user to obtain the internal state of the chip when the abnormality occurs in time, and avoid or solve the chip abnormality.
[0042] The embodiment of the present invention uses an abnormal signal detection module and an abnormal state processing module to form an abnormal state processing device suitable for a chip, so as to obtain the current abnormal state flag data through the abnormal signal detection module, perform abnormal detection on the current abnormal state flag data, and after obtaining the abnormal signal detection result, send the abnormal signal detection result to the abnormal state processing module. The abnormal state processing module can perform abnormal state processing operations according to the abnormal signal detection result, solve the problem that the existing chip cannot quickly obtain the chip abnormal state data, can obtain the chip abnormal state data in time, and improve the processing efficiency of the chip abnormal state.
[0043] Figure 2 It is a structural diagram of a chip abnormal state processing device provided by an embodiment of the present invention. This embodiment is concretized based on the above embodiment. In this embodiment, the specific composition structure of the internal units of the abnormal signal detection module and the abnormal state processing module are given.
[0044] Correspondingly, such as Figure 2 As shown, the abnormal signal detection module 110 in the chip abnormal state processing device of this embodiment may include an abnormal signal input unit 111 and an abnormal signal matching unit 112: the abnormal signal input unit 111 and the abnormal signal matching unit 112 are communicatively connected, wherein:
[0045] The abnormal signal input unit 111 is used to generate current abnormal state flag data according to the current abnormal signal, and send the current abnormal state flag data to the abnormal signal matching unit; the abnormal signal matching unit 112 is used to obtain abnormal signal configuration reference data, and match the current abnormal state flag data with the abnormal signal configuration reference data to obtain the abnormal signal detection result.
[0046] The abnormal signal configuration reference data may be data configured by the user on the abnormal signal matching unit 112 as needed and used to detect the abnormal state type.
[0047] like Figure 2 As shown, the abnormal signal input unit 111 can be used to receive various abnormal signals sent by the chip, and generate current abnormal state flag data based on various abnormal signals. Optionally, the abnormal signal received by the abnormal signal input unit 111 can be a digital logic signal of an abnormal state. The abnormal signal input unit 111 can include a digital logic hardware design that can summarize all supported abnormal signals and input them to the abnormal signal matching unit 112.
[0048] like Figure 2 As shown, the user can pre-configure the abnormal signal configuration reference data for the abnormal signal matching unit 112. Exemplarily, assuming that the abnormal state flag data has a total of 4 bits, which are used to identify HardFault abnormality, Lockup abnormality, NMI abnormality and user-specified abnormality, respectively. If the user needs to detect and process 4 abnormal states, the abnormal signal configuration reference data can be configured to 1111. If the user only needs to detect and process the three types of abnormal states of HardFault abnormality, Lockup abnormality and NMI abnormality, the abnormal signal configuration reference data can be configured to 1110. The abnormal signal matching unit 112 may include a digital logic design that can match the abnormal signal configuration reference data with the current abnormal state flag data.
[0049] Correspondingly, after the abnormal signal input unit 111 generates the current abnormal state flag data according to the current abnormal signal, the generated current abnormal state flag data can be sent to the abnormal signal matching unit 112. After receiving the current abnormal state flag data, the abnormal signal matching unit 112 can match it with the abnormal signal configuration reference data, and then determine the abnormal signal detection result according to the matching result.
[0050] Optionally, the abnormal signal detection module 110 may be a functional module implemented in the chip design phase, and belongs to the digital logic part of the chip. Figure 2 As shown, the abnormal signal detection module 110 can also be configured with enabling logic. The abnormal state processing module 120 can be a functional module implemented in the chip design stage, that is, it belongs to the digital logic part of the chip, and can control whether this part of the logic is enabled, or it can be a software program code implanted in the chip. The digital logic enable control can configure the digital logic design to be enabled or disabled. Specifically, when the digital logic enable control is turned off, when the chip abnormal state occurs, the subsequent processing behavior is executed according to the processor architecture specification or the subsequent processing behavior is executed according to the software program design by default; when the digital logic enable control is turned on, when the chip abnormal state occurs, the set logic of the abnormal signal detection module 110 and the abnormal state processing module 120 is executed.
[0051] In an optional embodiment of the present invention, the number of current abnormal signals may be multiple, and the abnormal signal input unit 111 is also used to: determine the level value of each current abnormal signal and the bit position of the abnormal status flag data corresponding to each current abnormal signal; assign a value to the bit position of the abnormal status flag data corresponding to each current abnormal signal according to the level value of each current abnormal signal to obtain the current abnormal status flag data.
[0052] Figure 3 Schematic diagram of the structure of the digital logic hardware design of the abnormal signal input unit provided by the embodiment of the present invention. Figure 3 As shown, after the chip detects any abnormal state, the level of the corresponding abnormal signal can be raised through the corresponding register, and the abnormal signal input unit 111 can assign values to the corresponding bits of each abnormal signal in the corresponding abnormal state flag data in a logical or manner according to the high and low level states of each abnormal signal. The value of the corresponding bit of the high-level abnormal signal in the abnormal state flag data is 1, and the value of the corresponding bit of the low-level abnormal signal in the abnormal state flag data is 0, so that the specific value identified by the current abnormal state flag data reflects the abnormal type currently occurring in the chip.
[0053] For example, it is assumed that the current abnormal state flag data has a total of 4 bits, which are used to identify HardFault exception, Lockup exception, NMI exception and user-specified exception respectively, and the original value of each bit in the abnormal state flag data is 0. When the chip detects the occurrence of HardFault exception and user-specified exception, the level of the HardFault exception signal can be raised through the register, so that the first bit and the fourth bit of the current abnormal state flag data are flipped to 1, that is, the current abnormal state flag data is 1001, indicating that the chip currently has a HardFault exception and a user-specified exception.
[0054] Figure 4 Schematic diagram of the structure of the digital logic hardware design of the abnormal signal matching unit provided by the embodiment of the present invention. Figure 4 As shown, the abnormal signal matching unit 112 can match the current abnormal state flag data with the abnormal signal configuration reference data in a logical AND manner. It can be understood that the abnormal signal detection result can be that at least one abnormal signal is matched successfully or unsuccessfully. Unsuccessful matching can include a situation where there is no abnormal state, and can also include a situation where an abnormal state exists but does not belong to the abnormal state range configured by the abnormal signal configuration reference data. For example, the user only needs to detect and process the three types of abnormal states, namely HardFault exception, Lockup exception and NMI exception, and configure the abnormal signal configuration reference data to 1110. If the current abnormal state flag data is 0001, the matching result is 0000, that is, the match is unsuccessful, indicating that there is currently a user-specified abnormality, but the abnormal state is not a monitoring state that the user is concerned about.
[0055] like Figure 2 As shown, the abnormal state processing module 120 may include an abnormal state saving unit 121, which is used to: when it is determined that the abnormal signal detection result matches the target abnormal state, determine the target register according to the abnormal signal detection result; and store the data saved in the target register into the target memory address.
[0056] The target abnormal state is also a state of a successful match. The target register may be a register for storing abnormal state analysis-related data, or may be other registers outside the chip default storage register range. The target memory address may be a memory address for storing data stored in the target register.
[0057] Correspondingly, such as Figure 2 and Figure 4As shown, when the abnormal signal matching unit 112 determines that the abnormal signal detection result includes an abnormal state, and the abnormal state belongs to the abnormal state range set by the abnormal signal configuration reference data, that is, the match is successful, the matching result can be sent to the abnormal state processing module 120 for further processing. Specifically, the target register corresponding to the target abnormal state data can be determined by the abnormal state storage unit 121 according to the abnormal signal detection result, and the target register can store the associated data of the target abnormal state. Exemplarily, the target register can be a general register, a special register, and other abnormal related registers specified by the user when the chip is in an abnormal state. The data stored in the target register can be used as reference data to analyze or process the abnormal state, such as abnormal log data and abnormal cause data. The user can analyze the cause of the abnormal state of the chip based on the data stored in the target register to perform abnormal processing on the chip in a targeted manner. Further, the abnormal state storage unit 121 can store the data stored in the target register in the target memory address.
[0058] In an optional embodiment of the present invention, the abnormal state processing module 120 may also include an abnormal state output unit 122, which may be used to: determine an automatic output method for abnormal state field data according to abnormal state output configuration information; wherein the automatic output method includes a communication method, a communication protocol and a communication rate; and automatically output the abnormal state field data through the automatic output method.
[0059] The abnormal state output configuration information may be configuration information for automatically outputting data. The abnormal state field data may be data stored in the target memory address, which can help users obtain the abnormal state field information of the chip, so as to timely analyze the cause of the abnormality of the chip and solve the chip abnormality.
[0060] Optionally, the abnormal status field data is not automatically output by default. Figure 2As shown, the abnormal state output unit 122 can determine the communication mode, communication protocol and communication rate of the abnormal state field data according to the abnormal state output configuration information, so as to automatically output the abnormal state field data through the configured automatic output mode. Optionally, the communication mode of the abnormal state field data can include but is not limited to USB (Universal Serial Bus), UART (Universal Asynchronous Receiver / Transmitter), SPI (Serial Peripheral Interface), I2C (Inter-Integrated Circuit), SWI (Single-Wire Interface), GPIO (General Purpose Input Output) and RF (Radio Frequency) and other communication modes. If the specific values of the communication mode, communication protocol and communication rate are not specified in the abnormal state output configuration information, the communication mode, communication protocol and communication rate can also be determined by the default value of the chip.
[0061] In an optional embodiment of the present invention, the abnormal state processing module 120 may include an abnormal state post-processing unit 123, and the abnormal state post-processing unit 123 is used to: determine the current abnormal state post-processing behavior according to the abnormal signal detection result; wherein the current abnormal state post-processing behavior may include at least one of reset, infinite loop, returning to the chip initial state (Boot, Bootloader, etc.) and executing a user-defined program; the user-defined program may include an entry address for executing the user-defined program; and perform abnormal state processing operations through the current abnormal state post-processing behavior.
[0062] Correspondingly, such as Figure 2As shown, the abnormal state processing module 120 can also determine the post-processing behavior that matches the current abnormal state according to the abnormal signal detection result through the internal abnormal state post-processing unit 123, such as reset, dead loop, return to the chip initial state (Boot, Bootloader, etc.) and execute user-defined programs. When the current abnormal state post-processing behavior is to execute a user-defined program, the specific program address set by the user in the corresponding configuration in the user-specified exception can be used as the entry address of the custom program, and then the user-defined program is obtained and executed through the entry address to achieve the processing of the abnormal state. Among them, returning to the chip initial state can be setting the chip to return to the initial state. Optionally, the initial state of the chip can be the state in which the user program is not loaded when the chip provider provides the chip to the downstream. Alternatively, the initial state of the chip can also be the state provided to the terminal user after the chip provider provides the chip to the downstream and the downstream service provider loads the user program.
[0063] In an optional embodiment of the present invention, the abnormal state processing module 120 is also used to: determine the default behavior of exception processing or the default behavior of the software program when it is determined that the abnormal signal detection result is an abnormal state that is not matched; and perform an abnormal state processing operation through the default behavior of exception processing or the default behavior of the software program.
[0064] The default behavior of exception handling may be the default behavior of the chip processor framework, and the default behavior of the software program may be the default behavior of the software logic inside the chip.
[0065] It should be noted that if Figure 4 As shown, if the abnormal signal matching unit 112 determines that the abnormal signal detection result includes an abnormal state, but the abnormal state does not belong to the abnormal state range set by the abnormal signal configuration reference data, that is, the match is unsuccessful, then the internal processor of the chip can process the current abnormal state according to the specified default behavior or software program default behavior. Optionally, the default behavior of the processor architecture is generally to enter a hardware error or lock, etc.
[0066] The above technical solution configures digital logic inside the chip to monitor the abnormal state of the chip, cooperates with the software program to save the abnormal state field data, and can output it to the chip user in a specific way, so that the chip user can obtain the chip abnormal state data in time. At the same time, by providing different abnormal state post-processing behaviors, it can help users avoid or solve the chip abnormal state and improve the processing efficiency of the chip abnormal state.
[0067] Figure 5is a flowchart of a chip abnormal state processing method provided by an embodiment of the present invention. This embodiment is applicable to the case where abnormality detection and processing of the chip is performed according to the acquired current abnormal state flag data. The method can be executed by a chip abnormal state processing device, which can be implemented by software and / or hardware and can generally be integrated in the chip. Figure 5 As shown, the method includes the following operations:
[0068] S110, obtaining current abnormal state flag data, performing abnormality detection on the current abnormal state flag data, and obtaining an abnormal signal detection result.
[0069] S120: Perform an abnormal state processing operation according to the abnormal signal detection result.
[0070] Optionally, obtaining current abnormal state flag data includes: generating the current abnormal state flag data according to a current abnormal signal; performing abnormality detection on the current abnormal state flag data to obtain an abnormal signal detection result, including: obtaining abnormal signal configuration reference data, and matching the current abnormal state flag data with the abnormal signal configuration reference data to obtain the abnormal signal detection result.
[0071] Optionally, there are multiple current abnormal signals, and generating the current abnormal status flag data based on the current abnormal signals includes: determining the level value of each of the current abnormal signals and the bit position of the abnormal status flag data corresponding to each of the current abnormal signals; assigning a value to the bit position of the abnormal status flag data corresponding to each of the current abnormal signals according to the level value of each of the current abnormal signals to obtain the current abnormal status flag data.
[0072] Optionally, an abnormal state processing operation is performed according to the abnormal signal detection result, including: when it is determined that the abnormal signal detection result matches the target abnormal state, determining the target register according to the abnormal signal detection result; and storing the data saved in the target register into the target memory address.
[0073] Optionally, an abnormal state processing operation is performed according to the abnormal signal detection result, including: determining an automatic output method for abnormal state field data according to abnormal state output configuration information; wherein the automatic output method includes a communication method, a communication protocol and a communication rate; and automatically outputting the abnormal state field data through the automatic output method.
[0074] Optionally, an abnormal state processing operation is performed according to the abnormal signal detection result, including: determining a current abnormal state post-processing behavior according to the abnormal signal detection result; wherein the current abnormal state post-processing behavior includes at least one of a reset, an infinite loop, returning to the chip initial state, and executing a user-defined program; the user-defined program includes an entry address for executing the user-defined program; and performing an abnormal state processing operation through the current abnormal state post-processing behavior.
[0075] Optionally, performing an abnormal state processing operation according to the abnormal signal detection result includes: determining an abnormal state mismatch by determining an abnormal state processing default behavior or a software program default behavior; and performing an abnormal state processing operation by using the abnormal state processing default behavior or the software program default behavior.
[0076] Optionally, the abnormal signal detection result includes a current abnormal state; the current abnormal state includes at least one of NMI, HardFault, Lockup and user-specified abnormality.
[0077] The embodiment of the present invention obtains the current abnormal state flag data, performs abnormality detection on the current abnormal state flag data, obtains the abnormal signal detection result, and then performs abnormal state processing operation according to the abnormal signal detection result, thereby solving the problem that the existing chip cannot quickly obtain the chip abnormal state data. The chip abnormal state data can be obtained in time, and the processing efficiency of the chip abnormal state is improved.
[0078] The above chip abnormal state processing method is a method that can be executed by the chip abnormal state processing device provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the method executed by the chip abnormal state processing device provided by any embodiment of the present invention.
[0079] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with the relevant laws and regulations and do not violate public order and good morals.
[0080] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.
[0081] Figure 6 FIG. 1 is a schematic diagram showing the structure of a chip 10 that can be used to implement an embodiment of the present invention. Figure 6As shown, the chip abnormal state processing 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. Various programs and data required for the operation of the chip 10 can also be stored in the RAM 13. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14. At the same time, the chip 10 may also include the chip abnormal state processing device ( Figure 6 not shown).
[0082] Optionally, the chip abnormal state processing device includes an abnormal signal detection module and an abnormal state processing module, the abnormal signal detection module and the abnormal state processing module are communicatively connected, wherein:
[0083] The abnormal signal detection module is used to obtain current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, obtain an abnormal signal detection result, and send the abnormal signal detection result to the abnormal state processing module;
[0084] The abnormal state processing module is used to perform an abnormal state processing operation according to the abnormal signal detection result.
[0085] Several components in chip 10 are connected to I / O interface 15, including input unit 16, output unit 17, storage unit 18, and communication unit 19. Communication unit 19 allows chip 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0086] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a chip abnormal state processing method.
[0087] Optionally, the chip abnormal state processing method may include: acquiring current abnormal state flag data, performing abnormality detection on the current abnormal state flag data to obtain an abnormal signal detection result; and performing an abnormal state processing operation according to the abnormal signal detection result.
[0088] In some embodiments, the chip abnormal state processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the chip 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the chip abnormal state processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the chip abnormal state processing method in any other appropriate manner (e.g., by means of firmware).
[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0091] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0093] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0094] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0095] Figure 7 is a structural diagram of an electronic device provided according to an embodiment of the present invention. Figure 7 As shown, the electronic device includes a chip 10 as described in any embodiment of the present invention.
[0096] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0097] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A chip abnormal state processing device, characterized in that: The chip is configured to include an abnormal signal detection module and an abnormal state processing module, wherein the abnormal signal detection module and the abnormal state processing module are communicatively connected, wherein: The abnormal signal detection module is used to obtain current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, obtain an abnormal signal detection result, and send the abnormal signal detection result to the abnormal state processing module; The abnormal state processing module is used to perform an abnormal state processing operation according to the abnormal signal detection result.
2. The device according to claim 1, characterized in that The abnormal signal detection module includes an abnormal signal input unit and an abnormal signal matching unit, wherein the abnormal signal input unit and the abnormal signal matching unit are communicatively connected, wherein: The abnormal signal input unit is used to generate the current abnormal state flag data according to the current abnormal signal, and send the current abnormal state flag data to the abnormal signal matching unit; The abnormal signal matching unit is used to obtain abnormal signal configuration reference data, and match the current abnormal state flag data with the abnormal signal configuration reference data to obtain the abnormal signal detection result.
3. The device according to claim 2, characterized in that The number of the current abnormal signals is multiple, and the abnormal signal input unit is further used for: Determine the level value of each of the current abnormal signals and the bit position of the abnormal state flag data corresponding to each of the current abnormal signals; The bit positions of the abnormal state flag data corresponding to each of the current abnormal signals are assigned values according to the level values of each of the current abnormal signals to obtain the current abnormal state flag data.
4. The device according to claim 1, characterized in that The abnormal state processing module includes an abnormal state storage unit, and the abnormal state storage unit is used to: In the case where it is determined that the abnormal signal detection result matches the target abnormal state, determining the target register according to the abnormal signal detection result; The data stored in the target register is stored in the target memory address.
5. The device according to claim 1, characterized in that The abnormal state processing module includes an abnormal state output unit, and the abnormal state output unit is used to: Determine an automatic output mode of abnormal state field data according to the abnormal state output configuration information; wherein the automatic output mode includes a communication mode, a communication protocol and a communication rate; The abnormal state field data is automatically outputted through the automatic output method.
6. The device according to claim 1, characterized in that The abnormal state processing module includes an abnormal state post-processing unit, and the abnormal state post-processing unit is used to: Determine a post-processing behavior of the current abnormal state according to the abnormal signal detection result; wherein the post-processing behavior of the current abnormal state includes at least one of reset, infinite loop, returning to the initial state of the chip, and executing a user-defined program; the user-defined program includes an entry address for executing the user-defined program; An abnormal state processing operation is performed through the current abnormal state post-processing behavior.
7. The device according to claim 1, characterized in that The abnormal state processing module is also used for: In the case where it is determined that the abnormal signal detection result is an abnormal state that is not matched, determining an abnormal processing default behavior or a software program default behavior; The abnormal state processing operation is performed through the abnormal processing default behavior or the software program default behavior.
8. The device according to any one of claims 1 to 7, characterized in that: The abnormal signal detection result includes a current abnormal state; the current abnormal state includes at least one of a non-maskable interrupt NMI, a hardware error HardFault, a lockup, and a user-specified abnormality.
9. A chip abnormal state processing method, characterized in that: Applied to chips, including: Acquire current abnormal state flag data, perform abnormality detection on the current abnormal state flag data, and obtain an abnormal signal detection result; An abnormal state processing operation is performed according to the abnormal signal detection result.
10. A chip, characterized in that: The chip comprises: at least one processor; A memory communicatively connected to the at least one processor, and a chip abnormal state processing device as described in any one of claims 1-8.
