以太网学习之Ethernet Lite MAC
0赞
Ethernet Lite MAC 功能
- 功能
接口: MII
速度: 10M/100M bps (时钟速率必须大于以太网速度的一半)
支持半双工和全双工 ( C_DUPLEX 参数控制)
可选的乒乓Buffer (C_TX_PING_PONG 和 C_RX_PING_PONG 参数控制)
- 限制
不支持多播 - 只支持单播和广播。(Datasheet第23页)
不支持Jumbo Frame - 仅支持标准的1500Byte长度的Frame。
不支持Burst - 使用了plbv46_slave_single_v1_00_a作为PLB接口,不支持Burst操作
Ethernet Lite MAC 结构

- 时钟
总共有三个时钟,分别为接收时钟,发送时钟和PLB时钟。
接收时钟和发送时钟都由外部的PHY提供。可以是2.5MHz或25MHz(对应10Mbps和100Mbps)。时钟精度要求100ppm,占空比范围为35%-65%.
PLB时钟必须大于以太网速度的一半,即5MHz 或 50MHz.
- 控制
为减少占用的芯片资源,使用BRAM的最后一个区段作为控制寄存器

GIE - Global Interrupt Enable (1为允许)
Control - P = Program, S = Status, I = Tx Interrupt Enable
用软件控制和发送数据流程是这样的
• The software stores the transmit data in the dual port memory starting at address offset 0x0
• The software writes the length data in the dual port memory at address offset 0x07F4
• The software writes a ’1’ to the Status bit at address offset 0x07FC (bit 31 on the data bus)
• The software monitors the Status bit and waits until it is set to ’0’ by the Ethernet Lite MAC before initiating another transmit
• If the transmit interrupt and the global interrupt are both enabled, an interrupt will occur when the Ethernet Lite MAC clears the Status bit
• The transmit interrupt if enabled will also occur with the completion on writing the MAC address
当吧Status置1后,EMAC Lite开始发送数据,会经过这些步骤:
Generate the preamble and start of frame fields
• Read the length and the specified amount of data out of the dual port memory according to the length value adding padding if required
• Detect any collision and performing any jamming, backoff, and retry if necessary
• Calculates the CRC and appends it to the end of the data
• Clears the status bit at the completion of the transmission
• Clearing the status bit will cause a transmit complete interrupt if enabled
问题
- 发送控制位的Length和前面的type/length有什么区别?
EMAC Lite不会对type/length做任何处理,而是把它们当作普通数据一样发送出去。
控制位的Length是在发送时用于计数的。
