Focuses on the Transaction Layer (TLP types, address spaces, headers, framing, VCs, ordering, prefix rules, and QoS) in a beginner-friendly but technically rich way.


Transaction Layer & TLP Deep Dive


1. Role of the Transaction Layer

The Transaction Layer (TL) is the brain of PCIe communication.

It is responsible for:
✔ Creating and decoding TLPs (Transaction Layer Packets)
✔ Addressing, routing, and ordering
✔ Virtual channels & QoS
✔ Handling reads, writes, and completions
✔ TLP prefix support (PASID, ATS, TPH, etc.)


2. Types of Transactions (TLP Types)

CategoryTransaction
PostedMemory Write, Message
Non-PostedMemory Read, I/O Read/Write
CompletionsCompletion with Data (CplD), Completion without Data (Cpl)

Posted = Fire & Forget
Non-Posted = Must receive completion
Completion = Response to non-posted request


3. Address Spaces

Address SpaceUsage
Memory SpaceDevice memory, MMIO registers
I/O SpaceLegacy I/O (rare in modern PCIe)
Configuration SpaceDevice discovery & configuration
Message SpaceInterrupts (MSI/MSI-X), PME, ERR messages

4. Virtual Channels (VCs) & Traffic Classes (TC)

  • PCIe supports up to 8 VCs (VC0–VC7)
  • Each VC maps to one or more Traffic Classes (TC0–TC7)

ASCII Mapping:

TC0 -> VC0 (Default, Low Priority)
TC1 -> VC1 (High Priority)
TC2 -> VC2 (Isochronous / Real-time)

Prevents head-of-line blocking
Enables Quality of Service (QoS)


5. TLP Header Fields (Key Fields)

FieldPurpose
FormatDefines header size (3DW/4DW) & data presence
TypeIdentifies TLP type
TCPriority
TDDigest (CRC) present?
EPPoisoned error
AttributesRO, No Snoop
LengthPayload size
Requester IDWho sent it
TagIdentify transaction
AddressMemory/I/O address
Byte EnableValid bytes

6. TLP Framing

A complete TLP consists of:

+-----------------+
| TLP Header      |
+-----------------+
| Optional Prefix |
+-----------------+
| Payload (Data)  |
+-----------------+
| ECRC (optional) |

7. TLP Ordering Rules

Default rules:

  • Non-Posted before Posted writes
  • Read requests must return completions in order
  • Completions must preserve Tag ordering

Relaxed Ordering (RO) bit:

  • Allows out-of-order transmission for performance

No Snoop:

  • Bypasses CPU cache (for DMA, streaming data)

8. TLP Prefix Rules

Prefixes add extra metadata for advanced features:

Prefix FeaturePurpose
PASIDProcess ID for virtualization
TPHCompletion steering hints
ATSAddress translation for IOMMU
Steering TagEfficient routing inside switches

Prefix is processed in both Non-Flit and Flit mode.


9. Transaction Flow Example (Memory Read)

Step 1: RC sends Memory Read TLP (Non-Posted)
Step 2: Device receives request
Step 3: Device sends Completion TLP (CplD) with data
Step 4: RC processes data

Ensures reliable, ordered completion.


10. TLP Flow with Virtual Channels (QoS Example)

High Priority Video Stream -> VC1 (fast path)
Low Priority Logging Data -> VC0 (best-effort)

Scheduler ensures VC1 is served first.


11. Putting It All Together (ASCII Summary)

[Transaction Layer]
   |
   |-- Create TLP (Header + Prefix + Data)
   |-- Apply Ordering Rules (RO, No-Snoop, TC)
   |-- Assign Virtual Channel (VC0/VC1)
   v
[Data Link Layer]
   |
   |-- Add Seq #, CRC
   |-- Reliable delivery (ACK/NAK)
   v
[Physical Layer]
   |
   |-- Encode, transmit, equalize

12. Why the Transaction Layer is CRITICAL

✔ Manages TLP packet structure
✔ Defines transaction types (read/write/completion)
✔ Implements ordering, QoS, routing
✔ Enables virtualization (PASID, ATS, SR-IOV)
✔ Coordinates with Data Link Layer for reliability
✔ Talks directly to device logic and software API

It is the MOST important layer for architects & verification engineers!


Scroll to Top