Multi-chip communication method based on FPGA master controller and neural network algorithm

By defining frame structures and modules in the multi-chip structure controlled by FPGA, communication of multi-layer data structures and multiple data types is realized, solving the problem of multi-chip neural network algorithm communication that cannot be realized in the existing technology, and ensuring data The accuracy and reliability of transmission are suitable for image processing with neural network algorithms.

WO2024192907A1PCT designated stage expired Publication Date: 2024-09-26ZHEJIANG LAB
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/101706
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-17
Filing Date
2023-06-21
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

The existing technology lacks a communication method based on multi-chip neural network algorithms controlled by FPGA. It cannot realize communication of multi-layer data structures and multiple data types, cannot accurately execute functions and data transmission, and cannot provide timely feedback on data transmission status.

Method used

Using a multi-chip structure based on FPGA main control, the frame structure is defined to include original data frame, status frame, hierarchical data frame, hierarchical weight frame, calculation result frame, etc., and the data is realized through the FPGA main control guidance interface module and data receiving module. Transmission and status requests use the frame command segment, numerical status segment and check segment to ensure the accuracy and reliability of data transmission.

Benefits of technology

It realizes communication of multi-layer data structures and multiple data types, accurately schedules data transmission in multi-chip systems, clarifies data structures and request commands, and provides timely feedback on receiving and sending status and error types. It is suitable for image processing of neural network algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023101706_26092024_PF_FP
    Figure CN2023101706_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the present invention is a multi-chip communication method based on an FPGA master controller and a neural network algorithm. Image processing based on a neural network algorithm is completed by means of design of an original data frame, a status frame, a hierarchical data frame, a hierarchical weight frame, a calculation result frame, a hierarchical data request frame, a hierarchical weight request frame, a calculation result request frame, and an operation status request frame, and by means of scheduling of sending and receiving processes. According to the present invention, neural network algorithm-based communication of multi-level data structures and multiple data types is ensured, sending and receiving of data required by the master controller and chips in a multi-chip system are accurately scheduled, and data request commands are sent; the present invention plays a very active role in giving feedback on receiving, sending, chip running statuses, errors that occur, and error types.
Need to check novelty before this filing date? Find Prior Art

Description

A communication method for multi-chip neural network algorithm based on FPGA master control Technical Field

[0001] The present invention relates to the field of communications, and in particular to a communication method of a multi-chip neural network algorithm based on FPGA master control. Background Art

[0002] Multi-chip collaboration is an important way to solve the problem of insufficient functions and computing power of a single chip. The main method currently used in multi-chip collaboration is to use one chip as the master control chip in multi-chip communication. With the rapid development of FPGA technology, its diversified functional design, convenient and fast circuit adjustment, and flexibly configurable pin interface have greatly reduced the development time of multi-chip systems. FPGA-based multi-chip communication has a very positive role in promoting the realization of this system.

[0003] However, in the existing technology, there is no specific communication method for multi-chip neural network algorithms based on FPGA master control. It is impossible to complete the communication of multi-layer data structures and multiple data types based on artificial intelligence neural network algorithms, and it is impossible to clearly define the corresponding data types and number of layers. It is impossible to accurately execute the corresponding functions and send and receive the required data, and it is impossible to provide timely feedback on the data transmission status.

[0004] Summary of the Invention

[0005] In view of the deficiencies in the prior art, the present invention aims to provide a communication method for a multi-chip neural network algorithm based on FPGA master control.

[0006] To achieve the above object, the technical solution adopted by the present invention is: the present invention provides a communication method of a multi-chip neural network algorithm based on FPGA master control, the method comprising the following steps:

[0007] (1) A multi-chip structure based on an FPGA master control constructs a frame structure, wherein the frame structure includes an original data frame, a status frame, a layered data frame, a layered weight frame, a calculation result frame, a layered data request frame, a layered weight request frame, a calculation result request frame, and an operation status request frame; the multi-chip structure based on the FPGA master control guides the operation of the master control interface module and the chip data receiving module to realize data communication for the chip or chipset;

