Transmit
As shown in the diagram below, the transmit PCS function consists of three blocks, the ordered set state machine (OS SM), the code group state machine (CG SM) with accompanying code group multiplexer, and the 8b/10b encoder.
The state diagram for the ordered set (OS) state machine is shown below. The state machine directly interfaces with the GMII signals. It delineates transmit frames and drives the code group (CG) state machine through the tx_o_set signal. All state, signal, function, and variable names that are used in the HDL source code are identical to this state diagram for easy reference.

The state diagram for the code group (CG) state machine is shown below. The (Moore) state machine multiplexes data, special, idle, and configuration code groups into the input of the 8B/10B encoder. All state, signal, function, and variable names that are used in the HDL source code are identical to this state diagram for easy reference.

Synchronization
The Synchronization state machine is responsible for determining whether the underlying receive channel is ready for operation. Code group synchronization is acquired by the detection of three consecutive ordered sets containing commas. The state diagram is shown below. All state, signal, function, and variable names that are used in the HDL source code are identical to this state diagram for easy reference.
Receive
The PCS Receive state machine continuously passes RXD[7:0] and sets the RX_DV and RX_ER signals to the GMII interface based on the received code groups from the TBI interface. The state diagram is shown below. It consists of two parts. Signal flows between these parts are indicated by off-page symbols. All state, signal, function, and variable names that are used in the HDL source code are identical to these state diagrams for easy reference.

Auto-Negotiation
The Auto-Negotiation function exchanges information between two devices that share a link segment and automatically configures both devices to take maximum advantage of their abilities. The Auto-Negotiation function allows the devices to switch between operational modes in an orderly fashion. The state diagram is shown below. All state, signal, function, and variable names that are used in the HDL source code are identical to this state diagram for easy reference.