PHY
# PHY
What’s a PHY? Physical Layer in the OSI reference model, and refers to the devices required to implement the functions of the physical layer. The role of PHY is to perform signal conversion so that the signal can be sent to the opposite device correctly.
# PCS
This dude connects the GMII to the PMA.
Functions:
- Reset
- Transmit
- Receive
# 10BT1S 802.3cg
Simple case of the 10BT1s:
# 4B/5B Encoding
Encodes MII data nibbles to/from 4B/5B.
- Each symbol
tx_sym
is conveyed to the PMA through the PMA_UNITDATA.request service primitive, where tx_sym is a 5B symbol. - Upon assertion of TX_EN, the PCS Transmit function passes two SYNC symbols to the PMA, followed by two SSD symbols that replace the first 16 bits of the packet preamble. Following the second SSD, TXD<3:0> is encoded into 5B symbols until TX_EN is deasserted.
- Following the deassertion of TX_EN, the PCS Transmit generates a special code ESD. When there is no transmit error, ESD is followed by ESDOK. When there is a transmit error, ESD is followed by ESDERR. When a jabber condition is detected, ESD is followed by ESDJAB
# IEEE 802.3bp
There are differences across different standards. Below is a description of the 1000 Mbit/s ethernet standard.
PCS operation is primarily controlled by a few indication messages generated by the PMA
More complicated case with 1000BT1:
- TXMODE:
- SEND_N: transmit the symbols received from the GMII data stream
- SEND_I: idle sequence
- SEND_T: training mode sequence {-1, +1}
- SEND_Z: send zeroes
- CONFIG: specifies whether the PHY is in MASTER or SLAVE mode
# Transmit
# Encoding
Data is encoded into 80/81 bit blocks.
# Block structure:
Each block is 81 bits.
- BIT(0) header: 0 = data. 1 = control
- BIT(1-80): payload
# Data Block
It is just 10 data octets thats all.
# Control Block
%%
🖋 Edit in Excalidraw, and the
dark exported image%%
- Idle (Normal Inter-frame) control characters are transmitted when TX_EN is not asserted and no other supported control code is present at the GMII
- Error: TX_ER and TX_EN are both asserted. Error allows physical sublayers such as the PCS to propagate received errors.
- LP_IDLE: TX_EN is not asserted, TX_ER is asserted, and TXD<7:0> = 0x1. A continuous stream of LPI control characters is used to maintain a link in the LPI transmit mode. Idle control characters are used to transition from the LPI transmit mode to the normal power mode. If EEE is not supported, then LP_IDLE shall be converted to IDLE.
- Stream of 4050 bits (PHY Frame) taken from TXD<7:0>:
- 45 of such blocks
- 9 bits OAM data
- 396 bits Reed-Solomon forward error correction
- 15 bit side stream scrambler
- Each group of 3 bits is converted to 2 PAM symbols (3B2T) for a total of $4500/3*2 = 2700$ symbols
- Pass to PMA through a “UNITDATA.request”
# Receive
# Side-stream Scrambling
Scrambling is important for good waveform characteristics. One way to do this is with linear feedback shift registers.
The bits stored in the shift register delay line at time n are denoted by $Scr_n[32:0]$. At each symbol period, the shift register is advanced by one bit, and one new bit represented by $Scr_n[0]$ is generated:
# Link Synchronization
# PMA Training
The 2 PHYs undergo a “training” sequence to exchange information about the capabilities and scrambler seed. Training mode signals are PAM2 {-1, +1}, a PHY frame is thus 2700 bits rather than 4050 in data mode.
# Training scrambler function
Master: $g_{M(x)}=1+x^{13}+x^{33}$
Slave: $g_{s(x)} = 1+x^{20}+x^{33}$
# Encoding
Partial PHY Frame: here we define a partial PHY frame to be 1 every 180 bits
The bit Sn is mapped to the transmit symbol Tn as follows: if Sn = 0 then Tn = +1, if Sn = 1 then Tn = –1
# PMA
This dude streams the data from PCS onto the twisted-pair cable. Functions:
- tx/rx
- clock recovery
- link monitor
- PHY Control functions.
# 802.3 cg
The PMA encodes tx_sym from PCS, LSB first, into a DME stream over the wire pair BI_DA
# Differential Manchester Encoding (DME)
A type of encoding whereby the polarity does not matter, but rather, only the presence or absence of a transition during the bit interval matters. In 10BT1S:
- bit interval is 80ns
- a transition in the middle (40ns) = logic 1, else = logic 0
# 802.3bp
# Tx/Rx
The PMA Transmit function comprises a transmitter to generate a three level modulated signal on the single twisted-pair copper cable.
The PMA Receive function comprises a receiver for PAM3 signals on the twisted-pair. PMA Receive contains the circuits necessary to both detect symbol sequences from the signals received at the MDI over receive pair and to present these sequences to the PCS Receive function. The PMA translates the signals received on the twisted-pair into the PMA_UNITDATA.indication parameter rx_symb.
# PHY Control
PHY Control generates the control actions that are needed to bring the PHY into a mode of operation during which frames can be exchanged with the link partner.
Exchanged between link partners with a 12-octet InfoField, which is XORed with the first 96 bits of the 15th partial PHY frame (bits 2520 to 2615) of the PHY frame