[0008] (2) Data transmission is initiated by the original data frame or request frame, including the FPGA master sending data and requesting data to the chip or chipset, and the chip or chipset requesting data from the FPGA master;

[0009] (3) The FPGA master transmits data to the chip or chipset. After the chip receives the data, it stores or calculates the data and then transmits the calculation results to the FPGA master. If a transmission error occurs during the de-framing and verification process during the FPGA master transmission, the receiver transmits an error frame. If there is a status request or control requirement during the FPGA master transmission, the FPGA master transmits the status request or control command to the chip or chipset.

[0010] (4) The FPGA master sends a data transmission request frame to the chip or chipset. After the chip receives the data, it transmits the data or data storage or calculation results to the FPGA master. The chip requests data from the FPGA master, and the FPGA master transmits the data to the chip or chipset. If a transmission error occurs during the de-framing and verification process during the FPGA master transmission, the receiver transmits an error frame. If there is a status request or control requirement during the FPGA master transmission, the FPGA master transmits a status request or control command to the chip or chipset.

[0011] Furthermore, the frame structure is specifically as follows:

[0012] The original data frame includes a frame instruction segment, a numerical status segment, a data segment and a check segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment is a data structure, including a frame start code, an image frame height and an image frame width; the data segment is the data to be sent, and is grouped into 1 group of 32 bits according to the data to be sent each time, and the data is arranged from the bottom bit to the high bit. For the last data segment less than 32 bits, the high bit is padded with 0; the check segment uses a checksum check method to invert all data values ​​of the frame instruction segment, the numerical status segment, the data segment and the check segment and add 1, and arrange them according to high and low bits, padded with 0 for high bits less than 32 bits, and padded with the low 32 bits for bits exceeding 32 bits;

[0013] The status frame includes a frame instruction segment and a numerical status segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code, and the numerical status segment includes a reception correct status, a data counting error status, a data check error status and a chip operation error status;

[0014] The layered data frame, layered weight frame, and calculation result frame each include a frame instruction segment, a numerical status segment, a data segment, and a check segment; wherein the frame instruction segment includes a frame start code, a frame number code, and a frame type code; the numerical status segment includes a data length code, layer number information, image frame height, and image frame width; the framing method of the data segment is consistent with that of the original data frame; and the check method of the check segment is consistent with that of the original data frame.

[0015] The layered data request frame, the layered weight request frame, and the calculation result request frame each include a frame instruction segment and a numerical status segment, and the layered data request frame, the layered weight request frame, and the calculation result request frame are used to request the layered data frame, the layered weight frame, and the calculation result frame, respectively; wherein the frame instruction segment includes a frame start code, a frame number code, and a frame type code; and the numerical status segment includes a data length code, layer number information, image frame height, and image frame width;

[0016] The operation status request frame includes a frame instruction segment and a numerical status segment; wherein, the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment includes a frame reception completion status, a frame reception error status, a chip status request frame and a master FPGA status request frame and a status command from the master to the chip.

[0017] Furthermore, by adjusting the structure of the frame instruction segment, the transmission of the chip or chipset can be controlled simultaneously; the first 32 bits of each frame are sent to guide the operation of the FPGA master control interface module and the chip data receiving module, and the corresponding frame information is transmitted to the chip or chipset corresponding to the frame number code according to the frame type code; the frame instruction segment includes sending according to the data number, ignoring the first bit and repeating it, ignoring the first and second bits and repeating it, ignoring the first, second and third bits and repeating it, ignoring the first, second, third and fourth bits and repeating it all, which can ensure that the data is sent to the corresponding chip or the corresponding 2, 4, 8, 16 and 32 chips to repeat the data.

