1104 - LatticeECP3/ECP5: What are Link CRC (LCRC) and End to End Cyclic Redundancy Check (ECRC), and how are they used?
Description:Peripheral Component Interconnect Express (PCIe) provides two different CRC tests for the transfer of data. The LCRC, or Link CRC, is handled in the data link layer. The optional ECRC, or endpoint CRC, is handled in the transaction layer. Each of these CRC functions can be used to verify that correct data has been received, but they differ on handling the error.
The LCRC is used to verify data sent across a single PCIe link. This CRC is performed in the data link layer resulting in a NAK if the check fails. A NAK in the data link layer forces the transmitting device to resend the errored TLP. TLPs with LCRC errors are terminated directly in the data link layer and are not passed onto the transaction layer.
The ECRC is used to verify data sent from a source PCIe port to the final destination PCIe port. For systems that hop through switches or other types of connectivity solutions, the ECRC can be used to make sure the TLP is correct over the entire path. The source port adds the ECRC to the end of the TLP in the transaction layer. The data link layer of each hop does not alter the ECRC. The final port checks the ECRC against the received TLP. If an error occurs, the receiver passes a message back to the transmitter. This error handling is performed by the Advanced Error Reporting (AER) feature of PCIe. Specific status bits in the AER capability structure are sent and the complete header of the errored TLP is stored for software interrogation. How the transmitting device handles ECRC errors is outside the scope of the PCIe specification.
In the Lattice PCIe IP core LCRC is included as part of the data link layer. ECRC is an optional feature that can be included. ECRC utilizes approximately 1K Look Up Tables (LUTs) for both the generator and checker. For more information on how to control ECRC and the available ports, refer to IPUG85, PCIe IP Core User Manual.http://www.latticesemi.com/view_document?document_id=38406