Chapter 5.6 – Request and Completion TLPs in PCI Express

(Formats, Fields, and Flow Examples)


1. Introduction

In PCI Express, every operation begins with a Request TLP and, if it’s a non-posted request, is followed by one or more Completion TLPs from the recipient.

The Request and Completion mechanism enables asynchronous, full-duplex communication, eliminating the wait-states and arbitration delays that plagued traditional parallel PCI buses.


2. Classification of Requests

Requests in PCIe are categorized based on their function and completion behavior:

TypeExample TLPsCompletion Expected?Direction
PostedMemory Write, Message❌ NoRequester → Completer
Non-PostedMemory Read, I/O Read, Configuration Read✅ YesRequester ↔ Completer
CompletionCompletion, Completion with DataCompleter → Requester

💡 Posted = No response required, Non-posted = Must be acknowledged with a completion.


3. Request TLP Structure

Every Request TLP contains:

  • A Header describing the operation (Format/Type, Address, Attributes)
  • Optional Payload (for write operations)
  • Optional Digest (ECRC) for end-to-end integrity
Example 1: Memory Write (Posted Request)

DW0: [Fmt=10, Type=00000, TC, TD, EP, Attr, Length]

DW1: [Requester ID, Tag, Last BE, First BE]

DW2–DW3: [Address]

Payload: Data

Optional: ECRC

Example 2: Memory Read (Non-Posted Request)

DW0: [Fmt=00, Type=00000, TC, TD, EP, Attr, Length]

DW1: [Requester ID, Tag, Last BE, First BE]

DW2–DW3: [Address]

(No Payload)

Optional: ECRC

Both packets are transmitted downstream (from Requester → Completer).


4. Completion TLPs Overview

A Completion TLP is sent in response to a Non-Posted Request, carrying either:

  • Status information only, or
  • Status + Requested data
Completion TypeDescriptionData Payload
CplCompletion without data❌ No
CplDCompletion with data✅ Yes
CplDLCompletion with data + Locked transaction✅ Yes

5. Completion Header Fields

Completion headers reuse many common TLP header fields, but also include unique ones:

FieldPurpose
Completer IDIdentifies the device sending the completion
Completion StatusIndicates success or error type
BCM (Byte Count Modified)Flags modified byte count
Byte CountNumber of valid bytes returned
Requester IDEchoed from original request
TagMatches the completion to its request
Lower AddressByte alignment offset for returned data

6. Completion Status Codes

CodeMeaningDescription
000bSuccessful Completion (SC)Request completed successfully
001bUnsupported Request (UR)Completer doesn’t support the requested operation
010bConfiguration Request Retry Status (CRS)Indicates configuration not yet ready (software retries later)
011bCompleter Abort (CA)Completer unable to process request due to internal error

7. Lower Address Field

When a Completion returns data, the Lower Address field identifies the byte offset of the first valid byte in the payload relative to a DW boundary.

Example:

  • Original Read Address = 0x0000_0002
  • Lower Address = 2
  • Returned data starts at byte offset 2 in the first word.

This ensures proper byte alignment during reassembly of read data.

8. Completion Flow Example – Memory Read


Step 1: Requester Sends a Memory Read
  • Type: Memory Read (Non-Posted)
  • Tag: 0x4A
  • Address: 0x0000_2004
  • Length: 8 DWs (32 bytes)
Step 2: Completer Receives and Processes
  • Decodes address and verifies access permissions.
  • Reads 32 bytes from memory.
Step 3: Completer Sends a CplD
  • Type: Completion with Data
  • Status: Successful
  • Requester ID: Echoed from request
  • Tag: 0x4A
  • Byte Count: 32
  • Lower Address: 4
Step 4: Requester Matches Completion
  • Uses Tag and Requester ID to match.
  • Reassembles data and delivers it to application logic.
  • Removes Tag from outstanding list.

🔁 This asynchronous request–completion cycle allows multiple outstanding reads to overlap, maximizing bandwidth.


9. Completion with Error Example

If the completer encounters an unsupported address range:

  • Completer sends Completion (Cpl) with:
    • Status = Unsupported Request (UR)
    • No Data Payload
  • Requester reports an AER (Advanced Error Reporting) event if enabled.

10. Byte Count and BCM Field

The Byte Count field specifies the number of valid bytes in the completion payload.

  • Normally = Length × 4 (for full DW data)
  • Modified Byte Count (BCM=1) indicates that Byte Count differs from the expected value — often due to boundary trimming or partial completions.

11. Completion with Data Example (CplD)

Let’s decode a simple completion:

FieldValueDescription
Fmt10bWith Data
Type01010bCompletion
Completion Status000bSuccessful
BCM0Normal
Byte Count0x1016 bytes
Requester ID0008hFrom Request
Tag1AhMatches Request
Lower Address00hData starts at byte 0
Payload16 bytes of read data

12. Ordering Rules Between Requests and Completions

  • Posted requests (e.g., writes) may bypass non-posted requests (reads) to optimize throughput.
  • Completions must always return in Tag order per Requester ID.
  • PCIe switches and bridges ensure that completion packets aren’t reordered relative to their originating request.

🔧 Hardware Verification Tip:
Assertions like “completion matches tag of request” and “completions never reorder” are standard checks in PCIe testbenches.


13. Real-World Analogy

Think of a PCIe read as an online order:

  1. You (Requester) send an order (Memory Read).
  2. The seller (Completer) acknowledges and ships the package (Completion with Data).
  3. You track it using your order number (Tag).
  4. If it can’t be delivered (UR/CA), the seller sends a notification.

This asynchronous, tag-based system keeps everything traceable and efficient.


NOTES

  • Request TLPs initiate operations; Completions close the loop.
  • Tags ensure completions map correctly to outstanding requests.
  • Completion headers contain status, byte count, and lower address for alignment.
  • Errors are communicated via completion status codes.

Proper tag handling is vital for protocol compliance and throughput optimization.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top