Skip to guide

Part 4 · Performance labs

CPI, MIPS, AMAT, storage, and EMAT

Work the quantitative problems with explicit hit-rate denominators, timing assumptions, units, and reproducible intermediate steps.

Reason cycle by cycle, calculate the cost of misses and stalls, and explain why each implementation choice changes performance or correctness.

Updated July 20261 connected chaptersInteractive labs + worked examples

Worked problems

Carry the probability through the hierarchy.

State the timing convention, convert percentages to probabilities, and multiply a penalty only by the fraction of instructions or accesses that actually pay it.

01

Pipeline CPI and MIPS

CPI = 1 + 0.25(0.20)(3) + 0.20(0.30)(1)

Branch misses add 0.15 CPI. Load-use stalls add 0.06 CPI.

CPI = 1.21MIPS = 2,500 MHz / 1.21 = 2,066.12
02

Three-level AMAT tradeoff

2 + 0.10(10 + 0.20 × 60) = 4.2 ns

With the proposed slower but higher-hit L2:

2 + 0.10(12 + 0.05 × 60) = 3.5 nsThe proposal improves AMAT by 0.7 ns, or 16.7%.
03

1 MiB, 8-way, 64-byte PIPT tag array

lines = 2²⁰ / 2⁶ = 2¹⁴ sets = 2¹⁴ / 2³ = 2¹¹ offset = 6 bits · index = 11 bits

For the source's implied 34-bit physical address, tag = 34 − 11 − 6 = 17 bits. Including one valid bit per line:

(17 + 1) × 2¹⁴ = 294,912 bits288 Kibit = 36 KiB
04

Write-back L1, write-through L2 CPI

memory-op fraction = 0.20 + 0.10 = 0.30expected data time = 0.30 × [2 + 0.10(15 + 0.20×70 + 0.40×15)] = 1.65 ns/instruction

The prompt supplies nanoseconds but no processor clock period, so a unique CPI cannot be derived. For clock period T in ns:

CPI = 1 + 1.65 / TAt T = 1 ns, CPI = 2.65. If the base pipeline already includes the 2 ns L1 hit, count only miss overhead: CPI = 1 + 1.05/T, or 2.05 at T = 1 ns.
05

Four-level page-table EMAT

The translated 48-bit virtual address splits into four nine-bit indexes and a 12-bit offset. A 40-bit physical address has a 28-bit PPN plus that offset. Eight-byte PTEs make each 512-entry page-table level exactly 4 KiB.

translation = 1 + 0.01(4 × 100) = 5 cyclesdata access = 1 + 0.05(100) = 6 cycles

A TLB miss pays four uncached PTE reads. The subsequent L1 lookup still occurs, and an L1 miss pays one DRAM access. This exercise uses the source's serial TLB-then-cache timing model; a VIPT implementation may overlap part of those hit paths.

EMAT = 5 + 6 = 11 cycles

Continue the system

Connect the adjacent layer.