Welcome FPGA engineers to join the official WeChat technical group.
Clickthe blue textto follow us at FPGA Home – the best and largest pure FPGA engineer community in China

1. Why Use Serdes
Traditional source synchronous transmission separates clock and data. This works fine at lower rates (<1000M).

However, this becomes problematic at higher rates.

Due to inconsistent transmission line delays and jitter, the receiver cannot sample the data correctly, causing misalignment in the eye diagram. This led to the idea of recovering the clock from the data for sampling, known as CDR.

This eliminates the issue of inconsistent delays; minor jitter will not affect sampling (the recovered clock will jitter with the data).
2. Why Use 8b10b, 64b66b?
1. Provide Sufficient Transitions to Recover Clock

However, there is still a problem: the transmitter and receiver must share a ground, which is often difficult to achieve.

Thus, differential signal transmission is used to prevent excessive current at the receiver due to common-mode voltage, employing a current-driven mode. The receiver has capacitors for AC coupling, isolating DC. This brings another issue: DC balance is needed. Hence, the following reasons arose.
2. DC Balance, Equal Numbers of 0s and 1s

3. Run Length, Maximum Length of Consecutive 0s and 1s
AGC (Automatic Gain Control) requires AC components to amplify.

4. Comma Code, K Codes
In high-speed serial streams on Serdes, the data needs to be converted back from serial to parallel at the receiver. How to identify byte boundaries for alignment?
This requires a special sequence, called the comma code.
Some control signals needed during transmission should ideally not conflict with the data, which is the purpose of K codes.
Based on the above four reasons, 8b10b and 64b66b were developed.
3. 8b10b Encoding
To summarize, 8b10b encoding transforms 8-bit data into 10-bit data, where the number of 1s or 0s does not exceed 6, and consecutive 1s or 0s do not exceed 4. This significantly reduces the original 1024 Hamming space. It includes 256 data codes and 12 control codes. Thus, data and control codes do not overlap.

Among them, K28.1, K28.5, and K28.7 can serve as delimiter codes, also known as comma codes, to help the receiver find byte boundaries in the serial data stream. The commonly used K28.5 is 0xBC. Since normal transmission data may also contain 0xBC, how to distinguish? There is a separate control line, tx_is_K, which is pulled high when transmitting K codes and low when transmitting data, to control whether the 8b10b encoding module encodes data or control K codes.
4. Details of Xilinx Serdes
1. Usage of COMMA Codes
K28.5, 0xBC, +0101_111100, -1010_000011; used to detect byte segmentation.
Other K codes are used for frame start, frame end, clock correction, and data alignment.
2. Multi-Byte Processing
At higher data rates, the external width may be 2 words (16 bits) or 4 words (32 bits). If the transmitter and receiver do not agree on which word sends the comma code, byte boundaries can be detected, but the receiver may experience byte swapping. For any single COMMA data alignment, choose even byte alignment. When sending, 0x5ABC->2’b01.

It is also possible to choose to send a combined comma code, which concatenates NP commas for transmission, allowing the receiver to detect 16-bit double word boundaries and avoid the aforementioned issue. When sending, 0xBCBC->2’b11.

Note: Do not select decode valid comma only, as other K codes may also be sent for control. Anyway, 8b10b uses the resources of the transceiver hard core, so make full use of it.
3. Loopback Settings:
1. “000”: Normal mode
2. “001”: Near-end PCS loopback
3. “010”: Near-end PMA loopback
4. “100”: Far-end PMA loopback
5. “110”: Far-end PCS loopback
Note that the loopback configured in the example file provided by Xilinx refers to reserved loopback interfaces, which still need to be manually configured additionally.
4. fsm_down State Machine

In the Monitor Data_Valid module, the correct signal from frame_check is used, and a verification failure will reset GTrxreset. This feedback can be disregarded; it can be directly set to 1. A manual adjustment is needed.

Welcome communication engineers and FPGA engineers to follow our public account.

National Largest FPGA WeChat Technical Group
Welcome everyone to join the national FPGA WeChat technical group, which has tens of thousands of engineers, a group of technology-loving engineers, where FPGA engineers help each other and share knowledge, creating a strong technical atmosphere!Quickly invite your friends to join!!

Press and hold to join the national FPGA technical group.
FPGA Home Component City
Advantageous component service, for inquiries please scan the code to contact the group owner: Jin Juan, Email: [email protected] Welcome recommendations to procurement
ACTEL, AD some advantageous ordering (operating full series):

XILINX, ALTERA advantageous stock or ordering (operating full series):

(The above devices are some models, for more models please consult group owner Jin Juan)
Service Philosophy: FPGA Home Component City aims to facilitate engineers in quickly and conveniently purchasing components. After years of dedicated service, our customer service is spread across large domestic listed companies, military research units, and small and medium-sized enterprises. Our biggest advantage is emphasizing service first and achieving fast delivery at competitive prices!
Directly operated brands: Xilinx, ALTERA, ADI, TI, NXP, ST, E2V, Micron, and over a hundred other component brands, particularly adept at handling components subject to US embargoes against China.We welcome engineer friends to recommend us to procurement or consult us directly!We will continue to provide the best service in the industry!

Official thanks to brands in the FPGA technical group: Xilinx, Intel (Altera), Microsemi (Actel), Lattice, Vantis, Quicklogic, Lucent, etc.