EE Primers · Communication interfaces · Parallel bus

PCI: how the parallel bus works, cycle by cycle

Conventional PCI (1992) is a shared, synchronous, multiplexed parallel bus: 32 or 64 address/data lines, a handful of control lines, and one clock that every device on the bus uses. One master at a time wins the bus from a central arbiter, puts an address on the lines, and then moves data in a burst while master and target pace each other with two ready signals. Its signaling deliberately relies on reflections from the unterminated end of the bus. Everything software sees in PCI Express today (configuration space, BARs, bus numbers, bridges) was defined here. This page walks through the electrical layer, a transaction clock by clock, arbitration, configuration and interrupts, bridges, and PCI-X.

Next: PCI Express: how it works and why it replaced PCI. Specification: PCI Local Bus Specification [1].

01 · At a glance

PCI in one minute

What it is
  • A shared bus: every device connects to the same AD[31:0] lines. Only one transfers at a time, in one direction at a time (half duplex).
  • Synchronous: all signals are sampled on the rising edge of one 33 MHz (or 66 MHz) clock.
  • Multiplexed: the same AD lines carry the address in the first clock and data afterwards.
How data moves
  • A master requests the bus (REQ#), gets a grant (GNT#), starts a transaction with FRAME#, and the addressed target claims it with DEVSEL#.
  • Data moves on every clock edge where both IRDY# (master ready) and TRDY# (target ready) are low. Either side can insert wait states.
  • Transfers are bursts of any length; the address increments implicitly.
Numbers
  • 133 MB/s peak (32-bit, 33 MHz) shared by all devices; 266 MB/s at 32-bit/66 MHz or 64-bit/33 MHz; 533 MB/s at 64-bit/66 MHz.
  • 5 V or 3.3 V signaling, set by the connector key.
  • Typically about four slots at 33 MHz, two at 66 MHz.
00 · Layers

PCI against the OSI model

PCI is a bus, not a network, so its "layers" are thin. The specification defines the electrical interface and the bus protocol, plus the configuration and address-decoding rules that let bridges build a hierarchy. There is no packet format and no retransmission: an error is reported, not corrected. Click a layer; the sections below carry the same tags.

00 · The example system

A host bridge, three slots and a PCI-to-PCI bridge

CPUfront-side bus DRAM Interrupt ctrlPIC / I/O APIC Host bridge (north bridge) · bus 0 owner ArbiterREQ#/GNT# per slot Config accessCF8h / CFCh Clock33 MHz per slot PCI bus 0, bused to every slot:AD[31:0], C/BE[3:0]#, PAR, FRAME#,IRDY#, TRDY#, DEVSEL#, STOP# point-to-point per slot: REQ#, GNT#, CLK, IDSEL (from one AD line) Slot 1NIC Slot 2SCSI HBA Slot 3sound card PCI-to-PCI bridgeType 1 headerprimary 0 · secondary 1own arbiter and clocks bus 1 → INTA#–INTD#, rotated per slot →
The data path (AD, C/BE#, PAR) and transaction control (FRAME#, IRDY#, TRDY#, DEVSEL#, STOP#) are bused to every slot. REQ#, GNT#, CLK and IDSEL are private per slot. The host bridge translates CPU accesses into PCI cycles, holds the arbiter, and turns the I/O ports CF8h/CFCh into configuration cycles. A PCI-to-PCI bridge starts a new bus with its own loads and timing budget.
00 · Signals

The signals on a PCI slot

A trailing # means active low: asserted at the low voltage. Control signals are sustained tri-state: the device that drove one low must drive it high for one clock before releasing it, and a pull-up on the motherboard holds it high while nobody drives it.

SignalDriven byTypeFunction
CLKSystem, one per slotin33 or 66 MHz; everything is sampled on its rising edge
RST#SysteminReset
AD[31:0]Master (address, write data) / target (read data)tri-stateMultiplexed address and data
C/BE[3:0]#Mastertri-stateBus command in the address phase; byte enables in data phases
PARWhoever drove AD one clock earliertri-stateEven parity over AD[31:0] and C/BE[3:0]#
FRAME#Mastersustained tri-stateTransaction in progress; deasserted when the last data phase begins
IRDY#Mastersustained tri-stateInitiator ready: write data valid, or ready to accept read data
TRDY#Targetsustained tri-stateTarget ready: read data valid, or ready to accept write data
DEVSEL#Targetsustained tri-state"I decoded this address and claim the transaction"
STOP#Targetsustained tri-stateTarget asks to end the transaction (retry, disconnect, abort)
IDSELHost bridge, via one AD line per slotinChip select for configuration cycles
REQ#, GNT#Master / arbiterpoint to pointBus request and grant
LOCK#Mastersustained tri-stateExclusive access (atomic read-modify-write); rarely used
PERR#, SERR#Anys/t/s, open drainData parity error; system error (address parity, fatal)
INTA#–INTD#Deviceopen drain, levelShared, level-triggered interrupts
REQ64#, ACK64#, AD[63:32], C/BE[7:4]#, PAR64Master / target64-bit extension64-bit data path, negotiated per transaction
PRSNT1#, PRSNT2#Card (to ground)staticCard present and power class: 7.5, 15 or 25 W
M66EN, PME#, 3.3VauxCard / systemstatic, open drain66 MHz capable; power-management wake; standby power (2.2+)
00 · Electrical

Reflected-wave switching and the timing budget

PCI drivers are deliberately weak. A driver switches the line only about halfway, and the bus is left unterminated at its far end, so the wave reflects back at full height: the far end sees the incident wave plus its reflection, double the launched step, and receivers along the way reach a valid level when the reflection passes them. This saves power and termination parts, and lets cheap CMOS drivers run a bus with many stubs. The price is time: a receiver near the driver is not valid until the wave has run to the end and back.

The clock period at 33 MHz (30 ns) is split into four budgets: the driver's clock-to-valid time Tval (≤ 11 ns), the propagation and settling time on the bus Tprop (≤ 10 ns), clock skew between devices Tskew (≤ 2 ns) and the receiver's setup time Tsu (≥ 7 ns). At 66 MHz (15 ns) every term halves: 6, 5, 1 and 3 ns, which is why the bus can only be half as long and carry half the loads.

Reflected-wave simulator

3.3 V signaling; a receiver reads high above 0.5 VCC (1.65 V). The far end is modelled as an open circuit (reflection coefficient +1); the driver end reflects with (Rs − Z0)/(Rs + Z0). A lossless lattice model: real buses add stub ringing and capacitive slowing.

5 V and 3.3 V
  • PCI 1.0 used 5 V signaling; 2.0 added 3.3 V. The connector key stops a card being plugged into a slot of the wrong signaling voltage: the 3.3 V key is at pins 12/13, the 5 V key at pins 50/51.
  • Universal cards have both notches and take their I/O voltage from the slot's VI/O pins.
  • PCI 2.3 (2002) dropped 5 V-only cards; PCI 3.0 (2004) dropped 5 V motherboard slots.
Loading and layout rules
  • A 33 MHz bus budgets roughly ten electrical loads; each slot with its card counts for more than one, so about four slots. At 66 MHz: two connectors, or four soldered-down devices.
  • Short stubs: on an add-in card each shared signal may run only about 1.5 inches from the connector to the chip, and must present one load.
  • CLK is routed point to point to every device with matched lengths, to stay inside the 2 ns skew budget.
Connector
  • Card-edge connector, 62 contacts per side for 32-bit (minus the key positions); 64-bit adds 32 per side.
  • Power: 5 V, 3.3 V, ±12 V; the card's PRSNT pins declare 7.5, 15 or 25 W.
  • Many ground pins: they are the return path for the single-ended bus.
00 · Bus cycles

A transaction, clock by clock

Every PCI transaction has one address phase (one clock: address on AD, command on C/BE#, FRAME# asserted) followed by one or more data phases. Signals change shortly after a rising clock edge and are sampled at the next one. A data phase completes on any rising edge where IRDY# and TRDY# are both low; otherwise it is a wait state. The master signals the last data phase by deasserting FRAME# while asserting IRDY#. On a read, AD changes hands from master to target, which needs a turnaround clock where nobody drives it. Build a transaction:

Transaction builder

C/BE[3:0]#CommandC/BE[3:0]#Command
0000Interrupt Acknowledge1010Configuration Read
0001Special Cycle (broadcast, nobody claims it)1011Configuration Write
0010I/O Read1100Memory Read Multiple (prefetch several lines)
0011I/O Write1101Dual Address Cycle (64-bit address in two clocks)
0110Memory Read1110Memory Read Line (one cache line)
0111Memory Write1111Memory Write and Invalidate (whole lines)

0100, 0101, 1000 and 1001 are reserved. In data phases C/BE[3:0]# are byte enables: low means that byte lane carries valid data.

00 · Endings and latency

Who may stop a transaction, and how long anyone may wait

EndingSignalsMeaningWhat the master does
NormalMaster deasserts FRAME# for the last phaseAll data transferredReleases the bus
RetrySTOP# without TRDY#, before any dataTarget busy (or starting a delayed transaction)Must repeat the same transaction later
DisconnectSTOP# with or after TRDY#Target can take no more data in this burstStarts a new transaction for the rest, at the next address
Target-abortSTOP# asserted, DEVSEL# deassertedFatal error at the targetMust not retry; reports the error
Master-abortNo DEVSEL# by the subtractive-decode clockNobody owns the addressEnds the cycle; reads typically return all ones (FFFFFFFFh), which is how enumeration finds empty slots
Latency rules (PCI 2.1+)
  • A target must complete the first data phase within 16 clocks of FRAME#, or signal retry.
  • Each later data phase must complete within 8 clocks.
  • A slow target (a bridge that must fetch data from far away) therefore retries and fetches in the background: a delayed transaction. The master's repeat attempt later finds the data ready.
Parity
  • PAR covers AD[31:0] and C/BE[3:0]# with even parity and is driven one clock after the bits it protects.
  • A receiver that sees a data parity error asserts PERR#; an address parity error asserts SERR#, usually a system-level NMI.
  • There is no retransmission: PCI detects errors but does not correct them. PCIe's LCRC and replay fix this.
00 · Arbitration

Sharing the bus: REQ#, GNT# and the latency timer

Each master has a private REQ#/GNT# pair to a central arbiter in the host bridge. Arbitration is hidden: the arbiter can grant the next master while the current transaction is still running, so the new owner starts as soon as the bus goes idle. The arbitration algorithm is not specified (round robin is common), and the arbiter may park the grant on one master when nobody is asking. A master whose grant has been removed must end its burst when its latency timer (a config register, in clocks) expires, which caps how long one device can hold the bus.

Bus-sharing simulator: three masters, round-robin arbiter

All three masters request continuously. Each transaction: 1 address clock + initial latency + data phases (one per clock, no later waits) + 1 idle turnaround clock. When the timer expires and another master is waiting, the owner stops at that point and requests again.

00 · Configuration

Configuration cycles, IDSEL and CF8h/CFCh

Every function has 256 bytes of configuration space: Vendor and Device ID, Command and Status, Class Code, Header Type, BARs, Interrupt Pin and Line, and a capability list. Configuration cycles need a way to reach a card before it has any address assigned, so PCI uses a separate select line, IDSEL: each slot's IDSEL is wired (usually through a resistor) to a different upper AD line, and a Type 0 configuration cycle drives exactly one of those lines high in the address phase, selecting one slot. The low AD bits carry the function and register number.

For a bus behind a bridge, the host issues a Type 1 cycle carrying the bus, device, function and register numbers. Each bridge checks the bus number against its secondary-to-subordinate range, forwards the cycle, and the bridge whose secondary bus matches converts it into a Type 0 cycle with the right IDSEL. On PCs the CPU starts all this by writing an address to I/O port CF8h (CONFIG_ADDRESS) and reading or writing I/O port CFCh (CONFIG_DATA): configuration mechanism #1.

Configuration access

IDSEL wiring is board-specific; this example uses the common arrangement where device n on bus 0 has IDSEL on AD[16 + n]. Only devices whose IDSEL line exists on the board can be reached; scanning the others gives master-abort and all-ones data.

Discovery and setup then work exactly as they still do in PCIe: read the Vendor ID of every possible device (FFFFh means empty), check the Header Type for multi-function devices and bridges, number the buses behind bridges depth first, size each BAR by writing all ones and reading back, assign address ranges, and enable memory/I/O decoding and bus mastering in the Command register. The PCIe overview has interactive BAR-sizing and enumeration walkthroughs.

00 · Interrupts

INTA#–INTD#, sharing and the swizzle

PCI has four interrupt wires, INTA# to INTD#. They are level-triggered and open-drain, so several devices can share one: each holds the line low until its driver services it, and the handler polls every device on that line. A single-function device uses INTA#. To stop every card piling onto the same wire, the motherboard rotates the connections slot by slot, and a PCI-to-PCI bridge rotates the lines of the devices behind it by device number, the swizzle: pin at the bridge = (pin + device number) mod 4. The firmware's routing tables (MP tables, ACPI _PRT) tell the OS which interrupt input each slot's pins finally reach. PCI 2.2 added MSI, interrupts as memory writes, which PCIe made the norm.

Interrupt swizzle through a PCI-to-PCI bridge

00 · Bridges and hierarchy

PCI-to-PCI bridges, and what PCIe inherited

What a bridge does
  • Starts a new electrical bus: its own loads, clock tree, arbiter and timing budget. This was how a system got more than four slots.
  • Has a Type 1 configuration header: primary, secondary and subordinate bus numbers, plus memory, prefetchable-memory and I/O base/limit windows.
  • Forwards a transaction downstream if its address falls in a window (positive decode), upstream if it does not.
How it stays fast
  • Posted writes: the bridge accepts write data into a buffer and completes the cycle at once, then forwards it.
  • Delayed reads: it retries the master, fetches the data on the other side, and completes when the master returns.
  • Ordering rules (a read pushes earlier posted writes ahead of it) keep producer-consumer software correct across bridges.
Defined by PCIIn PCI Express
Configuration space, Vendor/Device/Class IDs, Header Type 0/1Unchanged; extended from 256 B to 4 KB
BARs and sizing by writing all onesUnchanged
Bus:Device.Function, Type 0/Type 1 configurationUnchanged, as configuration TLPs; ECAM replaces CF8h/CFCh
PCI-to-PCI bridge, primary/secondary/subordinate, windowsEvery root port and switch port is a virtual PCI-to-PCI bridge
Posted writes, delayed reads, ordering rulesPosted / non-posted / completion TLPs with the same ordering model
INTA#–INTD#Emulated as Assert/Deassert_INTx messages; MSI/MSI-X preferred
Shared bus, arbitration, FRAME#/IRDY#/TRDY#, reflected waveGone: point-to-point serial links, packets, credits
00 · Bandwidth

133 MB/s peak, and what a device actually gets

Peak bandwidth assumes a data phase on every clock. Real transactions pay for the address phase, the target's initial latency, the turnaround and arbitration, and short bursts pay those costs often. And whatever is left is shared by every device on the bus.

00 · PCI-X

PCI-X: the last push for the parallel bus

PCI-X (1998) kept PCI's signals, connector and software model but changed the protocol so it could run faster in servers. PCI-X 2.0 (2003) doubled and quadrupled the data rate before PCI Express replaced it.

PCIPCI-X 1.0PCI-X 2.0
Clock / transfer rate33, 66 MHz66, 100, 133 MHz133 MHz clock; 266 MT/s (DDR), 533 MT/s (QDR)
Peak, 64-bit266, 533 MB/s533 MB/s – 1.06 GB/s2.13 GB/s, 4.27 GB/s
Signaling5 V / 3.3 V, reflected wave3.3 VMode 2: 1.5 V, source-synchronous strobes for DDR/QDR data
TimingInputs used in the same clockRegistered: inputs captured in a flip-flop and acted on one clock later, so decode gets a whole cycleSame
Request informationAddress + commandPlus an attribute phase: requester's bus/device/function, a tag, total byte count, relaxed-ordering and no-snoop hintsSame
Slow targetsRetry and delayed transactionsSplit transactions: the target answers "split response" and later sends a split completion back to the requester, identified by its ID and tagSame
Wait statesEither side, any data phaseMuch more restricted; masters cannot insert waitsSame
Error protectionParity (detect only)ParityECC on data and header (Mode 2)
Slots per bus~4 at 33 MHz, 2 at 66 MHzAt most twoFewer still at the highest rates
The bridge to PCIeRequester IDs, tags, byte counts, split completions, relaxed ordering and no-snoop all reappear in PCI Express as fields of every TLP. PCI-X worked out the transaction model; PCIe replaced the wires underneath it.
00 · History

PCI versions

VersionYearChange
1.0199232-bit, 33 MHz, 5 V signaling; optional 64-bit
2.01993Connector and add-in card specification; 3.3 V slots
2.11995Optional 66 MHz; latency rules made mandatory
2.21998ECNs incorporated, Mini PCI, PME#; MSI
2.320023.3 V signaling support required; 5 V-only cards removed
3.020045 V keyed system-board connector removed
00 · Self-check

Questions

On which clock edges does data actually move in a PCI burst?

On every rising edge where IRDY# and TRDY# are both sampled low. Any edge where either is high is a wait state.

Why does a read need a turnaround clock that a write does not?

The master drives AD with the address in the address phase. On a read the target must drive the data, and two drivers must never fight: the master releases AD, one clock passes with nobody driving, then the target takes over. On a write the master keeps driving AD, so no turnaround is needed.

How does the master tell the target which data phase is the last?

It deasserts FRAME# at the same time as it asserts IRDY# for the final data phase. FRAME# high with IRDY# low means "this is the last one".

Why does PCI's reflected-wave signaling make the bus slower near the driver?

The driver launches only about half the swing. Receivers near the driver see that half-height step, below the input threshold, until the wave reaches the open far end and reflects back. The worst-case receiver therefore waits for a full round trip.

A device behind a bridge at device number 2 uses INTB#. Which pin does it reach at the bridge?

(INTB = 1, + 2) mod 4 = 3: INTD#.

00 · Further reading

References

  1. PCI-SIG, PCI Local Bus Specification, Revisions 2.2 and 3.0: electrical (Ch. 4), protocol (Ch. 3), configuration (Ch. 6).
  2. PCI-SIG, PCI-to-PCI Bridge Architecture Specification 1.2, and PCI-X Addendum to the PCI Local Bus Specification 1.0 and 2.0.
  3. T. Shanley, D. Anderson, PCI System Architecture, MindShare / Addison-Wesley; D. Abbott, PCI Bus Demystified.
  4. Wikipedia: Peripheral Component Interconnect; OSDev: PCI; Connect Tech: PCI-X bus technology.
PCIe overview →PCIe Gen 4 →Tri-state drivers →Open-drain drivers →