General framework of lower-level FPGA software

By designing the top-level protocol and cross-clock domain synchronization mechanism of communication modules and execution modules in FPGA computers, the differences in communication processing in different systems are solved, and the commonality of FPGA computers and software portability are realized, and the simplification of simplification of FPGA computers is achieved. The research and development process.

CN113961243BActive Publication Date: 2024-11-05Shanghai Institute of Basic Aerospace Technology
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111037489.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2024-11-05
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

In electronic systems, although the underlying communication protocol is the same, the top-level protocol and instruction processing methods vary depending on the system, resulting in technical homogeneous labor and poor portability during the development process, making it difficult to achieve universalization of FPGA lower-level computers.

Method used

A general framework of lower computer FPGA software is designed to parse and form instructions and reply packets through the top-level protocol between the communication module and the upper computer and the execution module to realize cross-clock domain synchronization, ensuring the effectiveness of instructions and reply and stability and allow for replacement of execution modules without changing the communication modules.

Benefits of technology

It realizes the universalization of FPGA computers in electronic systems composed of different upper computers and lower computers, reduces code modification, enhances the portability and R&D efficiency of software, and simplifies the design and replacement process of execution modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961243B_ABST
    Figure CN113961243B_ABST
Patent Text Reader

Abstract

The invention discloses a general framework of lower computer FPGA software, including: a communication module and an execution module; the communication module communicates with the upper computer via a communication interface chip upwards, and communicates with the execution module for controlling the execution components inside the software downwards, thereby controlling each execution component; the interaction protocol between the communication module and the communication interface chip is a bottom-level protocol, which is determined by the interaction timing between the communication interface chip and the FPGA; the interaction protocol between the communication module and the execution module belongs to a top-level protocol; the instruction data packet sent by the upper computer to the FPGA via the communication interface chip is parsed by the communication module, and the parsed instructions are distributed to the corresponding execution module for execution, the communication module obtains the instruction execution result from the execution module, and the communication module forms a reply data packet and replies to the instruction of the upper computer through the communication interface chip, and each instruction corresponds to a reply. The invention enables the FPGA software to have a unified architecture, enhances the portability of the software, and accelerates research and development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic systems, and in particular to a general framework of lower-level computer FPGA software. Background Art

[0002] The upper computer and the lower computer constitute an electronic system, which is a basic paradigm in the field of electronic design. The upper computer is usually composed of a computer that can run CPU programs, and the lower computer is usually composed of a system based on FPGA or single-chip microcomputer. The upper computer and the lower computer can use different underlying communication protocols, such as USB, UART, etc. The underlying communication protocol usually processes the parsing and construction of bits to the data packet level, that is, obtaining data packets based on the received bits, or sending the data in the data packet in the form of bits. Above the underlying communication protocol, there are higher-level communication protocols. These communication protocols process the parsing and construction of data packets to the "meaning data" (the meaning data is the customized data with specific meaning), that is, parsing various meaning data from the received data packet, and then performing certain operations based on the data, or forming a data packet based on the meaning data and sending it out.

[0003] Different systems use different underlying communication protocols, which can be classified into several categories, such as USB, UART, etc. The same can be achieved within each category. However, even if the underlying protocols are the same, the top-level protocols are usually different; after communication occurs, the processing of various instructions and data is also different. There are differences in developing different systems, but the work is technically homogenized. Summary of the invention

[0004] The purpose of the present invention is to establish a universal top-level protocol for a lower computer with FPGA as the core, and to construct a general framework of FPGA software for the lower computer. The communication module in the software framework receives the command data packet of the upper computer, parses it and sends the command to the corresponding execution module for execution, obtains the execution result replied by the execution module, and transmits it to the upper computer after forming a reply data packet.

[0005] In order to achieve the above-mentioned purpose, the present invention provides a general framework of lower-level FPGA software, including: a communication module, an execution module;

[0006] The communication module communicates with the host computer via the communication interface chip, and communicates with the execution module for controlling the execution components inside the software, thereby controlling each execution component;

[0007] The interaction protocol between the communication module and the communication interface chip is a bottom-level protocol, which is determined by the interaction timing between the communication interface chip and the FPGA; the interaction protocol between the communication module and the execution module belongs to the top-level protocol;

