Single bit flip fast repair method, device, computer equipment and storage medium
By segmenting and copying program segments in the processor, using interrupt response services for real-time checksum comparison, single-bit flip is directly fixed in the processor, solving the hardware resource overhead and real-time problems in the prior art, and improving data Processing efficiency.
Patent Information
- Application Number
- CN202111001156.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-08-30
AI Technical Summary
The prior art requires adding hardware resources when processing single-bit flips, resulting in a reduction in real-time data processing, and each data read needs to pass through a memory controller, affecting efficiency.
By dividing the program segments in the internal RAM into multiple subprograms, copying them into replica blocks, and calling the interrupt response service for real-time checksum comparison when triggered by the timer, the original block is repaired based on the comparison results, avoiding the increase The hardware resource requirements are directly read in the processor.
It improves the real-time data processing of the chip processor, reduces hardware resource overhead, and realizes rapid repair of single-bit flip without passing through the memory controller.
Smart Images

Figure CN113626246B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of digital processing chips, and in particular to a method, device, computer equipment and storage medium for rapid repair of a single-bit flip. Background Art
[0002] In computer chip technology, due to the influence of chip packaging materials, single-bit flips may occur in memory. Single-bit flips refer to: a certain bit in the memory randomly jumps, and the originally stored 1 becomes 0, or the originally stored 1 becomes 0. This situation will seriously affect the execution of the program or the storage of data. For example, a bit in the binary bit that originally represents the number 4 may eventually be displayed as $ due to a single-bit flip. The phenomenon of single-bit flips is random, and the errors that occur each time are different. Rewriting or resetting can restore to normal, but it cannot be restored during operation. When a large amount of data is stored and processed, if reset is always required, a lot of time and computing resources will be wasted.
[0003] At present, adding hardware is commonly used to solve the problem of single-bit flipping, such as adding an EDAC (Error Detection And Correction) system structure in the memory controller. The main idea of this hardware structure is to generate a certain number of check codes based on the original data written into the memory when the original data is written, and save it together with the corresponding original data; when reading, the check code is also read out, and the judgment is made based on the check code and the read data. For example, the traditional parity check code sets the parity bit to 1 based on the odd number of 1 bits in the original data. If a single-bit flip occurs, causing the number of 1 bits to become an even number, after comparing it with the stored parity bit, it can be determined that a single-bit flip has occurred, which can be automatically corrected, and the correct data is output, and the corrected data is written back to cover the original erroneous data at the same time, and finally the correct data is transmitted to the processor for processing. All these actions are automatically completed by hardware design.
[0004] However, this method currently requires increased hardware resource overhead, and each data read must pass through the memory controller, reducing the real-time performance of data processing. Summary of the invention
[0005] Based on this, it is necessary to provide a single-bit flip fast repair method, device, computer equipment and storage medium to address the above technical problems.
[0006] A single bit flip fast repair method, the method comprising:
[0007] After power-on, the original program segment in the internal RAM is divided into multiple sub-programs;
[0008] Copying the plurality of subprogram segments as duplicate program segments;
[0009] For each copy program segment, respectively obtain the original program checksum, and store the original program checksum and the copy program segment in an external RAM;
[0010] Under the triggering of the timer, the interrupt response service is called to obtain the real-time checksum of each subroutine, and the checksum is compared with the original program checksum to obtain the program status of the subroutine;
[0011] The original program segment is repaired according to the program state.
[0012] In one embodiment, when a timer is triggered, the interrupt response service is called to obtain a real-time checksum for each subroutine, and the checksum is compared with the original program checksum to obtain the program status of the subroutine, including:
[0013] Calling an interrupt response service to compare the real-time checksum with the original program checksum to obtain a comparison result;
[0014] If the comparison result is a verification error, the program status of the subroutine is determined to be a program error.
[0015] In one embodiment, repairing the original program segment according to the program state includes:
[0016] If the program status is a program error, then obtaining the starting address of the corresponding error subroutine in the internal RAM and the length of the program occupied space;
[0017] According to the starting address and the length of the space occupied by the program, the error subroutine is compared with the corresponding copy program segment field by field to obtain the error field;
[0018] Compare the error field with the corresponding copy field bit by bit to obtain the number of error bits;
[0019] Repair the original program segment according to the number of erroneous bits.
[0020] In one embodiment, repairing the original program segment according to the number of erroneous bits includes:
[0021] If the number of error bits is only one, the corresponding error bit is flipped to obtain a subroutine after error correction;
[0022] Calling the interrupt response service to perform verification on the error-corrected subroutine to obtain a verification result;
[0023] If within the preset time period, the verification results are all normal, then the repair is judged to be successful.
[0024] In one embodiment, the internal RAM includes a data constant area; before calling the interrupt response service to check the error-corrected subroutine, the method further includes:
[0025] Determining whether the data constant area changes;
[0026] If a change occurs, the corresponding data in the external backup data area is copied to the data constant area; wherein the external backup data area is obtained by copying the data in the original data constant area to the external RAM when power is turned on.
[0027] In one embodiment, if the number of error bits includes multiple bits, a restart instruction is triggered to restart the entire chip.
[0028] In one of the embodiments, when the interrupt response service is executed, other programs are stopped.
[0029] A single-bit flip fast repair device, the device comprising:
[0030] Subroutine segmentation module, used to divide the original program segment in the internal RAM into multiple subroutines after power-on;
[0031] A copy program segment copying module, used for copying the plurality of subprogram segments as copy program segments;
[0032] An original program checksum obtaining module, used for respectively obtaining an original program checksum for each copy program segment, and storing the original program checksum and the copy program segment in an external RAM;
[0033] A program status determination module is used to call the interrupt response service to obtain a real-time checksum for each subroutine under the triggering of a timer, and compare it with the original program checksum to obtain the program status of the subroutine;
[0034] The original program segment repairing module is used to repair the original program segment according to the program state.
[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above-mentioned single-bit flip fast repair method embodiment when executing the computer program.
[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the above-mentioned single-bit flip fast repair method embodiment.
[0037] The above-mentioned single-bit flip fast repair method, device, computer equipment and storage medium divide the original program segment in the internal RAM into multiple subprograms after the chip is powered on; copy the multiple subprograms as copy program segments; obtain the original program checksum for each copy program segment, store the original program checksum and the copy program segment in the external RAM; under the triggering of the timer, call the interrupt response service to obtain the real-time checksum for each subprogram, compare it with the original program checksum, and obtain the program status of the subprogram; repair the original program segment according to the program status. This application mainly repairs by calling the interrupt response service. Compared with the solution of adding a memory controller for repair in the traditional technology, it does not need to increase hardware resources, and does not need to pass through the memory controller when the processor reads data, which further improves the real-time performance of the chip processor in data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a process flow of a single bit flip fast repair method in one embodiment;
[0039] Figure 2 A schematic diagram of a process flow of a single-bit flip fast repair method in another embodiment;
[0040] Figure 3 A schematic diagram of a process flow of a single-bit flip fast repair method in another embodiment;
[0041] Figure 4 A structural block diagram of a single-bit flip fast repair device in an embodiment;
[0042] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The single-bit flip fast repair method provided in this application can be applied to the ZYNQ chip in the power system, especially the CSD-602 series merging unit device. The CSD-602 series merging unit device includes a series of chip models, which are suitable for digital substations. The device is located in the process layer of the substation, and can collect analog signals of traditional current and voltage transformers, as well as digital signals of electronic current and voltage transformers, and send the sampled values (SV) to the protection, measurement and control, fault recording and other devices of the interval layer in the form of optical-Ethernet according to IEC61850-9-2. The device can also judge the position of the knife switch and the circuit breaker to complete the switching or parallel function according to the GOOSE sent by the intelligent terminal of the process layer or the on-site collection of the input value of this device. At the same time, it can communicate with other measurement and control devices to send the operating status, alarm, remote signal and other information of other measurement and control devices.
[0045] The packaging material of the ZYNQ chip contains alpha particles, which causes the high-speed RAM (Random Access Memory, also called main memory, which is the internal memory that directly exchanges data with the CPU) in the ZYNQ chip to easily produce bit flips. The external ZYNQ chip is DDR (DDR SDRAM, full name Double Data Rate synchronous dynamic random-access memory, double rate synchronous dynamic random access memory) memory, and the probability of flipping is very low. This application mainly provides a repair solution for the bit flipping of the RAM area inside the ZYNQ chip.
[0046] The RAM in the CSD602 chip is mainly divided into internal RAM and external RAM, as shown in the following table:
[0047]
[0048] In one embodiment, Figure 1 As shown, a single-bit flip fast repair method is provided, which is described by taking the method applied to a processor (CPU) in a chip as an example, and includes the following steps:
[0049] Step S101, after power-on, the original program segment in the internal RAM is divided into multiple sub-programs.
[0050] The original program segment is the program code for implementing the application program written into the chip.
[0051] Specifically, after the chip is powered on, the original program segment in the memory is divided into multiple sub-programs.
[0052] Step S102, copy multiple subprogram segments as duplicate program segments.
[0053] Specifically, the above-mentioned multiple subprogram segments are copied as duplicate program segments, and the original program segments in the original internal RAM still exist in the internal RAM.
[0054] Step S103, obtaining the original program checksum for each copy program segment, and storing the original program checksum and the copy program segment in an external RAM;
[0055] Among them, the original program checksum, also called the program check code, is a check code calculated using certain rules, such as a parity check code, which calculates whether the number of 1 bits in the source code of each subroutine is odd or even. It can also be other forms of check codes, not limited to parity check codes.
[0056] Specifically, the processor calls MISR (Master Interrupt Service Routine) to obtain the original program checksum for each of the above-mentioned copy program segments, and stores the original program checksum and the corresponding copy program segment in the external RAM.
[0057] Step S104, under the triggering of the timer, the interrupt response service is called to obtain the real-time checksum of each subroutine, and the checksum is compared with the original program checksum to obtain the program status of the subroutine.
[0058] Specifically, when triggered by the timer, the processor calls the interrupt response service (for example, a 125us interrupt) to obtain a real-time checksum for each subroutine in the internal RAM, and compares the real-time checksum with the original program checksum stored in the external RAM to obtain the program status of the subroutine. For example, if the comparison result is inconsistent, it indicates that the subroutine has an error. If the comparison is consistent, it indicates that there is no bit flipping in the subroutine.
[0059] Step S105, repairing the original program segment according to the program status.
[0060] Specifically, if the program status is a program error, the erroneous subroutine is repaired, thereby repairing the entire original program segment. The repair method includes restarting or finding the flipped bit and flipping it accordingly.
[0061] The above embodiment, after the chip is powered on, divides the original program segment in the internal RAM into multiple subprograms; copies the multiple subprograms as copy program segments; obtains the original program checksum for each copy program segment, stores the original program checksum and the copy program segment in the external RAM; under the triggering of the timer, calls the interrupt response service to obtain the real-time checksum for each subprogram, compares it with the original program checksum, and obtains the program status of the subprogram; repairs the original program segment according to the program status. This embodiment mainly repairs by calling the interrupt response service. Compared with the solution of adding a memory controller for repair in the traditional technology, it does not need to increase hardware resources, and does not need to pass through the memory controller when the processor reads data, which further improves the real-time performance of the chip processor in data processing.
[0062] In one embodiment, the above step S104 includes: calling an interrupt response service to compare the real-time checksum with the original program checksum to obtain a comparison result; if the comparison result is a check error, determining that the program status of the subroutine is a program error.
[0063] Specifically, when triggered by the timer, the processor calls the interrupt response service (for example, a 125us interrupt) to obtain a real-time checksum for each subroutine in the internal RAM, and compares the real-time checksum with the original program checksum stored in the external RAM to obtain the program status of the subroutine. For example, if the comparison result is inconsistent, it indicates that the subroutine has an error. If the comparison is consistent, it indicates that there is no bit flipping in the subroutine.
[0064] In the above embodiment, by calculating the real-time checksum and comparing the real-time checksum with the stored original program checksum, the subroutine with bit flipping is detected and the program status of the subroutine is obtained, providing data for subsequent program repair.
[0065] In one embodiment, the above-mentioned step S105 includes: if the program status is a program error, obtaining the starting address of the corresponding erroneous subroutine in the internal RAM and the length of the program occupied space; according to the starting address and the length of the program occupied space, comparing the erroneous subroutine with the corresponding copy program segment field by field to obtain the erroneous field; comparing the erroneous field with the corresponding copy field bit by bit to obtain the number of erroneous bits; repairing the original program segment according to the number of erroneous bits.
[0066] like Figure 2 As shown, Figure 2The flowchart of the single-bit flip quick repair method in another embodiment is shown in FIG. 1 . MISR divides the original program segment into several segments, and checks each subroutine at a 125us interrupt. If there is a problem with the check of a segment, the starting address area and length of the segment are returned to the process that handles the application in the processor. The application process finds that there is a problem with the MISR program check, and obtains the starting address and length of the erroneous program segment, and compares them with the copy program segments backed up in the external RAM one by one LONG (LONG is a field, a LONG is generally 4 bytes, and may also be 8 bytes in some systems). It can be found that a certain LONG has changed, and then the bits of the LONG are compared bit by bit to obtain the number of erroneous bits, for example, whether one bit is flipped or multiple bits are flipped.
[0067] In the above embodiment, the subroutine is compared with the copy program segment field by field through the interrupt response service, so that the error field can be accurately located, which is conducive to subsequent accurate repair.
[0068] In one embodiment, the above-mentioned repairing of the original program segment according to the number of error bits includes: if the number of error bits is only one, flipping the corresponding error bit to obtain a subroutine after error correction; calling an interrupt response service to verify the subroutine after error correction to obtain a verification result; if within a preset time period, the verification results show that the program is normal, then it is determined that the repair is successful.
[0069] like Figure 2 As shown in the figure, if only one bit changes in the error program segment, the bit is repaired according to the backup copy program segment. If there is no change, the program continues to execute normally. The following MISR program check is continued. If no MISR check abnormality occurs within the preset time period (for example, within 1 minute), it proves that the repair is successful. If a MISR check error still occurs within the preset time period (for example, within 1 minute), the entire chip is restarted immediately.
[0070] In the above embodiment, after repair, the program is re-checked without restarting the program every time, which is beneficial to improving the data processing efficiency of the chip.
[0071] In one embodiment, the internal RAM includes a data constant area, and before the calling interrupt response service performs verification on the error-corrected subroutine, the method further includes:
[0072] Determine whether the data constant area has changed; if it has changed, copy the corresponding data in the external backup data area to the data constant area; wherein the external backup data area is obtained by copying the data in the original data constant area to the external RAM when power is turned on.
[0073] Specifically, if only one bit of the program segment changes, the bit is repaired according to the backup program area, and at the same time, it is determined whether the data constant area (such as scale factor, 9-2 transmission channel, configuration area) has changed. If it has changed, the external backup area is copied to the corresponding data constant area. If it has not changed, the program continues to execute normally. Among them, the external backup data area is obtained by copying the data in the original data constant area to the external RAM when power is turned on.
[0074] The above embodiment helps to improve the accuracy of the entire program by checking and repairing the data constant area.
[0075] In one embodiment, if the number of error bits includes multiple bits, a restart instruction is triggered to restart the entire chip.
[0076] Specifically, if more than one bit changes in the error program segment, it means that the tampered program has destroyed the program area, and the entire chip is restarted.
[0077] In the above embodiment, the entire chip is restarted when multiple bits are flipped, thereby ensuring the efficiency of program segment repair.
[0078] In one embodiment, once a MISR check is found to be abnormal, the backup copy program segment is directly copied to the internal RAM, and the external backup data constant area is copied to the data constant area of the chip's internal RAM. During the repair and judgment process, when the 125us interrupt program is in progress, all other programs stop running, including collection and SV (sampling value) transmission. After the program is repaired, data collection and SV (sampling value) reception are first opened. After a delay of 1.5ms, the real-time data area has 5 points for newly collected data before the SV (sampling value) transmission is opened. If MISR or other checksum errors occur again within 1 hour, indicating that the recovery has failed, the entire chip is restarted. In the merged unit program, the relevant SV (sampling value) programs are placed in the program area of the chip's internal RAM, and it is necessary to ensure that the program in this area is completely correct.
[0079] In one embodiment, if Figure 3 As shown, Figure 3 A flow chart of a single-bit flip quick repair method in another embodiment is shown. In the repair method, the prerequisite is: it is not considered that the external RAM backup program area and the chip internal RAM program area are modified at the same time within 1 hour.
[0080] After power-on initialization, the entire internal program area of DSP 0x12460C~0x13bFFF is copied to the external RAM, and a program checksum is performed on this backup program area (in the data area of DDR). The external data RAM has sufficient space to store the backup program area. When power is turned on, the constant area and fixed value area to be used are backed up in the external data area, and a checksum is performed on this backup area. The checksum of the backup program is checked once every hour to see if it is correct. If the number of abnormalities is greater than the preset number, for example 3 times, the abnormality is repaired. If it is still not repaired after more than 3 times, the chip is re-installed.
[0081] The above embodiment does not need to increase hardware resource overhead, thereby improving the real-time performance of data processing.
[0082] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0083] In one embodiment, Figure 4 As shown, a single-bit flip fast repair device 400 is provided, comprising: a subroutine segmentation module 401, a replica program segment copying module 402, an original program checksum obtaining module 403, a program state determination module 404, and an original program segment repairing module 405, wherein:
[0084] The subroutine segmentation module 401 is used to divide the original program segment in the internal RAM into multiple subroutine segments after power-on;
[0085] A duplicate program segment copying module 402 is used to copy the plurality of subprogram segments as duplicate program segments;
[0086] The original program checksum obtaining module 403 is used to obtain the original program checksum for each copy program segment, and store the original program checksum and the copy program segment in an external RAM;
[0087] The program status determination module 404 is used to call the interrupt response service to obtain a real-time checksum for each subroutine when triggered by a timer, and compare it with the original program checksum to obtain the program status of the subroutine;
[0088] The original program segment repairing module 405 is used to repair the original program segment according to the program state.
[0089] In one embodiment, the program status determination module 404 is further used to: call the interrupt response service to compare the real-time checksum with the original program checksum to obtain a comparison result; if the comparison result is a check error, the program status of the subroutine is determined to be a program error.
[0090] In one embodiment, the original program segment repair module 405 is further used to, if the program status is a program error, obtain the starting address of the corresponding erroneous subroutine in the internal RAM and the length of the program occupied space; compare the erroneous subroutine with the corresponding copy program segment field by field according to the starting address and the length of the program occupied space to obtain the erroneous field; compare the erroneous field with the corresponding copy field bit by bit to obtain the number of erroneous bits; and repair the original program segment according to the number of erroneous bits.
[0091] In one embodiment, the above-mentioned original program segment repair module 405 is further used to, if the number of erroneous bits is only one, flip the corresponding erroneous bit to obtain a subroutine after error correction; call the interrupt response service to verify the subroutine after error correction to obtain a verification result; if within a preset time period, the verification results are all normal for the program, it is determined that the repair is successful.
[0092] In one embodiment, the internal RAM includes a data constant area; the above-mentioned original program segment repair module 405 is also used to determine whether the data constant area has changed; if it has changed, the corresponding data in the external backup data area is copied to the data constant area; wherein, the external backup data area is obtained by copying the data in the original data constant area to the external RAM when power is turned on.
[0093] In one embodiment, if the number of error bits includes multiple bits, a restart instruction is triggered to restart the entire chip.
[0094] In one embodiment, when the interrupt response service is executed, other programs are stopped.
[0095] For the specific definition of the single-bit flip quick repair device, please refer to the definition of the single-bit flip quick repair method above, which will not be repeated here. Each module in the above-mentioned single-bit flip quick repair device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0096] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store application data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a single-bit flip fast repair method is implemented.
[0097] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0098] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, each step in the above-mentioned single-bit flip fast repair method embodiment is implemented.
[0099] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, each step in the above-mentioned single-bit flip fast repair method embodiment is implemented.
[0100] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A single bit flip fast repair method, characterized in that: Applied to the RAM area inside the ZYNQ chip, the method includes: After power-on, the main interrupt service routine is called to divide the original program segment in the internal RAM into multiple sub-programs; Copying the plurality of subprogram segments as duplicate program segments; Calling the main interrupt service program to obtain the original program checksum for each copy program segment, and storing the original program checksum and the copy program segment in an external RAM; Under the triggering of the timer, the interrupt response service is called to obtain the real-time checksum of each subroutine, and the checksum is compared with the original program checksum to obtain the program status of the subroutine; Repairing the original program segment according to the program status includes: if the program status is a program error, obtaining the starting address of the corresponding error subroutine in the internal RAM and the length of the program occupied space; comparing the error subroutine with the corresponding copy program segment field by field according to the starting address and the length of the program occupied space to obtain the error field; comparing the error field with the corresponding copy field bit by bit to obtain the number of error bits; repairing the original program segment according to the number of error bits.
2. The method according to claim 1, characterized in that The interrupt response service is called under the triggering of the timer to obtain the real-time checksum of each subroutine, and the real-time checksum is compared with the original program checksum to obtain the program status of the subroutine, including: Calling an interrupt response service to compare the real-time checksum with the original program checksum to obtain a comparison result; If the comparison result is a verification error, the program status of the subroutine is determined to be a program error.
3. The method according to claim 1, characterized in that The repairing of the original program segment according to the number of erroneous bits comprises: If the number of error bits is only one, the corresponding error bit is flipped to obtain a subroutine after error correction; Calling the interrupt response service to perform verification on the error-corrected subroutine to obtain a verification result; If within the preset time period, the verification results are all normal, then the repair is judged to be successful.
4. The method according to claim 3, characterized in that The internal RAM includes a data constant area; before calling the interrupt response service to check the error-corrected subroutine, the method further includes: Determining whether the data constant area changes; If a change occurs, the corresponding data in the external backup data area is copied to the data constant area; wherein the external backup data area is obtained by copying the data in the original data constant area to the external RAM when power is turned on.
5. The method according to claim 3, characterized in that: If the number of error bits includes multiple bits, a restart instruction is triggered to restart the entire chip.
6. The method according to any one of claims 1 to 5, characterized in that: When the interrupt response service is executed, other programs are stopped.
7. A single bit flip fast repair device, characterized in that: Applied to the RAM area inside the ZYNQ chip, the device comprises: The subroutine segmentation module is used to call the main interrupt service program to divide the original program segment in the internal RAM into multiple subroutines after power-on; A copy program segment copying module, used for copying the plurality of subprogram segments as copy program segments; An original program checksum obtaining module, used for calling the main interrupt service program to obtain the original program checksum for each copy program segment, and storing the original program checksum and the copy program segment in an external RAM; A program status determination module is used to call the interrupt response service to obtain a real-time checksum for each subroutine under the triggering of a timer, and compare it with the original program checksum to obtain the program status of the subroutine; The original program segment repair module is used to repair the original program segment according to the program status, including: if the program status is a program error, obtaining the starting address of the corresponding error subroutine in the internal RAM and the length of the program occupied space; according to the starting address and the length of the program occupied space, comparing the error subroutine with the corresponding copy program segment field by field to obtain the error field; comparing the error field with the corresponding copy field bit by bit to obtain the number of error bits; repairing the original program segment according to the number of error bits.
8. The device according to claim 7, characterized in that The program status determination module is further used to: Calling an interrupt response service to compare the real-time checksum with the original program checksum to obtain a comparison result; If the comparison result is a verification error, the program status of the subroutine is determined to be a program error.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
