Method for realizing regular self-checking and self-repairing of FPGA (Field Programmable Gate Array) program

By adding semiconductor bus switching switches and partition storage in the FPGA system, using the MCU to perform word-by-word comparison and repair during regular self-tests, the problems of FPGA devices self-test and self-repair in high-irradiation environments are solved, and the long-term reliability of the device is improved and self-test efficiency.

CN118939463AInactive Publication Date: 2024-11-12BEIJING INST OF COMP TECH & APPL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411116433.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In high-irradiation environments, it is difficult for FPGA devices to achieve regular self-test and self-repair, and the prior art cannot effectively resist failures caused by single-particle flip (SEU).

Method used

By adding semiconductor bus switching switches between FPGA, MCU and external program memory, the partition stores FPGA programs, and the MCU switches control rights during periodic self-tests, directly access the memory for word-by-word comparison and repair, and use fault-free partition coverage Failed partition.

Benefits of technology

It realizes long-term and reliable operation of FPGA devices in high irradiation environments, improves self-test efficiency and reliability, and promptly detects and repairs faults caused by single-particle flips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939463A_ABST
    Figure CN118939463A_ABST
Patent Text Reader

Abstract

The invention relates to a method for realizing regular self-checking and self-repairing of an FPGA (Field Programmable Gate Array) program, and belongs to the technical field of FPGA high-reliability design in the fields of aviation, aerospace and nuclear power. A semiconductor bus change-over switch is additionally arranged among an FPGA, an MCU and an FPGA external program memory, and the MCU controls the switching gating enabling of the semiconductor bus change-over switch by default; an FPGA external program memory is divided into an upper area and a lower area according to addresses, and the upper area and the lower area are used for storing the same FPGA programs respectively. The FPGA external program memory is defaulted to be communicated with the FPGA when the equipment is powered up and started each time and is used for loading an FPGA program; and during regular self-inspection, the MCU switches the control right of the FPGA external program memory, and the MCU directly accesses the FPGA external program memory for self-inspection. According to the method, the SEU problem can be found in advance through regular self-inspection, and automatic repair is carried out in time, so that the utilization rate of the FPGA external memory and the efficiency and reliability of regular self-inspection of the FPGA program are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of FPGA high reliability design in the fields of aviation, aerospace and nuclear power, and specifically relates to a method for realizing periodic self-checking and self-repairing of FPGA programs. Background Art

[0002] With the development of information technology, the functions that FPGA can realize are becoming more and more abundant, and the application scenarios are becoming more and more complex and diverse. In some special application environments, such as near radiation sources and in outer space, it is necessary to regularly perform self-checks and automatic error correction on the FPGA program to ensure system robustness and functional correctness.

[0003] The conventional self-check method is to read all the data in the FPGA external program memory and compare and check the data with the check code through CRC and other methods. The advantage is that it takes up less storage space; the disadvantage is that once a problem is found, it can only be reported and cannot be self-repaired. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] The technical problem to be solved by the present invention is how to provide a method for realizing periodic self-checking and self-repairing of FPGA programs, so as to solve the problem of long-term reliable operation, self-checking and automatic error correction of FPGA devices in high radiation environments.

[0006] (II) Technical solution

[0007] In order to solve the above technical problems, the present invention proposes a method for implementing periodic self-checking and self-repairing of FPGA programs, the method comprising:

[0008] Set the switch: add a semiconductor bus switch between the FPGA, MCU and FPGA external program memory; control the semiconductor bus switch through the MCU to switch the control of the FPGA external program memory. When the MCU selection control pin input is "1", the FPGA external program memory is directly connected to the MCU; when the MCU selection control pin input is "0", the FPGA external program memory is directly connected to the FPGA;

[0009] Memory partitioning: divide the FPGA external program memory into two areas according to the address, and store the same FPGA program in each area;

[0010] Power-on startup: Each time the device is powered on, the FPGA external program memory is connected to the FPGA by default to load the FPGA program. After loading, it runs the scheduled functions normally;

[0011] Periodic self-check: During the periodic self-check, the MCU switches the control of the FPGA external program memory; the MCU directly accesses the FPGA external program memory, reads and compares the data in the upper and lower halves word by word, and if they are consistent, the self-check passes, the log is reported, and the normal operation mode is returned; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After the faulty half area is confirmed, the faulty half area is overwritten with the FPGA program stored in the non-faulty half area, and the check is performed again. After it is correct, the processing result is reported and the normal operation mode is returned.

