Special processing method for FPGA upgrade bit

By adjusting the synchronization word position and FLASH writing sequence in the FPGA bit file, the problem of infinite loop during the FPGA upgrade process is solved, stable upgrade and update under abnormal circumstances are achieved, work efficiency is improved and costs are reduced.

CN118535190APending Publication Date: 2024-08-23成都玖锦科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410600111.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

During the automatic upgrade process, the FPGA fails to upgrade due to abnormal conditions such as software upgrade errors or device power outages. As a result, the golden image bit cannot successfully jump to the updata image bit, causing an infinite loop and preventing the minimum system from being loaded again, affecting software updates.

Method used

By finding and adjusting the position of the sync word AA995566 in the FPGA bit file, inserting FF blank characters, generating a new updata image bit, and performing special erase and write operations in FLASH, ensure that the sync word is written at the end to avoid death Loopsum check failed.

Benefits of technology

It effectively avoids the endless loop situation during the FPGA upgrade process, ensuring that the device can load the golden image bit, the minimum system can be started, and the software can re-update the FPGA bit, which improves work efficiency and saves labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535190A
    Figure CN118535190A
Patent Text Reader

Abstract

The invention discloses a special processing method for FPGA (Field Programmable Gate Array) upgrade bit, which is characterized in that the position of a bit start synchronization word AA995566 in the FPGA bit in a bit file is specially processed, so that the abnormal condition that the jump from a golden image bit to an updata image bit is caught in an endless loop cannot occur in any abnormal condition in the upgrade process. Therefore, it is ensured that after an abnormal condition occurs in the FPGA upgrading process, the equipment can load a golden image bit minimum system from the new power-on startup, software can find a communication interface between the software and the FPGA to carry out new FPGA bit upgrading, and if bit data errors are caused by the abnormality in the FPGA upgrading process before the last synchronization word is written in, the equipment can be updated after the equipment is shut down and is powered on again. According to the method, when the FPGA automatically jumps to the updata image bit, the FPGA performs fallback to load the golden image bit under the action of the watch dog, and the method is convenient and effective, and is beneficial to saving time and labor cost and improving the working efficiency at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer applications, and in particular to a special processing method for FPGA upgrade bits. Background Art

[0002] When the FPGA is automatically upgrading the update image bit, if a software upgrade error or a sudden power failure occurs, the FPGA upgrade bit will fail. After the upgrade fails, when the device is powered on again, the FPGA will first load the golden image bit to automatically jump to the update image bit. Since the previous upgrade failed to update the FPGA bit, the golden image bit fails to jump to the update image bit. Under normal circumstances, after the golden image bit fails to jump to the update image bit, it will fallback again to the golden image bit to load the golden image bit under the action of wathcdog, ensuring that the FPGA can start with the golden bit minimum system, so that the software can be updated again.

[0003] Because the sudden power failure of the device is a completely random event, the data in the read-write address space of the update image bit being upgraded may be damaged in various unpredictable ways. This will cause an infinite loop when the FPGA jumps from the golden bit to the update image bit when it is powered on again after the upgrade fails. The FPGA cannot fallback to the golden image bit to load the minimum system under the action of the watch dog. In this case, the FPGA will always fail to load successfully, and the host computer software will not be able to detect the communication interface between the FPGA and the host computer, so the software cannot update new bits.

[0004] When this happens, the traditional method is to disassemble the entire device and the single-board hardware that failed to upgrade the FPGA bit, erase the entire address space of the FPGA configuration flash through JTAG, and then re-solidify the golden image bit. Only after erasing and re-solidifying the golden image bit can the software perform subsequent upgrade maintenance of the update image bit. This approach is inefficient and increases labor costs. Summary of the invention

[0005] In order to overcome the shortcomings and deficiencies of the prior art, the present invention provides a special processing method for FPGA upgrade bits.

[0006] The technical solution adopted by the present invention is:

[0007] Step S1, using an FPGA tool to generate an FPGA updata image bit file that needs to be upgraded;

[0008] Step S2, using bit processing software to read the entire file content of the updata image bit;

[0009] Step S3, the bit processing software finds the bit synchronization word AA995566 and calculates its position in the entire bit file, and assumes that the position of the synchronization word in the current bit is x;

[0010] Step S4, the bit processing software inserts y FF blank characters into the front part of the bit file to generate a new updata image bit;

[0011] Step S5, adding the processed updata image bit to the bit upgrade software;

[0012] Step S6, the bit upgrade software reads the processed updata image bit and caches all data into the cache space;

[0013] Step S7, the bit upgrade software caches the 4096B data including the synchronization word AA995566 separately in another cache space;

[0014] Step S8, the bit upgrade software sends an erase command to the FLASH to erase the first 4096B address interval of the update image bit upgrade address space;