[0008] The instruction data packet sent by the host computer to the FPGA through the communication interface chip is parsed by the communication module, and the parsed instructions are distributed to the corresponding execution module for execution. The communication module obtains the instruction execution result from the execution module. After the communication module assembles the reply data packet, it replies to the instruction of the host computer through the communication interface chip. Each instruction corresponds to a reply.

[0009] The above-mentioned general framework of the lower-computer FPGA software, wherein the top-level protocol also includes: the specific position and specific meaning of each meaning data in the data packet, requiring the communication modules of the upper-computer software and the lower-computer software to have consistent definitions so that they can communicate with each other; the top-level protocol is the content defined in the present invention and is universal.

[0010] The above-mentioned lower-level FPGA software general framework, wherein the instruction belongs to the top-level protocol and is composed of several bytes, and the communication module parses the following meaning data from the instruction: CommandType is the object of the instruction, that is, which execution module in the FPGA software the instruction is finally sent to; CommandData is the content of the instruction;

[0011] The reply belongs to the top-level protocol and consists of several bytes. After the communication module receives the reply from the execution module, it assembles a reply data packet and sends it to the host computer through the communication interface. The host computer parses the following meaning data from the reply data packet: ResponseType indicates which execution module in the FPGA software issued the reply; ResponseData is the content of the reply.

[0012] The above-mentioned lower computer FPGA software general framework, wherein CommandArrived and CommandData are a group of signals, which are sent from the communication module to the execution module, and ResponseArrived and ResponseData are a group of signals, which are sent from the execution module to the communication module; the two groups of signals need to be synchronized across clock domains, and the synchronization processing is completed in the communication module, so that the group of signals CommandArrived and CommandData can achieve synchronization from the communication module clock domain clk to the execution module clock domain ModuleClk; so that the group of signals ResponseArrived and ResponseData can achieve synchronization from the execution module clock domain ModuleClk to the communication module clock domain clk; the signals at the communication module and the execution module ports are all signals under the execution module clock domain ModuleClk or signals that can be directly used by ModuleClk without synchronization, that is, the synchronized group of signals CommandArrived and CommandData and the group of signals ResponseArrived and ResponseData before synchronization.

[0013] The above-mentioned lower computer FPGA software general framework, wherein the synchronization method for the group of signals CommandArrived and CommandData is: synchronizing the CommandArrived signal in the clock domain clk of the communication module before synchronization to the clock domain ModuleClk of the execution module, and not processing CommandData, to ensure that when the CommandArrived is valid after synchronization, CommandData is already in a stable state;

[0014] The synchronization method for the ResponseArrived and ResponseData signals is: synchronize the ResponseArrived signal in the clock domain ModuleClk of the execution module before synchronization to the clock domain clk of the communication module, and do not process the ResponseData, ensuring that when the synchronized ResponseArrived is valid, the ResponseData is already in a stable state.

[0015] In the above-mentioned lower-computer FPGA software general framework, the synchronization processing of CommandArrived and ResponseArrived is cross-clock synchronization of a single signal.

[0016] The above-mentioned lower computer FPGA software general framework, wherein, after receiving the upper computer data packet, the communication module parses the command object CommandType from the data packet, where CommandType is the ID of the execution module, and then sets the exclusive CommandArrived of the execution module corresponding to CommandType to 1, and passes the command content CommandData to the exclusive CommandData of the execution module;

[0017] After receiving the exclusive ResponseArrived signal of the execution module, the communication module sets the ResponseType according to the ID of the execution module, and copies the exclusive ResponseData of the execution module as ResponseData, which together with the ResponseType constitutes a reply data packet and is sent to the host computer via the communication interface chip.

[0018] The above-mentioned lower-machine FPGA software general framework, wherein the framework can replace the execution module according to the task requirements, but does not change the communication module.

[0019] How to design the execution module using the general framework of the lower-level FPGA software to interact with the communication module? The specific timing is described as follows:

[0020] The execution module detects that the CommandArrived signal in the ModuleClk clock domain is high, that is, valid, and then reads the value of the instruction content CommandData. After the instruction is executed, set ResponseArrived to valid and set the reply content ResponseData. The communication module detects the ResponseArrived signal in the clk clock domain, enters the reply process, and sets CommandArrived to invalid. When the execution module detects that CommandArrived in the ModuleClk clock domain is invalid, ResponseArrived needs to be set to invalid.

