A multi-rate GMII interface receiving system and method
By designing a GMII interface receiving system that supports multiple rates and utilizing data splicing, distribution, FIFO, and selection modules, the problem of fixed rate of GMII interface in FPGA chip is solved, and flexible data transmission and compatibility are achieved to adapt to different network environments.
Patent Information
- Application Number
- CN202411535849.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-10-31
AI Technical Summary
The existing GMII interface in FPGA chips can only use a fixed 1000Mbps or 100Mbps reception rate, which has poor flexibility and compatibility and cannot meet the requirements of custom network protocols.
A GMII interface receiving system supporting multiple rates was designed, which included a data splicing module, a data distribution module, a data FIFO module, an operation module, a selection module and a data frame control unit. By combining and selecting received data signals of different rates, flexible switching between 1000Mbps and 100Mbps was achieved.
The GMII interface realizes flexible data transmission at different rates, ensures the compatibility and flexibility of data transmission, and adapts to various network environments.
Smart Images

Figure CN119324844B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application generally relates to the technical field of communication, and particularly relates to a GMII interface receiving system and method supporting multiple rates. BACKGROUND
[0002] The GMII (Gigabit Media Independent Interface) interface is a commonly used Ethernet physical layer interface. Copper Ethernet refers to a technology that transmits Ethernet signals through copper wires (such as twisted pairs). It is widely used in home, office and enterprise networks. In modern network devices (such as switches, routers and network cards), the GMII interface is a common design choice, enabling devices to connect to copper Ethernet networks and ensuring high-speed data transmission.
[0003] However, if custom network protocols need to be handled, this approach is not flexible enough and cannot meet usage requirements. When developing Ethernet protocols using FPGA (Field Programmable Gate Array) chips, the GMII interface can often only use a fixed 1000Mbps rate or 100Mbps rate for reception, which has limitations and poor versatility. Therefore, we propose a GMII interface receiving system and method supporting multiple rates to solve the above problems. SUMMARY
[0004] In view of the above defects or deficiencies in the prior art, it is desirable to provide a GMII interface receiving system and method supporting multiple rates to improve data transmission flexibility and compatibility.
[0005] In a first aspect, the present application provides a GMII interface receiving system supporting multiple rates, comprising:
[0006] a data splicing module, a data distribution module, a data FIFO module, an operation module, a first selection module, a second selection module, a third selection module and a fourth selection module connected in communication;
[0007] The data splicing module is configured to combine a first received data signal and a second received data signal to obtain a 1000M received data signal.
[0008] The second selection module is configured to select the 1000M received data signal as an output data signal when the rate is 1000Mbps.
[0009] The fourth selection module is configured to select a received data valid signal as an output data valid signal when the rate is 1000Mbps.
[0010] The operation module is used to perform an AND operation on the byte data valid signal and the received data valid signal to obtain an operation result; the operation result is 1 or 0;
[0011] The data distribution module is configured to obtain a first received data signal and the operation result; when the operation result is 1, the first received data signal is used as the upper four-bit 100M received data signal and is transmitted to the data FIFO module; when the operation result is 0, the first received data signal is used as the lower four-bit 100M received data signal and is transmitted to the data FIFO module;
[0012] The first selection module is configured to obtain the byte data valid signal, and when the byte data valid signal is 0, output 1 and send a write enable signal to the data FIFO module;
[0013] The third selection module is configured to send a read enable signal to the data FIFO module when the data FIFO module is in a data reading state;
[0014] The data FIFO module is configured to form a 100M received data signal using the upper four bits of the 100M received data signal and the lower four bits of the 100M received data signal based on the write enable signal, and send the 100M received data signal to the second selection module based on the read enable signal;
[0015] The data splicing module is used to combine the first received data signal and the second received data signal to obtain a 1000M received data signal;
[0016] The second selection module is further configured to select the 100M received data signal as the output data signal when the rate is 100 Mbps;
[0017] The fourth selection module is further configured to select the read enable signal as the output data valid signal when the rate is 100 Mbps.
[0018] According to the technical solution provided in the embodiment of the present application, it also includes: a data frame control unit communicatively connected to the data FIFO module;
[0019] The data frame control unit is configured to cache the length of the received data frame into the length FIFO module when the rate is 100 Mbps; and in an idle state, detect whether there is data in the length FIFO module, and if so, jump to a length reading state;
[0020] The data frame control unit is further configured to read the received data frame length stored in the length FIFO module in the length reading state and jump to the data reading state; at 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data, and the fourth bits of two consecutive data are spliced into an 8-bit data and stored in the data FIFO, so the number of data actually stored in the FIFO is half of the received data frame length value, and half of the received data frame length is called the valid data number;
[0021] The data frame control unit is further configured to read the data in the data FIFO module and record the number of reads in the data reading state; and jump to the idle state when the number of reads is the number of valid data.
[0022] According to the technical solution provided in the embodiment of the present application, the data frame control unit includes: a length counter, the length counter being used to store the length of the received data frame;
[0023] The length counter is used to start recording the number of data read in the received data frame when the received data valid signal is 1; when the received data valid signal is 0, stop recording the number of data read in the received data frame after a delay of two clock cycles.
[0024] According to the technical solution provided in the embodiment of the present application, the byte data valid signal is the least significant bit valid signal of the length counter.
[0025] According to the technical solution provided in the embodiment of the present application, the second selection module has:
[0026] A first input port is used to obtain the 1000M receive data signal;
[0027] The second input port is used to obtain the 100M received data signal;
[0028] The first selection port is used to obtain the rate; when the rate is 1000 Mbps, the 1000 Mbps received data signal is selected as the output data signal; when the rate is 100 Mbps, the 100 Mbps received data signal is selected as the output data signal;
[0029] The first output port is used to output the output data signal.
[0030] According to the technical solution provided in the embodiment of the present application, the data distribution module has:
[0031] A third input port is used to obtain a first received data signal;
[0032] a second selection port for obtaining a calculation result; when the calculation result is 1, the first received data signal is used as the upper four-bit 100M received data signal; when the calculation result is 0, the first received data signal is used as the lower four-bit 100M received data signal;
[0033] The second output port is used to transmit the upper four bits of the 100M received data signal to the data FIFO module;
[0034] The third output port is used to transmit the lower four bits of the 100M received data signal to the data FIFO module.
[0035] According to the technical solution provided in the embodiment of the present application, the first received data signal is the lower four-bit received data signal of the eight-bit received data signal, and the second received data signal is the upper four-bit received data signal of the eight-bit received data signal.
[0036] According to the technical solution provided in the embodiment of the present application, when the rate is 1000Mbps, the data frame length of the 1000M received data signal is equal to the data frame length of the output data signal; when the rate is 100Mbps, the data frame length of the 100M received data signal is twice the data frame length of the output data signal.
[0037] In a second aspect, the present application provides a GMII interface receiving method supporting multiple rates. Based on the above-mentioned GMII interface receiving system supporting multiple rates, the method comprises the following steps:
[0038] Combining the first received data signal and the second received data signal to obtain a 1000 Mbps received data signal; and when the rate is 1000 Mbps, selecting the 1000 Mbps received data signal as the output data signal and selecting the received data valid signal as the output data valid signal;
[0039] Performing an AND operation on the byte data valid signal and the received data valid signal to obtain an operation result; the operation result is 1 or 0;
[0040] Obtaining a first received data signal and the operation result; when the operation result is 1, using the first received data signal as the upper four-bit 100M received data signal and transmitting it to the data FIFO module; when the operation result is 0, using the first received data signal as the lower four-bit 100M received data signal and transmitting it to the data FIFO module;
[0041] Obtain the byte data valid signal, and when the byte data valid signal is 0, output 1 and send a write enable signal to the data FIFO module;
[0042] When the data FIFO module is in a data reading state, sending a read enable signal to the data FIFO module;
[0043] Based on the write enable signal, the upper four bits of the 100M received data signal and the lower four bits of the 100M received data signal are used to form a 100M received data signal and stored in the data FIFO module, and based on the read enable signal, the 100M received data signal is sent to the second selection module;
[0044] When the rate is 100 Mbps, the 100 Mbps received data signal is selected as the output data signal, and the read enable signal is selected as the output data valid signal.
[0045] According to the technical solution provided in the embodiment of the present application, the following steps are also included:
[0046] When the rate is 100Mbps, the received data frame length is cached in the length FIFO module; in the idle state, whether there is data in the length FIFO module is detected, and if so, it jumps to the length reading state;
[0047] In the length reading state, the received data frame length of the length FIFO module is read and the module jumps to the data reading state. At 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data. The fourth bits of two consecutive data are concatenated into an 8-bit data and stored in the data FIFO. Therefore, the number of data actually stored in the FIFO is half of the received data frame length value. Half of the received data frame length is called the valid data number.
[0048] In the data reading state, the data in the data FIFO module is read and the number of reads is recorded; when the number of reads is the number of valid data, the module jumps to the idle state.
[0049] It can be seen from the above technical solution that this application has at least the following beneficial effects:
[0050] The present application discloses a GMII interface receiving system supporting multiple rates, comprising: a data splicing module, a data distribution module, a data FIFO module, an operation module, a first selection module, a second selection module, a third selection module and a fourth selection module connected in communication; the operation module performs an AND operation on a byte data valid signal and a received data valid signal to obtain an operation result; wherein the operation result is 1 or 0; the data distribution module obtains a first received data signal and an operation result; when the operation result is 1, the first received data signal is used as a high four-bit 100M received data signal and is transmitted to the data FIFO module; when the operation result is 0, the first received data signal is used as a low four-bit 100M received data signal and is transmitted to the data FIFO module; the first selection module obtains a byte data valid signal, and when the byte data valid signal is 0, outputs 1 and sends a write enable signal to the data FIFO module; the third selection module is used to When the IFO module is in the data reading state, it sends a read enable signal to the data FIFO module; the data FIFO module uses the upper four-bit 100M received data signal and the lower four-bit 100M received data signal to form a 100M received data signal based on the write enable signal, and sends the 100M received data signal to the second selection module based on the read enable signal; the data splicing module combines the first received data signal and the second received data signal to obtain a 1000M received data signal; the second selection module is used to select the 1000M received data signal as the output data signal when the rate is 1000Mbps, and select the 100M received data signal as the output data signal when the rate is 100Mbps; at the same time, the fourth selection module is used to select the received data valid signal as the output data valid signal when the rate is 1000Mbps, and select the read enable signal as the output data valid signal when the rate is 1000Mbps.
[0051] The data splicing module, data distribution module, data FIFO module, operation module and multiple selection modules designed and used in this application enable the GMII interface receiving system to support multiple network rates and ensure data transmission flexibility and compatibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Other features, objects and advantages of the present application will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings.
[0053] Figure 1 A schematic diagram of the structure of a GMII interface receiving system that supports multiple rates.
[0054] Figure 2 This is an example diagram of the data receiving process.
[0055] Figure 3 This is an example diagram of length FIFO reading and writing.
[0056] Figure 4 This is an example diagram of a data frame control unit.
[0057] Figure 5 This is an example diagram of the selector.
[0058] Figure 6 This is an example diagram of a distributor.
[0059] Numbers in the figure: 100, data splicing module; 200, data allocation module; 300, data FIFO module; 400, operation module; 500, first selection module; 600, second selection module; 700, third selection module; 800, fourth selection module. DETAILED DESCRIPTION
[0060] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.
[0061] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0062] In order to make the GMII interface receiving system supporting multiple rates provided by the embodiment of the present application clearer and easier to understand, the system is introduced below with reference to the accompanying drawings. Figure 1 As shown in the figure, this figure is a schematic diagram of the structure of a GMII interface receiving system supporting multiple rates provided in an embodiment of the present application, the system comprising:
[0063] The data splicing module 100, the data distribution module 200, the data FIFO module 300, the operation module 400, the first selection module 500, the second selection module 600, the third selection module 700 and the fourth selection module 800 are communicatively connected;
[0064] The data splicing module 100 is used to combine the first received data signal and the second received data signal to obtain a 1000M received data signal; here, the first received data signal is the lower four-bit received data signal of the eight-bit received data signal, and the second received data signal is the upper four-bit received data signal of the eight-bit received data signal. The data splicing module 100 is, for example, a splicer. A splicer is a circuit or module used to merge multiple data sources or signals into a single data stream for transmission, storage or processing. The data input to the input port of the splicer can be parallel data or serial data, and the output port of the splicer is used to output the merged data stream.
[0065] The second selection module 600 is configured to select the 1000 Mbps received data signal as the output data signal when the data rate is 1000 Mbps. The second selection module 600 is, for example, a selector. A selector is configured to select an output signal from multiple input signals. The number of ports of the selector depends on the number of bits in the selector.
[0066] like Figure 5 As shown, the second selection module 600 has:
[0067] The first input port is used to obtain 1000M receiving data signal; the first input port is Figure 5 Data input port 1 in.
[0068] The second input port is used to obtain 100M receiving data signal; the second input port is Figure 5 Data input port 2.
[0069] The first selection port is used to obtain the rate; when the rate is 1000Mbps, the 1000M received data signal is selected as the output data signal; when the rate is 100Mbps, the 100M received data signal is selected as the output data signal; the first selection port is Figure 5 The control signal port in .
[0070] The first output port is used to output the output data signal. The first output port is Figure 5 The data output port in .
[0071] It should be noted that the port designs and functions of the first selection module 500 , the second selection module 600 , the third selection module 700 and the fourth selection module 800 are the same and are not described in detail one by one.
[0072] The fourth selection module 800 is configured to select the received data valid signal as the output data valid signal when the rate is 1000 Mbps. Here, the fourth selection module 800 is, for example, a selector.
[0073] The operation module 400 is used to perform AND operation on the byte data valid signal and the received data valid signal to obtain an operation result; the operation result is 1 or 0; here, the type of the operation module 400 is, for example, an AND operation module, which is used to perform AND operation, which is a basic operation method in a computer. Among them, the byte data valid signal is Figure 2 In rx_cnt[0], the valid signal of received data is Figure 2 gmii_rx_dv in .
[0074] Data distribution module 200 is configured to receive a first received data signal and a calculation result. When the calculation result is 1, the first received data signal is used as the upper four bits of the 100M received data signal and transmitted to data FIFO module 300. When the calculation result is 0, the first received data signal is used as the lower four bits of the 100M received data signal and transmitted to data FIFO module 300. Data distribution module 200 is, for example, a distributor. A distributor is a digital circuit component that distributes a single input signal into multiple output signals.
[0075] like Figure 6 As shown, the data distribution module 200 has:
[0076] The third input port is used to obtain the first received data signal; the third input port is Figure 6 Data input port 4.
[0077] The second selection port is used to obtain the operation result; when the operation result is 1, the first received data signal is used as the upper four-bit 100M received data signal; when the operation result is 0, the first received data signal is used as the lower four-bit 100M received data signal; the second selection port is Figure 6 The control signal input port 3 in.
[0078] The second output port is used to transmit the high four-bit 100M received data signal to the data FIFO module 300; the second output port is Figure 6 Data input port 1 in.
[0079] The third output port is used to transmit the lower four bits of the 100M received data signal to the data FIFO module 300. The third output port is Figure 6 Data input port 2.
[0080] The first selection module 500 is used to obtain a byte data valid signal, and when the byte data valid signal is 0, output 1 and send a write enable signal to the data FIFO module 300; here, the type of the first selection module 500 is, for example, a selector.
[0081] The third selection module 700 is configured to send a read enable signal to the data FIFO module 300 when the data FIFO module 300 is in a data reading state. Here, the type of the third selection module 700 is, for example, a selector.
[0082] The data FIFO module 300 is configured to generate a 100M receive data signal using the upper four bits of the 100M receive data signal and the lower four bits of the 100M receive data signal based on a write enable signal, and to transmit the 100M receive data signal to the second selection module 600 based on a read enable signal. The data FIFO module 300 is, for example, a data FIFO module, which is widely used in data flow management and processing. It is a data structure that stores data according to the first-in, first-out (FIFO) principle. It is primarily used to transfer data between producers and consumers to resolve speed mismatches. In FPGA chip design, the data FIFO module can help balance data flow rate and processing rate, thereby improving overall system performance.
[0083] The second selection module 600 is configured to select the 100 Mbps received data signal as the output data signal when the rate is 100 Mbps.
[0084] The fourth selection module 800 is configured to select the read enable signal as the output data valid signal when the data rate is 100 Mbps. Here, the fourth selection module 800 is, for example, a selector.
[0085] Furthermore, the system further comprises: a data frame control unit communicatively connected to the data FIFO module 300;
[0086] The data frame control unit is used to cache the length of the received data frame into the length FIFO module when the rate is 100Mbps; and in the idle state, it detects whether there is data in the length FIFO module. If so, it jumps to the length reading state; the length FIFO module is used to store the length of a frame of data. The number of numbers in the length FIFO module indicates how many frames of data the data FIFO module 300 has received. When reading a length, the data of the data FIFO module 300 is read according to half of the length value, that is, the effective length is half of the length read out in the length FIFO module.
[0087] The data frame control unit is also used to read the received data frame length stored in the length FIFO module in the length reading state and jump to the data reading state; at 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data, and the fourth bits of two consecutive data are spliced into an 8-bit data and stored in the data FIFO. Therefore, the actual number of data stored in the FIFO is half of the received data frame length value. Half of the received data frame length is called the valid data number. The reading and writing process of the length FIFO module is as follows: Figure 3 shown.
[0088] The data frame control unit is further configured to read the data in the data FIFO module 300 and record the number of reads in the data reading state; and jump to the idle state when the number of reads is the number of valid data.
[0089] When the rate is 100 Mbps, the upper four bits of the 100M received data signal and the lower four bits of the 100M received data signal are selected to form a 100M received data signal. Therefore, the data FIFO module 300 usually writes two frames of data and then reads the data once to obtain the number of valid data.
[0090] Here, the type of the data frame control unit is, for example, a receiving state machine, which is an important component for processing data frame reception in network communication, and controls the data frame reception process according to different receiving states.
[0091] The data frame control unit includes: a length counter, the length counter is used to store the length of the received data frame;
[0092] The length counter is used to start recording the number of data read in the received data frame when the received data valid signal is 1; when the received data valid signal is 0, it stops recording the number of data read in the received data frame after a delay of two clock cycles.
[0093] Here, the byte data valid signal is the least significant bit signal of the length counter.
[0094] During the data frame reception process, the receiving state machine controls each stage of the data flow, while the length FIFO plays the role of data buffering and storage.
[0095] When the receive state machine detects the start of a data frame, it begins pushing received bytes into the FIFO, gradually filling it. During reception, data bytes are stored one by one in the length FIFO. The receive state machine reads data from the PHY layer and places it into the FIFO until a complete frame (one frame contains 8 bits of data) is received. The length FIFO records the byte length of the currently received data frame. Typically, the state machine updates the length field in the FIFO with each received byte to ensure the accurate total length of the current frame. When the receive state machine detects the end of a frame or the complete length of the frame (i.e., when 8 bits of data have been received), it reads the data from the FIFO and performs further verification. The state machine verifies and detects errors on the data in the FIFO and passes it to the upper layer protocol as needed. After receiving a complete frame, the receive state machine checks the data integrity (for example, calculating a CRC checksum). If the data is complete and correct, the receive state machine passes the data frame to the upper layer protocol for processing. If an error is detected, the frame may be discarded or the error information may be reported to the upper layer.
[0096] It should be noted that when the rate is 1000Mbps, the data frame length of the 1000M received data signal is equal to the data frame length of the output data signal; when the rate is 100Mbps, the data frame length of the 100M received data signal is twice the data frame length of the output data signal.
[0097] like Figure 4 As shown in the figure, when the data rate is 100M, the data frame control unit includes three states: idle state, length read state, and data read state. In the idle state, it checks whether there is data in the length FIFO. If there is data, it indicates that a complete data frame has been cached, and the control unit jumps to the length read state. In the length read state, the length value in the length FIFO is read, and the length of the transmitted data frame is half of this value, and the control unit jumps to the data read state. In the data read state, the 8-bit data in the data FIFO is read and the number of reads is counted. If the number of reads reaches the length of the transmitted data frame, the control unit jumps to the idle state and the number of reads counter is cleared.
[0098] Reading and writing process of data frame length:
[0099] like Figure 3 As shown in the figure, a length counter rx_cnt[15:0] is defined. When the receive data valid signal gmii_rx_dv changes from 0 to 1, the length counter starts to count up. When gmii_rx_dv changes from 1 to 0, the length counter stops counting after a delay of two clock cycles. The length FIFO write enable wr_en is controlled to be valid, and the value of the length counter is written to the length FIFO. When the state machine is in the length reading state, the length FIFO read enable rd_en is valid to read the length value in the length FIFO.
[0100] Data frame receiving and conversion process:
[0101] like Figure 2 As shown, the lower four bits gmii_rxd[3:0] and the upper four bits gmii_rxd[7:4] of the received data signal are combined into gmii_rxd_1000M[7:0] through the splicer and enter the selector 2. Here, the selector 2 refers to the second selection module 600.
[0102] The lower four bits of the received data signal, gmii_rxd[3:0], enter the distributor. When the AND operation between the lowest bit of the length counter, rx_cnt[0], and the received data valid signal, gmii_rx_dv, is 1, the distributor uses gmii_rxd[3:0] as the upper four bits of the 100M received data signal, gmii_rxd_100M[7:4]. If the AND operation is 0, the distributor uses gmii_rxd[3:0] as the lower four bits of the 100M received data signal, gmii_rxd_100M[3:0]. When rx_cnt[0] is 0, selector 1 outputs 1, validating the data FIFO write enable signal, wr_en, and writing gmii_rxd_100M[7:0]. Here, selector 1 refers to the first selection module 500. In the data reading state, the selector 3 outputs a read enable signal rd_en to read gmii_rxd_100M[7:0] in the data FIFO to the selector 2. Here, the selector 3 is the third selection module 700.
[0103] When the rate is 1000 Mbps, selector 2 selects gmii_rxd_1000M[7:0] as the output data gmii_rxd_out[7:0], and selector 4 selects gmii_rx_dv as the output data valid signal gmii_rx_dv_out. When the rate is 100 Mbps, selector 2 selects gmii_rxd_100M[7:0] as the output data gmii_rxd_out[7:0], and selector 4 selects rd_en output by selector 3 as the output data valid signal gmii_rx_dv_out. Here, selector 4 is the fourth selection module 800.
[0104] The present application also provides a GMII interface receiving method supporting multiple rates. Based on the above-mentioned GMII interface receiving system supporting multiple rates, the method includes the following steps:
[0105] The first received data signal and the second received data signal are combined to obtain a 1000 Mbps received data signal; and when the rate is 1000 Mbps, the 1000 Mbps received data signal is selected as the output data signal, and the received data valid signal is selected as the output data valid signal;
[0106] Perform AND operation on the byte data valid signal and the received data valid signal to obtain the operation result; the operation result is 1 or 0;
[0107] Obtaining a first received data signal and a calculation result; when the calculation result is 1, using the first received data signal as the upper four-bit 100M received data signal and transmitting it to the data FIFO module 300; when the calculation result is 0, using the first received data signal as the lower four-bit 100M received data signal and transmitting it to the data FIFO module 300;
[0108] Obtain the byte data valid signal, and when the byte data valid signal is 0, output 1 and send a write enable signal to the data FIFO module 300;
[0109] When the data FIFO module 300 is in a data reading state, a read enable signal is sent to the data FIFO module 300;
[0110] Based on the write enable signal, the upper four bits of the 100M received data signal and the lower four bits of the 100M received data signal are used to form a 100M received data signal and stored in the data FIFO module 300, and based on the read enable signal, the 100M received data signal is sent to the second selection module 600;
[0111] When the rate is 100Mbps, the 100M receive data signal is selected as the output data signal, and the read enable signal is selected as the output data valid signal.
[0112] Furthermore, the method further comprises the following steps:
[0113] When the rate is 100Mbps, the length of the received data frame is cached in the length FIFO module; in the idle state, it detects whether there is data in the length FIFO module, and if so, jumps to the length reading state;
[0114] In the length reading state, the length of the received data frame is read from the length FIFO module and the module jumps to the data reading state. At 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data. The fourth bits of two consecutive data are concatenated into an 8-bit data and stored in the data FIFO. Therefore, the actual number of data stored in the FIFO is half of the received data frame length. Half of the received data frame length is called the valid data number.
[0115] In the data reading state, the data in the data FIFO module 300 is read and the number of reads is recorded; when the number of reads is the number of valid data, the state is switched to the idle state.
[0116] The data splicing module 100, data distribution module 200, data FIFO module 300, operation module 400 and multiple selection modules designed and used in conjunction with each other enable the GMII interface receiving system to support multiple network rates and ensure data transmission flexibility and compatibility.
[0117] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in this application.
Claims
1. A GMII interface receiving system supporting multiple rates, characterized in that: include: a data splicing module (100), a data distribution module (200), a data FIFO module (300), an operation module (400), a first selection module (500), a second selection module (600), a third selection module (700), and a fourth selection module (800) that are communicatively connected; The data splicing module (100) is used to combine the first received data signal and the second received data signal to obtain a 1000M received data signal; The second selection module (600) is used to select the 1000M received data signal as the output data signal when the rate is 1000Mbps; The fourth selection module (800) is used to select the received data valid signal as the output data valid signal when the rate is 1000 Mbps; The operation module (400) is used to perform an AND operation on the byte data valid signal and the received data valid signal to obtain an operation result; the operation result is 1 or 0; The data distribution module (200) is used to obtain a first received data signal and the operation result; when the operation result is 1, the first received data signal is used as a high-order 100M received data signal and is transmitted to the data FIFO module (300); when the operation result is 0, the first received data signal is used as a low-order 100M received data signal and is transmitted to the data FIFO module (300); The first selection module (500) is used to obtain the byte data valid signal, and when the byte data valid signal is 0, output 1 and send a write enable signal to the data FIFO module (300); The third selection module (700) is configured to send a read enable signal to the data FIFO module (300) when the data FIFO module (300) is in a data reading state; The data FIFO module (300) is used to form a 100M received data signal based on the write enable signal using the upper four-bit 100M received data signal and the lower four-bit 100M received data signal, and send the 100M received data signal to the second selection module (600) based on the read enable signal; The second selection module (600) is further configured to select the 100M received data signal as the output data signal when the rate is 100Mbps; The fourth selection module (800) is further configured to select the read enable signal as the output data valid signal when the rate is 100 Mbps.
2. A GMII interface receiving system supporting multiple rates according to claim 1, characterized in that: Also includes: a data frame control unit communicatively connected to the data FIFO module (300); The data frame control unit is used to cache the length of the received data frame into the length FIFO module when the rate is 100Mbps; And in the idle state, it detects whether there is data in the length FIFO module. If so, it jumps to the length reading state; The data frame control unit is further configured to read the received data frame length stored in the length FIFO module in the length reading state and jump to the data reading state; at 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data, and the fourth bits of two consecutive data are spliced into an 8-bit data and stored in the data FIFO, so the number of data actually stored in the FIFO is half of the received data frame length value, and half of the received data frame length is called the valid data number; The data frame control unit is further configured to read the data in the data FIFO module (300) in a data reading state and record the number of reads; and jump to an idle state when the number of reads is a valid data number.
3. A GMII interface receiving system supporting multiple rates according to claim 2, characterized in that: The data frame control unit includes: a length counter, the length counter being used to store the length of the received data frame; The length counter is used to start recording the number of data read in the received data frame when the received data valid signal is 1; when the received data valid signal is 0, stop recording the number of data read in the received data frame after a delay of two clock cycles.
4. A GMII interface receiving system supporting multiple rates according to claim 3, characterized in that: The byte data valid signal is the least significant bit valid signal of the length counter.
5. A GMII interface receiving system supporting multiple rates according to claim 1, characterized in that: The second selection module (600) has: A first input port is used to obtain the 1000M receive data signal; The second input port is used to obtain the 100M received data signal; The first selection port is used to obtain the rate; when the rate is 1000 Mbps, the 1000 Mbps received data signal is selected as the output data signal; when the rate is 100 Mbps, the 100 Mbps received data signal is selected as the output data signal; The first output port is used to output the output data signal.
6. A GMII interface receiving system supporting multiple rates according to claim 1, characterized in that: The data distribution module (200) has: A third input port is used to obtain a first received data signal; a second selection port for obtaining a calculation result; when the calculation result is 1, the first received data signal is used as the upper four-bit 100M received data signal; when the calculation result is 0, the first received data signal is used as the lower four-bit 100M received data signal; A second output port is used to transmit the upper four bits of the 100M received data signal to the data FIFO module (300); The third output port is used to transmit the lower four bits of the 100M received data signal to the data FIFO module (300).
7. A GMII interface receiving system supporting multiple rates according to claim 1, characterized in that: The first received data signal is a lower four-bit received data signal of an eight-bit received data signal, and the second received data signal is a higher four-bit received data signal of the eight-bit received data signal.
8. The GMII interface receiving system supporting multiple rates according to claim 1, wherein: When the rate is 1000Mbps, the data frame length of the 1000M received data signal is equal to the data frame length of the output data signal; when the rate is 100Mbps, the data frame length of the 100M received data signal is twice the data frame length of the output data signal.
9. A GMII interface receiving method supporting multiple rates, based on a GMII interface receiving system supporting multiple rates according to any one of claims 1 to 8, characterized in that: The method comprises the following steps: Combining the first received data signal and the second received data signal to obtain a 1000 Mbps received data signal; and when the rate is 1000 Mbps, selecting the 1000 Mbps received data signal as the output data signal and selecting the received data valid signal as the output data valid signal; Performing an AND operation on the byte data valid signal and the received data valid signal to obtain an operation result; the operation result is 1 or 0; Acquire a first received data signal and the operation result; when the operation result is 1, use the first received data signal as the upper four-bit 100M received data signal and transmit it to the data FIFO module (300); when the operation result is 0, use the first received data signal as the lower four-bit 100M received data signal and transmit it to the data FIFO module (300); Obtaining the byte data valid signal, and when the byte data valid signal is 0, outputting 1 and sending a write enable signal to the data FIFO module (300); When the data FIFO module (300) is in a data reading state, sending a read enable signal to the data FIFO module (300); Based on the write enable signal, a 100M received data signal is formed by using the upper four bits of the 100M received data signal and the lower four bits of the 100M received data signal and stored in the data FIFO module (300), and based on the read enable signal, the 100M received data signal is sent to the second selection module (600); When the rate is 100 Mbps, the 100 Mbps received data signal is selected as the output data signal, and the read enable signal is selected as the output data valid signal.
10. A GMII interface receiving method supporting multiple rates according to claim 9, characterized in that: The following steps are also included: When the rate is 100Mbps, the length of the received data frame is cached in the length FIFO module; in the idle state, it detects whether there is data in the length FIFO module, and if so, jumps to the length reading state; In the length reading state, the received data frame length of the length FIFO module is read and the module jumps to the data reading state. At 100Mbps, only the lower 4 bits of each 8-bit data in the received data frame are valid data. The fourth bits of two consecutive data are concatenated into an 8-bit data and stored in the data FIFO. Therefore, the number of data actually stored in the FIFO is half of the received data frame length value. Half of the received data frame length is called the valid data number. In the data reading state, the data in the data FIFO module (300) is read and the number of reads is recorded; when the number of reads is the number of valid data, the system jumps to the idle state.
Citation Information
Patent Citations
10 / 100 / 1000 / 2500 MBPS serial media independent interface (SGMII)
CN101167282A
Ethernet MAC (Media Access Control) sublayer controller and control method thereof
CN105634957A