[0015] Step S9, the bit upgrade software sends an erase command to the FLASH to erase all address spaces that need to be upgraded after the first 4096B address interval;

[0016] Step S10, the bit upgrade software sends a write data command to the FLASH, and writes all the data after the first 4096B slice data of the updata image bit into the upgrade address space of the FLASH in sequence.

[0017] Furthermore, the method further comprises:

[0018] Step S11, the bit upgrade software sends a write data command to FLASH to write the first 4096B of data previously cached into the first 4096B address space of FLASH;

[0019] Step S12, the bit upgrade software sends a shutdown command to the operating system, and the system is shut down after the bit upgrade to allow the FLASH update data to take effect.

[0020] Furthermore, in step S3, the synchronization word of the bit is in the first data of the bit file, and its position is the number of data contained in the bit file from the first data to the synchronization word AA995566. The position of the synchronization word generated by FPGA for each bit file is different, and each bit needs to recalculate the position of the synchronization word.

[0021] Furthermore, in step S5, the position of the synchronization word is artificially moved back to the last data position of the page operation length of the FLASH, and the number of blank characters to be inserted is calculated to be y=4096B-x.

[0022] Furthermore, in step S5, the bit upgrade software completely erases the 4096B slice address space storing the synchronization word at the beginning of the upgrade, and there is no data. After erasing, no bit data is written, but the bit data is updated and written from the second 4096B slice address space.

[0023] Furthermore, in step S3, when the bit synchronization word AA995566 cannot be found, the FPGA loader does not perform bit verification and bit file loading, and the FPGA falls back to load the golden image bit under the action of the watch dog.

[0024] Beneficial effects:

[0025] The present invention proposes a special processing method for FPGA upgrade bit, which ensures that the golden image bit jumps to the update image bit and falls into an infinite loop in any abnormal situation during the upgrade process by specially processing the position of the bit start synchronization word AA995566 in the FPGA bit in the bit file. Therefore, it is ensured that after an abnormal situation occurs during the FPGA upgrade process, the device can load the golden image bit minimum system when it is powered on again, and the software can find the communication interface between the FPGA and perform a new FPGA bit upgrade. The method is convenient and effective, and helps to save time and labor costs and improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 A bit processing and upgrade structure diagram of a special processing method for FPGA upgrade bits provided by an embodiment of the present invention;

[0028] Figure 2 A synchronization word position diagram before bit processing of a special bit processing method for FPGA upgrade provided by an embodiment of the present invention;

[0029] Figure 3 A synchronous word position diagram after bit processing of a special processing method for FPGA upgrade bits provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other. The present application is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0031] The embodiment of the present invention provides a special processing method for FPGA upgrade bit, which ensures that the golden image bit jumps to the update image bit and falls into an infinite loop in any abnormal situation during the upgrade process by performing special processing on the position of the bit start synchronization word AA995566 in the FPGA bit in the bit file. This ensures that after an abnormal situation occurs during the FPGA upgrade process, the device can load the golden image bit minimum system when it is powered on again, and the software can find the communication interface between the FPGA and perform a new FPGA bit upgrade.

[0032] like Figure 1 As shown, the method includes:

[0033] The present invention is achieved by the following steps:

[0034] Step S1, the FPGA tool generates an FPGA updata image bit file that needs to be upgraded;

[0035] Step S2, the bit processing software reads the entire file content of the update image bit;

[0036] Step S3, the bit processing software finds the bit synchronization word AA995566 and calculates its position in the entire bit file. The bit synchronization word is in the first data of the bit file, so its position is the number of data contained in the bit file from the first data to the synchronization word AA995566. The position of the synchronization word generated by FPGA for each bit file is different, so the position of the synchronization word needs to be recalculated for each bit. Assume that the position of the synchronization word in the current bit is x, such as Figure 2 shown.

[0037] Step S4, the bit processing software inserts y FF blank characters at the front of the bit file to generate a new updata image bit; the synchronization word is manually moved back to the last data position of the FLASH page operation length. Calculate the number of blank characters to be inserted y = 4096B-x;

[0038] Step S5, adding the processed updata image bit to the bit upgrade software;

[0039] Step S6, the bit upgrade software reads the processed updata image bit and caches all data into the cache space;

[0040] Step S7, the bit upgrade software caches the 4096B data including the synchronization word AA995566 separately in another cache space;

[0041] Step S8, the bit upgrade software sends an erase command to the FLASH to erase the first 4096B address interval of the update image bit upgrade address space. Only erase, do not write the upgrade data first;

[0042] Step S9, the bit upgrade software sends an erase command to the FLASH to erase all address spaces that need to be upgraded after the first 4096B address interval;

[0043] Step S10, the bit upgrade software sends a write data command to the FLASH, and writes all the data after the first 4096B slice data of the updata image bit into the upgrade address space of the FLASH in sequence;

