The Data Link Layer protects the contents of the TLP by using a 32-bit LCRC value. The Data Link Layer calculates the LCRC value based on the TLP received from the Transaction Layer and the sequence number it has just applied. The LCRC calculation utilizes each bit in the packet, including the reserved bits (such as bits 7:4 of byte 0).
On the receiver side, the first step that the Data Link Layer takes is to check the LCRC value. It does this by applying the same LCRC algorithm to the received TLP (not including the attached 32-bit LCRC). If a single or multiple-bit error occurs during transmission, the calculated LCRC value should not match the received LCRC value. If the calculated LCRC value does not equal the received value, the TLP is discarded and a Nak DLLP is scheduled for transmission. If the calculated value equals the received value, the Data Link Layer then proceeds to check the sequence number.
Like sequence numbers, the LCRC protects the contents of a TLP on a link-by-link basis. If a TLP travels across several links (for example, passes through a switch on its way to the root complex), an LCRC value is generated and checked for each link. In this way, it is different than the ECRC value that may be generated for a TLP. The ECRC serves to protect the TLP contents from one end of the PCI Express topology to the other end, while the LCRC only ensures TLP reliability for a give link. The 32-bit LCRC value for TLPs is also differentiated from the 16-bit CRC value that is used for DLLP packets.
1 comment:
I want to point out that the data width for 32-bit LCRC calculation doesn't have to 32-bit. In fact, for x16 PCI Express the data width is 128-bit (or 256-bit if the SerDes is Double Data Rate).
There is an online tool that can generate Verilog or VHDL code for the LCRC for different data width.
The tool is at OutputLogic.com
Post a Comment