FPGA (Field Programmable Gate Array) unit and corresponding user-defined lead code processing method thereof

By implementing the insertion, identification and conversion of user-defined preambles on the FPGA unit, it solves the limitations of traditional Ethernet IP core processing of non-standard preambles, improves the flexibility of the device, and supports high bandwidth requirements and complex network configurations. Dynamic leading header processing.

CN118764552APending Publication Date: 2024-10-11SHANGHAI ANLOGIC INFOTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410900587.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The traditional Ethernet IP core's processing of non-standard preambles at the receiving end is usually to discard the entire data packet, which limits the possibility of dynamically changing the preamble function in the network and cannot support more flexible system applications, especially when high bandwidth requirements are required. and complex network configurations.

Method used

Provide an FPGA unit and its user-defined preamble processing method, receive the packet data sent by the system through the first multi-rate Ethernet media access controller and insert the user-defined preamble to generate a user-defined preamble Ethernet packet, The second multi-rate Ethernet media access controller calls the preamble detection and replacement module to identify and store the preamble, and convert it into a standard preamble to achieve the insertion, identification and conversion of user-defined preambles.

Benefits of technology

It realizes the expansion of the user-defined preamble function in the FPGA unit, avoids the problem that the existing FPGA unit cannot handle the user-defined preamble, improves the flexibility of the device, and supports dynamic operation under high bandwidth requirements and complex network configurations. Leading header processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764552A_ABST
    Figure CN118764552A_ABST
Patent Text Reader

Abstract

The invention discloses an FPGA (Field Programmable Gate Array) unit and a corresponding user-defined preamble processing method, and the processing method comprises the steps: controlling a first multi-rate Ethernet media access controller to insert a user-defined preamble into packet data, and generating a user-defined preamble Ethernet packet; controlling a second multi-rate Ethernet media access controller to perform preamble identification on the user-defined preamble Ethernet packet, storing the user-defined preamble in an external memory, and converting the user-defined preamble Ethernet packet into a standard preamble Ethernet packet; controlling a first multi-rate Ethernet media access controller to pair a message obtained from a standard preamble Ethernet packet with a user-defined preamble obtained from an external memory to obtain a user-defined preamble message, and sending the user-defined preamble message to the system; compared with the prior art, the technical scheme of the invention can realize the expansion of the user-defined lead code function on the FPGA unit, and improves the flexibility of the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of integrated circuit design, and in particular to a method for processing an FPGA unit and a corresponding user-defined preamble code. Background Art

[0002] In modern network communications, the standard preamble of the Ethernet protocol usually adopts a fixed format, such as 0xFB 5555 55 55 55 55D5; however, with the continuous changes in application requirements, there is a demand for flexibility in the preamble, that is, the ability to dynamically change the content of the preamble to transmit additional information according to specific scenarios; for example, in high-speed networks, by dynamically changing the preamble, a single bandwidth can be divided into multiple independent channels without changing the total bandwidth. Each channel can have different address information, thereby supporting more flexible system applications.

[0003] However, traditionally, many Ethernet IP cores are designed according to the IEEE standard format. These IP cores usually discard the entire data packet when processing non-standard preamble headers such as 0xFB XX XX XX XX XX XX XX at the receiving end. This design limits the possibility of implementing the function of dynamically changing the preamble header in the network.

[0004] Therefore, how to solve this limitation and expand the application scenarios of the device is particularly important under the current high bandwidth requirements and complex network configurations. Summary of the invention

[0005] The technical problem to be solved by the present application is: to provide a method for processing an FPGA unit and its corresponding user-defined preamble, which can realize the expansion of the user-defined preamble function on the FPGA unit and improve the flexibility of the device.

[0006] In order to solve the above technical problems, the present application provides a method for processing a user-defined preamble, which is applicable to an FPGA unit, wherein the FPGA unit includes a first multi-rate Ethernet media access controller and a second multi-rate Ethernet media access controller, and the processing method includes:

[0007] Controlling the first multi-rate Ethernet media access controller to receive packet data sent by the system, and inserting a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet;

[0008] Control the second multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet, call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller;

[0009] Control the first multi-rate Ethernet media access controller to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

[0010] In a possible implementation, controlling the first multi-rate Ethernet media access controller to receive packet data sent by a system and inserting a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet specifically includes:

[0011] The first multi-rate Ethernet media access controller includes a first media access control layer transmitter and a first physical coding layer transmitter;

[0012] Based on the packet data sent by the first media access control layer transmitter receiving system, and obtaining a user-defined preamble, the user-defined preamble and the packet data are packaged into an Ethernet frame format to obtain Ethernet frame data, and the Ethernet frame data is sent to the first physical coding layer transmitter;

[0013] The received Ethernet frame data is scrambled based on the first physical coding layer transmitter to obtain a user-defined preamble Ethernet packet.

[0014] In a possible implementation, after generating the user-defined preamble Ethernet packet, the method further includes:

[0015] Sending the user-defined preamble Ethernet packet to a serial-to-parallel converter based on the first multi-rate Ethernet media access controller, so that the serial-to-parallel converter sends the user-defined preamble Ethernet packet to a peer system;

[0016] The peer system is used to send the received user-defined preamble Ethernet packet to the second multi-rate Ethernet media access controller.

[0017] In a possible implementation, the second multi-rate Ethernet media access controller includes a second physical coding layer transmitter and a second physical coding layer receiver.

[0018] Wherein, the second multi-rate Ethernet media access controller supports an Ethernet physical coding layer interface;

[0019] The second physical coding layer transmitter is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface, and the second physical coding layer receiver is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface; the preamble detection and replacement module is connected to an external memory.

[0020] In a possible implementation, calling the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, and storing the identified user-defined preamble in an external memory specifically includes:

[0021] Based on the preamble detection and replacement module, byte extraction processing is performed on the received user-defined preamble Ethernet packet to obtain a first prefix byte, and when it is determined that the first prefix byte meets the preset byte requirement, the initial position of the user-defined preamble is determined, and based on the preamble length, the end position of the user-defined preamble is determined;

[0022] Extracting the user-defined preamble from the user-defined preamble Ethernet packet based on the user-defined preamble initial position and the user-defined preamble terminal position, and storing the user-defined preamble in an external memory;

[0023] When receiving the user-defined preamble code, the external memory records the storage order of the user-defined preamble code.

[0024] In a possible implementation manner, obtaining the user-defined preamble code stored in the external memory specifically includes:

[0025] Obtaining a receiving order corresponding to the standard preamble Ethernet packets received by the first multi-rate Ethernet media access controller;

[0026] Based on the receiving sequence, a user-defined preamble code stored in the external memory is obtained.

[0027] In a possible implementation, the first multi-rate Ethernet media access controller further includes a first media access control layer receiver and a first physical coding layer receiver;

[0028] The first physical coding layer receiver is used to receive the standard preamble Ethernet packet and send the standard preamble Ethernet packet to the first medium access control layer receiver;

[0029] The first media access control layer receiver is used to parse and process the received standard preamble Ethernet packet to obtain a message;

[0030] The first medium access control layer receiver is connected to the external memory;

[0031] The first medium access control layer receiver is further used to receive the user-defined preamble code sent by the external memory.

[0032] The present application also provides an FPGA unit, comprising: a first multi-rate Ethernet media access controller and a second multi-rate Ethernet media access controller;

[0033] Wherein, the first multi-rate Ethernet media access controller is used to receive packet data sent by the system, and insert a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet;

[0034] The second multi-rate Ethernet media access controller is used to receive the user-defined preamble Ethernet packet, call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller;

[0035] The first multi-rate Ethernet media access controller is used to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

[0036] In a possible implementation, the first multi-rate Ethernet media access controller is used to receive packet data sent by the system, insert a user-defined preamble into the packet data, and generate a user-defined preamble Ethernet packet, specifically including:

[0037] The first multi-rate Ethernet media access controller includes a first media access control layer transmitter and a first physical coding layer transmitter;

[0038] Based on the packet data sent by the first media access control layer transmitter receiving system, and obtaining a user-defined preamble, the user-defined preamble and the packet data are packaged into an Ethernet frame format to obtain Ethernet frame data, and the Ethernet frame data is sent to the first physical coding layer transmitter;

[0039] The received Ethernet frame data is scrambled based on the first physical coding layer transmitter to obtain a user-defined preamble Ethernet packet.

[0040] In a possible implementation, after the first multi-rate Ethernet media access controller is configured to generate a user-defined preamble Ethernet packet, it further includes:

[0041] Sending the user-defined preamble Ethernet packet to a serial-to-parallel converter based on the first multi-rate Ethernet media access controller, so that the serial-to-parallel converter sends the user-defined preamble Ethernet packet to a peer system;

[0042] The peer system is used to send the received user-defined preamble Ethernet packet to the second multi-rate Ethernet media access controller.

[0043] In a possible implementation, the second multi-rate Ethernet media access controller includes a second physical coding layer transmitter and a second physical coding layer receiver.

[0044] Wherein, the second multi-rate Ethernet media access controller supports an Ethernet physical coding layer interface;

[0045] The second physical coding layer transmitter is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface, and the second physical coding layer receiver is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface; the preamble detection and replacement module is connected to an external memory.

[0046] In a possible implementation, the second multi-rate Ethernet media access controller is configured to call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, and store the identified user-defined preamble in an external memory, specifically including:

[0047] Based on the preamble detection and replacement module, byte extraction processing is performed on the received user-defined preamble Ethernet packet to obtain a first prefix byte, and when it is determined that the first prefix byte meets the preset byte requirement, the initial position of the user-defined preamble is determined, and based on the preamble length, the end position of the user-defined preamble is determined;

[0048] Extracting the user-defined preamble from the user-defined preamble Ethernet packet based on the user-defined preamble initial position and the user-defined preamble terminal position, and storing the user-defined preamble in an external memory;

[0049] When receiving the user-defined preamble code, the external memory records the storage order of the user-defined preamble code.

[0050] In a possible implementation, the first multi-rate Ethernet media access controller is configured to obtain the user-defined preamble stored in the external memory, specifically including:

[0051] Obtaining a receiving order corresponding to the standard preamble Ethernet packets received by the first multi-rate Ethernet media access controller;

[0052] Based on the receiving sequence, a user-defined preamble code stored in the external memory is obtained.

[0053] In a possible implementation, the first multi-rate Ethernet media access controller further includes a first media access control layer receiver and a first physical coding layer receiver;

[0054] The first physical coding layer receiver is used to receive the standard preamble Ethernet packet and send the standard preamble Ethernet packet to the first medium access control layer receiver;

[0055] The first media access control layer receiver is used to parse and process the received standard preamble Ethernet packet to obtain a message;

[0056] The first medium access control layer receiver is connected to the external memory;

[0057] The first medium access control layer receiver is further used to receive the user-defined preamble code sent by the external memory.

[0058] The present application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the method for processing a user-defined preamble code as described in any one of the above items.

[0059] The present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for processing a user-defined preamble code as described in any one of the above.

[0060] The present invention provides an FPGA unit and a corresponding method for processing a user-defined preamble, which has the following beneficial effects compared with the prior art:

[0061] The method comprises the steps of: controlling the first multi-rate Ethernet media access controller to receive packet data sent by the system, inserting a user-defined preamble into the packet data, and generating a user-defined preamble Ethernet packet; controlling the second multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet, calling a preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, storing the identified user-defined preamble in an external memory, converting the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and sending the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller; controlling the first multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet, and calling a preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, storing the identified user-defined preamble in an external memory, and converting the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and sending the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller; and controlling the first multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet. The standard preamble Ethernet packet is parsed and processed to obtain a message, and the user-defined preamble stored in the external memory is obtained, the user-defined preamble is paired with the message to obtain a user-defined preamble message, and the user-defined preamble message is sent to the system; compared with the prior art, the present application utilizes the first multi-rate Ethernet media access controller and the second multi-rate Ethernet media access controller in the FPGA unit to realize the insertion, identification, storage and conversion of the user-defined preamble, avoids the problem that the existing FPGA unit cannot process the user-defined preamble, realizes the expansion of the user-defined preamble function in the FPGA unit, and improves the flexibility of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flowchart of an embodiment of a method for processing a user-defined preamble provided by the present application;

[0063] Figure 2 It is a structural schematic diagram of an embodiment of an FPGA unit provided by the present application;

[0064] Figure 3 is a structural schematic diagram of another embodiment of an FPGA unit provided by the present application;

[0065] Figure 4 It is a structural schematic diagram of a terminal device provided by this application. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] Example 1, see Figure 1 , Figure 1FIG. 1 is a flow chart of an embodiment of a method for processing a user-defined preamble provided by the present application. Figure 1 As shown, it is applicable to an FPGA unit, wherein the FPGA unit includes a first multi-rate Ethernet media access controller and a second multi-rate Ethernet media access controller, and the processing method includes steps 101 to 103, which are specifically as follows:

[0068] Step 101: Control the first multi-rate Ethernet media access controller to receive packet data sent by a system, and insert a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet.

[0069] In one embodiment, the first multi-rate Ethernet media access controller includes a first media access control layer transmitter Mac tx and a first physical coding layer transmitter Pcs tx.

[0070] Specifically, the first multi-rate Ethernet media access controller includes but is not limited to a 100G multi-rate Ethernet media access controller.

[0071] Specifically, the data transmission direction of the first medium access control layer transmitter and the first physical coding layer transmitter is a direction of sending data from a device to a network.

[0072] In one embodiment, the first medium access control layer transmitter is connected to the first physical coding layer transmitter, the first medium access control layer transmitter is connected to the system, and the first physical coding layer transmitter is connected to a serial-to-parallel converter.

[0073] In one embodiment, based on the packet data sent by the first media access control layer transmitter receiving system and obtaining a user-defined preamble code, the user-defined preamble code and the packet data are packaged into an Ethernet frame format to obtain Ethernet frame data, and the Ethernet frame data is sent to the first physical coding layer transmitter.

[0074] Specifically, when obtaining the user-defined preamble code, since the first multi-rate Ethernet media access controller has a user-defined preamble code register in the tx direction for testing, wherein the user-defined preamble code configured by the user is stored in the user-defined preamble code register, after the first media access control layer transmitter receives the packet data sent by the system, the user-defined preamble code can be obtained or configured based on the user-defined preamble code register.

[0075] Preferably, the tx direction is the direction in which data is sent from the device to the network.

[0076] In one embodiment, the user-defined preamble code and the packet data are packaged into an Ethernet frame format. When the Ethernet frame data is obtained, the packet data is used as the data field, and the MAC address, type field and CRC check field are obtained at the same time. The user-defined preamble code, MAC address, type field, data field and CRC check field are arranged in sequence to obtain the Ethernet frame data.

[0077] In one embodiment, the first physical coding layer transmitter performs scrambling processing on the received Ethernet frame data to obtain a user-defined preamble Ethernet packet.

[0078] Specifically, the scrambling process is to eliminate long strings of 0s or 1s in the data to reduce clock synchronization problems and improve data transmission quality.

[0079] Specifically, based on the first physical coding layer transmitter, the received Ethernet frame data is subjected to user-defined preamble removal processing to obtain first removed data, the first removed data is subjected to scrambling processing to obtain scrambled data, and the user-defined preamble is added to the scrambled data to obtain a user-defined preamble Ethernet packet.

[0080] In one embodiment, after generating a user-defined preamble Ethernet packet, the user-defined preamble Ethernet packet is sent to a serial-to-parallel converter based on the first multi-rate Ethernet media access controller, so that the serial-to-parallel converter sends the user-defined preamble Ethernet packet to a peer system; wherein the peer system is used to send the received user-defined preamble Ethernet packet to the second multi-rate Ethernet media access controller.

[0081] Specifically, when the first multi-rate Ethernet media access controller sends the user-defined preamble Ethernet packet to the serial-to-parallel converter, optical fiber is used for data transmission.

[0082] Specifically, in network communications, especially in high-speed data transmission, the use of parallel transmission can improve data transmission efficiency and speed; therefore, after the user-defined preamble Ethernet packet is sent to the serial-to-parallel converter, the user-defined preamble Ethernet packet is converted into a parallel data format based on the serial-to-parallel converter, and the user-defined preamble Ethernet packet in the parallel data format is sent to the peer system.

[0083] Step 102: Control the second multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet, and call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller.

[0084] In one embodiment, the second multi-rate Ethernet media access controller includes a second physical coding layer transmitter Pcs tx and a second physical coding layer receiver Pcs rx.

[0085] Preferably, the rx direction is the direction in which data is sent from the network to the device.

[0086] In one embodiment, the second multi-rate Ethernet media access controller supports an Ethernet physical coding layer interface.