[0044] Step S11, the bit upgrade software sends a write data command to FLASH to write the first 4096B of data previously cached into the first 4096B address space of FLASH;

[0045] Step S12, the bit upgrade software sends a shutdown command to the operating system. After the bit upgrade, the system must be shut down to allow the FLASH update data to take effect. Figure 3 shown.

[0046] When loading bits after FPAG is powered on, the synchronization word AA995566 is searched after the first data of the bit is completed. After the synchronization word is found, the data is read in sequence with the synchronization word as punctuation to load and verify. When an abnormal situation occurs during the upgrade process, the loading and verification after the synchronization word will fall into an infinite loop. The principle of the bit processing method in the present invention is to ensure that the synchronization word is written last in the upgrade process of the entire update iamge bit by adjusting the position of the bit synchronization word and the special adjustment of the erase and write FLASH order during the software upgrade.

[0047] In the above step S5, the bit upgrade software completely erases the 4096B slice address space storing the synchronization word at the beginning of the upgrade, leaving no data. After erasing, no bit data is written, but the bit data is updated and written from the second 4096B slice address space. Only after all the data after the current updata image bit is written to the FLASH, the 4096B segment data containing the synchronization word is written back to the starting 4096B address slice of the FLASH, and after special processing of the bit file, the bit synchronization word is also at the end of the 4096B segment data. Therefore, it is guaranteed that the bit synchronization word is written to the FLASH address at the end of the entire update image bit.

[0048] If an exception occurs during the FPGA upgrade process before the last synchronization word is written, resulting in a bit data error, the device will not be able to find the bit synchronization word AA995566 when the golden image bit automatically jumps to the update image bit after the device is shut down and powered on again. The FPGA loader will not perform bit verification and bit file loading, and the loading will not fall into an infinite loop. At this time, the FPGA will fallback to load the golden image bit under the action of the watch dog, so the software can find the communication interface with the FPGA after the device is powered on again, and a new FPGA bit upgrade can be performed.

[0049] Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A special processing method for FPGA upgrade bit, characterized in that: The method includes: Step S1, using an FPGA tool to generate an FPGA updata image bit file that needs to be upgraded; Step S2, using bit processing software to read the entire file content of the updata image bit; Step S3, the bit processing software finds the bit synchronization word AA995566 and calculates its position in the entire bit file, and assumes that the position of the synchronization word in the current bit is x; Step S4, the bit processing software inserts y FF blank characters into the front part of the bit file to generate a new updataimage bit; Step S5, adding the processed updata image bit to the bit upgrade software; Step S6, the bit upgrade software reads the processed updata image bit and caches all data into the cache space; Step S7, the bit upgrade software caches the 4096B data including the synchronization word AA995566 separately in another cache space; Step S8, the bit upgrade software sends an erase command to the FLASH to erase the first 4096B address interval of the updateiamge bit upgrade address space; Step S9, the bit upgrade software sends an erase command to the FLASH to erase all address spaces that need to be upgraded after the first 4096B address interval; Step S10, the bit upgrade software sends a write data command to the FLASH, and writes all the data after the updataimage bit except the first 4096B slice data into the upgrade address space of the FLASH in sequence.

2. A special processing method for FPGA upgrade bit according to claim 1, characterized in that: The method further includes: Step S11, the bit upgrade software sends a write data command to FLASH to write the first 4096B of data previously cached into the first 4096B address space of FLASH; Step S12, the bit upgrade software sends a shutdown command to the operating system, and the system is shut down after the bit upgrade to allow the FLASH update data to take effect.

3. The special processing method for FPGA upgrade bit according to claim 1, characterized in that: In the step S3, the synchronization word of the bit is in the first data of the bit file, and its position is the number of data contained in the bit file from the first data to the synchronization word AA995566. The position of the synchronization word generated by FPGA for each bit file is different, and the position of the synchronization word needs to be recalculated for each bit.

4. The special processing method for FPGA upgrade bit according to claim 1, characterized in that: In step S5, the position of the synchronization word is manually moved back to the last data position of the page operation length of the FLASH, and the number of blank characters to be inserted is calculated as y=4096B-x.

5. The special processing method for FPGA upgrade bit according to claim 1, characterized in that: In step S5, the bit upgrade software completely erases the 4096B slice address space storing the synchronization word at the beginning of the upgrade, and there is no data. After erasing, no bit data is written, but the bit data is updated and written from the second 4096B slice address space.

6. The special processing method for FPGA upgrade bit according to claim 1, characterized in that: In step S3, when the bit synchronization word AA995566 cannot be found, the FPGA loader does not perform bit verification and bit file loading, and the FPGA falls back to load the golden image bit under the action of the watch dog.