A circuit and operation method for configuring, reading back and refreshing SRAM type FPGA
By designing configuration, readback and refresh circuits for SRAM-type FPGA, its stability problem in harsh environments is solved, on-site deployment without host computer and multiple memory support are realized, and the adaptability and functionality of FPGA are enhanced. .
Patent Information
- Application Number
- CN202111550030.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-12-17
AI Technical Summary
Configuration of SRAM-type FPGA The SRAM array is susceptible to the influence of space particles, cosmic rays, and charged particles, resulting in false flipping; in the existing technology, the JTAG configuration method cannot be used for on-site product deployment, and the PROM method cannot be read back and refreshed.
A circuit including a memory controller, serial port module, data path and FPGA interface module is designed. The serial port module communicates with the host computer to realize the configuration, readback and refresh of the SRAM FPGA, and can detect and update coding errors. It also supports multiple memory chip types such as parallel port NOR Flash, SPI Flash and PROM, allowing real-time adjustment of the chip working mode.
It enhances the adaptability of FPGA in harsh environments, enables on-site deployment without a host computer, supports multiple memory types, overcomes the shortcomings of fixed and single functions, and can read back, compare and refresh configuration data.
Smart Images

Figure CN114237122B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of integrated circuits, and in particular to a circuit and an operation method for configuring, reading back and refreshing an SRAM type FPGA. Background Art
[0002] FPGA is a field programmable gate array, which is a general-purpose integrated circuit on par with CPU and DSP. FPGA includes sequential logic, combinational logic, wiring resources, memory array, arithmetic logic array, clock network, IO logic and other resources. Users can call the resources in the FPGA through graphical design or hardware description language (HDL) design input to build various digital circuits.
[0003] After the user completes the FPGA function development and design, the circuit design needs to be converted into a binary code stream, which only contains digital combinations of 0 and 1. Different digital combinations determine the circuit structure within the FPGA. Since the function of the FPGA is determined by the code stream, if you want the FPGA to perform the expected function, you must first transfer the code stream into the FPGA. This process is called "configuration".
[0004] There is a dedicated memory array inside the FPGA chip to store the configuration code stream. Most FPGAs use an SRAM array to store configurations, which is called "Configuration SRAM". Some FPGAs also use non-volatile storage technologies such as Flash to store code streams, but these FPGAs generally have small capacities and limited uses.
[0005] FPGAs that use SRAM to store configurations on-chip are called SRAM-type FPGAs. They have large capacity and high speed, and are used in mainstream high-performance circuit applications. However, SRAM-type FPGAs have a disadvantage: when FPGAs are used in harsh environments such as irradiation environments and artificial satellites, the SRAM storage cells in their Configuration SRAM arrays are susceptible to the influence of charged particles and erroneous flips, resulting in 0 and 1 data errors, which in turn cause FPGA user circuit function errors.
[0006] The circuit for configuring FPGA is a well-known technology in the field: a typical method is JTAG download readback: from the host computer, through the download line of USB and JTAG interface, through the JTAG interface, the code stream is transmitted to the FPGA, and it can be read back and compared. This method can realize the configuration and readback of FPGA, but the disadvantage is that the configuration information is lost when the power is off, which is only suitable for debugging and cannot be used for on-site deployment of products and equipment. Another method is: use PROM to load the configuration when the FPGA is powered on. The advantage is that PROM can store the configuration data in a non-volatile manner, and because the host computer is not required in the working state, it can be deployed in actual products, but the disadvantage is that it can only load the configuration of the FPGA when it is powered on, and it is impossible to read back, compare, and refresh the FPGA configuration.
[0007] After searching, Chinese Patent Publication No. CN202011191407.9 discloses a method and device for dynamically refreshing the configuration data of an SRAM-type FPGA. This patent has the following defects: it only supports SPI NOR Flash, has a fixed single function, and cannot adjust the working mode of the chip in real time. Chinese Patent Publication No. CN202011420884.8 discloses an IP core for configuration and refresh control of a satellite-borne SRAM-type FPGA. This patent has the following defects: it only supports parallel port NOR Flash, has a fixed single function, and cannot adjust the working mode of the chip in real time.
[0008] In summary, the prior art has the following technical problems:
[0009] (1) The configuration SRAM array of SRAM-type FPGA is easily affected by space particles, cosmic rays, and charged particles, which may cause false flips.
[0010] (2) The JTAG configuration method cannot be used for actual on-site deployment of products.
[0011] (2) PROM mode cannot perform read-back refresh. Summary of the invention
[0012] In order to overcome the defects in the above-mentioned prior art, the present invention provides a circuit for configuring, reading back and refreshing an SRAM-type FPGA, which can detect and update the coding errors within the SRAM-type FPGA chip, and also uses a serial port module to monitor the working status of the chip and set and adjust the working mode.
[0013] To achieve the above object, the present invention adopts the following technical solutions, including:
[0014] A circuit for configuring, reading back and refreshing an SRAM type FPGA, the circuit comprising the following components: a storage controller, a serial port module, a data path, an FPGA interface module, and a state machine;
[0015] The data path is a bidirectional data transmission path for data interaction between the storage controller and the FPGA interface module, between the storage controller and the serial port module, and between the FPGA interface module and the serial port module;
[0016] The storage controller is used to read the data in the memory and send it to the serial port module or the FPGA interface module through the data path;
[0017] The serial port module is connected to the host computer in a two-way communication manner, and is used to send data to the host computer and receive information sent by the host computer, and the received information includes instructions, addresses, data, control information, and status information; the serial port module sends data to the corresponding address through the data path; the serial port module is also connected to the state machine, and sends the instructions, control information, and status information sent by the host computer to the state machine;
[0018] The FPGA interface module is used to receive data sent by the storage controller, that is, data in the memory, through the data path to configure the FPGA; the FPGA interface module is also used to receive data sent by the serial port module through the data path to configure the FPGA;
[0019] The FPGA interface module is used to read back the FPGA and obtain the read-back data of the FPGA; the FPGA interface module is also used to send the read-back data of the FPGA to the serial port module through the data path;
[0020] The FPGA interface module is used to compare the read-back data of the FPGA, that is, to compare the read-back data of the FPGA with the data in the memory or the data sent by the serial port module. If they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; the FPGA interface module is also used to refresh the configuration data of the FPGA using the data in the memory or the data sent by the serial port module;
[0021] The state machine is respectively connected to the storage controller and other components in the circuit. The state machine is used to receive instructions, control information, and status information sent by the serial port module; the state machine is used to control the various components in the circuit; and the state machine is used to obtain the working status / parameters of the various components in the circuit.
[0022] Furthermore, the storage controller is also used to receive data sent by the serial port module through a data path and write the data into a corresponding memory.
[0023] Further, the storage controller includes: an SPI Flash controller, a parallel port NOR Flash controller, and a PROM controller;
[0024] The SPI Flash controller is used to receive data sent by the serial port module through a data path and write it into the SPI Flash; the SPI Flash controller is also used to read data in the SPI Flash and send it to the serial port module or the FPGA interface module through the data path; the SPI Flash controller is used to perform read / write / erase operations on the SPI Flash;
[0025] The parallel port NOR Flash controller is used to receive data sent by the serial port module through the data path and write it into the NOR Flash; the NOR Flash controller is also used to read the data in the NOR Flash and send it to the serial port module or the FPGA interface module through the data path; the NOR Flash controller is used to perform read / write / erase operations on the NOR Flash;
[0026] The PROM controller is used to read data in the PROM and send it to the serial port module or the FPGA interface module through the data path; the PROM controller is used to perform a read operation on the PROM;
[0027] The FPGA interface module is used to receive data sent by the SPI Flash controller / parallel port NOR Flash controller / PROM controller through a data path, that is, data in the SPI Flash / NOR Flash / PROM, to configure the FPGA;
[0028] The FPGA interface module compares the read-back data of the FPGA, that is, compares the read-back data of the FPGA with the data in the SPI Flash / NOR Flash / PROM. If they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; if the configuration data of the FPGA is wrong, the FPGA interface module uses the data in the SPI Flash / NOR Flash / PROM to refresh the configuration data of the FPGA;
[0029] The state machine is connected to the SPI Flash controller, the parallel port NOR Flash controller, and the PROM controller respectively. The state machine controls the read / write / erase operations of the SPI Flash controller on the SPI Flash; the state machine controls the read / write / erase operations of the NOR Flash controller on the NOR Flash; the state machine controls the read operation of the PROM controller on the PROM; the state machine also obtains the working status / parameters of the SPI Flash controller, the parallel port NOR Flash controller, and the PROM controller respectively.
[0030] Furthermore, the circuit also includes: a configuration register; the serial port module is also connected to the configuration register in a two-way communication manner; the serial port module sends the data, control information, and status information sent by the host computer to the configuration register; the configuration register is used to control the working status / parameters of each component in the circuit; the configuration register is also used to obtain the working status / parameters of each component in the circuit.
[0031] Furthermore, the circuit further comprises: an ECC decoding module; the ECC decoding module is connected to the FPGA interface module;
[0032] When writing data to the memory, the data is first ECC-encoded, that is, error correction and error detection codes are added, and then the encoded data is written to the memory;
[0033] When the FPGA interface module receives the encoded data in the memory through the data path, the ECC decoding module is used to perform error detection and error correction on the encoded data in the memory.
[0034] Furthermore, the FPGA interface module is also used to detect whether a SEFI fault occurs in the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module resets the FPGA chip. After the FPGA interface module resets the FPGA chip, the FPGA interface module re-receives the data in the SPI Flash / NOR Flash / PROM, or re-receives the data sent by the serial port module to configure the FPGA.
[0035] The present invention also provides an operation method of a circuit for configuring, reading back and refreshing an SRAM type FPGA, comprising the following steps:
[0036] S1, the state machine waits for the instruction sent by the serial port module, determines whether the instruction sent by the serial port module, i.e. the instruction information of the host computer, is received, if the instruction is received, executes step S2; if the instruction is not received, executes step S3;
[0037] S2, after receiving the instruction sent by the serial port module, i.e. the instruction information of the host computer, the state machine parses the instruction and performs corresponding operations:
[0038] If the instruction parsing content is to access the memory, the memory controller is controlled to read / write / erase the memory according to the control information;
[0039] If the instruction parsing content is to access the FPGA, the FPGA interface module is controlled to configure / read back / refresh the FPGA according to the control information;
[0040] If the instruction parsing content is the setting of the circuit status / parameters, the circuit status / parameters are set according to the status information;
[0041] After the state machine completes the corresponding operation according to the instruction parsing content, it jumps to step S1;
[0042] S3, the state machine does not receive the instruction sent by the serial port module, the state machine controls the storage controller to read the data in the memory, and sends it to the FPGA interface module through the data path;
[0043] S4, the FPGA interface module receives data sent by the storage controller through the data path, that is, reads data in the memory, for configuring the FPGA, that is, the data in the memory is used as configuration data of the FPGA;
[0044] S5, FPGA enters user mode;
[0045] S6, after waiting for a fixed period of time, determine whether to read back:
[0046] If read back is performed, step S7 is executed;
[0047] If the read-back is not performed, it is determined whether to refresh. If refreshing is performed, step S8 is executed. If refreshing is not performed, the process jumps back to step S6.
[0048] S7, the FPGA interface module reads back the FPGA to obtain the readback data of the FPGA; the FPGA interface module is used to compare the readback data of the FPGA, that is, to compare the readback data of the FPGA with the data in the memory. If they are consistent, it means that the configuration data is correct, and jump back to step S6 to wait for a fixed time; if they are inconsistent, it means that the configuration data is wrong, and the configuration data is refreshed and step S8 is executed;
[0049] S8, the FPGA interface module receives the data sent by the storage controller through the data path, that is, reads the data in the memory, and uses the data in the memory to refresh or overwrite the configuration data of the FPGA; after the refresh is completed, jump back to step S6.
[0050] Further, in step S2,
[0051] If the instruction parsing content is to access the memory, the state machine controls the memory controller to receive the data sent by the serial port module through the data path and write it into the corresponding memory; or the state machine controls the memory controller to read the data in the memory and send it to the serial port module through the data path; or the state machine controls the memory controller to erase the data in the memory;
[0052] If the instruction parsing content is to access the FPGA, the state machine controls the FPGA interface module to receive the data sent by the serial port module through the data path and configure the FPGA, that is, the data sent by the serial port module is used as the configuration data of the FPGA; or, the state machine controls the FPGA interface module to read back the FPGA and obtain the readback data of the FPGA; the FPGA interface module compares the readback data of the FPGA and compares the readback data of the FPGA with the data sent by the serial port module. If they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; or, the state machine controls the FPGA interface module to refresh the configuration data of the FPGA using the data sent by the serial port module; or, the state machine controls the FPGA interface module to read back the FPGA and obtain the readback data of the FPGA, and the FPGA interface module sends the readback data of the FPGA to the host computer through the serial port module.
[0053] Furthermore, in step S3, the state machine controls the corresponding storage controller to read data in the memory with a high access priority according to the access priority of the memory.
[0054] Furthermore, after step S5, a fixed time is waited to determine whether to perform SEFI fault detection. If SEFI fault detection is performed, the FPGA interface module performs SEFI fault detection on the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module performs a chip reset on the FPGA. After the FPGA interface module performs a chip reset on the FPGA, the FPGA interface module re-receives the data in the memory, or re-receives the data sent by the serial port module, and configures the FPGA.
[0055] The advantages of the present invention are:
[0056] (1) Through configuration, readback, and refresh operations, the coding errors within the SRAM-type FPGA chip can be detected and updated, enhancing the FPGA's adaptability to harsh environments.
[0057] (2) Compared with the JTAG configuration mode, it can work without a host computer and can be deployed on site.
[0058] (3) Compared with the PROM configuration mode, it can realize the reading back, comparison and refresh of FPGA configuration code.
[0059] (4) Compared with existing patents, it can support multiple memory chip types such as parallel port NOR Flash, SPI Flash, PROM, etc.
[0060] (5) Compared with the existing patents, it overcomes the disadvantage of fixed single function: it can work according to the default preset process after power-on, and the working mode of the chip can be adjusted and set in real time through the serial port.
[0061] (6) The circuit for configuring readback refresh can be implemented by a single ASIC chip, or by using a CPLD or another FPGA. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 This is a circuit structure diagram of Example 1.
[0063] Figure 2 This is a circuit structure diagram of Example 2.
[0064] Figure 3 The present invention provides a flow chart of an operation method of a circuit for configuring, reading back and refreshing an SRAM type FPGA.
[0065] Figure 4 This is a schematic diagram of the host computer accessing each memory through the serial port module 4 in Example 1.
[0066] Figure 5 This is a schematic diagram of the host computer accessing the FPGA through the serial port module 4 in Example 1.
[0067] Figure 6 This is a schematic diagram of the host computer accessing the configuration register 9 through the serial port module 4 in Example 1.
[0068] Figure 7 This is a schematic diagram of configuring the FPGA through data in the memory in Example 1.
[0069] Figure 8 This is a schematic diagram of performing readback and refresh operations on the FPGA using data in the memory in Example 1. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0071] Example 1
[0072] Depend on Figure 1 As shown, a circuit for configuring, reading back and refreshing an SRAM type FPGA includes the following components: an SPI Flash controller 1, a parallel port NOR Flash controller 2, a PROM controller 3, a serial port module 4, a data path 5, an FPGA interface module 6, a state machine 8, and a configuration register 9.
[0073] The SPI Flash controller 1 , the parallel port NOR Flash controller 2 , and the PROM controller 3 are all storage controllers.
[0074] The SPI Flash controller 1 performs bidirectional data interaction with the data path 5; the SPI Flash controller 1 receives data sent by the serial port module 4 through the data path 5 and writes it to the SPI Flash; the SPI Flash controller 1 reads data in the SPI Flash and sends it to the serial port module 4 or the FPGA interface module 6 through the data path 5; the SPI Flash controller 1 accepts the control of the state machine 8, and under the control of the state machine 8, performs operations such as reading, writing and erasing on the parallel port SPI Flash.
[0075] The parallel port NOR Flash controller 2 performs bidirectional data exchange with the data path 5; the parallel port NOR Flash controller 2 receives the data sent by the serial port module 4 through the data path 5 and writes it to the NOR Flash; the parallel port NOR Flash controller 2 reads the data in the parallel port NOR Flash and sends it to the serial port module 4 or the FPGA interface module 6 through the data path 5; the parallel port NOR Flash controller 2 accepts the control of the state machine 8, and under the control of the state machine 8, performs operations such as reading, writing and erasing on the parallel port NOR Flash.
[0076] The PROM controller 3 performs data exchange with the data path 5; the PROM controller 3 reads the data in the PROM and sends it to the serial port module 4 or the FPGA interface module 6 through the data path 5; the PROM controller 3 accepts the control of the state machine 8 and performs a read operation on the PROM under the control of the state machine 8. Since PROM is generally read-only, in a typical scenario, the PROM controller 3 is only responsible for reading the data in the PROM and does not perform read and erase operations on the PROM; in this embodiment, the programming / burning of the PROM can be achieved by a dedicated interface and path.
[0077] The serial port module 4 is connected to the host computer for two-way communication, and receives commands, addresses, data, control information, status information and other information sent by the host computer.
[0078] The serial port module 4 is also connected to the state machine 8, and sends the instructions, control information, and status information of the host computer to the state machine 8. The state machine 8 controls the SPI Flash controller 1 / parallel port NOR Flash controller 2 / PROM controller 3 to perform read / write / erase operations on the SPI Flash / parallel port NOR Flash / PROM according to the instructions, control information, and status information of the host computer; controls the FPGA interface module 6 to perform configuration / readback / refresh operations on the FPGA; controls the SPI Flash controller 1 / parallel port NOR Flash controller 2 / PROM controller 3 to send the data read from the SPI Flash / NOR / PROM to the host computer through the serial port module 4; controls the FPGA interface module 6 to send the read-back FPGA configuration data, i.e., the FPGA read-back data, to the host computer through the serial port module 4.
[0079] The serial port module 4 is also connected to the configuration register 9, and sends the data, control information, and status information of the host computer to the configuration register 9; that is, the host computer performs read and write operations on the configuration register 9 through the serial port module 4; the configuration register 9 is used to control the working status / parameters of each component in the circuit; the configuration register 9 is also used to obtain the working status / parameters of each component in the circuit; the configuration register 9 can be understood as a control bit inside the circuit, which is used to set and control the functions of the circuit, etc., which is equivalent to a control register.
[0080] The data path 5 serves as a bidirectional data transmission path between the SPI Flash controller 1, the parallel port NOR Flash controller 2, the PROM controller 3, the serial port module 4, and the FPGA interface module 6; the data path 5 is controlled by a state machine; the state machine 8 controls the selection of the FPGA and the storage controller by the data path 5, and controls the data flow direction of the data path 5.
[0081] The FPGA interface module 6 receives data sent by the SPI Flash controller 1 / parallel port NOR Flash controller 2 / PROM controller 3, that is, the data in the SPI Flash / NOR Flash / PROM, and configures the FPGA; the FPGA interface module 6 receives data sent by the serial port module 4 and configures the FPGA; the FPGA interface module 6 reads back the FPGA and receives the read-back data of the FPGA; the FPGA interface module 6 compares the read-back data of the FPGA with the data in the SPI Flash / NOR Flash / PROM or with the data sent by the serial port module 4: if they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong, indicating that the configuration data of the configuration SRAM array in the FPGA has been incorrectly flipped. When the configuration data of the FPGA is wrong, the FPGA interface module 6 refreshes the FPGA, and the configuration data used for the refresh comes from one of the data in the SPI Flash / NOR Flash / PROM, or from the data sent by the serial port module 4.
[0082] The FPGA interface module 6 is also used to detect whether a SEFI fault occurs in the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module 6 resets the FPGA chip. The specific method of resetting the chip is to pull down the PROG_B or PROGRAM_B pin of the FPGA. After the FPGA interface module 6 resets the FPGA chip, it is necessary to re-acquire the data in the SPI Flash / NOR Flash / PROM or re-acquire the data sent by the serial port module 4, that is, re-acquire the configuration data to configure the FPGA.
[0083] SEFI faults include:
[0084] The DONE pin signal value of the target FPGA is abnormal, indicating that POR SEFI has occurred;
[0085] The FAR register inside the target FPGA is wrong, indicating that SelectMAP SEFI has occurred;
[0086] The BUSY pin value of the target FPGA is abnormal, indicating that SelectMAP SEFI is encountered;
[0087] The STATUS register inside the target FPGA is abnormal, indicating that POR SEFI or global SEFI has occurred;
[0088] The CTL register inside the target FPGA is abnormal, indicating that POR SEFI or global SEFI has occurred.
[0089] The state machine 8 is connected to the controller and other components in the circuit respectively. The state machine 8 is used to receive instructions, control information, and status information from the serial port module 4; the state machine 8 is used to obtain the working status / parameters of each component in the circuit; the state machine 8 is also used to control each component in the circuit, including: the state machine 8 is used to control the operation of the memory controller on the memory; the state machine 8 is used to control the selection of the FPGA and the storage controller by the data path 5, and control the data flow direction of the data path 5; the state machine 8 controls the configuration / readback / refresh of the FPGA by the FPGA interface module 6. The state machine 8 is also used to start and stop other components in the circuit, configure functions; control the overall workflow and data flow direction of the circuit; and reset the circuit after power-on.
[0090] Example 2
[0091] In order to improve the reliability of the system, based on Example 1, Figure 2 As shown, an ECC decoding module 7 is inserted into the circuit: that is, a circuit for configuring, reading back and refreshing an SRAM type FPGA, the circuit includes: an SPI Flash controller 1, a parallel port NOR Flash controller 2, a PROM controller 3, a serial port module 4, a data path 5, an FPGA interface module 6, an ECC decoding module 7, and a state machine 8.
[0092] The ECC decoding module 7 is connected to the FPGA interface module 6;
[0093] When writing data to SPI Flash / NOR Flash / PROM, first encode the data with ECC (Error Correction Code), that is, add the error correction code, and then write the encoded data into the corresponding memory. In the present invention, the error correction code can be added by the user using the software in the computer outside the circuit, or by the storage controller inside the circuit. If it is added by the storage controller inside the circuit, a corresponding ECC encoding module and decoding module are required; if it is added by the computer software outside the circuit, the computer software must have the ECC encoding function.
[0094] The FPGA interface module 6 uses the encoded data in the SPI Flash / NOR Flash / PROM to configure the FPGA, or when reading back the FPGA for comparison, the ECC decoding module 7 is used to perform error detection and correction on the encoded data in the SPI Flash / NOR Flash / PROM, thereby resisting data errors occurring in the SPI Flash / NOR Flash / PROM and improving the reliability of the circuit.
[0095] In this embodiment, the error correction and detection code adopts BCH coding, Hamming code or LDPC code. Among them, the BCH coding algorithm can correct 2-bit errors for every 51-bit data.
[0096] The ECC decoding module 7 is also connected to the state machine 8 and is controlled by the state machine 8. Under the control of the state machine 8, the ECC decoding module 7 performs error detection and correction on the encoded data in the SPI Flash / NOR Flash / PROM.
[0097] Example 3
[0098] Based on the circuit structure provided in Example 1, Figure 3 As shown, an operation method of configuring, reading back and refreshing an SRAM type FPGA of the present invention is as follows:
[0099] S1, after power-on, the state machine 8 resets the circuit, and then the state machine 8 waits for the instruction information sent by the serial port module 4, and determines whether the instruction sent by the serial port module 4, that is, the instruction information of the host computer, is received. If the instruction is received, step S2 is executed; if the instruction is not received, step S3 is executed;
[0100] S2, after receiving the instruction sent by the serial port module 4, i.e., the instruction information of the host computer, the state machine 8 parses the instruction and performs corresponding operations according to the instruction parsing content:
[0101] If the instruction parsing content is to access the memory, i.e., to access the SPI Flash / NOR Flash / PROM, the state machine 8 controls the SPI Flash controller 1 / parallel port NOR Flash controller 2 / PROM controller 3 to read / write / erase the SPI Flash / NOR Flash / PROM according to the instruction parsing content; wherein, reading means: the memory controller reads the data in the memory and sends it to the serial port module 4 through the data path 5; writing means: the memory controller receives the data sent by the serial port module 4 and writes it into the corresponding memory; erasing means: controlling the memory controller to erase the data in the memory;
[0102] If the instruction parsing content is to access the FPGA, the state machine 8 controls the FPGA interface module 6 to configure / read back / refresh the FPGA according to the instruction parsing content; or controls the FPGA interface module 6 to send the FPGA readback data to the host computer through the serial port module; wherein, configuration means: the FPGA interface module 6 receives the data sent by the serial port module 4 through the data path 5, which is used to configure the FPGA, that is, the data sent by the serial port module 4 is used as the configuration data of the FPGA; read back means: the FPGA interface module 6 reads back the FPGA, obtains the FPGA readback data, and sends it to the serial port module 4; compares the FPGA readback data, and compares the FPGA readback data with the data sent by the serial port module 4. If they are consistent, it means that the FPGA function is normal and the FPGA configuration data is correct; if they are inconsistent, the FPGA configuration data is wrong; refresh means: the FPGA interface module 6 uses the data sent by the serial port module 4 to refresh the FPGA configuration data;
[0103] If the instruction parsing content is the setting of the circuit status / parameters, the circuit status / parameters are set according to the status information;
[0104] After the state machine 8 completes the corresponding operation according to the instruction parsing content, it jumps to step S1;
[0105] S3, the state machine 8 does not receive the instruction sent by the serial port module 4, the state machine 8 controls the SPI Flash controller 1 / parallel port NOR Flash controller 2 / PROM controller 3 to read the data in the SPI Flash / NOR Flash / PROM, and sends it to the FPGA interface module 6 through the data path 5;
[0106] In step S3, there is an access priority among the SPI Flash, NOR Flash, and PROM. The state machine 8 controls the corresponding storage controller to read the data in the storage with the higher access priority according to the access priority of each storage;
[0107] S4, the FPGA interface module 6 receives the data sent by the storage controller through the data path 5, that is, reads the data in the memory, which is used to configure the FPGA, that is, the data in the memory is used as the configuration data of the FPGA;
[0108] S5, FPGA enters user mode;
[0109] S6, after waiting for a fixed time, determine whether to read back: In the present invention, whether to read back depends on whether the serial port module 4 receives the instruction and control information about the read back from the host computer, and the control information about the read back is stored in the configuration register 9, that is, whether the FPGA interface module 6 reads back is controlled by the configuration register 9;
[0110] If read back is performed, step S7 is executed;
[0111] If the readback is not performed, it is determined whether to perform a refresh. In the present invention, whether the FPGA interface module 6 performs a refresh is controlled by the configuration register 9. If a refresh is performed, step S8 is executed. If a refresh is not performed, step S6 is jumped. In the present invention, whether a refresh is performed depends on whether the serial port module 4 receives the refresh instruction and control information from the host computer, and the control information about the refresh is stored in the configuration register 9.
[0112] S7, the FPGA interface module 6 reads back the FPGA to obtain the readback data of the FPGA; the FPGA interface module 6 is used to compare the readback data of the FPGA, that is, to compare the readback data of the FPGA with the data in the memory. If they are consistent, it means that the configuration data is correct, and jump to step S6; if they are inconsistent, it means that the configuration data is wrong, and the configuration data is refreshed, and step S8 is executed;
[0113] S8, the FPGA interface module 6 receives the data sent by the storage controller through the data path 5, that is, reads the data in the memory, and uses the data in the memory to refresh or overwrite the configuration data of the FPGA; after the refresh is completed, jump to step S6.
[0114] In this embodiment, after step S5, a fixed time period may be waited to determine whether to perform SEFI fault detection. In the present invention, whether the FPGA interface module 6 performs SEFI fault detection is controlled by the configuration register 9. If SEFI fault detection is performed, the FPGA interface module (6) performs SEFI fault detection on the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module (6) performs a chip reset on the FPGA. After the FPGA interface module (6) performs a chip reset on the FPGA, the FPGA interface module (6) re-receives data in the memory or re-receives data sent by the serial port module (4) to configure the FPGA.
[0115] Based on the circuits and operation methods for configuring, reading back and refreshing the SRAM-type FPGA provided in the above-mentioned embodiments 1 and 3, the data flow in the circuit is described as follows:
[0116] When receiving instructions, data, addresses and other information from the serial port module 4, the serial port module 4 is used to access each memory, and the memory read, write and erase operations are performed by Figure 4 As shown. The FPGA is configured, read back, refreshed, etc. through the serial port module 4. Figure 5 The serial port module 4 is used to read and write the configuration register 9 in the chip. Figure 6When reading data from the memory, the FPGA is configured using the data in the memory. Figure 7 The FPGA is read back and refreshed through the data in the memory. Figure 8 shown.
[0117] Based on the circuit for configuring, reading back and refreshing the SRAM type FPGA provided in the above embodiments 1 and 2, the serial port module 4 can be RS232, RS422, RS485, or it can be replaced with a bus interface such as CAN bus, IIC bus, etc. The memory includes three types: SPI Flash, parallel port NOR Flash, and PROM. When the circuit is applied, only one type can be placed, or two or more types can be placed. SPI, parallel port NOR, and PROM are the most common and mature memories. An equivalent replacement form is that new memories such as RRAM resistive memory, FRAM ferroelectric memory, and PCRAM phase change memory can also be used. The FPGA chip served by the circuit can be 1, 2, 3, or 4, and the circuit can be modified and upgraded to support more FPGA chips.
[0118] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A circuit for configuring, reading back and refreshing an SRAM-type FPGA, characterized in that: The circuit includes the following components: a storage controller, a serial port module (4), a data path (5), an FPGA interface module (6), and a state machine (8); The data path (5) is a bidirectional data transmission path for data interaction between the storage controller and the FPGA interface module (6), between the storage controller and the serial port module (4), and between the FPGA interface module (6) and the serial port module (4); The storage controller is used to read data in the storage and send the data to the serial port module (4) or the FPGA interface module (6) through the data path (5); The serial port module (4) is bidirectionally connected to the host computer for sending data to the host computer and receiving information sent by the host computer, wherein the received information includes instructions, addresses, data, control information, and status information; the serial port module (4) sends the data to the corresponding address through the data path (5); the serial port module (4) is also connected to the state machine (8) and sends the instructions, control information, and status information sent by the host computer to the state machine (8); The FPGA interface module (6) is used to receive data sent by the storage controller, i.e., data in the memory, through the data path (5) to configure the FPGA; the FPGA interface module (6) is also used to receive data sent by the serial port module (4) through the data path (5) to configure the FPGA; The FPGA interface module (6) is used to read back the FPGA and obtain the read-back data of the FPGA; the FPGA interface module (6) is also used to send the read-back data of the FPGA to the serial port module (4) through the data path (5); The FPGA interface module (6) is used to compare the read-back data of the FPGA, that is, to compare the read-back data of the FPGA with the data in the memory or the data sent by the serial port module (4); if they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; the FPGA interface module (6) is also used to refresh the configuration data of the FPGA using the data in the memory or the data sent by the serial port module (4); The state machine (8) is respectively connected to the storage controller and other components in the circuit, and the state machine (8) is used to receive instructions, control information, and status information sent by the serial port module (4); the state machine (8) is used to control the components in the circuit; the state machine (8) is used to obtain the working status / parameters of the components in the circuit; The storage controller comprises: an SPI Flash controller (1), a parallel port NOR Flash controller (2), and a PROM controller (3).
2. A circuit for configuring, reading back and refreshing an SRAM-type FPGA according to claim 1, characterized in that: The storage controller is also used to receive data sent by the serial port module (4) through a data path (5) and write the data into a corresponding memory.
3. A circuit for configuring, reading back and refreshing an SRAM type FPGA according to claim 1, characterized in that: The storage controller comprises: an SPI Flash controller (1), a parallel port NOR Flash controller (2), and a PROM controller (3); The SPI Flash controller (1) is used to receive data sent by the serial port module (4) through a data path (5) and write the data into the SPI Flash; the SPI Flash controller (1) is also used to read data in the SPI Flash and send the data to the serial port module (4) or the FPGA interface module (6) through the data path (5); the SPI Flash controller (1) is used to perform read / write / erase operations on the SPI Flash; The parallel port NOR Flash controller (2) is used to receive data sent by the serial port module (4) through a data path (5) and write the data into the NOR Flash; the parallel port NOR Flash controller (2) is also used to read the data in the NOR Flash and send the data to the serial port module (4) or the FPGA interface module (6) through the data path (5); the parallel port NOR Flash controller (2) is used to perform read / write / erase operations on the NOR Flash; The PROM controller (3) is used to read data in the PROM and send the data to the serial port module (4) or the FPGA interface module (6) through the data path (5); the PROM controller (3) is used to perform a read operation on the PROM; The FPGA interface module (6) is used to receive data sent by the SPI Flash controller (1) / parallel port NOR Flash controller (2) / PROM controller (3) through the data path (5), that is, the data in the SPI Flash / NOR Flash / PROM, to configure the FPGA; The FPGA interface module (6) compares the read-back data of the FPGA, that is, compares the read-back data of the FPGA with the data in the SPI Flash / NOR Flash / PROM. If they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; if the configuration data of the FPGA is wrong, the FPGA interface module (6) uses the data in the SPI Flash / NOR Flash / PROM to refresh the configuration data of the FPGA; The state machine (8) is connected to the SPI Flash controller (1), the parallel port NOR Flash controller (2), and the PROM controller (3) respectively. The state machine (8) controls the SPI Flash controller (1) to perform read / write / erase operations on the SPI Flash; the state machine (8) controls the parallel port NOR Flash controller (2) to perform read / write / erase operations on the NOR Flash; the state machine (8) controls the PROM controller (3) to perform read operations on the PROM; and the state machine (8) also obtains the working states / parameters of the SPI Flash controller (1), the parallel port NOR Flash controller (2), and the PROM controller (3) respectively.
4. A circuit for configuring, reading back and refreshing an SRAM type FPGA according to claim 1, 2 or 3, characterized in that: The circuit further comprises: a configuration register (9); the serial port module (4) is also bidirectionally connected to the configuration register (9); the serial port module (4) sends data, control information, and status information sent by the host computer to the configuration register (9); the configuration register (9) is used to control the working state / parameters of each component in the circuit; and the configuration register (9) is also used to obtain the working state / parameters of each component in the circuit.
5. A circuit for configuring, reading back and refreshing an SRAM type FPGA according to claim 1, 2 or 3, characterized in that: The circuit further comprises: an ECC decoding module (7); the ECC decoding module (7) is connected to the FPGA interface module (6); When writing data to the memory, the data is first ECC-encoded, that is, error correction and error detection codes are added, and then the encoded data is written to the memory; When the FPGA interface module (6) receives the encoded data in the memory through the data path (5), the ECC decoding module (7) is used to perform error detection and error correction on the encoded data in the memory.
6. A circuit for configuring, reading back and refreshing an SRAM type FPGA according to claim 1, 2 or 3, characterized in that: The FPGA interface module (6) is also used to detect whether a SEFI fault occurs in the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module (6) performs a chip reset on the FPGA. After the FPGA interface module (6) performs a chip reset on the FPGA, the FPGA interface module (6) re-receives data in the SPI Flash / NOR Flash / PROM, or re-receives data sent by the serial port module (4), and configures the FPGA.
7. An operating method for a circuit for configuring, reading back and refreshing an SRAM type FPGA according to claim 1, 2 or 3, characterized in that: The following steps are involved: S1, the state machine (8) waits for the instruction sent by the serial port module (4), determines whether the instruction sent by the serial port module (4), i.e., the instruction information of the host computer, is received, and if the instruction is received, executes step S2; if the instruction is not received, executes step S3; S2, after receiving the instruction sent by the serial port module (4), i.e., the instruction information of the host computer, the state machine (8) parses the instruction and performs corresponding operations: If the instruction parsing content is to access the memory, the memory controller is controlled to read / write / erase the memory according to the control information; If the instruction parsing content is to access the FPGA, then the FPGA interface module (6) is controlled to configure / read back / refresh the FPGA according to the control information; If the instruction parsing content is the setting of the circuit status / parameters, the circuit status / parameters are set according to the status information; After the state machine (8) completes the corresponding operation according to the instruction parsing content, it jumps to step S1; S3, the state machine (8) does not receive the instruction sent by the serial port module (4), and the state machine (8) controls the storage controller to read the data in the memory and sends it to the FPGA interface module (6) through the data path (5); S4, the FPGA interface module (6) receives data sent by the storage controller through the data path (5), i.e., reads data in the memory, for configuring the FPGA, i.e., the data in the memory is used as configuration data of the FPGA; S5, FPGA enters user mode; S6, after waiting for a fixed period of time, determine whether to read back: If read back is performed, step S7 is executed; If the read-back is not performed, it is determined whether to refresh. If refreshing is performed, step S8 is executed. If refreshing is not performed, the process jumps back to step S6. S7, the FPGA interface module (6) reads back the FPGA to obtain the read-back data of the FPGA; the FPGA interface module (6) is used to compare the read-back data of the FPGA, that is, to compare the read-back data of the FPGA with the data in the memory; if they are consistent, it means that the configuration data is correct, and jump back to step S6 to wait for a fixed time; if they are inconsistent, it means that the configuration data is wrong, and the configuration data is refreshed, and step S8 is executed; S8, the FPGA interface module (6) receives data sent by the storage controller through the data path (5), i.e. reads data in the memory, and uses the data in the memory to refresh, i.e. overwrite, the configuration data of the FPGA; After the refresh is completed, jump back to step S6; The storage controller comprises: an SPI Flash controller (1), a parallel port NOR Flash controller (2), and a PROM controller (3).
8. The method for configuring, reading back and refreshing an SRAM-type FPGA according to claim 7, characterized in that: In step S2, If the instruction parsing content is to access the memory, the state machine (8) controls the memory controller to receive the data sent by the serial port module (4) through the data path (5) and write the data into the corresponding memory; or the state machine (8) controls the memory controller to read the data in the memory and send it to the serial port module (4) through the data path (5); or the state machine (8) controls the memory controller to erase the data in the memory; If the instruction parsed content is to access the FPGA, the state machine (8) controls the FPGA interface module (6) to receive the data sent by the serial port module (4) through the data path (5) and configure the FPGA, that is, the data sent by the serial port module (4) is used as the configuration data of the FPGA; or, the state machine (8) controls the FPGA interface module (6) to read back the FPGA and obtain the read-back data of the FPGA; the FPGA interface module (6) compares the read-back data of the FPGA and compares the read-back data of the FPGA with the data sent by the serial port module (4); if they are consistent, it means that the FPGA function is normal and the configuration data of the FPGA is correct; if they are inconsistent, the configuration data of the FPGA is wrong; or, the state machine (8) controls the FPGA interface module (6) to refresh the configuration data of the FPGA using the data sent by the serial port module (4); or, the state machine (8) controls the FPGA interface module (6) to read back the FPGA and obtain the read-back data of the FPGA, and the FPGA interface module (6) sends the read-back data of the FPGA to the host computer through the serial port module (4).
9. The method for configuring, reading back and refreshing an SRAM-type FPGA according to claim 7, characterized in that: In step S3, the state machine (8) controls the corresponding storage controller to read data in the memory with a high access priority according to the access priority of the memory.
10. The method for configuring, reading back and refreshing an SRAM-type FPGA according to claim 7, characterized in that: After step S5, a fixed time is waited to determine whether to perform SEFI fault detection. If SEFI fault detection is performed, the FPGA interface module (6) performs SEFI fault detection on the FPGA. If a SEFI fault is detected in the FPGA, the FPGA interface module (6) performs a chip reset on the FPGA. After the FPGA interface module (6) performs a chip reset on the FPGA, the FPGA interface module (6) re-receives data in the memory or re-receives data sent by the serial port module (4) to configure the FPGA.
Citation Information
Patent Citations
Astronavigation FPGA universal refresh circuit based on JTAG interface and achieving method thereof
CN103840823A
Circuit and method for updating FPGA configuration data
CN108319465A
Configuration data dynamic refreshing method and device of SRAM type FPGA
CN112433777A
IP core for satellite-borne SRAM type FPGA configuration and refresh control
CN112527350A
Read-back refreshing method and system for FPGA
CN113268263A
Cited By
Merging buffer access operations in a coarse-grained reconfigurable computing system
US12254300B2
Merging Buffer Access Operations in a Coarse-grained Reconfigurable Computing System
US20230325312A1
