EE Primers · Communication interfaces · High-speed serial

PCI Express: how it works, and why it replaced the parallel bus

PCI Express is the main interconnect inside almost every computer: CPU to SSD, GPU, network card, accelerator and memory expander. It looks to software exactly like the old parallel PCI bus (the same configuration space, address windows and memory-mapped registers), but physically it is a tree of point-to-point serial links, each made of one or more lanes, carrying packets. This page explains why it was built that way, how a system is wired and discovered, how packets move, and how the generations from 2.5 GT/s to 128 GT/s fit together. The generation pages then follow one real system each, down to individual signals.

Before PCIe: PCI: how the parallel bus works. Deep dives: Gen 4 · NVMe SSD · Gen 5 · GPU x16 · Gen 6 · CXL memory, PAM4, FLITs. Specification: PCI Express Base Specification [1].

01 · At a glance

PCIe in one minute

What it is
  • A point-to-point, packet-switched, serial interconnect between a host (the root complex in the CPU) and devices.
  • Each link has 1, 2, 4, 8 or 16 lanes. A lane is two differential pairs: one that only transmits and one that only receives (dual simplex). Having a separate pair for each direction is what lets a link send and receive at the same time. The pairs being differential is a separate choice, for noise immunity: the receiver reads the difference between the two wires, so noise common to both cancels.
  • No clock wire per lane: the receiver recovers the clock from the data. A 100 MHz reference clock is usually shared.
What software sees
  • The PCI programming model, unchanged since 1992: every function has a configuration space, BARs map its registers into memory, and the OS enumerates the tree at boot.
  • Drivers read and write device registers with ordinary loads and stores; devices move data with DMA into host memory and signal with MSI interrupts (which are memory writes).
How it scales
  • Wider: more lanes (x1 to x16).
  • Faster: each generation roughly doubles the per-lane rate: 2.5 → 5 → 8 → 16 → 32 → 64 → 128 GT/s.
  • Further: switches fan one link out to many; retimers extend reach; the same link can carry CXL.
  • Always backward compatible: a link trains to the best rate and width both ends support.
00 · Why it exists

From PCI to PCI-X to PCI Express

