EE Primers · Communication interfaces · High-speed serial

PCIe Gen 4: an NVMe SSD talking to a CPU over four lanes at 16 GT/s

PCI Express is a packet-switched, point-to-point serial link. Each lane is two AC-coupled differential pairs, one per direction, running NRZ at 16 GT/s in Gen 4. Bytes are striped across lanes, wrapped in 128b/130b blocks and scrambled; the receiver recovers its own clock and needs no forwarded clock per lane, only a shared 100 MHz reference. This page follows one concrete system, a CPU root port driving an M.2 NVMe SSD on an x4 link, through the signals, the power-up sequence, link training and equalization, the board constraints, and a 4 KB read at the level of individual transaction-layer packets.

Specifications: PCI Express Base Specification 4.0 [1], CEM 4.0 [2], PCI-SIG M.2 [3], NVM Express Base [4].

New to PCIe? Start with PCI Express: how it works and why it exists.

01 · At a glance

Where Gen 4 sits among the generations

Gen 1Gen 2Gen 3Gen 4Gen 5
Transfer rate per lane2.5 GT/s5.0 GT/s8.0 GT/s16.0 GT/s32.0 GT/s
Encoding8b/10b8b/10b128b/130b128b/130b128b/130b
Data per lane, per direction250 MB/s500 MB/s985 MB/s1.97 GB/s3.94 GB/s
x4 link, per direction1.0 GB/s2.0 GB/s3.94 GB/s7.88 GB/s15.75 GB/s
Unit interval (UI)400 ps200 ps125 ps62.5 ps31.25 ps
Nyquist frequency1.25 GHz2.5 GHz4 GHz8 GHz16 GHz
Channel loss budget (approx., ball to ball)——≈ 22 dB≈ 28 dB≈ 36 dB
Refclk jitter limit (common clock)—3.1 ps1.0 ps0.5 ps RMS0.15 ps RMS
  • What Gen 4 changed: doubled the rate over Gen 3 with the same 128b/130b coding, added a second equalization pass at 16 GT/s, made Lane Margining at the Receiver mandatory (the host can step a receiver's sampling point in time and voltage to measure the real eye in-system), defined retimers formally, and added 10-bit tags and scaled flow control so more requests can be in flight to cover the longer latency of a faster link.
  • Layers: Transaction layer (TLPs: memory reads and writes, completions, messages), Data Link layer (sequence numbers, LCRC, ACK/NAK replay, flow-control credits carried in DLLPs), Physical layer (framing, scrambling, 128b/130b, lane striping, SerDes, equalization).
  • Same software model since Gen 1: configuration space, BARs, memory-mapped I/O. A Gen 4 SSD trains down to Gen 3 or lower if the channel or the partner can't do 16 GT/s.
00 · Layers

PCIe against the OSI model

The OSI model splits any communication system into seven layers, each solving one problem and handing a unit of data to the layer below. PCIe defines only three layers of its own (Transaction, Data Link, Physical), and NVMe plus the operating system sit above them. The mapping below is the conventional one; PCIe was not written against OSI, so the edges are approximate. Click a layer to see what it does in this system and where this page covers it. Every section below carries the same layer tags.

One command, wrapped layer by layer

The NVMe read command from the worked example, on its way to the SSD inside a completion TLP. Each layer adds its own header or trailer around the unit from the layer above; the receiver strips them in reverse. Widths are not to scale.
02 · The example system

CPU root port to an M.2 NVMe SSD, x4

Host SoC (CPU) CPU coresNVMe driver Memory ctrlcoherent fabric System DRAMSQ / CQ ringsPRP data buffers Root port TransactionTLPs, credits Data linkseq#, LCRC, ACK Physical128b/130b, scrambleTX FIR · RX CTLE+DFE Clock generator100 MHz HCSL, SSC Host TX → SSD RX · 4 lanes · 16 GT/s AC cap (host) ×4 SSD TX → Host RX · 4 lanes · 16 GT/s AC cap (SSD) REFCLK± 100 MHz (diff) PERST# (reset) CLKREQ# (open-drain) PEWAKE# (open-drain) SMBus (optional, NVMe-MI) 3.3 V power (several pins) + GND M.2M key M.2 2280 NVMe SSD NVMe controller PCIe endpoint PHY/DL/TL NVMe queues + DMA FTL on embedded cores LDPC ECC · NAND IF DRAM cacheL2P map table NANDch 0–1 NANDch 2–3 NANDch 4–5 NANDch 6–7 PMICcore, VCC, VCCQ rails
Each "lane" arrow is four differential pairs. Every pair is AC-coupled at its transmitter end: the host places capacitors on its TX pairs, the SSD carries its own on the module. REFCLK is shared (common-clock architecture), so both ends see the same spread-spectrum modulation. The SSD controller is the PCIe endpoint and the bus master for data: it reads commands from and writes data into host DRAM by DMA.
03 · Signals

Every critical signal on the link

SignalDirectionElectricalFunctionWhat to get right
TX0±…TX3± (host)Host → SSDDifferential NRZ, 16 GT/s, ~0.8–1.2 Vpp,diff launch, 3-tap FIRDownstream data lanes85 Ω diff, AC cap 176–265 nF at the transmitter side, intra-pair skew, insertion loss
RX0±…RX3± (host)SSD → HostSame, received with CTLE + DFE + CDRUpstream data lanesNo caps on the host RX side (they are on the SSD), keep away from TX pairs (NEXT)
REFCLK±Host → SSD100 MHz HCSL (or LP-HCSL), ±300 ppm, SSC down-spread ≤ 0.5 % at 30–33 kHzReference for both PLLs; CDR tracks dataJitter ≤ 0.5 ps RMS (Gen 4 common clock), 85/100 Ω, stable ≥ 100 µs before PERST# releases
PERST#Host → SSDSingle-ended, 3.3 V (1.8 V on newer M.2 hosts)Fundamental reset of the deviceReleased ≥ 100 ms after 3.3 V is stable and ≥ 100 µs after REFCLK is stable
CLKREQ#BidirectionalOpen-drain, pulled up on hostDevice requests REFCLK; deasserts in L1 substates so the host can stop the clockHold low (or route to a clock generator OE) if L1.2 is not used
PEWAKE#SSD → HostOpen-drainWake request from D3coldPull-up on the always-on rail
SMB_CLK / SMB_DATABidirectionalSMBus, open-drainOut-of-band management (NVMe-MI, thermal)Optional on M.2; level of pull-ups
3.3 V, GNDHost → SSD3.3 V ± 5 %, several pinsAll SSD power; PMIC makes core and NAND railsGen 4 SSDs peak 7–9 W; size for transient, keep GND pins tied solidly (they are also the lanes' return)
SUSCLKHost → SSD32.768 kHz, 3.3 VLow-power timer clockOptional
NamingConnector specifications name lanes PETp/PETn and PERp/PERn from one side's point of view, and the two sides of a link use opposite conventions. Write schematic nets as "HOST_TX_TO_SSD" style names and cross-check every pair once: a TX tied to a TX is the most common bring-up error.
04 · Power-up

Power, reference clock, reset, then training

Not to scale. The device's PLL locks to REFCLK while PERST# is held low. After release, the LTSSM must reach Detect within 20 ms. For a port that can run faster than 5 GT/s, software waits 100 ms after link training completes before sending configuration requests; the device may answer with Configuration Request Retry Status while it boots.
Common bring-up failureREFCLK gated by an unhandled CLKREQ#: the clock generator output enable is tied to CLKREQ#, the SSD has not yet driven CLKREQ# low (it is still in reset), so no clock arrives and the device never leaves Detect. Enable the clock unconditionally until the BIOS sets up L1 substates.
05 · Physical layer

128b/130b blocks, scrambling and lane striping

The physical layer does not see packets as a byte stream on one wire. It takes the framed TLP, deals the bytes round-robin across the lanes (byte 0 to lane 0, byte 1 to lane 1, …), and on each lane packs 16 bytes into a 128-bit block preceded by a 2-bit sync header: 10b marks a data block, 01b an ordered-set block (training sets, SKP, electrical idle). The 128 data bits are scrambled with a 23-bit LFSR (x23+x21+x16+x8+x5+x2+1) so the line has frequent transitions and a flat spectrum; the sync headers are not scrambled, which guarantees at least one transition every 130 bits for the CDR.

At Gen 3 and later the TLP is framed by a 4-byte STP token (TLP length, a framing CRC and the 12-bit sequence number) and closed by a 4-byte LCRC. Pick a TLP from the NVMe read below to see how it lands on the four lanes.

00 · Signaling and encoding

Key signaling and encoding schemes in PCIe

Signaling is how a symbol becomes a voltage on the wire (how many levels, single-ended or differential, what driver). Encoding is how data bits are turned into the symbols that are sent, to guarantee transitions for clock recovery, keep the line DC-balanced through the AC capacitors, and mark block and packet boundaries. PCIe has changed its encoding twice and its signaling once.

WhereSignaling (electrical)Encoding / codingWhy it was chosen
Data lanes, Gen 1–2NRZ (PAM2), differential, AC-coupled CML / SST driver8b/10b + scramblingDC balance and a transition at least every 5 bits, at a 20 % bandwidth cost
Data lanes, Gen 3–5 (Gen 4 here)NRZ (PAM2), 2 levels, 1 bit per UI, 3-tap TX FIR128b/130b: 2-bit sync header + 128 scrambled bits; 23-bit LFSR scrambler; framing tokens (STP, SDP, END, EDB)1.5 % overhead instead of 20 %; the scrambler supplies transitions and spectral spreading, the sync header bounds the run length and marks blocks
Data lanes, Gen 6–7 (for contrast)PAM4: 4 levels, 2 bits per UI (32 GBd for 64 GT/s), Gray-coded, optional precodingFLIT mode (1b/1b): fixed 256-byte FLITs with lightweight FEC and CRC; no sync headersDoubles the data rate without doubling the Nyquist frequency; PAM4's smaller eyes raise the raw BER, which FEC corrects
Training and controlSame lanesOrdered sets: TS1, TS2, SKP, EIOS, EIEOS (a low-frequency pattern that wakes receivers from electrical idle)Link training, clock compensation, power-state entry and exit
Reference clock100 MHz HCSL (≈ 0.7 V single-ended swing, current-mode, 50 Ω to ground), SSC down-spreadNone: a clockCommon timing for both PLLs; SSC spreads EMI
Receiver detectCommon-mode step on TX, charge-time sensingNoneFind which lanes have a partner before any data is sent
Sideband (PERST#, CLKREQ#, PEWAKE#, SMBus)LVCMOS 3.3 V or 1.8 V; open-drain for CLKREQ#, PEWAKE#, SMBusStatic levels; SMBus is I²C-likeSlow control that must work before the link exists
06 · Equalization

Transmitter presets and what the receiver sees

At 8 GHz Nyquist a PCB trace loses roughly 0.6–1.2 dB per inch, so a long run plus vias, connector and packages approaches 28 dB: the received signal is a small, smeared copy of what was sent. Both ends fight this. The transmitter uses a 3-tap FIR: a pre-cursor tap (preshoot) and a post-cursor tap (de-emphasis) that lower the steady-state level relative to transitions, a high-pass pre-distortion. The receiver adds a CTLE (continuous-time linear equalizer, analog peaking) and a DFE (decision-feedback equalizer that subtracts the post-cursor ISI of already decided bits).

During link training the receiver asks the far transmitter to try presets P0–P10 and fine coefficient values and keeps the best one. The simulation below runs a PRBS7 pattern through the chosen preset and a lossy channel and folds the result into an eye. It has no receiver equalization, so it shows how much the transmitter alone can do.

PresetP4P1P3P2P0P5P6P9P8P7
Preshoot (dB)000001.92.53.53.53.5
De-emphasis (dB)0−3.5−2.5−4.4−6.0000−3.5−6.0
c−1, c+10, 00, −0.1670, −0.1250, −0.2000, −0.250−0.100, 0−0.125, 0−0.166, 0−0.125, −0.125−0.100, −0.200

Eye simulator · 16 GT/s, PRBS7

07 · Link training

The LTSSM: from Detect to L0 at 16 GT/s

The Link Training and Status State Machine runs in both ports. The link always comes up at 2.5 GT/s first, agrees on width and lane numbers, enters L0, and only then changes speed through Recovery, equalizing at 8 GT/s and again at 16 GT/s. Click a state.

08 · Worked example

A 4 KB NVMe read, packet by packet

The host reads one 4 KB block (eight 512-byte LBAs starting at LBA 1000h) from the SSD. NVMe keeps queues in host memory, so the SSD does almost all the bus traffic: it fetches the command, writes the data and posts the completion by DMA. The CPU touches the link only twice, both times to write a doorbell register. Max payload size (MPS) is 256 bytes.

Hidden trafficEvery TLP above is acknowledged by an ACK DLLP (8 bytes on the wire) flowing the other way, and both ends advertise flow-control credits with UpdateFC DLLPs. A TLP that arrives with a bad LCRC is NAKed and replayed from the transmitter's replay buffer; software never sees it, but the correctable-error counters (AER) do.
Where the time goesThe 4 KB of data occupies the x4 Gen 4 link for about 0.57 µs. The NAND page read takes 50–100 µs. Link speed sets the throughput of many parallel commands (queue depth), not the latency of one.
09 · Throughput

From 16 GT/s to bytes per second

B/W = lanes × rate × 128/130 ÷ 8 × MPS / (MPS + 4 STP + header + 4 LCRC) × (1 − DLLP/SKP share)
10 · Design constraints

Board rules for a 16 GT/s channel

Impedance and loss
  • 85 Ω differential ± 10 % (100 Ω is workable with a small reflection penalty; follow the SoC guide).
  • End-to-end budget about 28 dB at 8 GHz including both packages. Standard FR-4 stripline is ≈ 1.0–1.2 dB/in at 8 GHz; mid-loss ≈ 0.8; low-loss laminates ≈ 0.5–0.6.
  • Over budget: shorten, use better laminate, or add a retimer (a redriver amplifies noise and does not reset the budget).
Skew
  • Intra-pair (P to N) ≤ 5 mil (0.13 mm, ≈ 0.8 ps); compensate near the bend or pin that created it, not at the far end.
  • Lane-to-lane matching is not needed: the receiver deskews several nanoseconds per lane. Do not add serpentine for it.
  • Glass-weave skew: route at an angle to the weave or use spread glass for long runs.
  • Polarity inversion within a pair is always allowed and lane reversal is usually supported: use them to avoid crossovers.
Vias and AC caps
  • Minimise layer changes; each via pair needs adjacent ground return vias.
  • Back-drill or use blind vias so stubs resonate well above 16 GHz (calculator below).
  • AC caps 0201 or 0402, 220 nF typical, placed symmetrically; void the reference plane under the pads to lift their impedance toward 85 Ω.
Crosstalk and return path
  • Separate TX and RX pairs (different layers or wide spacing): a strong local TX next to a weak incoming RX is the worst NEXT case.
  • Pair-to-pair spacing ≥ 3–5 × the dielectric height to the reference plane.
  • Continuous ground reference; never cross a plane split; stitching vias at every reference change.
REFCLK
  • Route as a differential pair with the same care as a lane; keep away from switching regulators.
  • HCSL needs 50 Ω to ground at the source (or use LP-HCSL with internal termination).
  • One fan-out output per device; budget the clock buffer's additive jitter against 0.5 ps RMS.
Sideband and power
  • PERST# driven from a GPIO that is low through power-up; never let it float high.
  • CLKREQ# and PEWAKE# are open-drain: pull-ups on the correct rail.
  • 3.3 V: bulk plus decoupling at the connector; SSD write bursts are fast load steps.
11 · When it breaks

Failure modes and debug signatures

SymptomLikely causeCheck / fix
SSD not enumerated at allNo REFCLK (CLKREQ# gating), PERST# never released or released too early, TX wired to TXScope REFCLK and PERST# against 3.3 V; check LTSSM state register in the root port (stuck in Detect means no receiver termination seen)
Link trains at Gen 3 (8 GT/s) or Gen 1, not Gen 4Equalization at 16 GT/s failed: too much loss, reflections, crosstalkRead the negotiated speed and EQ status bits; run lane margining; check stubs and the loss budget
Link trains x2 or x1 instead of x4One lane open, a missing or wrong AC cap, a lane swapped without reversal supportCheck which lanes are missing; continuity and cap placement
Correctable errors increasing (Bad TLP, Bad DLLP, Replay rollover)Marginal eye; errors fixed by replay but throughput dropsAER counters per port; lane margining to find the weak lane; temperature dependence
Drops off the bus after idleL1.2 exit: CLKREQ# not wired or REFCLK not restarted in timeDisable ASPM L1 substates to confirm, then fix the CLKREQ# path
Fails only with spread spectrum onSeparate clocks used with SSC (not SRIS-capable)Use common REFCLK, or enable SRIS mode on both ends
12 · Self-check

Questions

What is the raw bandwidth of a Gen 4 x4 link in one direction, and what does an SSD actually achieve?

4 × 16 GT/s × 128/130 ÷ 8 = 7.88 GB/s. With 256-byte payloads, 24 bytes of TLP framing and a few percent of DLLPs, about 7.0–7.2 GB/s is available; Gen 4 SSDs advertise around 7 GB/s sequential reads.

Why are the AC coupling capacitors at the transmitter end and not on both ends?

One series capacitor per line is enough to block DC between the two ends' common-mode voltages. Placing them at each transmitter's side means each board (host and add-in card) carries the caps for the pairs it drives, so any card works in any slot. Receiver detection also relies on sensing the far termination through this capacitor.

Why don't the four lanes need to be length matched?

Each lane recovers its own clock, and the receiver aligns lanes using the block boundaries and training sets, with several nanoseconds of deskew per lane. Only the P and N of each pair must match.

Who moves the 4 KB of data in an NVMe read, the CPU or the SSD?

The SSD. It is a bus master: it fetches the command with a memory read and writes the data into host memory with posted memory writes. The CPU only writes the submission doorbell and the completion doorbell.

A link trains at 8 GT/s on one board and 16 GT/s on another of the same design. Where do you look first?

Equalization at 16 GT/s. Compare lane margining results, then the channel: laminate lot (loss), via stub length (back-drill depth), and the AC cap and connector region for impedance discontinuities.

13 · Further reading

References

  1. PCI-SIG, PCI Express Base Specification, Revision 4.0: Physical Layer (Ch. 4), Data Link Layer (Ch. 3), Transaction Layer (Ch. 2), Reset (6.6).
  2. PCI-SIG, PCI Express Card Electromechanical Specification, Revision 4.0: REFCLK, PERST#, CLKREQ#, channel budget allocation.
  3. PCI-SIG, PCI Express M.2 Specification: M-key pinout, sideband signals and voltages.
  4. NVM Express, NVM Express Base Specification: submission and completion queues, doorbells, PRP lists, MSI-X.
  5. SoC and SSD-controller platform design guides (e.g. Intel PDG, AMD, NVIDIA Jetson, Phison/Marvell reference designs) for the board-level numbers used on a real design.
USB 3.1 →Automotive Ethernet →CML drivers →DDR4 →