[0087] Specifically, since the data packet sent by the peer system to the second multi-rate Ethernet media access controller is a user-defined preamble Ethernet packet, and the media access controller in the second multi-rate Ethernet media access controller cannot parse it, it will directly discard the user-defined preamble Ethernet packet; therefore, the second multi-rate Ethernet media access controller does not perform data processing on the user-defined preamble Ethernet packet sent by the peer system, but instead sets the second multi-rate Ethernet media access controller to support an Ethernet physical coding layer interface. Based on the Ethernet physical coding layer interface, the user-defined preamble Ethernet packet can be output to the outside of the second multi-rate Ethernet media access controller, and the user-defined preamble Ethernet packet is processed outside the second multi-rate Ethernet media access controller.

[0088] In one embodiment, the second physical coding layer transmitter is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface, and the second physical coding layer receiver is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface; the preamble detection and replacement module is connected to an external memory.

[0089] In one embodiment, after receiving the user-defined preamble Ethernet packet, the second physical coding layer transmitter sends the user-defined preamble Ethernet packet to the preamble detection and replacement module based on the Ethernet physical coding layer interface.

[0090] In one embodiment, based on the preamble detection and replacement module, byte extraction processing is performed on the received user-defined preamble code Ethernet packet to obtain a first prefix byte. When it is determined that the first prefix byte meets the preset byte requirement, the initial position of the user-defined preamble code is determined, and based on the preamble code length, the end position of the user-defined preamble code is determined. Based on the user-defined preamble code initial position and the user-defined preamble code end position, the user-defined preamble code is extracted from the user-defined preamble code Ethernet packet, and the user-defined preamble code is stored in an external memory.

[0091] Specifically, the preamble detection and replacement module includes a preamble detector, and byte extraction processing is performed on the received user-defined preamble Ethernet packet based on the preamble detector.

[0092] Specifically, since the format of the preamble in the standard Ethernet packet is fixed, which is 0xFB 55 5555 55 55D5, and the non-standard preamble, that is, the user-defined preamble, is 0xFB XX XX XX XX XX XX XX, based on the above, it can be known that the two have the same byte 0xFB, therefore, the byte 0xFB is set as the preset byte requirement.

[0093] Specifically, when performing byte extraction processing on the received user-defined preamble Ethernet packet based on the preamble detector, the user-defined preamble Ethernet packet is read byte by byte. When it is detected that the first prefix byte matches the byte 0xFB, the first prefix byte is extracted, and it is confirmed that the first prefix byte meets the preset byte requirement, the starting byte position corresponding to the first prefix byte is recorded, and the starting byte position is determined as the initial position of the user-defined preamble.

[0094] Specifically, whether it is a standard Ethernet packet preamble or a user-defined preamble, the corresponding preamble lengths are the same. Therefore, after determining the preamble length, the end position of the user-defined preamble can be determined based on the preamble length and the initial position of the user-defined preamble.

[0095] In one embodiment, when receiving the user-defined preamble, the external memory records the storage order of the user-defined preamble.

[0096] In one embodiment, after the preamble detection and replacement module extracts the user-defined preamble from the user-defined preamble Ethernet packet, it also obtains a standard preamble and uses the standard preamble as the user-defined preamble to convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet.

[0097] In one embodiment, the standard preamble Ethernet packet is sent to the second physical coding layer transmitter through the Ethernet physical coding layer interface based on the preamble detection and replacement module.

[0098] In one embodiment, upon receiving the standard preamble Ethernet packet, the second physical coding layer transmitter sends the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller.

[0099] Step 103: Control the first multi-rate Ethernet media access controller to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

[0100] In one embodiment, the first multi-rate Ethernet media access controller further includes a first media access control layer receiver Mac rs and a first physical coding layer receiver Pcs rs.

[0101] In one embodiment, the first physical coding layer receiver is used to receive the standard preamble Ethernet packet and send the standard preamble Ethernet packet to the first medium access control layer receiver.

[0102] Specifically, the first multi-rate Ethernet media access controller is connected to the second physical coding layer transmitter of the second multi-rate Ethernet media access controller through the first physical coding layer receiver, so as to receive the standard preamble Ethernet packet.

[0103] In one embodiment, the first media access control layer receiver is used to parse and process the received standard preamble Ethernet packet to obtain a message.

[0104] Specifically, since the Ethernet packet received by the first media access control layer receiver is a standard preamble Ethernet packet, at this time, the first media access control layer receiver can normally identify the standard preamble Ethernet packet and parse the message from the standard preamble Ethernet packet.

