TOE25G IP Core Data Sheet
PKL and TDL setting in Send command
TDL = N times of PKL + Residue
Connection termination of unusual case
Core Facts |
|
Provided with Core |
|
Documentation |
Reference design manual Demo instruction manual |
Design File Formats |
Encrypted File |
Instantiation Templates |
VHDL |
Reference Designs & Application Notes |
Vivado Project, See Reference design manual |
Additional Items |
Demo on KCU116/VCU118/ZCU111/VCK190 |
Support |
|
Support Provided by Design Gateway Co., Ltd. |
E-mail: ip-sales@design-gateway.com
URL: design-gateway.com
· TCP/IP stack implementation
· Support IPv4 protocol
· Support one session for each TOE25G IP (Multisession can be implemented by using multiple TOE25G IPs)
· Support both Server and Client mode (Passive/Active open and close)
· Support Jumbo frame
· Transmit packet size aligned to 128-bit, transmitted data bus size
· Total amount of received data aligned to 128-bit, received data bus size
· Simple data interface by standard FIFO interface at 128-bit data bus
· Simple control interface by 32-bit single-port RAM interface
· 64-bit AXI4 stream interface with 10G or 25G Ethernet MAC
· Various transmit and receive buffer sizes to optimize resource usage or performance
· Minimum user clock frequency: 195.3125 MHz for 25G Ethernet or 78.125 MHz for 10G Ethernet
· Ethernet speed (10G or 25G) selected by the model of Ethernet MAC and PCS
· Reference design available on KCU116/VCU118/ZCU111/VCK190 board
· Not support data fragmentation feature
· Customized service for following features
· Unaligned 128-bit data transferring
· Buffer size extension by using Windows Scaling feature
· Network parameter assignment by other methods
Table 1: Example Implementation Statistics for Ultrascale+ device
Family |
Example Device |
Fmax (MHz) |
CLB Regs |
CLB LUTs |
CLB1 |
IOB |
BRAM Tile2 |
URAM |
Design Tools |
Virtex-Ultrascale+ |
XCVU9P-FLGA2104-2L-E |
350 |
3869 |
3905 |
780 |
- |
20 |
2 |
Vivado2021.2 |
Kintex UltraScale+ |
XCKU5P-FFVB676-2-E |
350 |
3869 |
3904 |
764 |
- |
20 |
2 |
Vivado2021.2 |
Zync UltraScale+ |
XCZU28DR-FFVG1517-2-E |
350 |
3871 |
3914 |
770 |
- |
20 |
2 |
Vivado2021.2 |
Notes:
1) Actual logic resource dependent on percentage of unrelated logic
2) Block memory resources are based on 64KB Tx data buffer, 16KB Tx packet buffer, and 64KB Rx data buffer. The minimum buffer sizes for jumbo frame are 8KB Tx data buffer, 8KB Tx packet buffer, and 16KB Rx data buffer.
Table 2: Example Implementation Statistics (Versal)
Family |
Example Device |
Fmax (MHz) |
CLB Regs |
CLB LUTs |
Slice1 |
IOB |
BRAM Tile2 |
URAM |
Design Tools |
Versal AI Core |
XCVC1902-VSVA2197-2MP-ES |
350 |
3873 |
4472 |
939 |
|
19 |
2 |
Vivado2021.2 |
Figure 1: TOE25G IP Application
Figure 1 shows an example application of a sensor monitoring system, where data from the sensor is stored in a FIFO and forwarded to a remote system via 25G Ethernet using the TOE25G IP. The TOE25G IP supports full-duplex transfer in the same TCP session, allowing the Remote system to set parameters for real-time controlling the sensor monitoring system via 25G Ethernet while receiving the data from TOE25G IP via 25G Ethernet network.
Figure 2: TOE25G IP Block Diagram
As shown in Figure 2, TOE25G IP core can be divided into three parts, i.e., control block, transmit block, and receive block. The details of each block are described as follows.
All parameters of the IP are set via Register interface that consists of 5-bit address signals and 32-bit data signals. The timing diagram of the Register interface is similar to a single-port RAM interface, as shown in Figure 6. The write and read address are the same signal. Table 3 provides a description of each register.
Table 3: Register map Definition
RegAddr [4:0] |
Reg Name |
Dir |
Bit |
Description |
00000b |
RST |
Wr /Rd |
[0] |
Reset IP. 0b: No reset, 1b: Reset. Default value is 1b. Once the network parameters have been assigned, the user can execute system initialization by setting this register to 1b and then 0b. This action loads the parameters into the IP and executes the system initialization. If the user needs to update certain parameters, this process must be repeated by setting this register to 1b and then 0b again. The RST register controls the following network parameters: SML, SMH, DML, DMH, DIP, SIP, DPN, SPN, and SRV. |
00001b |
CMD |
Wr |
[1:0] |
User command. 00b: Send data, 10b: Open connection (active), 11b: Close connection (active), 01b: Undefined. The command operation begins after the user sets CMD register. In order to start a new operation by setting this register, the system must first be in Idle state. To confirm that the system is not busy, the user should read bit[0] of CMD register or RegDataA1 output, which should be equal to 0b. |
Rd |
[0] |
System busy flag. 0b: Idle, 1b: IP is busy. |
||
[3:1] |
Current IP status. 000b: Send data, 001b: Idle, 010b: Active open, 011b: Active close, 100b: Receive data, 101b: Initialization, 110b: Passive open, 111b: Passive close. |
|||
00010b |
SML |
Wr /Rd |
[31:0] |
Define 32-bit lower MAC address (bit [31:0]) for this IP. To update this value, the IP must be reset by RST register. |
00011b |
SMH |
Wr /Rd |
[15:0] |
Define 16-bit upper MAC address (bit [47:32]) for this IP. To update this value, the IP must be reset by RST register. |
00100b |
DIP |
Wr /Rd |
[31:0] |
Define 32-bit target IP address. To update this value, the IP must be reset by RST register. |
00101b |
SIP |
Wr /Rd |
[31:0] |
Define 32-bit IP address for this IP. To update this value, the IP must be reset by RST register. |
00110b |
DPN |
Wr /Rd |
[15:0] |
Define 16-bit target port number. Unused when the port is opened in passive mode. To update this value, the IP must be reset by RST register. |
00111b |
SPN |
Wr /Rd |
[15:0] |
Define 16-bit port number for this IP. To update this value, the IP must be reset by RST register. |
01000b |
TDL |
Wr |
[31:0] |
Total Tx data length in byte unit. The value must be aligned to 16-byte because bit[3:0] are not used. Valid range is 16-0xFFFFFFF0. The user must first set this register before setting CMD register = Send data (00b). When the IP executes the ‘Send data’ command and asserts Busy to 1b, the system will read this register, allowing the user to subsequently set the TDL register for the next command. If the same TDL is used in the subsequent command, the user is not required to set TDL again. |
Rd |
[31:0] |
Remaining transfer length in byte unit which does not transmit. |
RegAddr [4:0] |
Reg Name |
Dir |
Bit |
Description |
01001b |
TMO |
Wr |
[31:0] |
Define timeout value for awaiting the return of an Rx packet from the target. The counter runs based on the Clk signal provided by the user, with the timer unit being equal to 1/Clk. If the packet is not received within the specified time, TimerInt will be asserted to 1b. For further information of TimerInt, please refer to the Read value of TMO[7:0] register. It is recommended to set the TMO to a value greater than 0x6000. |
Rd |
|
The details of timeout interrupt are shown in TMO[7:0]. Other bits are read for IP monitoring. [0]-Timeout from not receiving ARP reply packet After timeout, the IP resends ARP request until ARP reply is received. [1]-Timeout from not receiving SYN and ACK flag during active open operation After timeout, the IP resends SYN packet for 16 times and then sends FIN packet to close connection. [2]-Timeout from not receiving ACK flag during passive open operation After timeout, the IP resends SYN/ACK packet for 16 times and then sends FIN packet to close connection. [3]-Timeout from not receiving FIN and ACK flag during active close operation After the 1st timeout, the IP sends RST packet to close connection. [4]-Timeout from not receiving ACK flag during passive close operation After timeout, the IP resends FIN/ACK packet for 16 times and then sends RST packet to close connection. [5]-Timeout from not receiving ACK flag during data transmit operation After timeout, the IP resends the previous data packet. [6]-Timeout from Rx packet lost, Rx data FIFO full, or wrong sequence number The IP generates duplicate ACK to request data retransmission. [7]-Timeout from too small receive window size when running Send data command and setting PSH[2] to 1b. After timeout, the IP retransmits data packet, similar to TMO[5] recovery process. [21]-Lost flag when the sequence number of the received ACK packet is skipped. As a result, TimerInt is asserted and TMO[6] is equal to 1b. [22]-FIN flag is detected during sending operation. [23]-Rx packet is ignored due to Rx data buffer full (fatal error). [27]-Rx packet lost detected [30]-RST flag is detected in Rx packet [31],[29:28],[26:24]-Internal test status |
||
01010b |
PKL |
Wr /Rd |
[15:0] |
TCP data length of each Tx packet in byte unit. The value must be aligned to 16-byte because bit[3:0] are not used. Valid from 16-8960. Default value is 1456 byte, which is the maximum size of non-jumbo frame and aligned to 16-byte. During running Send data command (Busy=1b), the user must not set this register. Similar to TDL register, the user does not need to set PKL register again if the next command uses the same packet length. |
01011b |
PSH |
Wr /Rd |
[2:0] |
Sending mode when running Send data command. [0]-Disable to retransmit packet. 0b: Generate the duplicate data packet for the last data packet in Send data command when TDL value is not equal to N times of PKL value to accelerate ACK packet (default). 1b: Disable the duplicate data packet. [1]-PSH flag value in TCP header for all transmitted packet. 0b: PSH flag = 0b (default). 1b: PSH flag = 1b. |
[4:0] |
Reg Name |
Dir |
Bit |
Description |
01011b |
PSH |
Wr /Rd |
[2:0] |
[2]-Enable to retransmit data packet when Send data command is paused until timeout, caused by the receive window size being smaller than the packet size. This flag is designed to resolve the system hang problem resulting from lost window update packet. Activating data retransmission prompts the target device to regenerate the lost window update packet. All following conditions must be met to initiate data retransmission. (1) PSH[2] is set to 1b. (2) The current command is ‘Send data’ and all data are not completely sent. (3) The receive window size is smaller than the packet size. (4) Timer set by TMO register is overflowed. 0b: Disable the feature (default), 1b: Enable the feature. |
01100b |
WIN |
Wr /Rd |
[5:0] |
Threshold value in 1Kbyte unit to initiate window update packet transmission. Default value is 0 (Not enable window update transmission). The IP sends the window update packet when the free space in the Rx data buffer increases by an amount greater than the threshold value from the value in the most recently transmitted packet. For example, if the user sets WIN=000001b (1 Kbyte) and the window size of the most recently transmitted packet is 2 Kbyte, when the user reads 1 Kbyte data from the IP and the free space in the Rx data buffer is updated from 2 Kbyte to be 3 Kbyte, the IP detects that the increased window size is greater than the threshold value of 1 Kbyte (3 KB – 2 KB). As a result, the IP sends the window update packet to update the receive buffer size. |
01101b |
ETL |
Wr |
[31:0] |
Extended total Tx data length in byte unit. The value must be aligned to 16-byte and bit[3:0] are not used. The user can set this register during the Send data command operation (Busy=1b) to extend the total Tx data length. This allows for continuous data transmission without having to resend a new command to the IP. However, there are some important considerations to use this feature: 1) The ETL register must be programmed when the read value of TDL is not less than 128 Kbytes to ensure that Busy is not de-asserted to 0b before setting the ETL register. 2) The set value of ETL must be less than the maximum value of TDL (0xFFFFFFF0) minus the read value of TDL, to avoid overflow value. For example, the user sets TDL to 3.5 GB and then sets CMD register to Send data. After the IP completes 2 GB of data (remaining size = 1.5 GB), the user sets the ETL register to 1.5 GB. The total transmit length is equal to 5 GB (3.5 GB of TDL + 1.5 GB of ETL). |
01110b |
SRV |
Wr /Rd |
[1:0] |
00b: Client mode (default). When the RST register changes from 1b to 0b, the IP sends an ARP request to obtain the Target MAC address from the ARP reply returned by the target device. The IP busy signal is de-asserted to 0b after receiving the ARP reply. 01b: Server mode. When RST register changes from 1b to 0b, the IP waits for an ARP request from the target to obtain Target MAC address. After receiving the ARP request, the IP generates an ARP reply and then de-asserts the IP busy signal to 0b. 1Xb: Fixed MAC Mode. When the RST register changes from 1b to 0b, the IP updates all internal parameters and then de-asserts IP busy to 0b. Target MAC address is loaded through the DML/DMH register. Note: In Server mode, when RST register changes from 1b to 0b, the target device must resend an ARP request for the TOE25G IP to complete the IP initialization process. |
01111b |
VER |
Rd |
[31:0] |
IP version |
10000b |
DML |
Wr /Rd |
[31:0] |
Define 32-bit lower target MAC address (bit [31:0]) for this IP when SRV[1]=1b (Fixed MAC). To update this value, the IP must be reset by RST register. |
10001b
|
DMH |
Wr /Rd |
[15:0] |
Define 16-bit upper traget MAC address (bit [47:32]) for this IP when SRV[1]=1b (Fixed MAC). To update this value, the IP must be reset by RST register. |
The TCP stack is responsible for controlling the modules involved in interfacing with the user and transferring packets via EMAC. The IP operation involves two phases - IP initialization and data transfer. After the RST register transitions from 1b to 0b, the initialization phase begins. The SRV[1:0] are used to set the initialization mode, which can be Client mode, Server mode, or Fixed MAC mode. The TCP stack reads the parameters from the Reg module and sets them in the Transmit and Receive blocks for packet transfer with the target device. Once initialization is complete, the IP enters the data transfer phase.
To transfer data between the TOE25G IP and the target device, three processes are involved: port opening, data transfer, and port closing. The IP supports active open or close by sending SYN or FIN packets when the user sets the CMD register to 10b (port opening) or 11b (port closing). Alternatively, the port can be opened or closed by the target device (passive mode) when the TCP Stack receives SYN or FIN packet. While the port is being opened or closed, the Busy flag is asserted to 1b. Once all packets are transferred, Busy is de-asserted to 0b. The ConnOn signal can be applied to check if the port status is completely opened or closed. The data can be transferred when ConnOn is asserted to 1b (indicating that the port is completely opened).
To send the data, user data is stored in the Tx data and Tx packet buffers. Packet Builder uses the network parameters set by the user to build TCP header, and then the data of Tx data buffer is appended to the TCP packet. The Transmit block then sends the TCP packet to the target device via Ethernet MAC. If the target device receives the data correctly, an ACK packet is returned to Receive block. The TCP Stack monitors the status of the Transmit and Receive blocks to confirm that the data has been sent successfully. If the data is lost, the TCP Stack pauses the current data transmission and initiates the data retransmission process in Transmit block.
When the Receive block receives data, TCP Stack checks the order of the received data. If the data is in the correct order, a normal ACK packet is generated by the Transmit block. Otherwise, the TCP Stack starts the lost data recovery process by instructing the Transmit block to generate duplicate ACKs to the target device.
Table 4: TxBuf/TxPac/RxBufBitWidth Parameter description
Value of BitWidth |
Buffer Size |
TxBufBitWidth |
TxPacBitWidth |
RxBufBitWidth |
9 |
8kByte |
Valid |
Valid |
Valid |
10 |
16kByte |
Valid |
Valid |
Valid |
11 |
32kByte |
Valid |
No |
Valid |
12 |
64kByte |
Valid |
No |
Valid |
The size of this buffer is determined by the “TxBufBitWidth” parameter of the IP, with valid value ranging from 9 – 12 (8KB to 64 KB), which corresponds to the address size of a 128-bit buffer as shown in Table 4. The buffer size should be at least twice the size of the Tx Packet Size set in the PKL register. This buffer stores data from the user to prepare the transmit packet sent to the target device. Data is removed from the buffer when the target device confirms that the data has been completely received. When the buffer size is large enough, the IP can send multiple data packets to the target device without waiting for an ACK packet to clear the buffer. The user can continuously store new data in the Tx data buffer without waiting for long periods. This results in the best transmit performance on a 25G Ethernet connection. However, if there is significant latency time due to the carrier, networking interface, or target system, all the data in the Tx data buffer may be transferred before an ACK packet is returned to flush the buffer. In such cases, the user must pause filling the buffer with new data, resulting in reduced transmit performance.
Note: The IP cannot send the packet if the data stored in the buffer is less than transmit size. The IP must wait until the data from user is sufficient to create one packet.
The size of the buffer size is determined by the “TxPacBitWidth” parameter of the IP. Its valid range is 9-10 (8KB and 16 KB), and the details of the parameter are shown in Table 4. To store at least one transmit packet, the buffer size must be larger than the Tx packet size set by the PKL register. Note that the maximum value of the PKL register is equal to the Tx Packet Buffer size (in bytes) minus 48.
(1) The network parameters must match the values set in the Reg module, such as the MAC address, IP address, and Port number.
(2) The packet must either be an ARP packet or a TCP/IPv4 packet without a data fragment flag.
(3) The IP header length and TCP header length must be valid, with the IP length being equal to 20 bytes and the TCP header length being between 20 and 60 bytes.
(4) Both the IP checksum and TCP checksum must be correct.
(5) The data pointer, as decoded by the sequence number, must be within a valid range.
(6) The acknowledge number must be within a valid range.
The size of the Rx data buffer is determined by the “RxBufBitWidth” parameter of the IP and can range from 9 – 12 (8KB to 64 KB). The size of the Rx data buffer is also applied as the window size of the transmit packet. When the Rx data buffer is sufficiently large, the target device can send multiple data packets to the TOE25G IP without having to wait for an ACK packet, which may be delayed by the networking system. Consequently, a larger Rx data buffer can improve the receive performance.
The data is stored in the buffer until it is read by the user. If the user does not read the data from the buffer for long time, the buffer becomes full, and the target device can no longer send data to the IP, resulting in reduced performance. To achieve optimal received performance, it is recommended that the user logic reads the data from the IP as soon as it is available. By doing so, the Rx data buffer will not become full, and the receive performance will not be affected by the full window size.
The Ethernet system consists of Ethernet MAC and PCS/PMA hardware components. When operating at 25G Ethernet, the user interface of the Ethernet MAC utilizes a 64-bit AXI4 stream at 390.625 MHz. There are various solutions available for a 25G Ethernet System, provided by Design Gateway and Xilinx.
Ethernet system by Design Gateway
Design Gateway offers two IP cores as solutions for the Ethernet system, which can directly connect to TOE25G IP. The first solution is the 10G25GEMAC IP Core, which implements Ethernet MAC features with minimal IP resource usage and low latency time. The PCS/PMA module can be created using the Xilinx’s IP wizard. The Ethernet speed, whether 10G or 25G, can be configured from the PCS/PMA module, provided by from Xilinx. The second solution is the 25GEMAC/PCS + RS-FEC IP core, which implements Ethernet MAC, PCS, and RS-FEC features for 25G Ethernet with optimized resource utilization and low latency. Additional information about each IP core can be found on the following website.
https://dgway.com/products/IP/10GEMAC-IP/dg_10g25gemacip_data_sheet_xilinx_en.pdf
https://www.xilinx.com/products/intellectual-property/ef-di-25gemac.html
https://dgway.com/products/IP/GEMAC-IP/dg_xxvgmacrsfecip_data_sheet_xilinx.pdf
Ethernet system by Xilinx
Xilinx also provides two types of Ethernet system: a hard IP core and a soft IP core. The soft IP core is the 10G/25G Ethernet Subsystem, which includes Ethernet MAC, PCS, and PMA features. On the other hand, the hard IP core is the Ethernet MAC Subsystem, implementing Ethernet MC and PCS features. The PMA must be generated using the Transceiver IP wizard. The hard IP core is available on the Versal devices. To connect the TOE25G IP with Xilinx Ethernet system IP, an adapter logic with a small FIFO is required due to the different characteristics of the ready/valid signals. More information regarding these characteristics is described in the EMAC interface topic. For further details about Xilinx’s Ethernet solutions, please visit the following link.
https://www.xilinx.com/products/intellectual-property/ef-di-25gemac.html
https://www.xilinx.com/products/intellectual-property/mrmac.html
Descriptions of all parameters and I/O signals are provided in Table 5 - Table 7. The EMAC interface is 64-bit AXI4 stream interface.
Table 5: Core Parameters
Name |
Value |
Description |
TxBufBitWidth |
9-12 |
Setting Tx data buffer size. The value is referred to address bus size of this buffer. |
TxPacBitWidth |
9-10 |
Setting Tx packet buffer size. The value is referred to address bus size of this buffer. |
RxBufBitWidth |
9-12 |
Setting Rx data buffer size. The value is referred to address bus size of this buffer. |
Table 6: User I/O Signals (Synchronous to Clk)
Signal |
Dir |
Description |
Common Interface Signal |
||
RstB |
In |
Reset IP core. Active Low. |
Clk |
In |
User clock. The clock frequency must be equal to or greater than half of the MacClk frequency (195.3125 MHz for 25G Ethernet or 78.125 MHz for 10G Ethernet). |
User Interface |
||
RegAddr[4:0] |
In |
Register address bus. Valid when RegWrEn=1b in Write process. |
RegWrData[31:0] |
In |
Register write data bus. Valid when RegWrEn=1b. |
RegWrEn |
In |
Register write enable. Valid at the same clock as RegAddr and RegWrData. |
RegRdData[31:0] |
Out |
Register read data bus. Available the next clock after RegAddr is valid. |
ConnOn |
Out |
Connection Status. 1b: connection is opened, 0b: connection is closed. |
TimerInt |
Out |
Timer interrupt. Asserted to high for 1 clock cycle when timeout is detected. More details of Interrupt status could be checked from TMO[7:0] register. |
RegDataA1[31:0] |
Out |
32-bit read value of CMD register (RegAddr=00001b). Bit[0] is TOE25G IP busy flag. |
RegDataA8[31:0] |
Out |
32-bit read value of TDL register (RegAddr=01000b) |
RegDataA9[31:0] |
Out |
32-bit read value of TMO register (RegAddr=01001b) |
Tx Data Buffer Interface |
||
TCPTxFfFlush |
Out |
Tx data buffer within the IP is reset. Asserted to 1b when the connection is closed or the IP is reset. |
TCPTxFfFull |
Out |
Asserted to 1b when Tx data buffer is full. User needs to stop writing data within 4 clock cycles after this flag is asserted to 1b. |
TCPTxFfWrCnt[11:0] |
Out |
Data counter in 128-bit unit of Tx data buffer to show the amount of data in Tx data buffer. |
TCPTxFfWrEn |
In |
Write enable to Tx data buffer. Asserted to 1b to write data to Tx data buffer. |
TCPTxFfWrData[127:0] |
In |
Write data to Tx data buffer. Valid when TCPTxFfWrEn=1b. |
Rx Data Buffer Interface |
||
TCPRxFfFlush |
Out |
Rx data buffer within the IP is reset. Asserted to 1b when the connection is opened. |
TCPRxFfRdCnt[11:0] |
Out |
Data counter of Rx data buffer to show the amount of received data in 128-bit unit. |
TCPRxFfLastRdCnt[3:0] |
Out |
Remaining byte of the last data in Rx data buffer when total amount of received data in the buffer is not aligned to 16-byte unit. User cannot read the data until all 16-byte data is received. |
TCPRxFfRdEmpty |
Out |
Asserted to 1b when Rx data buffer is empty. User needs to stop reading data immediately when this signal is asserted to 1b. |
TCPRxFfRdEn |
In |
Asserted to 1b to read data from Rx data buffer. |
TCPRxFfRdData[127:0] |
Out |
Data output from Rx data buffer. Valid in the next clock cycle after TCPRxFfRdEn is asserted to 1b. |
Table 7: EMAC I/O Signals (Synchronous to MacClk)
Signal |
Dir |
Description |
MacClk |
In |
User interface clock of the EMAC which is equal to 390.625MHz for 25G Ethernet. |
tx_axis_tdata[63:0] |
Out |
Transmitted data. Valid when tx_axis_tvalid=1b. |
tx_axis_tkeep[7:0] |
Out |
The byte enable of transmitted data. Valid when tx_axis_tvalid=1b. |
tx_axis_tvalid |
Out |
Valid signal of transmitted data. |
tx_axis_tlast |
Out |
Control signal to indicate the final word in the frame. Valid when tx_axis_tvalid=1b. |
tx_axis_tuser |
Out |
Control signal to indicate an error condition. This signal is always 0b. |
tx_axis_tready |
In |
Handshaking signal. Asserted to 1b when tx_axis_tdata has been accepted. This signal must not be de-asserted to 0b when a packet is transmitting. |
rx_axis_tdata[63:0] |
In |
Received data. Valid when rx_axis_tvalid=1b |
rx_axis_tvalid |
In |
Valid signal of received data. rx_axis_tvalid must be asserted to 1b continuously for transferring each packet. |
rx_axis_tlast |
In |
Control signal to indicate the final word in the frame. Valid when rx_axis_tvalid=1b. |
rx_axis_tuser |
In |
Control signal asserted at the end of received frame (rx_axis_tvalid=1b and rx_axis_tlast=1b) to indicate that the frame has CRC error. 0b: normal packet, 1b: error packet. |
rx_axis_tready |
Out |
Handshaking signal. Asserted to 1b when rx_axis_tdata has been accepted. rx_axis_tready is de-asserted to 0b for 2 clock cycles to be the gap size between each received packet. |
After the RST register value is changed from 1b to 0b, the initialization of TOE25G IP is initiated. Three modes can be executed, Client mode (SRV=00b), Server mode (SRV=01b), and Fixed MAC mode (SRV[1]=1b). The information on each mode is presented in the timing diagram below.
Figure 3: IP Initialization in Client mode
As shown in Figure 3, in Client mode, the TOE25G IP sends an ARP request packet and waits for an ARP reply packet returned from the target device. Target MAC address is extracted from ARP reply packet. Upon completion, the Busy signal (bit0 of RegDataA1) is de-asserted to 0b.
Figure 4: IP Initialization in Server mode
Figure 5: IP Initialization in Fixed mode
As shown in Figure 5, after reset process in Fixed MAC mode is completed, the TOE25G IP updates all parameters from the registers. The Target MAC address is loaded from DML and DMH register. Once this process is finished, the Busy signal is de-asserted to 0b.
Figure 6: Register interface timing diagram
Figure 7: CMD register timing diagram
Tx FIFO interface provides two control signals for the flow control, the full flag (TCPTxFfFull) and the write data counter (TCPTxFfWrCnt). TCPTxFfWrCnt is updated two clock cycles after asserting TCPTxFfWrEn. TCPTxFfFull serves as an indicator of when the internal buffer is almost full and is asserted before it reaches its capacity. It is recommended to pause sending data within four clock cycles after TCPTxFfFull is asserted. Figure 8 shows an example timing diagram for the Tx FIFO interface.
Figure 8: Tx FIFO interface timing diagram
(1) Before asserting TCPTxFfWrEn to 1b to write the data to TOE25G IP, the full flag (TCPTxFfFull) must not be asserted to 1b and ConnOn must be equal to 1b. To write the data, assert TCPTxFfWrEn to 1b along with TCPTxFfWrData.
(2) If TCPTxFfFull is asserted to 1b, TCPTxFfWrEn must be de-asserted to 0b within four clock cycles to pause sending data.
(3) When there is no more data for transferring, the connection may be terminated by active or passive mode. After the port is closed, the following situations are found.
a) ConnOn changes from 1b to 0b.
b) TCPTxFfFlush is asserted to 1b to flush all data inside TxFIFO for a while and then de-asserted to 0b.
c) TCPTxFfWrCnt is reset to 0.
d) TCPTxFfFull is asserted to 1b to block the new user data and then de-asserted to 0b, similar to TCPTxFfFlush.
Figure 9: Rx FIFO interface timing diagram using Empty flag
(2) The TCPRxFfRdData signal is valid in the next clock cycle.
(3) Reading data must be immediately paused by setting TCPRxFfRdEn=0b when TCPRxFfEmpty is equal to 1b.
(4) The user must read all data from the Rx data buffer before creating a new connection. When a new connection is established, all data in the Rx data buffer is flushed, and TCPRxFfFlush is set to 1b. Once the new connection is completed, the ConnOn value changes from 0b to 1b.
(5) After finishing the Flush operation, TCPRxFfEmpty is asserted to 1b.
Figure 10: Rx FIFO interface timing diagram using read counter
When the user logic reads data in burst mode, the TOE25G IP provides a read data counter signal to indicate the total amount of data stored in the Rx data buffer in 128-bit unit. For instance, in Figure 10, there are five units of data available in the Rx data buffer. Therefore, the user can set TCPRxFfRdEn to 1b for five clock cycles to read all the data from the Rx data buffer. The latency time to update TCPRxFfRdCnt after setting TCPRxFfRdEn to 1b is two clock cycles.
EMAC interface of TOE25G IP utilizes a 64-bit AXI4-stream interface, but it has a limitation that it cannot pause data transmission before transmitting the end of the packet. To transmit a packet, the tx_axis_tready must be asserted to 1b while transmitting a packet. However, once the final data of the packet has been transferred, tx_axis_tready can be de-asserted to 0b to pause the transmission of the next packet.
Figure 11: Transmit EMAC interface timing diagram
(1) TOE25G IP asserts tx_axis_tvalid to 1b with the first data of the packet. All signals are latched until tx_axis_tready is asserted to 1b to accept the first data.
(2) After the first data is accepted by EMAC, tx_axis_tready must remain set to 1b to accept all remaining data in the packet from the TOE25G IP until the end of the packet. The IP sends all data of each packet continuously.
(4) Once the end of the packet has been transferred, tx_axis_tready can be asserted to 0b to pause the transmission of the next packet.
The Receive EMAC interface also requires continuous receipt of packet data, similar to Transmit EMAC interface. The Valid signal must remain asserted at 1b from the start of the packet to the end of the packet without interruption, as shown in Figure 12.
Figure 12: Receive EMAC interface timing diagram
(2) The end of the packet is detected when rx_axis_tlast=1b and rx_axis_tvalid=1b. In this cycle, the final data of the packet is valid on rx_axis_tdata.
(3) After the final data of the packet has been transferred, TOE25G IP de-asserts rx_axis_tready for 2 clock cycles to complete the packet post-processing. Therefore, EMAC must support pausing data packet transmission for 2 clock cycles.
On the other hand, if the system design of TOE25G IP utilizes the Ethernet system IP provided by Design Gateway, it can directly connect without additional logic.
The steps to set the registers for transferring data in Client mode are outlined below.
1) Set the RST register=1b to reset the IP.
2) Set the SML/SMH for MAC address, DIP/SIP for IP address, and DPN/SPN for port number.
Note: DPN is an optional setting when the port is opened by IP (Active open).
3) Set RST register=0b to start the IP initialization process. The TOE25G IP will send an ARP request packet to get the Target MAC address from the ARP reply packet. The Busy signal is de-asserted to 0b after completing the initialization process.
4) The new connection can be created by two modes.
a. Active open: Write CMD register = “Open connection” to create the connection (SYN packet is firstly sent by TOE25G IP). After that, wait until Busy flag is de-asserted to 0b.
b. Passive open: Wait until “ConnOn” signal = 1b (the target device sends SYN packet to TOE25G IP firstly).
5) a. For sending data, set TDL register (total transmit length) and PKL register (packet size). Then, set CMD register = “Send Data” to start data transmission. The user can send the data to TOE25G IP via the TxFIFO interface before or after setting the CMD register. Once the command is finished, the Busy flag is de-asserted to 0b. The user can set a new value to the TDL/PKL register and then set CMD register = “Send Data” to start the next transmission.
b. For receiving data, the user should monitor RxFIFO status and read the data until RxFIFO is empty.
6) Similar to creating the connection, the connection can be terminated by two modes.
a. Active close: Set CMD register = “Close connection” to close the connection (FIN packet is firstly sent by TOE25G IP). After that, wait until Busy flag is de-asserted to 0b.
b. Passive close: Wait until “ConnOn” signal = 0b (FIN packet is sent from the target to TOE25G IP firstly).
1) Set RST register=1b to reset the IP.
2) Set SML/SMH for MAC address, DIP/SIP for IP address, and DPN/SPN for port number.
3) Set RST register=0b to begin the IP initialization process by waiting for an ARP request packet to get the Target MAC address. The IP then creates an ARP reply packet to return to the target device. Once the initialization process is completed, the Busy signal is de-asserted to 0b.
4) The remaining steps are the same as step 4 – 6 of Client mode.
In Fixed MAC mode, the MAC Address of the target device is loaded from DML and DMH register. The process for transferring data is the same as that of Client and Server mode. The following steps provides an example of how to run TOE25G IP in Fixed MAC mode.
1) Set RST register=1b to reset the IP.
2) Set SML/SMH for MAC address of TOE25G IP, DML/DMH for MAC address of the target device, DIP/SIP for IP address, and DPN/SPN for port number.
3) Set RST register=0b to begin the IP initialization process. Once initialization is completed, the busy signal will be de-asserted to 0b.
4) The remaining steps are the same as step 4 – 6 of Client mode.
When executing the Send command, the TOE25G IP can operate in two modes based on the value of TDL compared to N times of PKL. The details for each mode are described as follows.
Figure 13: TCP packet when TDL = N times of PKL
If TDL value is equal to N times of PKL value, the user data is split into N packets and transmitted to the target device, as shown in Figure 13. If the target device responds with an ACK packet for each TCP packet, there will be N ACK packets in the network system. To improve network performance, several ACK packets can be combined into be one packet using the TCP delayed ACK technique. Therefore, the number of ACK packets returned from the target device (M) may be less than the number of data packets from TOE25G IP (N) when running the Send command. The PSH[0] value does not affect this condition. The last data packet (TCP Data#N) is sent only once.
Figure 14: TCP packet when TDL = (N times of PKL) + Residue
If TDL value is not equal to N times of PKL value, the data sent to the target device is split into N packets of PKL-byte data and one last packet that contains Res-byte data, as shown in Figure 14. The first step is similar to the condition where TDL is equal to N times of PKL. The IP needs to receive an ACK packet from the target device to confirm that all N-packets have been received completely. After that, the last packet, which contains the residue byte data, is sent to the target device. If the PSH[0] register is set to 0b (default value), the residue packet is sent twice. Otherwise, the last packet is sent only once. The Send command is completed when the target returns an ACK to confirm that the last packet have been received.
Note: If target device is running on an OS that enables the delayed ACK feature, the ACK#M packet, which confirms the acceptance of TCP Data#N, may arrive too late due to timeout condition in some conditions. Therefore, the target device needs to disable the delayed ACK feature or the TDL value should be aligned to PKL value in systems that are sensitive to this latency time.
Figure 15: Terminate connection sequence
The process of terminating a connection in the normal case is illustrated in Figure 15, where four packets are exchanged between two devices. The first device (Device#0) initiates the connection termination by sending a FIN packet. If the second device (Device#1) agrees to terminate the connection, it responds with an ACK and FIN packet, which may be sent together in one packet or in separate packets. Finally, Device#0 confirms the termination by sending an ACK packet. The TOE25G IP can execute the close connection in two modes, Active and Passive. This section describes the operation of TOE25G IP in some unusual cases.
The TOE25G IP Core functionality was verified by simulation and also proved on real board design by using KCU116, VCU118, ZCU111, and VCK190 board.
User must be familiar with HDL design methodology to integrate this IP into their design.
This product is available directly from Design Gateway Co., Ltd. Please contact Design Gateway Co., Ltd. For pricing and additional information about this product using the contact information on the front page of this datasheet.
Revision |
Date |
Description |
1.5 |
22-May-2023 |
Correct Figure6 and PKL. Add TCPTxFfWrCnt signal, Connection termination of unusual case section, and ZCU111 support. |
1.4 |
29-Dec-2022 |
Update Figure6 |
1.3 |
25-May-2022 |
Support VCK190 and add PKL/TDL setting in Send command topic |
1.2 |
31-Aug-2020 |
Correct ARP figure and add KCU116 board |
1.1 |
24-Aug-2020 |
Rename IP from TenGEMAC to 10G25GEMAC |
1.0 |
5-Aug-2020 |
New release |