[0012] (III) Beneficial effects

[0013] The present invention proposes a method for realizing periodic self-check and self-repair of FPGA program. The present invention directly accesses the FPGA external program memory during the periodic self-check by the MCU, reads and compares the data of the upper and lower half areas word by word, and realizes the highest self-check efficiency while occupying the MCU resources as little as possible. In addition, once a single particle upset is found in the FPGA program, the faulty partition can be repaired by the fault-free partition.

[0014] The present invention provides a new idea and method for solving the problem of long-term reliable operation of FPGA devices in high radiation environments (mainly to resist single event upset SEU). It is intended to detect SEU problems in advance through regular self-checking and automatically repair them in time.

[0015] The present invention improves the utilization rate of the FPGA external memory and the efficiency and reliability of the periodic self-check of the FPGA program. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a hardware architecture diagram of the FPGA periodic self-checking system of the present invention;

[0017] Figure 2 Partitioning the FPGA external non-volatile program memory of the present invention;

[0018] Figure 3 This is a flow chart of the FPGA periodic self-check of the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0020] The present invention belongs to the field of FPGA high reliability design technology in the fields of aviation, aerospace and nuclear power, and relates to a method for resisting single particle flips in electromagnetic, space or high radiation environments by performing regular self-checks by sharing an FPGA external program memory and performing redundant backup of the FPGA program in the memory.

[0021] In order to improve the ability of FPGA programs to resist single-event upsets (SEU) in harsh electromagnetic or space environments, the present invention discloses a method for implementing periodic self-checking of FPGA programs by sharing external memory. The method includes: (1) setting a switching switch. Add a semiconductor bus switching switch between the FPGA, MCU and FPGA external program memory. By default, the MCU controls the switching gating enable of the semiconductor bus switching switch. It is used to switch the control of the FPGA external program memory between the FPGA and the MCU; (2) memory partitioning. The FPGA external program memory is divided into upper and lower areas according to the address, and the same FPGA program is stored in each area; (3) power on and start. During daily use, each time the device is powered on and started, the FPGA external program memory is connected to the FPGA by default for loading the FPGA program; (4) periodic self-checking. When performing periodic self-checking with the large system operation and maintenance cycle, the MCU switches the control of the FPGA external program memory. The MCU directly accesses the FPGA external program memory, reads and compares the data in the upper and lower halves word by word, and if they are consistent, the self-check passes, the log is reported, and the system returns to normal operation. If they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After the faulty half is confirmed, the faulty half is overwritten with the FPGA program stored in the non-faulty half, and the check is performed again. If there is no error (if self-repair is not possible after more than three attempts, a serious fault is reported and the large system is shut down for maintenance), the processing result is reported and the system returns to normal operation.

[0022] In order to simplify the design to the maximum extent, improve the utilization rate of the FPGA external memory and the efficiency and reliability of the FPGA program periodic self-check, the present invention provides a periodic self-check method by sharing the external program memory with the MCU.

[0023] According to the characteristics of SEU events that are rare and sporadic, the present invention allows the MCU to directly access the FPGA external program memory during the periodic self-test, read and compare the data in the upper and lower halves word by word, and achieve the highest self-test efficiency while occupying as few MCU resources as possible. In addition, once a single-particle upset is found in the FPGA program, the faulty partition can be repaired through the fault-free partition. The method includes:

[0024] (1) Setting the switch: Add a semiconductor bus switch between the FPGA, MCU, and FPGA external program memory. The MCU controls the semiconductor bus switch to switch the control of the FPGA external program memory. When the MCU selection control pin input is "1", the FPGA external program memory is directly connected to the MCU; when the MCU selection control pin input is "0", the FPGA external program memory is directly connected to the FPGA (see Hardware Architecture). Figure 1 );

[0025] (2) Memory partitioning: The FPGA external program memory is divided into two areas according to the address, and the same FPGA program is stored in each area (see Figure 2 );

[0026] (3) Power-on startup: During daily use, each time the device is powered on, the FPGA external program memory is connected to the FPGA by default to load the FPGA program. After the loading is completed, the program will run normally.