[0105] Specifically, after receiving the standard preamble Ethernet packet, the first media access control layer receiver also records the receiving order of the standard preamble Ethernet packet.

[0106] In one embodiment, the first MAC receiver is connected to the external memory.

[0107] In one embodiment, the first media access control layer receiver is further used to receive the user-defined preamble code sent by the external memory.

[0108] Specifically, after the first media access control layer receiver parses the message from the standard preamble Ethernet packet, it automatically obtains the user-defined preamble from the external memory based on the connection relationship with the external memory.

[0109] In one embodiment, the first multi-rate Ethernet media access controller is used to obtain the user-defined preamble code stored in the external memory by obtaining the reception order corresponding to the standard preamble code Ethernet packets received by the first multi-rate Ethernet media access controller; and based on the reception order, obtain the user-defined preamble code stored in the external memory.

[0110] Specifically, based on the receiving order, when obtaining the user-defined preamble code stored in the external memory, the receiving order is compared with the storage order recorded in the external memory. If there is a target storage order that is the same as the receiving order, the user-defined preamble code corresponding to the target storage order is obtained.

[0111] In one embodiment, when the user-defined preamble is paired with the message, the user-defined preamble and the message are mainly concatenated to obtain a user-defined preamble message.

[0112] In one embodiment, the user-defined preamble message is sent to the system based on the first medium access control layer receiver.

[0113] Example 2, see Figure 2 , Figure 2 is a schematic diagram of the structure of an embodiment of an FPGA unit provided by the present application, such as Figure 2 As shown, the FPGA unit includes a first multi-rate Ethernet media access controller 201 and a second multi-rate Ethernet media access controller 202, as follows:

[0114] The first multi-rate Ethernet media access controller 201 is used to receive packet data sent by the system, and insert a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet.

[0115] The second multi-rate Ethernet media access controller 202 is used to receive the user-defined preamble Ethernet packet, and call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, and convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller.

[0116] The first multi-rate Ethernet media access controller 202 is used to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

[0117] In one embodiment, the first multi-rate Ethernet media access controller 201 is used to receive packet data sent by the system, and insert a user-defined preamble code into the packet data to generate a user-defined preamble code Ethernet packet, specifically including: the first multi-rate Ethernet media access controller 201 includes a first media access control layer transmitter 2011 and a first physical coding layer transmitter 2012; based on the first media access control layer transmitter 2011, the packet data sent by the system is received, and the user-defined preamble code is obtained, the user-defined preamble code and the packet data are packaged into an Ethernet frame format to obtain Ethernet frame data, and the Ethernet frame data is sent to the first physical coding layer transmitter 2012; based on the first physical coding layer transmitter 2012, the received Ethernet frame data is scrambled to obtain a user-defined preamble code Ethernet packet.

[0118] In one embodiment, after the first multi-rate Ethernet media access controller 201 is used to generate a user-defined preamble Ethernet packet, it also includes: based on the first multi-rate Ethernet media access controller 201, sending the user-defined preamble Ethernet packet to a serial-to-parallel converter, so that the serial-to-parallel converter sends the user-defined preamble Ethernet packet to a peer system; wherein the peer system is used to send the received user-defined preamble Ethernet packet to the second multi-rate Ethernet media access controller 202.

[0119] In one embodiment, the second multi-rate Ethernet media access controller 202 includes a second physical coding layer transmitter 2021 and a second physical coding layer receiver 2022, wherein the second multi-rate Ethernet media access controller 202 supports an Ethernet physical coding layer interface; the second physical coding layer transmitter 2021 is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface, and the second physical coding layer receiver 2022 is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface; the preamble detection and replacement module is connected to an external memory.

[0120] In one embodiment, the second multi-rate Ethernet media access controller 202 is used to call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, and store the identified user-defined preamble in an external memory, specifically including: performing byte extraction processing on the received user-defined preamble Ethernet packet based on the preamble detection and replacement module to obtain a first prefix byte, and when it is determined that the first prefix byte meets the preset byte requirement, determining the initial position of the user-defined preamble, and determining the end position of the user-defined preamble based on the preamble length; extracting the user-defined preamble from the user-defined preamble Ethernet packet based on the user-defined preamble initial position and the user-defined preamble end position, and storing the user-defined preamble in the external memory; wherein, when the external memory receives the user-defined preamble, it records the storage order of the user-defined preamble.