PCI (1992) was a shared, parallel, synchronous bus: 32 (or 64) address/data lines, a common clock, and control signals that every slot connects to. One device talks at a time after winning arbitration. It worked well at 33 MHz. Pushing it faster hit physical limits that no amount of protocol work could fix:

  • Skew. All 32 or 64 bits must arrive inside the same clock window. Differences in trace length, loading and driver strength spread their arrival times; as the clock period shrinks, the spread eats the whole window.
  • Loads and reflections. Every slot is a stub on every line. PCI used reflected-wave switching (the driver launches about half the swing and relies on the reflection from the unterminated end), so each extra load slows the settling. A 33 MHz PCI bus typically carries about four slots; at 66 MHz the limit is two connectors (or four soldered-down devices); PCI-X allows at most two slots per bus.
  • Shared bandwidth. 133 MB/s (32-bit, 33 MHz) is shared by every device, and only one transfers at a time.
  • Pins and power. A 64-bit bus needs about 90 signal pins; widening further was impractical.
  • Sideband wires. Four shared interrupt lines (INTA#–INTD#), plus separate wires for errors, power management and hot-plug.

PCI-X (1998, 64-bit at 66–133 MHz) registered every input and output to the clock and accepted fewer slots per bus; PCI-X 2.0 (2003) added double- and quad-data-rate transfers (266 and 533 MT/s) with source-synchronous strobes and 1.5 V signaling. Both inherited the shared-bus limits. PCI Express (first specification 2002, 1.0a in 2003) kept the software model and replaced the physical layer: one dedicated link per device, differential pairs with embedded clocks so skew between lanes no longer matters, packets instead of bus cycles, and interrupts and errors carried as messages.

How the parallel bus actually ran a transfer, clock by clock: PCI primer →

Why the parallel bus stopped scaling

Illustrative common-clock budget (not PCI specification values): period ≥ clock-to-out (≈ 2 ns) + settling per extra load (≈ 1.2 ns each) + skew + setup/hold (≈ 1.5 ns) + clock skew (≈ 0.5 ns). A serial lane carries its own clock in the data, so none of these terms depend on the other lanes.

PCIPCI-XPCIe Gen 1 x1PCIe Gen 1 x16
TopologyShared busShared bus (at most 2 slots)Point to pointPoint to point
Signaling3.3/5 V single-ended, reflected wave3.3 V single-ended; PCI-X 2.0 DDR/QDR at 1.5 V with source-synchronous strobesDifferential, 2.5 GT/s, embedded clockSame, 16 lanes
Peak bandwidth133 MB/s (32-bit/33) – 533 MB/s (64-bit/66), shared1.06 GB/s (133 MHz) – 4.27 GB/s (533 MT/s), shared250 MB/s each way, dedicated4 GB/s each way, dedicated
Signal pins (data path)≈ 50 (32-bit) / ≈ 90 (64-bit)≈ 90464
InterruptsINTA#–INTD# wiresWires, MSI optionalMSI / MSI-X messages (legacy INTx emulated as messages)Same
DuplexHalf (one transfer at a time)HalfFullFull
00 · Layers

PCIe against the OSI model

PCIe defines three layers: Transaction, Data Link and Physical. The device driver, the OS and the device's own command set (NVMe, a GPU's command rings, a NIC's descriptors) sit above them. The mapping to OSI is the usual approximation; PCIe was not designed against it. Click a layer; the sections below carry the same tags.

One register write, wrapped layer by layer

A driver writes 4 bytes to a device register. The Transaction layer builds a memory-write TLP, the Data Link layer adds a sequence number and CRC, and the Physical layer frames it, scrambles it and sends it as bits on each lane. Widths not to scale.
00 · Topology

Root complex, switches, endpoints

A PCIe system is a tree. The root complex in the CPU connects the processor and memory to one or more root ports. Each port drives one link. A link ends at either an endpoint (an SSD, GPU, NIC) or a switch, which has one upstream port and several downstream ports and forwards packets between them. A device can contain up to 8 functions (independent PCI devices sharing one link; up to 256 with ARI), and SR-IOV lets one physical function present many virtual ones.

Each function is identified by its Bus:Device.Function (BDF): 8-bit bus, 5-bit device, 3-bit function, for example 03:00.0. Every link is its own bus; inside a switch there is one more internal bus. Requests are routed by address (memory TLPs go to whoever owns that address range) or by ID (configuration requests and completions go to a BDF).

Enumeration is depth first. Software reads the Vendor ID of each possible device on a bus; FFFFh means nothing is there. When it finds a bridge (a root port or switch port, Type 1 header), it gives the bridge the next free bus number as its secondary bus, walks that bus, and then records the highest bus found below as the bridge's subordinate bus, so the bridge knows which bus numbers to forward.
00 · Configuration space

Config space, ECAM and BARs

Every function has a configuration space: 256 bytes compatible with PCI, extended to 4 KB in PCIe. The first 64 bytes are a standard header: Vendor and Device ID, Class Code (what kind of device), Command and Status registers, and the Base Address Registers. After that come capability structures in linked lists: PCIe capability (link speed and width), MSI/MSI-X, power management, AER error reporting, and others in the extended space.

The CPU reaches config space through ECAM: a memory region where each function's 4 KB appears at an address computed from its BDF. A load from that address becomes a configuration-read TLP.

ECAM address

Address = base + bus·220 + device·215 + function·212 + register. 256 buses × 1 MB = 256 MB of address space for the whole tree.

BAR sizing: how software finds a device's window

00 · Inside a port

Controller, PIPE and PHY: how a PCIe port is built in silicon

Every PCIe port, in a CPU, SSD controller or GPU, splits into the same blocks. The controller is digital logic: the Transaction and Data Link layers and the logical part of the Physical layer. The PHY is the mixed-signal SerDes: the electrical part of the Physical layer. Between them sits a standard interface, PIPE (PHY Interface for PCI Express, an Intel specification also used for USB, SATA, DisplayPort and USB4), so a controller from one vendor can be paired with a PHY from another. The specification itself splits the Physical layer into a logical sub-block (state machines, framing, training sequences) and an electrical sub-block (analog transmit and receive).

Controller (digital, "MAC")PHY (mixed-signal SerDes) TransactionTLP build/parsecredits, orderingconfig spaceIDE encryption Data Linkseq #, LCRC / FLIT CRCACK/NAK, replay bufferDLLPs, power mgmt PHY logicalLTSSM, framingscrambling, encoding*lane striping, deskewelastic buffer*, FEC PIPEparallel data+ control PCS(serializerinterface,rx detect) PMATX driver + FIRRX CTLE/DFECDR, PLL TX pairsRX pairs * in the PIPE "SerDes architecture" these sit in the controller; in the original architecture, in the PHY
The PIPE "SerDes architecture" (introduced in PIPE 5.0, recommended for Gen 5 and required from Gen 6) moves encoding, the elastic buffer, polarity handling and loopback into the controller, leaving a lean, protocol-agnostic PHY that does serialization, clock recovery and receiver detection. This is how one SerDes design serves PCIe, USB and others.
00 · Packets

TLPs, DLLPs and the three kinds of request

Everything on a link is a packet. Transaction Layer Packets (TLPs) carry requests and data between endpoints of a transaction. Data Link Layer Packets (DLLPs) stay on one link: acknowledgements, flow-control credits and power management. TLPs fall into three classes, and the difference matters for performance and ordering.

TLPClassRouted byUsed for
MWrPosted: no replyAddressRegister writes, DMA writes into host memory, MSI/MSI-X interrupts
Msg, MsgDPostedAddress, ID, or implicitLegacy INTx emulation, error and power-management messages, vendor messages
MRdNon-posted: needs a completionAddressRegister reads, DMA reads of host memory
CfgRd0/1, CfgWr0/1Non-postedID (BDF)Configuration space access (Type 1 is forwarded by bridges, Type 0 is for the local bus)
IORd, IOWrNon-postedAddressLegacy I/O space; rarely used
FetchAdd, Swap, CASNon-postedAddressAtomic operations on host or device memory
Cpl, CplDCompletionID + tagAnswers to non-posted requests, with or without data
Posted vs non-posted
  • A posted write is fire-and-forget: the sender continues immediately. That is why writes are fast and reads are slow: a read stalls until its completion returns, a round trip of hundreds of nanoseconds to microseconds.
  • High-performance devices therefore have the device do the bulk data movement by DMA, and the CPU mostly writes (doorbells) rather than reads.
Ordering
  • Posted writes stay in order with each other.
  • A read (or, unless relaxed ordering is set, a completion) may not overtake an earlier posted write in the same direction. So a device can write data, then write a "done" flag, and anyone who sees the flag sees the data. Likewise a CPU read of a device register flushes the CPU's earlier writes to it.
  • Posted writes must be allowed to pass reads and completions, which prevents deadlock in bridges.
Reliability
  • The Data Link layer adds a sequence number and a 32-bit LCRC to every TLP. The receiver answers with ACK or NAK DLLPs; on NAK or timeout the sender replays from its replay buffer.
  • Errors are corrected per link, invisibly to software; counters in AER record them.

Flow control: you can only send what the receiver has room for

Each receiver advertises credits for its buffers, separately for headers and data of posted, non-posted and completion traffic (PH, PD, NPH, NPD, CplH, CplD). One header credit holds one TLP header; one data credit holds 16 bytes. A transmitter may send a TLP only if enough credits remain, and the receiver returns credits with UpdateFC DLLPs as it frees buffer space. No packet is ever dropped for lack of room. Try it:

Flow-control credits for posted writes

Actions

00 · How a device is used

Register writes, reads, DMA and interrupts

Every PCIe device driver uses the same four mechanisms. This walkthrough shows each once, for a generic device whose registers sit behind BAR0.

Go deeperThe same pattern with real commands and packet bytes: an NVMe read on the Gen 4 page, a GPU copy with hundreds of reads in flight on the Gen 5 page, and CXL memory loads without a driver on the Gen 6 page.
00 · Power management

Link states and device states

PCIe saves power at two levels. Device states (D0 to D3) are set by software and describe the whole function. Link states (L0 to L3) describe the link; the Data Link layer negotiates entry with power-management DLLPs and tells the Physical layer when to idle its transmitters. With ASPM (Active State Power Management) the hardware enters L0s or L1 on its own when the link is idle, without software involvement.

Link stateWhat is offExitEntered by
L0Nothing: normal operation——
L0p (Gen 6+)Some lanes, while the rest keep carrying trafficLanes return without retraining or stopping trafficHardware, by bandwidth demand
L0sOne direction's transmitter (electrical idle)Sub-microsecond to a few µsASPM; not used in FLIT mode
L1Both directions idle; PLLs may stay onMicroseconds, through RecoveryASPM, or software when a device goes to D3
L1.1 / L1.2REFCLK can stop (CLKREQ# released); L1.2 also turns off common-mode keepersTens of µsASPM with L1 substates; key for laptops and phones
L2 / L3Main power off; L2 keeps auxiliary power for wakeFull reset and retrainingSystem sleep or power-off

Device states: D0 (on), D1 and D2 (optional, lighter sleep), D3hot (off but still powered and configurable), D3cold (power removed; wake by WAKE# or an in-band beacon). Exit latencies above are typical; each device advertises its own in its capability registers.

00 · Generations

Gen 1 to Gen 7 compared

GenSpec yearRate per laneSignalingEncodingPer lane, each wayx16, each wayMain changePrimer
12002 (1.0a 2003)2.5 GT/sNRZ8b/10b250 MB/s4 GB/sSerial, point to point
220075 GT/sNRZ8b/10b500 MB/s8 GB/sDouble rate; −6 dB de-emphasis option
320108 GT/sNRZ128b/130b985 MB/s15.8 GB/sNew encoding instead of 10 GT/s; TX equalization negotiation
4201716 GT/sNRZ128b/130b1.97 GB/s31.5 GB/sLane margining, expanded (10-bit) tags and scaled credits, retimer supportGen 4 →
5201932 GT/sNRZ128b/130b3.94 GB/s63 GB/sPrecoding, alternate protocols (CXL)Gen 5 →
6202264 GT/sPAM4FLIT + FEC≈ 7.4–7.6 GB/s≈ 118–121 GB/sPAM4, 256 B FLITs, FEC, L0pGen 6 →
72025128 GT/sPAM4FLIT + FEC≈ 14.8–15.1 GB/s≈ 236–242 GB/sDouble symbol rate (64 GBd); optical links via the Optical Aware Retimer ECN

Bandwidths are after line encoding, before TLP header overhead. For Gen 6–7 the range depends on what counts as payload in a 256-byte FLIT: 236 bytes of TLPs (lower figure) or 242 bytes including the data-link bytes (upper figure, the one most references quote). Marketing figures often add both directions together, for example "256 GB/s" for Gen 6 x16 and "512 GB/s" for Gen 7 x16.

Bandwidth by generation and width

Width
Compare against

Why Gen 6 switched to PAM4. NRZ beyond 32 GT/s would push the Nyquist frequency to 32 GHz, where board and connector loss is prohibitive. PAM4 keeps 16 GHz by sending two bits per symbol on four levels, but each of its three eyes is a third the height of an NRZ eye, an SNR penalty of about 9.5 dB that makes crosstalk and reflections matter more and raises the raw error rate; hence FEC. Gen 7 keeps PAM4 and doubles the symbol rate to 64 GBd. PCI-SIG announced it in 2022 and released it in 2025, targeting the same reach as Gen 6: about 4–14 inches of system board plus 2–4 inches of add-in card through one connector.

Why the encodings changed: 8b/10b (Gen 1–2) guarantees transitions and DC balance but costs 20 %. Gen 3 chose 128b/130b with scrambling (1.5 % overhead) at 8 GT/s rather than going to 10 GT/s with 8b/10b, which delivered the doubling without the harder channel. Gen 6 doubled again without raising the symbol rate by moving to PAM4, and switched to fixed-size FLITs with forward error correction because PAM4's raw error rate is far higher. Each page linked in the table shows one of these steps in detail.

00 · Form factors

Where PCIe shows up physically

Form factorLanesTypical devicesNotes
CEM add-in card (slot)x1, x4, x8, x16GPUs, NICs, HBAs, accelerators75 W from the slot (12 V + 3.3 V), more via auxiliary connectors (12V-2x6 up to 600 W). A smaller card fits a larger slot.
M.2 (M key / B key)x2, x4NVMe SSDs, Wi-Fi (E key, x1)3.3 V only; 2230 to 22110 lengths. B key can also carry SATA or USB.
U.2 / U.3 (SFF-8639)x4 (or 2 × x2)2.5-inch enterprise SSDsHot-pluggable; U.3 (SFF-TA-1001) lets one backplane connector serve SAS, SATA and NVMe drives.
EDSFF: E1.S, E1.L, E3.S, E3.Lx4, x8, x16Data-center SSDs, CXL memory modules, acceleratorsDesigned for airflow and density; E3 also carries CXL devices.
OCuLink (SFF-8611)x4, x8External GPU docks, storage cablingCompact cabled PCIe connector.
MCIO (SFF-TA-1016), CopprLinkx4 to x16Server internal and rack cablesCopprLink (PCI-SIG, 2024) at 32 and 64 GT/s: internal cables on SFF-TA-1016 up to 1 m, external on SFF-TA-1032 up to 2 m.
Chip-downanySwitches, retimers, SSD controllers, Ethernet PHYs on the same boardNo connector: the shortest, cleanest channel.
Tunnelled: Thunderbolt / USB4virtualExternal enclosures, docksPCIe packets carried inside the USB4 transport; the OS sees a normal PCIe hierarchy with hot-plug.
00 · Security and compliance

Encrypting the link, and proving interoperability

IDE: Integrity and Data Encryption
  • Encrypts and authenticates TLPs with AES-GCM in the Transaction layer, giving confidentiality, integrity and replay protection against someone probing or interposing on the link.
  • Added to the PCIe 5.0 generation as an engineering change and part of the base specification from 6.0; CXL has its own IDE.
  • Link IDE protects one link; selective IDE protects a stream between two devices end to end, through switches that just forward it.
  • Keys are set up per stream before it is enabled; the device authenticates itself and exchanges keys through the DOE mailbox and SPDM messages.
Compliance
  • PCI-SIG runs Compliance Workshops where vendors test electrical characteristics, protocol behaviour and interoperability against other members' products.
  • Products that pass go on the PCI-SIG Integrators List; system builders use it to pick parts that are known to work together.
  • In-house validation uses the same tools: protocol analysers to watch link training and packets, and compliance boards and fixtures to measure the transmitter and receiver.
00 · Neighbours

PCIe next to other interconnects

PCIeUSB 3.x / USB4EthernetCXLNVLink
PurposeCPU ↔ devices inside a systemHot-plug peripherals over cablesNetworks between systemsCoherent memory and acceleratorsGPU ↔ GPU (and CPU) bandwidth
Who moves dataDevices master DMA into memoryHost schedules every transferEither end; packets may be droppedLoads and stores via the CPU's coherent fabricGPU memory accesses
AddressingMemory addresses and BDFDevice address + endpointMAC / IP addressesHost physical addressesGPU memory addresses
ReachBoard, slot, short cableUp to a few metresMetres to kilometresBoard, slot (and switch)Board, rack (switch)
Physical layerIts ownIts own (USB4 tunnels PCIe)Its own (many PHYs)PCIe's (Gen 5/6 PHY)Proprietary SerDes
Primerthis pageUSB 3.1 →Automotive Ethernet →Gen 6 + CXL →
00 · Self-check

Questions

Why can a serial lane run hundreds of times faster than one wire of the PCI bus?

It is point to point and terminated (no stubs from other slots), differential (common-mode noise rejected), and carries its own clock (no common-clock or bit-to-bit skew budget). The only timing that matters is within one pair.

What does BDF 03:00.0 mean, and how does software find it?

Bus 3, device 0, function 0. Software enumerates depth first from bus 0, assigning bus numbers to each bridge's secondary side; the device sits on the bus behind the bridge (root port or switch port) that was given bus 3. Its config space is at ECAM base + 3·220.

A BAR reads back FFFF_C000h after writing all ones. How big is the window?

Mask the low 4 type bits: FFFF_C000h. Invert and add one: 0000_4000h = 16 KB. Bit 0 = 0 means memory space, bits 2:1 = 00 means 32-bit, bit 3 = 0 means non-prefetchable.

Why do drivers avoid reading device registers in the fast path?

A read is non-posted: the CPU waits for a completion that takes a full round trip (often a microsecond or more through switches), while a write is posted and costs almost nothing. Fast designs have the device write status into host memory, where the CPU can read it from cache.

Why does an x16 link need no length matching between lanes, when a parallel bus did?

Each lane recovers its own clock, and the receiver realigns the lanes using known boundaries in the training sequences and data blocks, absorbing several nanoseconds of skew. Only the two wires of each pair must match.

00 · Further reading

References

  1. PCI-SIG, PCI Express Base Specification (Revisions 1.0 to 7.0): transaction, data link and physical layers; configuration space; ordering rules.
  2. PCI-SIG, PCI Local Bus Specification 3.0 and PCI-X 2.0: the parallel buses PCIe replaced.
  3. PCI-SIG, CEM, M.2 and CopprLink specifications; SNIA SFF-8639, SFF-TA-1006/1008 (EDSFF), SFF-8611 (OCuLink), SFF-TA-1016 (MCIO).
  4. R. Budruk, D. Anderson, T. Shanley, PCI Express System Architecture, MindShare / Addison-Wesley.
PCIe Gen 4 →PCIe Gen 5 →PCIe Gen 6 →USB 3.1 →CML drivers →