How the optimum is computed
Each AXI read is split into MRds. Every MRd reserves its worst-case completion space at issue (the completer may split on every RCB boundary), because a root port must advertise infinite completion credits. The read path is then a closed queueing network: a delay stage (pipeline, switches, endpoint) and the upstream link.
where D is the mean completion wire time at the bottleneck link, Z the mean non-link hold time, and X(N) the throughput from approximate MVA with link service variability cs2. R and H are the completion data and header footprint of one read, T its wire time, and L its payload.
Only the mean of the endpoint and switch latency affects saturated throughput; the delay stage is insensitive to the distribution. What costs extra buffer is reservation rounding (misaligned addresses, coarse slots), the head-of-line gap of in-order admission, and variation in completion size on the link. The simulation check runs a discrete-event model of the same closed loop with random latencies.
The theory behind it, and further reading
This is a textbook capacity-planning model from operations research — the kind used for computer systems for decades — applied to a hardware buffer. Each part of the calculator rests on a named result:
- Little’s law (L = λW) is the foundation, used three times: the latency-bound line BW = N·E[L]/(Z+D); the time-weighted reservation E[R·T]/E[T], which samples reads in flight in proportion to how long each is held; and the latency curve, N/X(N). It holds for any distribution.
- Asymptotic bound analysis (the operational laws of Denning and Buzen) gives the two straight lines, N·E[L]/(Z+D) and E[L]/D. They cross at the knee, N* = 1 + Z/D — the bandwidth-delay product counted in reads.
- A closed queueing network: one infinite-server delay station (pipeline, switches, endpoint) and one FIFO server (the link). That only the mean latency matters for saturated throughput is not Little’s law but product-form theory: an infinite-server station is insensitive to its service-time distribution (the BCMP theorem).
- Mean Value Analysis (Reiser and Lavenberg, 1980) computes the curve X(N) around the knee. The cs² term is a standard residual-service correction for non-exponential link service; it is what rounds the corner.
- Pollaczek–Khinchine (M/G/1) gives the link waiting time below saturation, and an M/G/∞ compound-Poisson occupancy sized with a Gaussian tail sets the buffer for a target backpressure probability — the square-root staffing idea from call-centre OR (Halfin–Whitt). Both live in the Python reference’s open regime, not on this page.
- Monte Carlo sampling estimates the per-read moments (sizes, reservations, link times), and discrete-event simulation validates the analytic approximation — the way OR checks any such model.
Queueing and performance modelling
- Lazowska, Zahorjan, Graham and Sevcik, Quantitative System Performance (Prentice Hall, 1984) — the classic on exactly this method: operational laws, asymptotic and balanced bounds, MVA for closed networks. Freely available online from the authors.
- Mor Harchol-Balter, Performance Modeling and Design of Computer Systems: Queueing Theory in Action (Cambridge, 2013) — the best modern intuitive treatment: Little’s law, closed versus open systems, and why the knee looks the way it does.
- Raj Jain, The Art of Computer Systems Performance Analysis (Wiley, 1991) — a practical engineer’s reference: operational laws, MVA, simulation design and validation.
- Bolch, Greiner, de Meer and Trivedi, Queueing Networks and Markov Chains, 2nd ed. (Wiley, 2006) — the rigorous reference for MVA with non-exponential service and for product-form theory.
- Leonard Kleinrock, Queueing Systems, Vol. 1: Theory and Vol. 2: Computer Applications (Wiley, 1975–76) — the foundation for M/G/1 and Pollaczek–Khinchine.
Interconnect and PCIe
- Dally and Towles, Principles and Practices of Interconnection Networks (Morgan Kaufmann, 2004) — credit-based flow control and sizing buffers to the credit round trip: the same problem from the network-on-chip side.
- Jackson and Budruk (MindShare), PCI Express Technology 3.0 (2012) — flow-control credits, tags, completion splitting and RCB, and why a root complex advertises infinite completion credits. It stops at Gen 3; for flit mode, 14-bit tags and Gen 6 onward the PCI-SIG Base Specification is the only authoritative source.
- Jacob, Ng and Wang, Memory Systems: Cache, DRAM, Disk (Morgan Kaufmann, 2007) — the endpoint-latency side: memory-level parallelism and outstanding-request limits, the same Little’s-law trade-off seen from the memory controller.
To read only one: Harchol-Balter for intuition, then Lazowska as the method reference. Between them they cover every equation here except the PCIe-specific overhead accounting.
Config for pcie_cpl_opt.py
Save as a .json file and run python pcie_cpl_opt.py --config file.json --sim to reproduce this point.
Download pcie_cpl_opt.py — the Python reference model (31 KB, no dependencies beyond numpy/matplotlib). It also covers the below-saturation open regime, which this page does not.