[0018] Furthermore, according to the binary or multi-valued network algorithm of the neural network, the original data or any layer of data as well as the total length of the data, the data structure and the number of layers to which the data belongs can be flexibly adjusted; the data required for the neural network algorithm is transmitted through the original data frame, layered data frame or layered weight frame, and then the frame is grouped, and the grouped frame is transmitted to the chip or chipset; after the reception is completed, the chip or chipset is calculated, and then the chip sends the calculation result frame to the main control.

[0019] Furthermore, the method can apply neural network algorithms for multiple application scenarios of images, text, voice, faces, objects and behaviors, and the original data, intermediate calculation data, weights and calculation result data in each scenario are all transmitted through this method; the method can handle the transmission of binary, ternary and multi-valued data and binary, ternary and multi-valued weights in neural network algorithms.

[0020] Furthermore, the multi-chip structure based on FPGA master control includes an FPGA master control system and multiple chip nodes; the FPGA master control system and each chip node are connected via a data connection line and a chip select signal line.

[0021] Furthermore, the FPGA master control or chip initiates a hierarchical data request, a hierarchical weight request or a calculation result request to the other party at any time before the calculation starts, during the calculation process and after the calculation is completed, and transmits the data, weights and calculation results to be transmitted.

[0022] Furthermore, the FPGA master monitors and controls the status of the multi-chip system, obtains the chip operating status and the master FPGA operating status request frame through the operating status request; for chips with poor operating status, the FPGA master adjusts the chip operating status by giving chip status commands.

[0023] The present invention also provides a communication device for a multi-chip neural network algorithm based on FPGA master control, including one or more processors for implementing the above-mentioned communication method for a multi-chip neural network algorithm based on FPGA master control.

[0024] The present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, it is used to implement the communication method of the multi-chip neural network algorithm based on FPGA master control.

[0025] The beneficial effects of the present invention are as follows: it is suitable for completing image processing based on neural network algorithms, and it plays a very active role in the communication of multi-layer data structures and multiple data types, accurately scheduling the sending and receiving of data required by the main control and each chip in the multi-chip system, and accurately clarifying its data structure, as well as issuing data request commands, for receiving, sending and chip operating status and feedback on errors and error types. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic diagram of a multi-chip structure based on FPGA master control of the present invention;

[0027] FIG2 is a schematic diagram of the original data frame structure of the present invention;

[0028] FIG3 is a schematic diagram of a status frame structure of the present invention;

[0029] FIG4 is a schematic diagram of the structure of the hierarchical data frame, hierarchical weight frame, and calculation result frame of the present invention;

[0030] FIG5 is a schematic diagram of the structures of a hierarchical data request frame, a hierarchical weight request frame, and a calculation result request frame according to the present invention;

[0031] FIG6 is a schematic diagram of the structure of an operation status request frame of the present invention;

[0032] FIG7 is a schematic diagram of the raw data and layered data transmission and processing flow of the present invention;

[0033] FIG8 is a schematic diagram of a data transmission and processing flow including a request frame according to the present invention;

[0034] FIG9 is a diagram of a communication device for a multi-chip neural network algorithm based on FPGA master control provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments, and the purpose and effects of the present invention will become more apparent. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0036] First, let’s explain the technical terms:

[0037] (1) FPGA: Field Programmable Gate Array;

[0038] (2) SoC: System on Chip;

[0039] (3) AMBA: Advanced Microcontroller Bus Architecture.

[0040] The present invention can complete the communication of multi-layer data structures and multiple data types based on neural network algorithms, accurately schedule the sending and receiving of data required by the main control and each chip in the multi-chip system, and accurately define its data structure; by issuing data request commands, feedback is provided on the reception, sending, chip operation status, errors that occur, and error types.

[0041] Example 1

[0042] The specific execution process of the communication method of the multi-chip neural network algorithm based on FPGA master control provided by the present invention is as follows:

[0043] Step 1: Build a multi-chip architecture based on an FPGA master controller. See Figure 1 for a schematic diagram of the multi-chip architecture based on an FPGA master controller. This architecture includes an FPGA master controller system and multiple SoC chip nodes. The FPGA master controller system and each SoC chip node are connected via data cables and chip select signal lines. The FPGA master controller system includes a framing and deframing module and an FPGA interface module, which are connected via an on-chip bus. The SoC chip nodes include a chip interface module and a framing and deframing module. Figure 1 shows only three chip nodes, where N <= 31, indicating a maximum of 32 nodes. Data is transmitted between the FPGA master controller system and each SoC chip node via a common data interface, using the same data transmission protocol. When sending data, the FPGA master controller reads the frame number in the frame instruction segment of the frame structure to determine the chip number or chipset number of the data to be transmitted. It then selects the corresponding chip using the chip select signal. If the data to be transmitted is a chipset, it is transmitted in ascending order of chip number. During the data reception process, the FPGA master controller sends data based on the first-come, first-served principle. If there are simultaneous selections, the data is received in ascending order according to the chip number.

[0044] The frame structure is constructed using a multi-chip structure based on an FPGA master controller. The frame structure includes raw data frames, status frames, layered data frames, layered weight frames, calculation result frames, layered data request frames, layered weight request frames, calculation result request frames, and operation status request frames. Each frame structure contains a frame instruction segment and a frame status segment. The frame instruction segment structure of each frame structure is consistent, being 32 bits. The frame instruction segment structure contains a frame start code, a frame number code, and a frame type code. The frame status segment is framed differently depending on the frame type. The frame structures of raw data frames, layered data frames, layered weight frames, and calculation result frames contain a frame data segment and a frame check segment. The frame data segment and frame check segment are framed differently depending on the frame type.

[0045] Referring to the schematic diagram of the raw data frame structure in Figure 2, a raw data frame includes a frame instruction segment, a numerical status segment, a data segment, and a check segment. The frame instruction segment includes a frame start code, a frame number code, and a frame type code. The numerical status segment is a data structure, including the frame start code, image frame height, and image frame width. The frame instruction segment of a raw data frame includes a 16-bit frame start code, including the frame instruction segment. When the send command begins, the frame encoding module uses the specific byte start code as the frame start code for the transmitted data. During the reception process, after the frame start code is received, the frame start code check is performed. If the check passes, a frame start check pass signal is triggered. If the check fails, an error signal is triggered. During transmission, the frame command segment contains an 8-bit frame number. The first 3 bits indicate the transmission mode, including sending by data number, ignoring repeated transmission of the first digit, ignoring repeated transmission of the first and second digits, ignoring repeated transmission of the first, second, and third digits, ignoring repeated transmission of the first, second, third, and fourth digits, and repeating all digits. This ensures that data is sent to the corresponding chip or to two, four, eight, 16, or 32 chips. The last 5 bits of the frame number indicate the chip to which data is sent, with values ​​from 00000 to 11111 supporting communication with up to 32 chips. The first 3 bits of received data are all defined as 000, and the last 5 bits are the corresponding chip number. Data processing is then performed based on the chip model corresponding to the received data. The frame command segment contains an 8-bit frame type code. The upper 6 bits of the frame type code contain a structure that indicates the specific meaning of the frame, such as 000001 for raw data frames. The lower 2 bits of the frame type code contain a structure that indicates the frame image type. The original data frame includes a single-value data frame 00, a binary image frame 01, a ternary image frame grayscale image frame 10, and a color image frame 11. The data segment is the data to be sent. It is grouped into 32-bit groups and sent from low to high. For the last data segment that is less than 32 bits, the high bits are padded with 0s. The counter begins counting after data reception begins. After the count is completed, the remaining data is no longer received. The checksum segment uses the checksum method to invert all data values ​​in the frame instruction segment, numerical status segment, data segment, and check segment, add 1, and arrange them in high-low order. The high bits that are less than 32 bits are padded with 0s.