[0027] (4) Regular self-check: During the periodic self-check of the large system operation and maintenance cycle, the MCU switches the control of the FPGA external program memory. The MCU directly accesses the FPGA external program memory, reads and compares the data in the upper and lower halves word by word, and if they are consistent, the self-check passes, the log is reported, and the normal operation mode is returned; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After confirming the faulty half-block, the faulty half-block is overwritten with the FPGA program stored in the non-faulty half-block, and the check is performed again. If there is no error (if self-repair fails after more than three attempts, a serious fault is reported and the large system is shut down for maintenance), the processing result is reported and the system returns to the normal operation mode.

[0028] Embodiment 1:

[0029] To facilitate those skilled in the art to understand the technical solution of the present invention, the technical solution of the present invention is further described in conjunction with the accompanying drawings of the specification. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the invention.

[0030] (1) Hardware architecture. Directly connect the FPGA external program memory to the semiconductor bus switch, where the semiconductor bus switch is also called a single-pole double-throw analog switch, typically CD4052, BCT4157, HS102, etc. The other end of the bus switch is connected to the MCU and FPGA respectively to achieve two-choice control. The control end of the bus switch determines whether the FPGA external program memory is connected to the FPGA or the MCU. To prevent MCU software failure, a hardware dip switch is added between the MCU and the bus switch to enable emergency control in the event of a software failure. See Figure 1 .

[0031] In specific implementation, when the high position of the hardware dip switch is set to 0, it is controlled by the hardware dip switch; when the high position of the hardware dip switch is set to 1, it is controlled by the MCU.

[0032] If controlled by hardware, the MCU strobe control pin setting is invalid. When the low position of the hardware DIP switch is set to 0, the semiconductor bus switch is controlled to directly connect the FPGA to the FPGA external memory. At this time, the FPGA can realize daily program loading and logic functions; when the low position of the hardware DIP switch is set to 1, the semiconductor bus switch is controlled to directly connect the MCU to the FPGA external memory. At this time, the FPGA external memory can be read and written by the MCU to realize the upgrade and repair of the FPGA program. It can also realize the reading and writing of the free area of ​​the FPGA external memory, so that it can be used as a supplement to the storage space of the MCU external non-volatile memory.

[0033] If controlled by MCU, the low setting of the hardware DIP switch is invalid. When the MCU strobe control pin is set to 0, the semiconductor bus switch is controlled to directly connect the FPGA to the FPGA external memory. At this time, the FPGA can realize daily program loading and logic functions; when the MCU strobe control pin is set to 1, the semiconductor bus switch is controlled to directly connect the MCU to the FPGA external memory. At this time, the FPGA external memory can be read and written by the MCU to realize the upgrade and repair of the FPGA program. It can also realize the reading and writing of the free area of ​​the FPGA external memory, so that it can be used as a supplement to the storage space of the MCU external non-volatile memory.

[0034] (2) FPGA external program memory partition. The FPGA external program memory is divided into two areas according to the address, and the same FPGA program is stored in each area (see Figure 2 );

[0035] In specific implementation, the internal part of the FPGA external program memory is divided into two partitions of the same size according to the address. One partition is used as the main partition for loading the program into the FPGA at startup; the other partition is used as a backup partition to back up the main partition and to be repaired through the other partition when a SEU failure occurs in one of the partitions.

[0036] (3) Daily operation power-on startup. When the device in daily operation is powered on, the FPGA external program memory is directly connected to the FPGA by default to load the FPGA program to ensure that the FPGA starts and works normally.

[0037] In specific implementation, no matter whether the DIP switch hardware or the MCU software obtains the control right to switch the FPGA external program memory, it will connect the FPGA to the FPGA external program memory by default when the device is powered on or restarted, so that during the power-on or program loading process, the FPGA can directly read the program from the main partition of the FPGA external program memory and run normally.

[0038] (4) Regular self-checking. The MCU regularly performs self-checking on the FPGA program, reading the programs in the upper and lower areas of the FPGA external program memory respectively. If the check is wrong, the program in the other area is refreshed and overwritten.

[0039] In specific implementation, after receiving the self-check instruction, the MCU switches the control of the FPGA external program memory. The MCU directly accesses the FPGA external program memory, reads and compares the data of the upper and lower half areas word by word, and if they are consistent, the self-check passes, the log is reported, and the normal operation mode is returned; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two half areas. After confirming the faulty half area, the faulty half area is overwritten by the FPGA program stored in the fault-free half area, and the check is performed again. After no error (if self-repair fails after more than three attempts, a serious fault is reported, and the large system is shut down for maintenance), the processing result is reported and the normal operation mode is returned. If self-repair fails after more than three attempts, a serious fault is reported, and the on-site operation and maintenance personnel manually handle it through the hardware dial switch and conduct a comprehensive maintenance.

