陳家揚
Start vivado in ubuntu
Access to PHY module (Ethernet port) with PL
Ethernet PHY
The PYNQ-Z2 has a Realtek RTL8211E-VL PHY supporting 10/100/1000 Ethernet.
The PHY is connected to the Zynq RGMII controller. The auxiliary interrupt (INTB) and reset (PHYRSTB) signals connect to MIO pins MIO10 and MIO9, respectively.
One of the Zynq PS Ethernet controllers can be connected to the appropriate MIO pins to control the Ethernet port.
The Zynq does not need to be configured for the PHY to establish a connection. After power-up the PHY starts with Auto Negotiation enabled, advertising 10/100/1000 link speeds and full duplex. The PHY will automatically establishes a link if there is an Ethernet-capable partner connected.
Since the Ethernet interface of the PYNQ-Z2 is connected to the PS (Processing System) side, it is necessary to externally connect an Ethernet module to the PL (Programmable Logic) side. The module I chose is the LAN8720
, which supports RMII (Reduced Media Independent Interface)
interface.
support 10Mbps / 100Mbps data rates
A single clock reference is used for both transmit and receive
2-bit (di-bit) wide transmit and receive data path
transmit data - TXD[1:0]
transmit strobe - TXEN
receive data - RXD[1:0]
receive error - RXER (Optional)
carrier sense - CRS_DV
Reference Clock - (RMII references usually define this signal as REF_CLK)
Near-end Loopback
Far Loopback
The far loopback mode is enabled by setting the FARLOOPBACK bit of the Mode Control/Status Register
to “1”.
In this mode, data that is received from the link partner on the MDI is
looped back out to the link partner.
Connector Loopback
pynq | LAN8720 |
---|---|
A20 | TX1 |
W9 | NC |
B19 | TX-EN |
Y8 | TX0 |
B20 | RX0 |
Y7 | RX1 |
Y17 | CLK |
Y16 | CRS |
F19 | MDIO |
W10 | MDC |
In this Eth-packet generator, a timer is used to generate (simulate) the content of the data payload.
The value of packet_timer
is then assigned to the 8-bit wide s_axis_tdata
, which serves as the input to data_fifo
module.
data_fifo
module until the total amount exceeds the payload size.preamble
field of the packet is transmitted.SFD
field of the packet is transmitted.HEADER
field of the packet is transmitted.state | tx_valid | tx_data | fcs_en | fcs_rst |
---|---|---|---|---|
IDLE | 0 | 0 | 0 | 1 |
PREAMBLE | 1 | preamble_buffer[RMII_WIDTH-1:0] | 0 | 0 |
SFD | 1 | sfd_buffer[RMII_WIDTH-1:0] | 0 | 0 |
HEADER | 1 | header_buffer[RMII_WIDTH-1:0] | 1 | 0 |
DATA | 1 | data_buffer[RMII_WIDTH-1:0] | 1 | 0 |
FCS | 1 | fcs_buffer[RMII_WIDTH-1:0] | 0 | 0 |
WAIT | 0 | 0 | 0 | 0 |
Since the RMII data width is 2 bits, transmitting a header requires iterations, where RMII_WIDTH = 2.
Illustrate the test plan and procedures.
I plan to use the following tools to capture the packets generated by the Ethernet module.
test.py
sni.py