[0046] Referring to the status frame structure diagram in Figure 3, the frame instruction segment of the status frame includes a frame instruction segment and a numerical status segment. The frame instruction segment includes a frame start code, a frame number code, and a frame type code. The last two bits of the frame instruction segment are 0. The numerical status segment of the status frame is 32 bits in total, including the frame reception completion status (all 32 bits are 0). Error status types include data count error 01, data check error 01, and chip operation error 110. It also includes master FPGA status correct 111, FPGA status error 1101, chip status correct 1110, chip status error 1111, and master control expects chip silence 10000. The status frame does not contain a data segment or a check segment.

[0047] Referring to Figure 4, the hierarchical data frame, hierarchical weight frame, and calculation result frame structure diagrams, each of which includes a frame instruction segment, a numerical status segment, a data segment, and a check segment; wherein the frame instruction segment includes a frame start code, a frame number code, and a frame type code. The frame type code of the frame instruction segment of the hierarchical data frame, hierarchical weight frame, and calculation result frame is 8 bits in total, with the upper 6 bits representing the structure of the specific meaning of the frame. The original data frame is 000011, and the last two bits of the frame instruction segment are 0. The numerical status segment includes a total of 32 bits, with the upper 8 bits representing the numerical size, and its numerical value is represented as N. The total length of the data segment is N*32, indicating that there are N*32 bits of original data transmission. The next highest 8 bits are the layer number information, indicating which layer of the algorithm this data frame or weight frame belongs to. The lower 16 bits represent the image, of which the upper 8 bits represent the image frame height and the lower 8 bits represent the image frame width. The total length of the original data frame is 32*(N+1) bits. The counter begins counting after starting to receive data. After the counting is completed, the remaining data is no longer received as data. The checksum verification method is used to invert all data values ​​in the frame instruction segment, numerical status segment, data segment, and check segment, add 1, and arrange them in high and low order. If the high order is less than 32 bits, fill it with 0.

[0048] Figure 5 is a schematic diagram of the structure of a layered data request frame, a layered weight request frame, and a calculation result request frame. The layered data request frame, the layered weight request frame, and the calculation result request frame each include a frame instruction segment and a numerical status segment, which are used to request the layered data frame, the layered weight frame, and the calculation result frame, respectively. The frame instruction segment includes a frame start code, a frame number code, and a frame type code; the numerical status segment includes a data length code, layer number information, image frame height, and image frame width. The frame type code in the frame instruction segment of the layered data request frame, the layered weight request frame, and the calculation result request frame is 8 bits in total, with the upper 6 bits representing the structure of the specific meaning of the frame. The original data frame is 000100, and the last two bits of the frame instruction segment are 0. The numerical status segment has a total of 32 bits, of which the upper 8 bits indicate the required numerical size, and its value is expressed as N. The total length of the data segment is N*32, indicating that the FPGA master control needs N*32 bits of raw data to read; the second upper 8 bits are layer information, indicating which layer of the algorithm this data frame and weight frame belongs to; the lower 16 bits represent the image, of which the upper 8 bits indicate the image frame height, and the lower 8 bits indicate the image frame width. The layered data request frame, layered weight request frame, and calculation result request frame do not contain data segments or check segments.

[0049] Figure 6 is a schematic diagram of the operational status request frame structure. The operational status request frame includes a frame instruction segment and a numerical status segment. The frame instruction segment includes a frame start code, a frame number code, and a frame type code. The frame type code in the frame instruction segment of the operational status request frame is 8 bits, with the upper 6 bits representing the specific meaning of the frame. The original data frame is 000101, and the last two bits of the frame instruction segment are 0. The numerical status segment is 32 bits, including the frame reception completion status, frame reception error status, chip status request frame, master control FPGA status request frame, and the master control's status command to the chip. The operational status request frame does not include a data segment or a checksum segment.