[0040] Embodiment 2:

[0041] A method for implementing periodic self-checking of FPGA programs by sharing external memory includes the following design methods and steps:

[0042] (1) Set a switch. Add a semiconductor bus switch between the FPGA, MCU, and FPGA external program memory. The MCU controls the semiconductor bus switch to switch the control of the FPGA external program memory. In other words, the FPGA external program memory is directly connected to the MCU or the FPGA.

[0043] (2) FPGA program partition storage: The FPGA external program memory is divided into two areas, upper and lower, according to the address, to store the same FPGA program in each area.

[0044] (3) Daily work start-up. When the device is powered on or restarted, the FPGA external program memory is directly connected to the FPGA by default. During power-on or program loading, the FPGA directly reads the program from the FPGA external program memory and runs normal functions;

[0045] (4) Periodic self-test. During the periodic self-test, the MCU switches the control of the FPGA external program memory. The MCU directly accesses the FPGA external program memory and reads and compares the data in the upper and lower halves word by word. If they are consistent, the self-test passes, the log is reported, and the system returns to normal operation. If they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After confirming the faulty half, the faulty half is overwritten with the FPGA program stored in the non-faulty half, and the check is performed again. If there is no error (if self-repair fails after more than three attempts, a serious fault is reported and the system is shut down for maintenance), the processing result is reported and the system returns to normal operation.

[0046] Furthermore, a bus switch is set between the FPGA external program memory and the MCU and FPGA, and the control of the FPGA external program memory can be switched manually and automatically. The control method is mainly based on the MCU software. In order to improve the system reliability, a dip switch is set between the MCU and the semiconductor switch group to prevent the FPGA program from being unable to load due to software failure.

[0047] Furthermore, in addition to storing the FPGA program, corresponding check codes are also stored in each partition, which are used to confirm the partition where the fault is located when an SEU fault occurs.

[0048] Furthermore, when the device is powered on, the FPGA external program memory is directly connected to the FPGA by default. This allows the FPGA to directly read the program from the FPGA external program memory and run normal functions during power-on or program loading. When the system is operating normally, the MCU can switch the control of the FPGA external memory according to business needs. Using the free area of ​​the FPGA external memory as an external non-volatile memory of the MCU can not only perform regular self-tests, but also make full use of the remaining storage space on the FPGA external program memory.

[0049] Furthermore, the MCU receives the self-test instruction and switches the control right of the FPGA external program memory.

[0050] Furthermore, the FPGA external program memory is directly accessed through the MCU.

[0051] Furthermore, during the self-test, the MCU reads and compares the data of the upper and lower halves of the FPGA external program memory word by word. If they are consistent, the self-test passes, the log is reported, and the normal operation mode is returned; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After the faulty half area is confirmed, the faulty half area is overwritten with the FPGA program stored in the non-faulty half area.

[0052] Furthermore, if self-repair fails after more than three attempts, a serious fault is reported and manually handled by on-site operation and maintenance personnel through hardware dial codes and a comprehensive overhaul is performed.

[0053] The present invention directly accesses the FPGA external program memory during the periodic self-check by the MCU, reads and compares the data of the upper and lower half areas word by word, and achieves the highest self-check efficiency while occupying as few MCU resources as possible. In addition, once a single particle upset is found in the FPGA program, the faulty partition can be repaired by the fault-free partition.

[0054] The present invention provides a new idea and method for solving the problem of long-term reliable operation of FPGA devices in high radiation environments (mainly to resist single event upset SEU). It is intended to detect SEU problems in advance through regular self-checking and automatically repair them in time.

[0055] The present invention improves the utilization rate of the FPGA external memory and the efficiency and reliability of the periodic self-check of the FPGA program.