[0121] In one embodiment, the first multi-rate Ethernet media access controller 201 is used to obtain the user-defined preamble code stored in the external memory, specifically including: obtaining the receiving order corresponding to the standard preamble code Ethernet packets received by the first multi-rate Ethernet media access controller 201; based on the receiving order, obtaining the user-defined preamble code stored in the external memory.

[0122] In one embodiment, the first multi-rate Ethernet media access controller 201 also includes a first media access control layer receiver 2013 and a first physical coding layer receiver 2014; wherein the first physical coding layer receiver 2014 is used to receive the standard preamble Ethernet packet and send the standard preamble Ethernet packet to the first media access control layer receiver 2013; the first media access control layer receiver 2013 is used to parse and process the received standard preamble Ethernet packet to obtain a message; the first media access control layer receiver 2013 is connected to the external memory; the first media access control layer receiver 2013 is also used to receive the user-defined preamble sent by the external memory.

[0123] In one embodiment, Figure 3 is a structural diagram of another embodiment of an FPGA unit provided by the present application, such as Figure 3 As shown, the invention comprises a first multi-rate Ethernet media access controller 201 and a second multi-rate Ethernet media access controller 202, wherein the first multi-rate Ethernet media access controller 201 comprises a first media access control layer transmitter 2011 and a first physical coding layer transmitter 2012, the first multi-rate Ethernet media access controller 201 further comprises a first media access control layer receiver 2013 and a first physical coding layer receiver 2014; the second multi-rate Ethernet media access controller 202 comprises a second physical coding layer transmitter 2021 and a second physical coding layer receiver 2022; the second multi-rate Ethernet media access controller 202 comprises a first physical coding layer transmitter 2021 and a second physical coding layer receiver 2022; The multi-rate Ethernet media access controller 202 also includes a second media access control layer transmitter 2023 and a second media access control layer receiver 2024; includes a system 203 connected to the first multi-rate Ethernet media access controller 201, and a serial-to-parallel converter 204 connected to the first multi-rate Ethernet media access controller 201 and the second multi-rate Ethernet media access controller 202 respectively; also includes a preamble detection and replacement module 205 connected to the second multi-rate Ethernet media access controller 202, and an external memory 206 connected to the preamble detection and replacement module 205.

[0124] The FPGA unit can implement the method for processing the user-defined preamble in the method embodiment. The options in the method embodiment are also applicable to this embodiment and will not be described in detail here.

[0125] Figure 4 It is a schematic diagram of the structure of a terminal device. Figure 4 As shown, the terminal device 4 of this embodiment includes: at least one processor 401 ( Figure 4 Only one is shown in the figure) a processor, a memory 402, and a computer program 403 stored in the memory 402 and executable on at least one processor 401, and when the processor 401 executes the computer program 403, the steps in any of the above method embodiments are implemented.

[0126] The terminal device 4 may be a computing device such as a smart phone, a laptop, a tablet computer, and a desktop computer. The terminal device may include but is not limited to a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0127] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0128] In some embodiments, the memory 402 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. In other embodiments, the memory 402 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. Further, the memory 402 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 402 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs. The memory 402 may also be used to temporarily store data that has been output or is to be output.

[0129] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0130] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code includes one or more executable instructions for realizing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes also be executed in the opposite order, depending on the functions involved.

[0131] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a terminal device to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0132] In summary, the present application provides an FPGA unit and a corresponding method for processing a user-defined preamble, which generates a user-defined preamble Ethernet packet by controlling a first multi-rate Ethernet media access controller to insert a user-defined preamble into packet data; controlling a second multi-rate Ethernet media access controller to perform preamble recognition on the user-defined preamble Ethernet packet, storing the user-defined preamble in an external memory, and converting the user-defined preamble Ethernet packet into a standard preamble Ethernet packet; controlling the first multi-rate Ethernet media access controller to pair a message obtained from the standard preamble Ethernet packet with a custom preamble obtained from an external memory, obtaining a user-defined preamble message, and sending it to the system; compared with the prior art, the technical solution of the present application can realize the expansion of the user-defined preamble function on the FPGA unit, thereby improving the flexibility of the device.

