Data transmission interface device based on FPGA and data transmission control method
By designing an FPGA-based data transmission interface device and utilizing parallel pipeline processing and retransmission mechanisms, the problems of high latency and insufficient reliability in point-to-point data transmission were solved, achieving high-speed and reliable data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG SHUANGYUAN TECH CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-05-19
AI Technical Summary
Existing FPGA-based data transmission solutions suffer from high latency and insufficient reliability in point-to-point high-speed transmission, failing to meet the requirements for high reliability and low latency.
Design an FPGA data transmission interface device, including a receiving link unit and a transmitting link unit. Utilize the parallel pipeline processing capability of the FPGA, and through the coordinated cooperation of the receiving control module, transmitting control module, ordinary packet queue, retransmission packet queue, sequential readout module, acknowledgment packet sending module, data packet sending module, and retransmission packet sending module, achieve high-speed sequential transmission of point-to-point data, and improve reliability through retransmission mechanism, sequence number sorting, and acknowledgment packet mechanism.
It achieves high-speed sequential transmission of point-to-point data with low latency, while reducing packet loss rate and data packet error rate, thus improving the reliability of data transmission.
Smart Images

Figure CN122069009A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a data transmission interface device and data transmission control method based on FPGA. Background Technology
[0002] Traditional standard protocols are designed for general use and may contain unnecessary overhead. For example, in a defined, point-to-point, direct-connection environment, complex flow control and negotiation mechanisms may seem redundant. In applications requiring extreme speed, simple parallel buses (such as FIFO-style direct connections between FPGAs via LVDS) or raw serial stream transmission based on SerDes are often used, but their reliability is insufficient. High-speed point-to-point transmission requires highly reliable, low-latency link-layer solutions.
[0003] Patent CN115296775B discloses a variable-rate communication system and method based on FPGA, relating to the field of communication data transmission. The key technical points are: a variable-rate communication system based on FPGA, comprising two transceiver systems that can be separately installed in two devices, each including a serial data transmission unit, a serial data reception unit, and an error handling unit implemented on the FPGA; and a communication method for the variable-rate communication system based on FPGA, comprising the following steps: S1, system initialization; S2, calculating the CRC checksum of the transmitted data; S3, 4B / 5B encoding; S4, sending data to the peer device; S5, receiving data; S6, 4B / 5B decoding; and S7, verifying the received data. This scheme relies on global clock division within the FPGA to achieve rate adjustment, but it cannot reduce latency and cannot achieve high-speed point-to-point data transmission. Furthermore, it uses serial stream transmission, resulting in insufficient reliability. Summary of the Invention
[0004] This invention provides an FPGA-based data transmission interface device and data transmission control method to achieve high-speed and reliable point-to-point data transmission.
[0005] An FPGA-based data transmission interface device includes an IP core, a receiving link unit, and a transmitting link unit. The receiving link unit receives received data output from the IP core and performs decoding, receiving format conversion, CRC32 verification, and data type determination on the received data. Based on the determination result, it performs at least one of the following operations: temporarily storing the received first ordinary data packet and generating a corresponding receiving acknowledgment sequence number; temporarily storing the received first retransmission data packet; generating a valid sequence number based on the received second acknowledgment packet; and outputting the received first ordinary data packet and / or the first retransmission data packet in sequence. The transmission link unit is used to perform CRC32 verification, transmission format conversion and encoding on the data to be transmitted, and output it to the IP core for transmission; the data to be transmitted is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.
[0006] Furthermore, the receiving link unit includes a decoding module, a receiving format conversion module, and a CRC32 receiving verification module. The decoding module is used to decode the received data, the receiving format conversion module is used to convert the format of the decoded received data, and the CRC32 receiving verification module is used to perform CRC32 verification on the format-converted received data.
[0007] Furthermore, the first ordinary data packet is assigned a sequentially increasing sequence number according to the order of transmission; The receiving link unit further includes a receiving control module, a normal packet queue, and a retransmission packet queue. The receiving control module is used to determine the data type of the received data after CRC32 verification, store the received first normal data packet in the normal packet queue, and generate corresponding receiving acknowledgment sequence number data according to the sequence number of the received first normal data packet; or, store the received first retransmission data packet in the retransmission packet queue; or, generate valid sequence number data according to the sequence number in the received second acknowledgment packet.
[0008] Furthermore, the receiving link unit also includes a sequential readout module, used to read the current data packet from the normal packet queue or the retransmission packet queue, determine the sequence number of the next data packet to be read based on the sequence number of the current data packet, read the corresponding data packet from the normal packet queue or the retransmission packet queue based on the sequence number of the next data packet to be read, and output the read data packets to the user terminal in sequence according to the sequence number.
[0009] Furthermore, the sequential read module determines the sequence number of the next data packet to be read as i+1 based on the sequence number i of the current data packet, and determines whether the ordinary packet queue is empty: If the regular packet queue is not empty and the sequence number of the first data packet in the regular packet queue is i+1, then read it. If the normal packet queue is not empty and the sequence number of the first data packet in the normal packet queue is not i+1: Determine if the retransmission packet queue is empty. If the retransmission packet queue is empty, wait for a preset time. If the retransmission packet queue is not empty and the sequence number of the first data packet in the retransmission packet queue is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet queue is i+1, then read it. If the regular packet queue is empty: check if the retransmission packet sequence is empty. If the retransmission packet sequence is empty, wait. If the retransmission packet sequence is not empty and the sequence number of the first data packet in the retransmission packet sequence is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet sequence is i+1, then read it.
[0010] Furthermore, the transmission link unit includes an acknowledgment packet transmission module, a data packet transmission module, a retransmission packet transmission module, and a transmission control module. The data packet transmission module is used to receive user data sent by the user terminal and encapsulate it into a second ordinary data packet for transmission to the transmission control module. The acknowledgment packet transmission module is used to receive the received acknowledgment sequence number data and encapsulate it into a first acknowledgment packet for transmission to the transmission control module. The retransmission packet transmission module is used to receive valid sequence number data and generate a second retransmission data packet that needs to be retransmitted based on the valid sequence number data for transmission to the transmission control module.
[0011] Furthermore, the retransmission packet sending module is equipped with a buffer queue for storing previously sent historical data packets, and deletes the corresponding historical data packets according to the valid sequence number data, and encapsulates the remaining historical data packets into a second retransmission data packet and sends it to the sending control module; The acknowledgment packet sending module is also used to generate space information based on the remaining space of the normal packet queue and the retransmission packet queue, and encapsulate the space information into the first acknowledgment packet; and to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient based on the space information. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, the module generates a corresponding normal pause packet and / or retransmission pause packet and sends it to the sending control module.
[0012] Furthermore, the transmission link unit also includes a CRC32 check transmission module, a transmission format conversion module, and an encoding module. The CRC32 check transmission module is used to receive the data to be transmitted output by the transmission control module, perform CRC32 check on the data to be transmitted, and send the data to be transmitted that passes the check to the transmission format conversion module for format conversion. The data to be transmitted after format conversion is sent to the encoding module for encoding and output to the IP core for transmission.
[0013] Furthermore, the transmission link unit also includes a heartbeat packet transmission module, the received data and the data to be transmitted also include heartbeat packets, and the receiving control module is also used to determine whether the received heartbeat packet is a request packet or an acknowledgment packet. If it is a request packet, the receiving control module controls the heartbeat packet transmission module to generate an acknowledgment packet and send it to the transmission control module. The receiving control module is also used to control the heartbeat packet sending module to generate a request packet and send it to the sending control module when no data is received after a preset time.
[0014] An FPGA-based data transmission control method applied to the above-mentioned device includes: The receiving link unit receives the received data output by the IP core, and performs decoding, receiving format conversion, CRC32 check, and data type determination on the received data. Based on the determination result, it performs at least one of the following operations: temporarily stores the received first ordinary data packet and generates corresponding receiving acknowledgment sequence number data; temporarily stores the received first retransmission data packet; generates valid sequence number data based on the received second acknowledgment packet; and outputs the received first ordinary data packet and / or the first retransmission data packet in sequence. The transmission link unit performs CRC32 verification, transmission format conversion, and encoding on the data to be transmitted, and outputs it to the IP core for transmission; the data to be transmitted is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.
[0015] Furthermore, the receiving link unit includes a decoding module, a receiving format conversion module, and a CRC32 receiving verification module. The decoding module decodes the received data and sends it to the receiving format conversion module. The receiving format conversion module converts the format of the decoded received data and sends it to the CRC32 receiving verification module. The CRC32 receiving verification module performs CRC32 verification on the format-converted received data.
[0016] Furthermore, the first ordinary data packet is assigned a sequentially increasing sequence number according to the sending order; the receiving link unit also includes a receiving control module, an ordinary packet queue, and a retransmission packet queue; The receiving control module determines the data type of the received data after CRC32 verification, stores the first ordinary data packet received in the ordinary packet queue, and generates corresponding receiving acknowledgment sequence number data based on the sequence number of the first ordinary data packet received; or, stores the first retransmission data packet received in the retransmission packet queue; or, generates valid sequence number data based on the sequence number in the second acknowledgment packet received.
[0017] Furthermore, the receiving link unit also includes an ordered readout module, which outputs the received first ordinary data packet and / or first retransmission data packet in sequence, including: The system reads the current data packet from the normal packet queue or the retransmission packet queue, determines the sequence number of the next data packet to be read based on the sequence number of the current data packet, reads the corresponding data packet from the normal packet queue or the retransmission packet queue based on the sequence number of the next data packet to be read, and outputs the read data packets to the user terminal in sequence according to the sequence number.
[0018] Furthermore, the sequential read module determines the sequence number of the next data packet to be read as i+1 based on the sequence number i of the current data packet, and determines whether the ordinary packet queue is empty: If the regular packet queue is not empty and the sequence number of the first data packet in the regular packet queue is i+1, then read it. If the normal packet queue is not empty and the sequence number of the first data packet in the normal packet queue is not i+1: Determine if the retransmission packet queue is empty. If the retransmission packet queue is empty, wait for a preset time. If the retransmission packet queue is not empty and the sequence number of the first data packet in the retransmission packet queue is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet queue is i+1, then read it. If the regular packet queue is empty: check if the retransmission packet sequence is empty. If the retransmission packet sequence is empty, wait. If the retransmission packet sequence is not empty and the sequence number of the first data packet in the retransmission packet sequence is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet sequence is i+1, then read it.
[0019] Furthermore, the transmission link unit includes an acknowledgment packet transmission module, a data packet transmission module, a retransmission packet transmission module, and a transmission control module. The data packet transmission module receives user data sent by the user terminal and encapsulates it into a second ordinary data packet, which is then transmitted to the transmission control module. The acknowledgment packet transmission module receives the received acknowledgment sequence number data and encapsulates it into a first acknowledgment packet, which is then transmitted to the transmission control module. The retransmission packet transmission module receives valid sequence number data, generates a second retransmission data packet that needs to be retransmitted based on the valid sequence number data, and transmits it to the transmission control module.
[0020] Furthermore, the retransmission packet sending module sets up a buffer queue to store the historical data packets that have been sent, and deletes the corresponding historical data packets according to the valid sequence number data, and encapsulates the remaining historical data packets into a second retransmission data packet and sends it to the sending control module; The acknowledgment packet sending module is also used to generate space information based on the remaining space of the normal packet queue and the retransmission packet queue, and encapsulate the space information into the first acknowledgment packet; and to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient based on the space information. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, the module generates a corresponding normal pause packet and / or retransmission pause packet and sends it to the sending control module.
[0021] Furthermore, the transmission link unit also includes a CRC32 check transmission module, a transmission format conversion module, and an encoding module. The CRC32 check transmission module receives the data to be transmitted output by the transmission control module, performs CRC32 check on the data to be transmitted, and sends the data to be transmitted that passes the check to the transmission format conversion module for format conversion. The data to be transmitted after format conversion is sent to the encoding module for encoding and output to the IP core for transmission.
[0022] Furthermore, the transmission link unit also includes a heartbeat packet transmission module, and the received data and the data to be transmitted also include heartbeat packets. The receiving control module determines whether the received heartbeat packet is a request packet or an acknowledgment packet. If it is a request packet, it controls the heartbeat packet transmission module to generate an acknowledgment packet and send it to the transmission control module. When the receiving control module waits for a preset time without receiving data, it controls the heartbeat packet sending module to generate a request packet and send it to the sending control module.
[0023] The FPGA-based data transmission interface device and data transmission control method provided by this invention have at least the following beneficial effects: (1) By utilizing the parallel pipeline processing capability of FPGA, high-speed sequential transmission and low latency of point-to-point data are achieved through the coordinated cooperation of the receiving control module, transmitting control module, ordinary packet queue, retransmission packet queue, sequential reading module, acknowledgment packet sending module, data packet sending module and retransmission packet sending module. (2) Based on the retransmission mechanism, sequence number sorting and acknowledgment packet mechanism, the packet loss rate and data packet error rate are reduced, further improving the reliability of data transmission. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of one embodiment of the FPGA-based data transmission interface device provided by the present invention.
[0025] Figure 2 This is a flowchart of one embodiment of the FPGA-based data transmission control method provided by the present invention. Detailed Implementation
[0026] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0027] refer to Figure 1In some embodiments, an FPGA-based data transmission interface device is provided, including an IP core 1, a receiving link unit, and a transmitting link unit. The receiving link unit is used to receive received data output by the IP core, and to decode, convert the received format, perform CRC32 verification, and determine the data type of the received data. Based on the determination result, it performs at least one of the following operations: temporarily storing the received first ordinary data packet and generating corresponding receiving acknowledgment sequence number data; temporarily storing the received first retransmission data packet; generating valid sequence number data based on the received second acknowledgment packet; and outputting the temporarily stored first ordinary data packet and / or first retransmission data packet in sequence. The transmission link unit is used to perform CRC32 verification, transmission format conversion and encoding on the data to be transmitted, and output it to the IP core for transmission; the data to be transmitted is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.
[0028] Specifically, IP core 1 is the IP core of PMA+PCS.
[0029] Furthermore, the receiving link unit includes a decoding module 2, a receiving format conversion module 3, and a CRC32 receiving verification module 4. The decoding module 2 is used to decode the received data, the receiving format conversion module 3 is used to convert the format of the decoded received data, and the CRC32 receiving verification module 4 is used to perform CRC32 verification on the format-converted received data.
[0030] Specifically, the device acts as a receiver. IP core 1 receives data, and decoding module 2 is a 64B / 66B decoding module. The received data from the PMA+PCS IP core consists of an undecoded 2-bit synchronization header and 64-bit data. After passing through the 64B / 66B decoding module 2, the decoded 2-bit synchronization header and 64-bit data are obtained. The decoded synchronization header and data are then converted by the receive format conversion module 3 to obtain 64-bit data (data), 8-bit keep (valid), 1-bit valid, and 1-bit last (end of data) signal. A 32-bit CRC checksum is also obtained. This module checks the data length; if it exceeds the set maximum value, it will truncate the data and output the last signal. Input the 64-bit-data, 8-bit-keep, 1-bit-valid, 1-bit-last and the received CRC check value into the CRC32 receiving verification module 4. If the CRC check value calculated from the input data is the same as the received CRC check value, the verification is considered to have passed, and the data is output to the receiving control module 5. If the CRC check value calculated from the input data is different from the received CRC check value, the verification is considered to have failed, and the entire frame is discarded to avoid receiving erroneous data packets.
[0031] Furthermore, the first ordinary data packet is assigned a sequentially increasing sequence number according to the sending order. Based on this sequence number, it is possible to detect data packet loss or duplicate data packets.
[0032] The receiving link unit further includes a receiving control module 5, a normal packet queue 6, and a retransmission packet queue 7. The receiving control module 5 is used to determine the data type of the received data after CRC32 verification, store the received first normal data packet in the normal packet queue 6, and generate corresponding receiving acknowledgment sequence number data according to the sequence number of the received first normal data packet; or, store the received first retransmission data packet in the retransmission packet queue 7; or, generate valid sequence number data according to the sequence number in the received second acknowledgment packet.
[0033] Specifically, the device acts as a receiver, receiving the first ordinary data packet sent by the sender. Each first ordinary data packet is assigned a sequence number, and the corresponding reception confirmation sequence number data is generated as the sequence number of each received first ordinary data packet.
[0034] After the device sends data to the other party, the other party returns a second confirmation packet based on the same mechanism. The second confirmation packet contains the sequence number of the data packet received by the other party, that is, the valid sequence number data is the sequence number of the data packet received by the other party.
[0035] Specifically, the receiving control module 5 is mainly used to determine the data type and distinguish different data packets. It uses the 8-bit frame type to determine whether the received packet is a normal data packet, a retransmission data packet, an acknowledgment packet, or a heartbeat packet. It considers an 8-bit frame type of 1 to be a normal data packet, 2 to be a retransmission data packet, 3 to be an acknowledgment packet, and 4 to be a heartbeat packet.
[0036] If it is the first ordinary data packet sent by the sender, then: 1) Store the received first ordinary data packet in the ordinary packet queue 6; 2) Generate a receive acknowledgment sequence number data corresponding to the sequence number of the first ordinary data packet, and send the receive acknowledgment sequence number data to the acknowledgment packet sending module.
[0037] If it is the first retransmission data packet sent by the sender, then the first retransmission data packet received will be stored in the retransmission packet queue.
[0038] If it is the second acknowledgment packet sent by the sender, bit[3] (total bits[7:0]) in the 8-bit status information is 1 to indicate that the received sequence number is valid, and 0 to indicate that it is invalid. It is necessary to generate valid sequence number data according to the second acknowledgment packet and send it to the retransmission packet sending module.
[0039] In some embodiments, the received data further includes a heartbeat packet. The receiving control module is also used to determine whether the received heartbeat packet is a request packet or a response packet. If it is a request packet, the receiving control module controls the heartbeat packet sending module to generate a response packet and send it to the sending control module.
[0040] Specifically, if it is a heartbeat packet, determine whether it is a request packet. If bit[0] is 1, it is a request packet; if bit[0] is 0, it is a response packet. If it is a request packet, inform the acknowledgment packet sending module to return a response packet.
[0041] Furthermore, the receiving link unit also includes a sequential readout module 8, which is used to read the current data packet from the normal packet queue 6 or the retransmission packet queue 7, and determine the sequence number of the next data packet to be read according to the sequence number of the current data packet, read the corresponding data packet from the normal packet queue 6 or the retransmission packet queue 7 according to the sequence number of the next data packet to be read, and output the read data packets to the user terminal in sequence according to the sequence number.
[0042] Furthermore, the sequential reading module 8 determines the sequence number of the next data packet to be read as i+1 based on the sequence number i of the current data packet, and checks whether the ordinary packet queue 6 is empty: If the regular packet queue is not empty and the sequence number of the first data packet in the regular packet queue is i+1, then read it. If the normal packet queue 6 is not empty and the sequence number of the first data packet in the normal packet queue 6 is not i+1: check if the retransmission packet queue 7 is empty. If the retransmission packet queue 7 is empty, wait for a preset time. If no data packet with sequence number i+1 is received within the preset time, it is determined that the data packet with sequence number i+1 is lost. If the data packet with sequence number i+1 is received, it is read. If the retransmission packet queue 7 is not empty and the sequence number of the first data packet in the retransmission packet queue 7 is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet queue is i+1, it is read. If the regular packet queue is empty: check if the retransmission packet sequence is empty. If the retransmission packet sequence is empty, wait. If the retransmission packet sequence is not empty and the sequence number of the first data packet in the retransmission packet sequence is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet sequence is i+1, then read it.
[0043] If the normal packet queue 6 is not empty and the sequence number of the first data packet in the normal packet queue 6 is not i+1, and the retransmission packet queue 7 is not empty and the sequence number of the first data packet in the retransmission packet queue 7 is not i+1, then it is determined whether the sequence number spans a page. The larger of the sequence number of the first data packet in the normal packet queue 6 and the sequence number of the first data packet in the retransmission packet queue 7 is subtracted from the smaller value. If the difference exceeds half of the maximum value of the sequence number, it is considered that a page span has occurred, and the sequence number of the next data packet to be read is changed to the larger of the sequence number of the first data packet in the normal packet queue 6 and the sequence number of the first data packet in the retransmission packet queue 7. Conversely, if the difference does not exceed half of the maximum value of the sequence number, it is considered that there is no page span, and the sequence number of the next data packet to be read is changed to the smaller of the sequence number of the first data packet in the normal packet queue 6 and the sequence number of the first data packet in the retransmission packet queue 7.
[0044] The serial number is 16 bits in size, and it returns to 0 after it reaches its maximum value; this is called a page span.
[0045] Specifically, the sequential read module mainly solves the problem of out-of-order received data packets. According to the storage logic, the data in the ordinary packet queue 6 is "from smallest to largest" (there are also cases of spanning multiple pages), and the data in the retransmission packet queue 7 is also "from smallest to largest" (there are also cases of spanning multiple pages). Starting from the currently output sequence number, data packets with adjacent sequence numbers are read.
[0046] Furthermore, the transmission link unit includes an acknowledgment packet transmission module 9, a data packet transmission module 10, a retransmission packet transmission module 11, and a transmission control module 12. The data packet transmission module 10 is used to receive user data sent by the user terminal and encapsulate it into a second ordinary data packet for transmission to the transmission control module 12. The acknowledgment packet transmission module 9 receives the reception acknowledgment sequence number data generated by the reception control module 5 and encapsulates it into a first acknowledgment packet for transmission to the transmission control module 12. The retransmission packet transmission module 11 is used to receive the valid sequence number data generated by the reception control module 5, generate a second retransmission data packet that needs to be retransmitted based on the valid sequence number data, and send it to the transmission control module 12.
[0047] Specifically, the retransmission packet sending module 11 is equipped with a buffer queue to store the historical data packets that have been sent. Based on the valid sequence number data, the corresponding historical data packets are deleted, and the remaining historical data packets are encapsulated into a second retransmission data packet and sent to the sending control module.
[0048] Specifically, the valid sequence number data is the sequence number of the second ordinary data packet received by the other party, and does not include the sequence number of the second ordinary data packet that was not received. Therefore, it is possible to determine which data packets the other party has received based on the valid sequence number data. Based on the valid sequence number data, the corresponding historical data packets in the buffer queue are deleted, and the remaining data packets are those that the other party has not received. The remaining historical data packets are encapsulated into a second retransmission data packet and sent to the sending control module.
[0049] Furthermore, the acknowledgment packet sending module is also used to generate space information based on the remaining space of the normal packet queue and the retransmission packet queue, and encapsulate the space information into the first acknowledgment packet; and to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient based on the space information. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, a corresponding normal pause packet and / or retransmission pause packet is generated and sent to the sending control module.
[0050] The sender can use the space information in the first acknowledgment packet to confirm whether the space in the receiver's normal packet queue and retransmission packet queue is insufficient.
[0051] In addition, the acknowledgment packet sending module is also used to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, a normal pause packet and / or a retransmission pause packet are generated and sent to the sending control module. When the other party receives the normal pause packet and / or the retransmission pause packet, it pauses the transmission of data packets for a period of time. During this period of time, if another normal pause packet and / or retransmission pause packet is received, the pause time will be refreshed. If no new normal pause packet and / or retransmission pause packet is received, the transmission of data packets will resume after the pause time ends.
[0052] Furthermore, the transmission link unit also includes a CRC32 check transmission module 13, a transmission format conversion module 14, and an encoding module 15. The transmission control module sends the data to be transmitted (second ordinary data packet, first acknowledgment packet, second retransmission data packet, and heartbeat packet) to the CRC32 check transmission module 13. The CRC32 check transmission module 13 is used to perform CRC32 check on the data to be transmitted (second ordinary data packet, first acknowledgment packet, second retransmission data packet, and heartbeat packet), and sends the data to be transmitted that passes the check to the transmission format conversion module 14 for format conversion. The format-converted data to be transmitted is then sent to the encoding module 15 for encoding and output to the IP core 1 for transmission.
[0053] Furthermore, the transmission link unit also includes a heartbeat packet transmission module 16, and the data to be transmitted also includes heartbeat packets.
[0054] The receiving control module is also used to control the heartbeat packet sending module to generate a request packet and send it to the sending control module when no data is received after a preset time.
[0055] For the transmitting link unit of this interface device, there are four types of data packets to be transmitted: heartbeat packet, first acknowledgment packet, second normal data packet, and second retransmission data packet. The heartbeat packet is an 8-bit frame type (equal to 4) with a data portion length of 0, used to determine connection status when no packets are received for an extended period. The first acknowledgment packet is an 8-bit frame type (equal to 3) with a data portion length of 0, used to transmit the sequence number of the first normal data packet that was correctly received. The second normal data packet is an 8-bit frame type (equal to 1) used to transmit data packets output by the user end. The second retransmission data packet is an 8-bit frame type (equal to 2) used to transmit data packets that were not correctly received.
[0056] The 8-bit status information of the heartbeat packet: bit[0] is 1 to represent a heartbeat request packet, and bit[0] is 0 to represent a heartbeat response packet. If no packet is received for a certain period of time, a heartbeat packet needs to be sent actively to determine whether the connection is still established.
[0057] The 16-bit sequence number of the first acknowledgment packet is 0; the 16-bit acknowledgment sequence number comes from the sequence number of the first ordinary data packet received; the 16-bit frame length is 20; 8-bit status information, bit[0] is used to determine whether the space of the ordinary packet queue is sufficient, bit[1] is used to determine whether the space of the retransmission packet queue is sufficient, 1 represents insufficient, 0 represents sufficient, the depth of ordinary packet queue 6 is set to 8192, the depth of retransmission packet queue 7 is set to 8192, and if the storage exceeds 4096, it is considered that the space is insufficient; a first acknowledgment packet is sent after receiving a first ordinary data packet, at this time bit[3] is 1, indicating that the sequence number of the current packet is available. When the receiving space is continuously insufficient and no data packet is sent or no acknowledgment packet is sent, a pause packet is actively sent to inform the sender that the current receiving space is still insufficient, at this time bit[3] is 0, indicating that the sequence number of the current packet is unavailable.
[0058] The 16-bit sequence number of the second ordinary data packet is an incrementing number; the 16-bit frame length is 20+ data bytes.
[0059] The second retransmitted data packet is identical to the stored ordinary data packet, except that the 8-bit status information changes in real time during transmission. A buffer queue with a depth of 8192 is prepared for the retransmission packet sending module, and a sequence number FIFO with a depth of 1024 is prepared for the confirmed valid sequence number data. The following conditions apply: 1) The buffer queue is not empty, the sequence number FIFO is not empty, but the first data in the sequence number FIFO is different from the sequence number of the first data packet in the buffer queue. It is considered that the first data packet in the current buffer queue needs to be retransmitted, and it is read out and retransmitted. 2) If the buffer queue is not empty, the sequence number FIFO is not empty, and the first data in the sequence number FIFO is the same as the sequence number of the first data packet in the buffer queue, it is considered that the current data packet does not need to be retransmitted, and it is read out and discarded. 3) If the buffer queue is empty but the sequence number FIFO is not empty, clear the sequence number FIFO; 4) If the buffer queue is not empty and the sequence number FIFO is empty, wait for 2000 clock cycles, and if the first data packet in the buffer queue is considered to need to be retransmitted, read it out and retransmit it.
[0060] When reading and sending retransmitted packets, it is necessary to modify the 8-bit status information, change bit[2] to 1, and modify bits[1:0] according to whether the receiving space is sufficient when reading.
[0061] The transmission control module controls the transmission of four types of packets, with priority determined by the order: heartbeat packets have the highest priority, followed by acknowledgment packets, then retransmission packets, and finally regular packets. If a regular pause packet is received, transmission of regular packets is paused (if transmission is in progress, it must start from the next packet), and a pause counter is started. If another regular pause packet is received during the counting process, the counter is reset to zero. Regular packet transmission resumes when the count reaches 8191. Similarly, if a retransmission pause packet is received, retransmission packet transmission is paused (if transmission is in progress, it must start from the next packet), and a pause counter is started. If another retransmission packet is received during the counting process, the counter is reset to zero. Retransmission packet transmission resumes when the count reaches 8191.
[0062] The CRC32 module calculates a 32-bit CRC checksum for the data to be transmitted and inserts it into the end of the packet. The transmission format conversion module converts the 64-bit-data, 8-bit-keep, 1-bit-valid, 1-bit-last data format into the 2-bit synchronization header and 64-bit data required for 64B / 66B encoding. This data is then output to the 64B / 66B encoding module for encoding and finally sent to the PMA+PCS IP core.
[0063] refer to Figure 2 In some embodiments, an FPGA-based data transmission control method is provided for use in the above-described apparatus, comprising: S1. The receiving link unit receives the received data output by the IP core, and performs decoding, receiving format conversion, CRC32 check, and data type determination on the received data. Based on the determination result, it performs at least one of the following operations: temporarily stores the received first ordinary data packet and generates corresponding receiving acknowledgment sequence number data; temporarily stores the received first retransmission data packet; generates valid sequence number data based on the received second acknowledgment packet; and outputs the received first ordinary data packet and / or the first retransmission data packet in sequence. S2. The sending link unit performs CRC32 verification, transmission format conversion, and encoding on the data to be sent, and outputs it to the IP core for transmission; the data to be sent is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.
[0064] Furthermore, the receiving link unit includes a decoding module, a receiving format conversion module, and a CRC32 receiving verification module. The decoding module decodes the received data and sends it to the receiving format conversion module. The receiving format conversion module converts the format of the decoded received data and sends it to the CRC32 receiving verification module. The CRC32 receiving verification module performs CRC32 verification on the format-converted received data.
[0065] Furthermore, the first ordinary data packet is assigned a sequentially increasing sequence number according to the sending order; the receiving link unit also includes a receiving control module, an ordinary packet queue, and a retransmission packet queue; The receiving control module determines the data type of the received data after CRC32 verification, stores the first ordinary data packet received in the ordinary packet queue, and generates corresponding receiving acknowledgment sequence number data based on the sequence number of the first ordinary data packet received; or, stores the first retransmission data packet received in the retransmission packet queue; or, generates valid sequence number data based on the sequence number in the second acknowledgment packet received.
[0066] Furthermore, the receiving link unit also includes an ordered readout module, which outputs the received first ordinary data packet and / or first retransmission data packet in sequence, including: The system reads the current data packet from the normal packet queue or the retransmission packet queue, determines the sequence number of the next data packet to be read based on the sequence number of the current data packet, reads the corresponding data packet from the normal packet queue or the retransmission packet queue based on the sequence number of the next data packet to be read, and outputs the read data packets to the user terminal in sequence according to the sequence number.
[0067] Furthermore, the sequential read module determines the sequence number of the next data packet to be read as i+1 based on the sequence number i of the current data packet, and determines whether the ordinary packet queue is empty: If the regular packet queue is not empty and the sequence number of the first data packet in the regular packet queue is i+1, then read it. If the normal packet queue is not empty and the sequence number of the first data packet in the normal packet queue is not i+1: Determine if the retransmission packet queue is empty. If the retransmission packet queue is empty, wait for a preset time. If the retransmission packet queue is not empty and the sequence number of the first data packet in the retransmission packet queue is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet queue is i+1, then read it. If the regular packet queue is empty: check if the retransmission packet sequence is empty. If the retransmission packet sequence is empty, wait. If the retransmission packet sequence is not empty and the sequence number of the first data packet in the retransmission packet sequence is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet sequence is i+1, then read it.
[0068] Furthermore, the transmission link unit includes an acknowledgment packet transmission module, a data packet transmission module, a retransmission packet transmission module, and a transmission control module. The data packet transmission module receives user data sent by the user terminal and encapsulates it into a second ordinary data packet, which is then transmitted to the transmission control module. The acknowledgment packet transmission module receives the reception acknowledgment sequence number data generated by the reception control module and encapsulates it into a first acknowledgment packet, which is then transmitted to the transmission control module. The retransmission packet transmission module receives the valid sequence number data generated by the reception control module, generates a second retransmission data packet that needs to be retransmitted based on the valid sequence number data, and transmits it to the transmission control module.
[0069] Furthermore, the retransmission packet sending module sets up a buffer queue to store the historical data packets that have been sent, and deletes the corresponding historical data packets according to the valid sequence number data, and encapsulates the remaining historical data packets into a second retransmission data packet and sends it to the sending control module; The acknowledgment packet sending module is also used to generate space information based on the remaining space of the normal packet queue and the retransmission packet queue, and encapsulate the space information into the first acknowledgment packet; and to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient based on the space information. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, the module generates a corresponding normal pause packet and / or retransmission pause packet and sends it to the sending control module.
[0070] Furthermore, the transmission link unit also includes a CRC32 check transmission module, a transmission format conversion module, and an encoding module. The CRC32 check transmission module receives the data to be transmitted output by the transmission control module, performs CRC32 check on the data to be transmitted, and sends the data to be transmitted that passes the check to the transmission format conversion module for format conversion. The data to be transmitted after format conversion is sent to the encoding module for encoding and output to the IP core for transmission.
[0071] Furthermore, the transmission link unit also includes a heartbeat packet transmission module, and the received data and the data to be transmitted also include heartbeat packets. The receiving control module determines whether the received heartbeat packet is a request packet or an acknowledgment packet. If it is a request packet, it controls the heartbeat packet transmission module to generate an acknowledgment packet and send it to the transmission control module. When the receiving control module waits for a preset time without receiving data, it controls the heartbeat packet sending module to generate a request packet and send it to the sending control module.
[0072] The FPGA-based data transmission interface device and data transmission control method provided in the above embodiments have at least the following beneficial effects: (1) By utilizing the parallel pipeline processing capability of FPGA, high-speed sequential transmission and low latency of point-to-point data are achieved through the coordinated cooperation of the receiving control module, transmitting control module, ordinary packet queue, retransmission packet queue, sequential reading module, acknowledgment packet sending module, data packet sending module and retransmission packet sending module. (2) Based on the retransmission mechanism, sequence number sorting and acknowledgment packet mechanism, the packet loss rate and data packet error rate are reduced, further improving the reliability of data transmission.
[0073] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A data transmission interface device based on FPGA, characterized in that, It includes an IP core, a receiving link unit, and a transmitting link unit. The receiving link unit is used to receive the received data output by the IP core, and to decode, convert the received format, perform CRC32 check, and determine the data type of the received data. Based on the determination result, it performs at least one of the following operations: temporarily storing the received first ordinary data packet and generating corresponding receive acknowledgment sequence number data; temporarily storing the received first retransmission data packet; generating valid sequence number data based on the received second acknowledgment packet; and outputting the temporarily stored first ordinary data packet and / or first retransmission data packet in sequence. The transmission link unit is used to perform CRC32 verification, transmission format conversion and encoding on the data to be transmitted, and output it to the IP core for transmission; the data to be transmitted is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.
2. The apparatus according to claim 1, characterized in that, The receiving link unit includes a decoding module, a receiving format conversion module, and a CRC32 receiving verification module. The decoding module is used to decode the received data, the receiving format conversion module is used to convert the format of the decoded received data, and the CRC32 receiving verification module is used to perform CRC32 verification on the format-converted received data.
3. The apparatus according to claim 1, characterized in that, The first ordinary data packet is assigned a sequentially increasing sequence number according to the order in which it is sent; The receiving link unit also includes a receiving control module, a normal packet queue, and a retransmission packet queue; the receiving control module is used to determine the data type of the received data after CRC32 verification, store the received first normal data packet in the normal packet queue, and generate the corresponding receiving acknowledgment sequence number data according to the sequence number of the received first normal data packet. Alternatively, the received first retransmission data packet can be stored in the retransmission packet queue; or, valid sequence number data can be generated based on the sequence number in the received second acknowledgment packet.
4. The apparatus according to claim 3, characterized in that, The receiving link unit also includes an in-order read module, which is used to read the current data packet from the normal packet queue or the retransmission packet queue, determine the sequence number of the next data packet to be read based on the sequence number of the current data packet, read the corresponding data packet from the normal packet queue or the retransmission packet queue based on the sequence number of the next data packet to be read, and output the read data packets to the user terminal in sequence according to the sequence number.
5. The apparatus according to claim 4, characterized in that, The sequential read module determines the sequence number of the next data packet to be read as i+1 based on the sequence number i of the current data packet, and checks whether the ordinary packet queue is empty: If the regular packet queue is not empty and the sequence number of the first data packet in the regular packet queue is i+1, then read it. If the normal packet queue is not empty and the sequence number of the first data packet in the normal packet queue is not i+1: check if the retransmission packet queue is empty. If the retransmission packet queue is empty, wait for a preset time. If the retransmission packet queue is not empty and the sequence number of the first data packet in the retransmission packet queue is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet queue is i+1, then read it. If the regular packet queue is empty: check if the retransmission packet sequence is empty. If the retransmission packet sequence is empty, wait. If the retransmission packet sequence is not empty and the sequence number of the first data packet in the retransmission packet sequence is not i+1, change the sequence number of the next data packet to be read. If the sequence number of the first data packet in the retransmission packet sequence is i+1, then read it.
6. The apparatus according to claim 1 or 3, characterized in that, The transmission link unit includes an acknowledgment packet transmission module, a data packet transmission module, a retransmission packet transmission module, and a transmission control module. The data packet transmission module is used to receive user data sent by the user terminal and encapsulate it into a second ordinary data packet for transmission to the transmission control module. The acknowledgment packet transmission module is used to receive the received acknowledgment sequence number data and encapsulate it into a first acknowledgment packet for transmission to the transmission control module. The retransmission packet transmission module is used to receive the valid sequence number data and generate a second retransmission data packet that needs to be retransmitted based on the valid sequence number data for transmission to the transmission control module.
7. The apparatus according to claim 6, characterized in that, The retransmission packet sending module is equipped with a buffer queue to store the historical data packets that have been sent. Based on the valid sequence number data, the module deletes the corresponding historical data packets and encapsulates the remaining historical data packets into a second retransmission data packet and sends it to the sending control module. The acknowledgment packet sending module is also used to generate space information based on the remaining space of the normal packet queue and the retransmission packet queue, and encapsulate the space information into the first acknowledgment packet; and to determine whether the space of the normal packet queue and the retransmission packet queue is continuously insufficient based on the space information. If the space of the normal packet queue and / or the retransmission packet queue is continuously insufficient, the module generates a corresponding normal pause packet and / or retransmission pause packet and sends it to the sending control module.
8. The apparatus according to claim 6, characterized in that, The transmission link unit further includes a CRC32 check transmission module, a transmission format conversion module, and an encoding module. The CRC32 check transmission module is used to receive the data to be transmitted output by the transmission control module, perform CRC32 check on the data to be transmitted, and send the data to be transmitted that passes the check to the transmission format conversion module for format conversion. The data to be transmitted after format conversion is sent to the encoding module for encoding and output to the IP core for transmission.
9. The apparatus according to claim 6, characterized in that, The transmission link unit further includes a heartbeat packet transmission module, and the received data and the data to be transmitted also include heartbeat packets. The receiving control module is also used to determine whether the received heartbeat packet is a request packet or a response packet. If it is a request packet, the receiving control module controls the heartbeat packet transmission module to generate a response packet and send it to the transmission control module. The receiving control module is also used to control the heartbeat packet sending module to generate a request packet and send it to the sending control module when no data is received after a preset time.
10. A data transmission control method based on an FPGA applied to the apparatus as described in any one of claims 1-9, characterized in that, include: The receiving link unit receives the received data output by the IP core, and performs decoding, receiving format conversion, CRC32 check, and data type determination on the received data. Based on the determination result, it performs at least one of the following operations: temporarily stores the received first ordinary data packet and generates corresponding receiving acknowledgment sequence number data; temporarily stores the received first retransmission data packet; generates valid sequence number data based on the received second acknowledgment packet; and outputs the received first ordinary data packet and / or first retransmission data packet in sequence. The transmission link unit performs CRC32 verification, transmission format conversion, and encoding on the data to be transmitted, and outputs it to the IP core for transmission; the data to be transmitted is a second ordinary data packet generated based on user data, a first acknowledgment packet generated based on received acknowledgment sequence number data, or a second retransmission data packet determined based on valid sequence number data.