[0056] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for implementing periodic self-checking and self-repair of FPGA programs, characterized in that: The method includes: Set the switch: add a semiconductor bus switch between the FPGA, MCU and FPGA external program memory; control the semiconductor bus switch through the MCU to switch the control of the FPGA external program memory. When the MCU selection control pin input is "1", the FPGA external program memory is directly connected to the MCU; when the MCU selection control pin input is "0", the FPGA external program memory is directly connected to the FPGA; Memory partitioning: divide the FPGA external program memory into two areas according to the address, and store the same FPGA program in each area; Power-on startup: Each time the device is powered on, the FPGA external program memory is connected to the FPGA by default to load the FPGA program. After loading, it runs the scheduled functions normally; Periodic self-check: During the periodic self-check, the MCU switches the control of the FPGA external program memory; the MCU directly accesses the FPGA external program memory, reads and compares the data in the upper and lower halves word by word, and if they are consistent, the self-check passes, the log is reported, and the normal operation mode is returned; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After the faulty half area is confirmed, the faulty half area is overwritten with the FPGA program stored in the non-faulty half area, and the check is performed again. After it is correct, the processing result is reported and the normal operation mode is returned.

2. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 1, characterized in that: The semiconductor bus switch is a single-pole double-throw analog switch.

3. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 1, characterized in that: The semiconductor bus switch is CD4052, BCT4157 or HS102.

4. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 1, characterized in that: A hardware dip switch is added between the MCU and the bus switch. When the high position of the hardware dip switch is set to 0, it is controlled by the hardware dip switch; when the high position of the hardware dip switch is set to 1, it is controlled by the MCU.

5. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 4, characterized in that: If controlled by hardware, the MCU selection control pin setting is invalid; when the low position of the hardware dip switch is set to 0, the semiconductor bus switching switch is controlled to directly connect the FPGA with the FPGA external memory. At this time, the FPGA implements daily program loading and logic functions; when the low position of the hardware dip switch is set to 1, the semiconductor bus switching switch is controlled to directly connect the MCU with the FPGA external memory. At this time, the MCU reads and writes the FPGA external memory to realize the upgrade and repair of the FPGA program, and realizes the reading and writing of the free area of ​​the FPGA external memory, so that it can be used as a supplement to the MCU external non-volatile memory storage space.

6. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 4, characterized in that: If controlled by MCU, the low position setting of the hardware dip switch is invalid; when the MCU enable control pin is set to 0, the semiconductor bus switching switch is controlled to directly connect the FPGA with the FPGA external memory. At this time, the FPGA implements daily program loading and logic functions; when the MCU enable control pin is set to 1, the semiconductor bus switching switch is controlled to directly connect the MCU with the FPGA external memory. At this time, the MCU reads and writes the FPGA external memory to realize the upgrade and repair of the FPGA program, and realizes the reading and writing of the free area of ​​the FPGA external memory, so that it can be used as a supplement to the MCU external non-volatile memory storage space.

7. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 1, characterized in that: The FPGA external program memory is divided into two partitions of the same size according to the address. One is the main partition, which is used to load the program into the FPGA at startup; the other is the backup partition, which backs up the main partition and is used to repair the SEU failure in one partition through the other partition.

8. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 7, characterized in that: In addition to storing the FPGA program, corresponding check codes are also stored in each partition to confirm the partition where the fault is located when an SEU fault occurs.

9. The method for implementing periodic self-checking and self-repairing of FPGA program as claimed in claim 1, characterized in that: Regardless of whether the DIP switch hardware or the MCU software obtains control over the switching of the FPGA external program memory, the FPGA is connected to the FPGA external program memory by default when the device is powered on or restarted, so that during the power-on or program loading process, the FPGA directly reads the program from the main partition of the FPGA external program memory and runs normally.

10. The method for implementing periodic self-checking and self-repairing of FPGA program according to any one of claims 1 to 9, characterized in that: After receiving the self-test instruction, the MCU switches the control of the FPGA external program memory; the MCU directly accesses the FPGA external program memory, reads and compares the data in the upper and lower halves word by word, and if they are consistent, the self-test passes, the log is reported, and the system returns to normal operation mode; if they are inconsistent, the fault log is reported, and the fault is further located through the corresponding check codes stored in the two halves. After confirming the faulty half-block, the faulty half-block is overwritten with the FPGA program stored in the non-faulty half-block, and the check is performed again. After it is correct, the processing result is reported and the system returns to normal operation mode; if self-repair cannot be performed after more than three attempts, a serious fault is reported, which is manually handled by the on-site operation and maintenance personnel through the hardware dip switch and a comprehensive overhaul is performed.