Chapter 5.3 – Generic TLP Header Format: Fields, Encoding, and Interpretation

1. Introduction

The header of a Transaction Layer Packet (TLP)** is the most critical section of the PCI Express data path** — it defines what kind of transaction is being performed, where it is going, and how it should be handled.
Unlike older PCI buses, where control signals were transmitted on dedicated lines, PCIe Encodes all control information within the packet header itself.

Every TLP starts with a header of 3 or 4 doublewords (DW) (12 or 16 bytes). The exact size depends on the addressing mode (32-bit or 64-bit) and whether the TLP carries data.


2. TLP Format Classification

Each packet begins with two key fields: Format (Fmt) and Type.
Together, they tell the receiver what kind of transaction the packet represents and whether data is present.

Fmt Field (2 bits)Type Field (5 bits)Meaning
0000000Memory Read (no data)
1000000Memory Write (with data)
0000100I/O Read
1000100I/O Write
0000101Configuration Read Type 0
1000101Configuration Write Type 0
0000110Configuration Read Type 1
1000110Configuration Write Type 1
00 / 1001100 – 01111Message packets
0001010Completion (no data)
1001010Completion (with data)

💡 Quick Tip:
Fmt defines presence of data and address width, while Type defines transaction intent (memory, config, message, completion, etc.).


3. TLP Header Field Breakdown

Let’s examine the common fields present in all TLP headers:

Field NameWidthPurpose
Fmt (Format)2 bitsSpecifies header format (3DW/4DW) and whether data payload exists
Type5 bitsIdentifies the transaction type (Memory, I/O, Config, Message, Completion)
Traffic Class (TC)3 bitsDefines priority/virtual channel for Quality of Service (QoS)
TD (TLP Digest)1 bitIndicates presence of End-to-End CRC (ECRC)
EP (Error Poisoned)1 bitMarks packet as containing poisoned data
Attr2 bitsSpecifies caching, ordering, and ID-based ordering attributes
Length10 bitsIndicates number of doublewords (DW) in payload (0–1024 DWs)
Requester ID16 bitsIdentifies source of the transaction
Tag8 bitsUniquely identifies the request (used to match completions)
Last BE / First BE4 + 4 bitsByte Enable masks for partial data writes
Address (32 or 64 bits)VariableTarget memory or I/O address

4. Header Format Variations

Used for small requests, such as Memory Reads, I/O Reads/Writes, or Configuration Accesses.

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

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

DW2: [Address (31:2), Reserved]

Used when addressing memory beyond 4 GB.

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

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

DW2: [Address (63:32)]

DW3: [Address (31:2), Reserved]

Same as above, but followed by one or more data doublewords (payload).


5. Special Fields Explained

Used to separate transactions into different Virtual Channels (VCs) for Quality of Service.
Example: Isochronous traffic can be assigned a higher TC for guaranteed latency.

If set, an ECRC follows the data payload.

  • Set to 1 → Digest present
  • Set to 0 → No digest

This optional ECRC gives end-to-end integrity across multiple hops, beyond link-level reliability.

If a device detects a corrupted payload but must still forward it (e.g., for diagnostics), it sets EP = 1.
Receivers treat this as poisoned data and prevent its use.

  • 00 – No Snoop = Disabled, Relaxed Ordering = Disabled
  • 01 – No Snoop = Disabled, Relaxed Ordering = Enabled
  • 10 – No Snoop = Enabled, Relaxed Ordering = Disabled
  • 11 – Both Enabled

These bits influence transaction ordering and caching rules.


6. Byte Enables (BE)

Each TLP specifies which bytes in the first and last doubleword are valid using First BE and Last BE fields.

Example:
A 3-DW header with First BE = 1100b and Last BE = 1111b means:

  • The first doubleword only uses the upper 2 bytes.
  • The last doubleword uses all 4 bytes.

This supports unaligned memory writes without requiring byte-level transfers.


7. Addressing

  • 32-bit (3-DW) TLPs use only the lower 32 bits of the address field.
  • 64-bit (4-DW) TLPs include an extra word for upper address bits.
    Address bits [1:0] are always zero since PCIe transfers operate on doubleword boundaries (4 bytes).

8. Example – Memory Write TLP (3 DW Header)

Let’s decode a typical 3DW Memory Write TLP header:

FieldValueMeaning
Fmt10bWith Data, 3DW
Type00000bMemory Write
TC000bDefault Traffic Class
TD0No ECRC
EP0Not poisoned
Attr00Default ordering
Length44 DW payload (16 bytes)
Requester ID0008hFunction #8
Tag05hUnique request ID
First BE1111Full data valid
Last BE0000Not used (single DW)
Address0x0008_1000Target memory address

This would write 16 bytes starting at 0x0008_1000.


9. Hardware Design Perspective

From a hardware design point of view:

  • The TLP header decoder is often implemented as a combinational parser using the Fmt/Type bits to select field extraction paths.
  • The ECRC generator/checker is part of the TLP assembly logic in the Transaction Layer.
  • For verification, TLP header templates are pre-defined in UVM testbenches to validate encoding correctness.

10. Key Takeaways

  • The TLP header is the brain of each transaction, encoding all essential control information.
  • The Fmt and Type fields together identify packet structure and purpose.
  • Features like Byte Enables, Attributes, and Traffic Class enable flexibility and fine-grained flow control.
  • Understanding header formats is essential before studying Completions, Flow Control, and Ordering.

Leave a Comment

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

Scroll to Top