赞
踩
工程中数据量越来越大,千兆以太网已不能满足需求,所以开发万兆网口需提上日程。基于FPGA的万兆网口代码=SFP(光模块) + PCS + PMA + MAC + UDP协议栈。xilinx提供了PCS+PMA,(MAC层也有IP核,但需要购买license)。本文只介绍MAC相关知识点。
一、MAC层帧格式
(1)Preamble
前导码,7字节的0x55。
(2)Start of Frame Delimiter(SFD)
帧分界符,1字节的0xD5
(3)Destination/Source Address
MAC源/目的地址,6字节。
(4)Length/Type
如果Length/Type=0x8100/0x88A8表示该帧是VLAN;Length/Type=0x8808表示该帧是流控帧(PAUSE,MAC层控制帧)。
(5)Pad
pad field长度是0~46B,作用是确保帧长度最少为64B(不包含Preamble和SFD)
(6)FCS
帧校验码。对destination address,source address,length/type,data,pad,进行CRC32校验。
二、Interframe Gap(帧间隔)
在进行连续帧发送时,发送完一帧数据后,需要等待一段时间,才能发送下一帧数据,其中等待一段时间称为帧间隔。
两帧之间的最小时间间隔,最小值为9.6ns对10Gb/s。
DA-Destination address;SA-Source address;L/T-Length/type field;FCS-Frame check sequence(CRC)
三、XGMII_TC/XGMII_RC和XGMII_TDATA/XGMII_RDATA关系
Lane | XGMII_TDATA/XGMII_RDATA | XGMII_TC/XGMII_RC |
---|---|---|
0 | [7:0] | [0] |
1 | [15:8] | [1] |
2 | [23:16] | [2] |
3 | [31:24] | [3] |
4 | [39:32] | [4] |
5 | [47:40] | [5] |
6 | [55:48] | [6] |
7 | [63:56] | [7] |
XGMII_TC/RC与XGMII_TDATA/XGMII_RDATA之间关系,如下表:
四、64bit 10G Ethement MAC接口信号
MAC顶层模块接口信号模仿xilinx官方提供的10G Ethemet MAC(15.1)接口,且接口信号时序大家可差看官方提供的pdf资料。
Site Search (amd.com)https://www.amd.com/en/search/site-search.html#q=pg072
信号名 | I/O | 信号位宽 | 信号功能描述 | ||
---|---|---|---|---|---|
PHY Interface | xgmii_rxd | I | 64 | Received data from PHY | |
xgmii_rxc | I | 8 | Received control from PHY | ||
xgmii_txd | O | 64 | Transmit data to PHY | ||
xgmii_txc | O | 8 | Transmit control to PHY | ||
AXI4-Stream Transmit Interface | tx_axis_tdata | I | 64 | AXI4-Stream data | |
tx_axis_tkeep | I | 8 | AXI4-Stream data control | ||
tx_axis_tvalid | I | 1 | AXI4-Stream data valid | ||
tx_axis_tready | O | 1 | AXI4-Stream acknowledge signal, indicate the start of a data transfer | ||
tx_axis_tlast | I | 1 | Indicating End of Ethernet Packet | ||
tx_axis_tuser | I | 1 or n | / | ||
tx_axis_aresetn | I | 1 | AXI4-Stream active-low reset for transmit path | ||
tx_ifg_delay | I | 8 | Configures Interframe Gap adjustment between packets | ||
AXI4-Stream Receive Interface | rx_axis_tdata | O | 64 | AXI4-Stream data | |
rx_axis_tkeep | O | 8 | AXI4-Stream data control | ||
rx_axis_tvalid | O | 1 | AXI4-Stream data valid | ||
rx_axis_tuser | O | 1 | / | ||
rx_axis_tlast | O | 1 | Indicating the end of a packet | ||
rx_axis_aresetn | I | 1 | AXI4-Stream active-low reset for receive path | ||
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。