[0021] Compared with the prior art, the technical beneficial effect of the present invention is that in an electronic system composed of different upper and lower computers, if the lower computer uses FPGA as the main control chip, the universal lower computer FPGA software architecture described in the present invention can be adopted, and there is no need to modify the code of the communication module responsible for command data packet parsing, task distribution, reply reading and reply data packet formation, and only the execution module needs to be changed according to the specific task. This makes the FPGA software have a unified architecture, enhances the portability of the software, and accelerates research and development. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The general framework of the lower computer FPGA software of the present invention is given by the following embodiments and drawings.

[0023] Figure 1 Schematic diagram of the relationship between the general framework of the lower-level FPGA software and other parts of the system;

[0024] Figure 2 The relationship diagram between the communication module, the communication interface chip and the execution module;

[0025] Figure 3 Timing diagram of the interaction protocol between the communication module and each execution module. DETAILED DESCRIPTION

[0026] The following will further describe in detail the lower computer FPGA software general framework of the present invention in conjunction with the accompanying drawings.

[0027] The communication module is the core module of the lower computer software. It communicates with the upper computer through the communication interface chip, and communicates with the execution module used to control the execution components inside the software, thereby controlling each execution component (see Figure 1 The communication module parses the command data packet of the host computer, passes it to the corresponding module for execution, obtains feedback on the command execution result, forms a reply data packet, and transmits it back to the host computer through the communication interface chip.

[0028] The interaction protocol between the communication module and the communication interface chip is the bottom layer protocol, and the bottom layer protocol is determined by the interaction timing between the communication interface chip and the FPGA. The interaction protocol between the communication module and the execution module belongs to the top layer protocol. In addition, the top layer protocol also includes the specific position and specific meaning of each meaning data in the data packet, and the communication modules of the upper computer software and the lower computer software need to have consistent definitions so that they can communicate with each other. The top layer protocol is the content defined in the present invention, and the present invention has universality for the definition of the top layer protocol.

[0029] The communication module parses the instructions sent by the host computer to the FPGA through the communication interface chip. The instructions are composed of several bytes. CommandType is the object of the instruction, that is, which execution module in the FPGA software the instruction is ultimately sent to. CommandData is the content of the instruction. Accordingly, the communication module replies to the instructions of the host computer through the communication interface chip, and each instruction must correspond to a reply.

[0030] ResponseType indicates which execution module in the FPGA software sends the response, and ResponseData is the content of the response.

[0031] Figure 2Describes the relationship between the communication module, the communication interface chip and the execution module, and the signals between the communication module and the execution module. Figure 3 It is a timing diagram of the interaction protocol between the communication module and each execution module. The timing consists of four groups of signals: CommandArrived (1-bit signal), CommandData (multi-bit fixed-bit signal), ResponseArrived (1-bit signal), and ResponseData (multi-bit fixed-bit signal) (see Table 1). For each execution module, these four groups of signals are independent. The number of bits in Table 1 is the number of bits of these four groups of signals for a single execution module.

[0032] Table 1 Signals for interaction between the communication module and a single execution module

[0033]

[0034] It should be pointed out that the communication module and each execution module have their own clock domains so that they can run at different clock frequencies. According to the design common sense of FPGA software, signal transmission in different clock domains needs to consider cross-clock domain synchronization processing, that is, CommandArrived, CommandData, ResponseArrived, and ResponseData need to be synchronized across clock domains. One of the advantages of the present invention is that the synchronization processing is completed in the communication module, so that these four groups of signals are synchronized with the clock domain ModuleClk of the corresponding execution module. If the clock domain synchronization processing is placed in each execution module, then each execution module needs to be synchronized. If it is placed in the communication module, the communication module will perform synchronization processing uniformly, and each execution module does not need to pay attention to the important, cumbersome and easily overlooked details of cross-clock domain. CommandArrived and CommandData are in the same direction, and they are combined into a multi-bit signal; ResponseArrived and ResponseData are in the same direction, and they are also multi-bit signals when combined together. The present invention converts the synchronization problem of multi-bit signals into the synchronization problem of unit signals. Specifically, the CommandArrived signal before synchronization is synchronized in the clock domain ModuleClk of the execution module, and CommandData is not processed, ensuring that when CommandArrived is valid after synchronization, CommandData is already in a stable state; the ResponseArrived signal before synchronization is synchronized in the clock domain clk of the communication module, and ResponseData is not processed, ensuring that when ResponseArrived is valid after synchronization, ResponseData is already in a stable state. The synchronization of CommandArrived and ResponseArrived is a cross-clock synchronization of a single signal. The specific method of synchronizing a single signal from the first clock domain to the second clock domain is to use two cascaded D flip-flops in the second clock domain (that is, the data output terminal Q of the first D flip-flop is connected to the data input terminal D of the second D flip-flop), and the unsynchronized signal (located in the first clock domain) is connected to the data input terminal D of the first D flip-flop, and the data output terminal Q of the second D flip-flop will generate the synchronized signal (located in the second clock domain). The specific method of cross-clock synchronization of a single signal belongs to common sense.

[0035] After receiving the command data packet from the host computer, the communication module parses the command object CommandType (multi-bit data, the serial number of the execution module) from the command data packet, and then sets the exclusive CommandArrived of the command object (i.e. the execution module) to 1, and passes the command content CommandData to the exclusive CommandData of the command object. After receiving the exclusive ResponseArrived signal of the execution module, the communication module sets the ResponseType (multi-bit data, the serial number of the execution module) according to the execution module, and copies the exclusive ResponseData of the execution module as ResponseData, and together with ResponseType, it forms a reply data packet and sends it to the host computer through the communication interface chip.

[0036] When the task requires, the execution module can be replaced, but the communication module will not be changed. The top-level protocol of the communication module remains unchanged in the above manner. If the communication interface chip remains unchanged, the bottom-level protocol will also remain unchanged. The number of execution modules can be changed according to the task requirements. The communication module contains a parameter that indicates the number of execution modules. The number of execution modules can be passed from the top-level module to the communication module without changing the communication module. The above reasons determine that the code of the entire communication module will remain unchanged. The entire FPGA software only needs to replace the execution module as required, and set the number of execution modules in the top-level module, which has great versatility. If further optimized, the communication module can be made into an IP core with parameters, and the code of the communication module is not allowed to be changed for easy use.

[0037] If the communication interface chip changes, the communication module needs to be changed accordingly, but generally speaking, the communication interface chip can be fixed to certain types of chips to cover different application scenarios and correspond to several communication modules.

[0038] like Figure 3 As shown in the figure, the usage of this framework, that is, how to design the execution module to interact with the communication module, the specific timing can be described as:

[0039] After the execution module detects that the CommandArrived signal in the ModuleClk clock domain is valid (high level), it needs to read the value of the instruction content CommandData. After the instruction is executed, ResponseArrived is set to valid and the reply content ResponseData is set. The communication module detects the ResponseArrived signal in the clk clock domain, enters the reply process, and sets CommandArrived to invalid. When the execution module detects that CommandArrived in the ModuleClk clock domain is invalid, ResponseArrived needs to be set to invalid.

[0040] Example

[0041] The communication module communicates with the Cypress FX3 series USB3.0 interface chip in a synchronous Slave FIFO mode. The communication data packet between the host and the slave consists of 12 bytes (see Table 2 and Table 3). In the table, CommandData[31:0] indicates that CommandData is 32-bit data. Similarly, CommandType, ResponseData, and ResponseType are also multi-bit data.

[0042] Table 2 12-byte instructions sent by the host computer to the monitoring board

[0043]

[0044] Table 3 The 12-byte reply sent by the monitoring board to the host computer

[0045]

Claims

1. The general framework of the lower computer FPGA software is characterized by: include: Communication module, execution module; The communication module communicates with the host computer via the communication interface chip, and communicates with the execution module for controlling the execution components inside the software, thereby controlling each execution component; The interaction protocol between the communication module and the communication interface chip is a bottom-level protocol, which is determined by the interaction timing between the communication interface chip and the FPGA; the interaction protocol between the communication module and the execution module belongs to the top-level protocol; The communication module parses the instruction data packet sent by the host computer to the FPGA through the communication interface chip. The parsed instructions are distributed to the corresponding execution module for execution. The communication module obtains the instruction execution result from the execution module. After the communication module assembles the reply data packet, it replies to the instruction of the host computer through the communication interface chip. Each instruction corresponds to a reply. The command belongs to the top-level protocol and is composed of several bytes. The communication module parses the following meaning data from the command: CommandType is the object of the command, that is, which execution module in the FPGA software the command is ultimately sent to; CommandData is the content of the command; The reply belongs to the top-level protocol and is composed of several bytes. After the communication module receives the reply from the execution module, it forms a reply data packet and sends it to the host computer through the communication interface. The host computer parses the reply data packet to obtain the following meaning data: ResponseType indicates which execution module in the FPGA software issued the reply; ResponseData is the content of the reply; CommandArrived and CommandData are a group of signals, which are sent from the communication module to the execution module; ResponseArrived and ResponseData are a group of signals, which are sent from the execution module to the communication module; the two groups of signals need to be synchronized across clock domains, and the synchronization is completed in the communication module, so that the group of signals CommandArrived and CommandData can achieve synchronization from the clock domain clk of the communication module to the clock domain ModuleClk of the execution module; the group of signals ResponseArrived and ResponseData can achieve synchronization from the clock domain ModuleClk of the execution module to the clock domain clk of the communication module; the signals at the ports of the communication module and the execution module are all signals under the clock domain ModuleClk of the execution module or signals that can be directly used by ModuleClk without synchronization, that is, the group of signals CommandArrived and CommandData after synchronization and the group of signals ResponseArrived and ResponseData before synchronization.

2. The lower computer FPGA software general framework as claimed in claim 1, characterized in that: The top-level protocol also includes: the specific position and specific meaning of each meaning data in the data packet, which requires the communication modules of the upper computer software and the lower computer software to have consistent definitions so that they can communicate with each other.

3. The lower computer FPGA software general framework as claimed in claim 1, characterized in that: The synchronization method for the CommandArrived and CommandData signals is: synchronize the CommandArrived signal in the clock domain clk of the communication module before synchronization to the clock domain ModuleClk of the execution module, and do not process the CommandData, so as to ensure that when the CommandArrived is valid after synchronization, the CommandData is already in a stable state; The synchronization method for the ResponseArrived and ResponseData signals is: synchronize the ResponseArrived signal in the clock domain ModuleClk of the execution module before synchronization to the clock domain clk of the communication module, and do not process the ResponseData, ensuring that when the synchronized ResponseArrived is valid, the ResponseData is already in a stable state.

4. The lower computer FPGA software general framework as claimed in claim 3, characterized in that: The synchronization of CommandArrived and ResponseArrived is processed as cross-clock synchronization of a single signal.

5. The lower computer FPGA software general framework as claimed in claim 4, characterized in that: After receiving the data packet from the host computer, the communication module parses the command object CommandType from the data packet. CommandType is the ID of the execution module, and then sets the exclusive CommandArrived of the execution module corresponding to CommandType to 1, and passes the command content CommandData to the exclusive CommandData of the execution module; After receiving the exclusive ResponseArrived signal of the execution module, the communication module sets the ResponseType according to the ID of the execution module, and copies the exclusive ResponseData of the execution module as ResponseData, which together with the ResponseType constitutes a reply data packet and is sent to the host computer via the communication interface chip.

6. The lower computer FPGA software universal framework as claimed in claim 1, characterized in that: The framework can replace the execution module according to the task requirements, but does not change the communication module.

7. A method for using the lower computer FPGA software universal framework as described in any one of claims 1 to 6, characterized in that: How to design the execution module to interact with the communication module. The specific timing is described as follows: The execution module detects that the CommandArrived signal in the ModuleClk clock domain is high, that is, valid, and then it needs to read the value of the instruction content CommandData. After the instruction is executed, ResponseArrived is set to valid, and the reply content ResponseData is set. The communication module detects the ResponseArrived signal in the clk clock domain, enters the reply process, and sets CommandArrived to invalid. When the execution module detects that CommandArrived in the ModuleClk clock domain is invalid, ResponseArrived needs to be set to invalid.