[0133] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing a user-defined preamble, characterized in that: Applicable to an FPGA unit, wherein the FPGA unit includes a first multi-rate Ethernet media access controller and a second multi-rate Ethernet media access controller, the processing method includes: Controlling the first multi-rate Ethernet media access controller to receive packet data sent by the system, and inserting a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet; Control the second multi-rate Ethernet media access controller to receive the user-defined preamble Ethernet packet, call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller; Control the first multi-rate Ethernet media access controller to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

2. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: Controlling the first multi-rate Ethernet media access controller to receive packet data sent by the system, and inserting a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet, specifically comprising: The first multi-rate Ethernet media access controller includes a first media access control layer transmitter and a first physical coding layer transmitter; Based on the packet data sent by the first media access control layer transmitter receiving system, and obtaining a user-defined preamble, the user-defined preamble and the packet data are packaged into an Ethernet frame format to obtain Ethernet frame data, and the Ethernet frame data is sent to the first physical coding layer transmitter; The received Ethernet frame data is scrambled based on the first physical coding layer transmitter to obtain a user-defined preamble Ethernet packet.

3. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: After generating a user-defined preamble Ethernet packet, it also includes: Sending the user-defined preamble Ethernet packet to a serial-to-parallel converter based on the first multi-rate Ethernet media access controller, so that the serial-to-parallel converter sends the user-defined preamble Ethernet packet to a peer system; The peer system is used to send the received user-defined preamble Ethernet packet to the second multi-rate Ethernet media access controller.

4. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: The second multi-rate Ethernet media access controller includes a second physical coding layer transmitter and a second physical coding layer receiver, Wherein, the second multi-rate Ethernet media access controller supports an Ethernet physical coding layer interface; The second physical coding layer transmitter is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface, and the second physical coding layer receiver is connected to an external preamble detection and replacement module based on the Ethernet physical coding layer interface; the preamble detection and replacement module is connected to an external memory.

5. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: Calling the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, and storing the identified user-defined preamble in an external memory, specifically includes: Based on the preamble detection and replacement module, byte extraction processing is performed on the received user-defined preamble Ethernet packet to obtain a first prefix byte, and when it is determined that the first prefix byte meets the preset byte requirement, the initial position of the user-defined preamble is determined, and based on the preamble length, the end position of the user-defined preamble is determined; Extracting the user-defined preamble from the user-defined preamble Ethernet packet based on the user-defined preamble initial position and the user-defined preamble terminal position, and storing the user-defined preamble in an external memory; When receiving the user-defined preamble code, the external memory records the storage order of the user-defined preamble code.

6. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: Acquiring the user-defined preamble code stored in the external memory specifically includes: Obtaining a receiving order corresponding to the standard preamble Ethernet packets received by the first multi-rate Ethernet media access controller; Based on the receiving sequence, a user-defined preamble code stored in the external memory is obtained.

7. A method for processing a user-defined preamble as claimed in claim 1, characterized in that: The first multi-rate Ethernet media access controller also includes a first media access control layer receiver and a first physical coding layer receiver; The first physical coding layer receiver is used to receive the standard preamble Ethernet packet and send the standard preamble Ethernet packet to the first medium access control layer receiver; The first media access control layer receiver is used to parse and process the received standard preamble Ethernet packet to obtain a message; The first medium access control layer receiver is connected to the external memory; The first medium access control layer receiver is further used to receive the user-defined preamble code sent by the external memory.

8. An FPGA unit, characterized in that: include: a first multi-rate Ethernet media access controller and a second multi-rate Ethernet media access controller; Wherein, the first multi-rate Ethernet media access controller is used to receive packet data sent by the system, and insert a user-defined preamble into the packet data to generate a user-defined preamble Ethernet packet; The second multi-rate Ethernet media access controller is used to receive the user-defined preamble Ethernet packet, call the preamble detection and replacement module to perform preamble identification on the user-defined preamble Ethernet packet, store the identified user-defined preamble in an external memory, convert the user-defined preamble Ethernet packet into a standard preamble Ethernet packet, and send the standard preamble Ethernet packet to the first multi-rate Ethernet media access controller; The first multi-rate Ethernet media access controller is used to parse and process the received standard preamble Ethernet packet to obtain a message, and obtain the user-defined preamble stored in the external memory, pair the user-defined preamble with the message to obtain a user-defined preamble message, and send the user-defined preamble message to the system.

9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for processing a user-defined preamble as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for processing a user-defined preamble as claimed in any one of claims 1 to 7.