[0050] Step 2: According to the design of different algorithms, after data collection is completed, the master FPGA will distribute tasks and integrate data. The master FPGA will execute part of the algorithm or all of the algorithm and hand it over to the chip for execution. Data transmission is initiated by the original data frame or request frame. Among them, the FPGA master sends data to the corresponding chip or chipset. This data is the original data or processed layered data. The FPGA master requests data from the corresponding chip or chipset. This data is mainly the layered result data after the chip processing is completed, the final calculation result data or the trained weight data. The chip or chipset requests data from the FPGA master. This data is mainly further data requested by the chip or chipset from the master after the calculation is completed.

[0051] Step 3: The FPGA master transmits data to the corresponding chip or chipset. After receiving the data, the corresponding chip performs data storage or calculation, and then transmits the calculation result to the FPGA master. If a transmission error occurs during the de-framing and verification process during the FPGA master transmission, the receiver transmits an error frame. If the FPGA master transmits a status request and control requirement, the FPGA master transmits status data to the corresponding chip or chipset. Referring to Figure 7, which shows the schematic diagram of the raw data and layered data transmission and processing flow, when the FPGA master sends raw data or a layered data task, the data to be sent is framed according to the above method and then sent to the corresponding chip or chipset through the interface module. After receiving the data, the chip first de-frames it. If the frame header is inconsistent with the agreement, it indicates an error. The chip enters the state frame framing and sends an error frame. If the frame header is correct, it continues to receive the data. After the data is received, it performs data verification. If the verification is incorrect, it indicates an error. The chip enters the state frame framing and sends an error frame. If the frame header verification is correct, data storage and calculation are performed. After the data storage and calculation are completed, the chip receives the correct result or calculation result, frames it, and sends it to the FPGA master through the interface. After receiving the error frame, the FPGA master controller reframes the corresponding data frame and resends the data; after receiving the correct frame, the FPGA master controller continues to send data, and enters the waiting state if the sending is completed; after receiving the calculation result frame, the FPGA master controller enters the result processing module.

[0052] Step 4: The FPGA master sends a data transmission request frame to the corresponding chip or chipset. After the corresponding chip receives the frame, it transmits the corresponding data or data storage or calculation results to the FPGA master; or the chip requests data from the FPGA master, and the FPGA master transmits data to the corresponding chip or chipset. If a transmission error occurs during the de-framing and verification process during the FPGA master transmission, the receiver transmits an error frame. If there is a status request or control requirement during the FPGA master transmission, the FPGA master transmits a status request or control command to the corresponding chip or chipset. 8 is a schematic diagram of data transmission and processing flow containing request frames. When the FPGA master has a data request task to send, the request frame to be sent is framed in the above manner, and then the data is sent to the corresponding chip or chipset through the interface module; after the chip side receives the data, it first deframes it. If the frame header is inconsistent with the agreement, it indicates that an error has occurred. The chip side enters the state frame framing and sends an error frame; if the reception is correct, the chip side frames it according to the corresponding data, weight, and result frame, and then sends it to the FPGA master through the interface module; after receiving the error frame, the FPGA master reframes the corresponding data frame and then resends the data; after the FPGA master receives the data transmission frame, if the frame header is inconsistent with the agreement, it indicates that an error has occurred. The master side enters the state frame framing and sends an error frame; when the chip side has a data request task to send to the FPGA master, its sending and response methods are consistent with those initiated by the FPGA master.

[0053] The communication method of the multi-chip neural network algorithm based on FPGA master control provided by the present invention can flexibly apply neural network algorithms in multiple application scenarios such as images, text, voice, faces, objects, and behaviors. The original data, intermediate calculation data, weights, calculation results and other data in each scenario are all transmitted through this method; the communication method of the multi-chip neural network algorithm based on FPGA master control can flexibly handle the transmission of binary, ternary, and multi-valued data and binary, ternary, and multi-valued weights in the neural network algorithm.

[0054] Example 2

[0055] Referring to FIG9 , an embodiment of the present invention provides a communication device for a multi-chip neural network algorithm based on FPGA master control, comprising one or more processors for implementing the communication method for a multi-chip neural network algorithm based on FPGA master control in the above embodiment.

[0056] The embodiment of the communication device of the multi-chip neural network algorithm based on FPGA master control of the present invention can be applied to any device with data processing capabilities, and the any device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located to read the corresponding computer program instructions in the non-volatile memory into the memory and run them. From the hardware level, as shown in Figure 9, it is a hardware structure diagram of any device with data processing capabilities where the communication device of the multi-chip neural network algorithm based on FPGA master control of the present invention is located. In addition to the processor, memory, network interface, and non-volatile memory shown in Figure 9, any device with data processing capabilities where the device in the embodiment is located can also include other hardware according to the actual function of the device with data processing capabilities, which will not be described in detail.

[0057] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0058] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present invention. A person of ordinary skill in the art can understand and implement the present invention without inventive work.

[0059] An embodiment of the present invention also provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the communication method of the multi-chip neural network algorithm based on FPGA master control in the above embodiment is implemented.

[0060] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium may also be any device with data processing capabilities, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0061] Those skilled in the art will understand that the foregoing descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art will still be able to modify the technical solutions described in the foregoing examples or substitute equivalents for some of the technical features therein. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the invention shall be included within the scope of protection of the invention.

[0062] The above embodiments are intended only to illustrate the design concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. The scope of protection of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design concepts disclosed in the present invention are within the scope of protection of the present invention.

Claims

1. A communication method for a multi-chip neural network algorithm based on FPGA master control, It is characterized in that The method comprises the following steps: (1) A frame structure is constructed by a multi-chip structure based on FPGA master control, wherein the frame structure includes an original data frame, a status frame, a hierarchical data frame, a hierarchical weight frame, a calculation result frame, a hierarchical data request frame, a hierarchical weight request frame, a calculation result request frame, and an operation status request frame; the multi-chip structure based on FPGA master control guides the operation of the main control interface module and the chip data receiving module to realize data communication for the chip or chipset; (2) Data transmission is initiated by the original data frame or request frame, including the FPGA master controller sending data and requesting data to the chip or chipset, and the chip or chipset requesting data from the FPGA master controller; (3) The FPGA master controller transmits data to the chip or chipset. After the chip receives the data, it stores or calculates the data and then transmits the calculation results to the FPGA master controller. If a transmission error occurs during the deframing and verification process during the FPGA master transmission, the receiver transmits an error frame; If there is a status request and control demand during the FPGA master transmission, the FPGA master transmits the status request or control command to the chip or chipset; (4) The FPGA master sends a data transmission request frame to the chip or chipset. After the chip receives the data, it stores the data or transmits the calculation result to the FPGA master. The chip requests data from the FPGA master, and the FPGA master transmits data to the chip or chipset. If a transmission error occurs during the de-framing and verification process of the FPGA master, the receiver transmits an error frame. If there is a status request or control demand during the FPGA master transmission, the FPGA master transmits the status request or control command to the chip or chipset.

2. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 1, It is characterized in that The frame structure is specifically as follows: The original data frame includes a frame instruction segment, a numerical status segment, a data segment and a check segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment is a data structure, including a frame start code, an image frame height and an image frame width; the data segment is the data to be sent, and is grouped into 1 group for each 32 bits of data to be sent each time, and the data is arranged from the bottom to the top. For the last data segment of less than 32 bits, the high bits are filled with 0; the check segment uses a checksum check method to invert all data values ​​of the frame instruction segment, the numerical status segment, the data segment and the check segment, and add 1, and arrange them according to high and low bits, and fill the high bits of less than 32 bits with 0, and take the lower 32 bits for more than 32 bits; The status frame includes a frame instruction segment and a numerical status segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code, and the numerical status segment includes a receiving correct state, a data counting error state, a data checking error state and a chip operation error state; The hierarchical data frame, hierarchical weight frame and calculation result frame all include a frame instruction segment, a numerical status segment, a data segment and a check segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment includes a data length code, layer number information, image frame height and image frame width; the framing method of the data segment is consistent with that of the original data frame; the check method of the check segment is consistent with that of the original data frame; The layered data request frame, the layered weight request frame and the calculation result request frame all include a frame instruction segment and a numerical status segment, and the layered data request frame, the layered weight request frame and the calculation result request frame are used to request the layered data frame, the layered weight frame and the calculation result frame respectively; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment includes a data length code, layer number information, image frame height and image frame width; The operation status request frame includes a frame instruction segment and a numerical status segment; wherein the frame instruction segment includes a frame start code, a frame number code and a frame type code; the numerical status segment includes a frame reception completion status, a frame reception error status, a chip status request frame and a master FPGA status request frame and a status command from the master to the chip.

3. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 2, It is characterized in that By adjusting the structure of the frame instruction segment, the transmission of the chip or chipset can be controlled simultaneously; the first 32 bits of each frame are sent to guide the operation of the FPGA master control interface module and the chip data receiving module, and the corresponding frame information is transmitted to the chip or chipset corresponding to the frame number code according to the frame type code; the frame instruction segment includes sending according to the data number, ignoring repeated sending of the first bit, ignoring repeated sending of the first and second bits, ignoring repeated sending of the first, second and third bits, ignoring repeated sending of the first, second, third and fourth bits, and repeating all bits, which can ensure that the data is sent to the corresponding chip or the corresponding 2, 4, 8, 16 and 32 chips to send data repeatedly.

4. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 3, It is characterized in that According to the binary or multi-valued network algorithm of the neural network, the original data or any layer of data as well as the total length of the data, the data structure and the number of layers to which the data belongs can be flexibly adjusted; the data required for the neural network algorithm is transmitted through the original data frame, the layered data frame or the layered weight frame, and then the frame is assembled, and the assembled frame is transmitted to the chip or chipset; after the reception is completed, the chip or chipset is calculated, and then the chip sends the calculation result frame to the main control.

5. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 4, It is characterized in that The method can use neural network algorithms for multiple application scenarios of images, text, voice, face, objects and behaviors, and the original data, intermediate calculation data, weights and calculation result data in each scenario are transmitted through the method; the method can handle the transmission of binary, ternary and multi-valued data and binary, ternary and multi-valued weights in neural network algorithms.

6. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 1, It is characterized in that The multi-chip structure based on FPGA master control includes an FPGA master control system and multiple chip nodes; the FPGA master control system and each chip node are connected via a data connection line and a chip selection signal line.

7. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 5, It is characterized in that The FPGA master control or chip initiates a hierarchical data request, a hierarchical weight request or a calculation result request to the other party at any time before the calculation starts, during the calculation process and after the calculation is completed, and transmits the data, weights and calculation results to be transmitted.

8. The communication method of the multi-chip neural network algorithm based on FPGA master control according to claim 7, It is characterized in that The FPGA master monitors and controls the status of the multi-chip system, obtains the chip operating status and the master FPGA operating status request frame through the operating status request; for chips with poor operating status, the FPGA master adjusts the chip operating status by giving chip status commands.

9. A communication device based on a multi-chip neural network algorithm controlled by FPGA, It is characterized in that It includes one or more processors for implementing the communication method of the multi-chip neural network algorithm based on FPGA master control as described in any one of claims 1-8.

10. A computer-readable storage medium having a program stored thereon, It is characterized in that When the program is executed by a processor, it is used to implement the communication method of the multi-chip neural network algorithm based on FPGA master control as described in any one of claims 1-8.

Citation Information

Patent Citations

  • FPGA (Field Programmable Gate Array)-based EtherCAT (Ethernet Control Automation Technology) main station device

    CN104702474A

  • Method and device for realizing communication between central processing unit and function chip

    CN106789507A

  • Master-slave CAN FD bus application layer communication method and system and electronic equipment

    CN112583683A

  • Fast retraining of fully fused neural transceiver components

    CN115733569A

  • Communication method of multi-chip neural network algorithm based on FPGA master control

    CN115964333A