1. Performance
1.1 Execution time (Iron Law)
$T = \text{IC} \times \text{CPI} \times T_c$
- IC: dynamic instruction count, meaning the instructions actually executed.
- CPI: average cycles per instruction.
- $T_c$: clock period (seconds per cycle).
- Use it whenever a change affects more than one of the three terms, for example fewer instructions but a slower clock. Compare the old and new products, never just the CPIs.
$\text{IPC} = \frac{1}{\text{CPI}}$
1.2 Speedup
$S = \frac{T_{old}}{T_{new}} = \frac{(\text{IC}\times\text{CPI}\times T_c){old}}{(\text{IC}\times\text{CPI}\times T_c){new}}$
- $S > 1$ means faster and $S < 1$ means slower.
- "X% faster" means $S = 1 + X/100$
- Example (Tutorial 2, 1.5): BLT instructions remove 10% of instructions but make the clock 5% slower.
$S = \frac{1.0 \times 1.49 \times T_c}{0.90 \times 1.5444 \times 1.05,T_c} = \frac{1.49}{1.4595} \approx 1.021$
1.3 Average (weighted) CPI
$\text{CPI} = \sum_i p_i \times \text{CPI}_i$
- $p_i$ is the fraction of instructions of type $i$, and $\text{CPI}_i$ is the cycles each one takes.
- Example (Tutorial 2, 1.5): $0.40(1)+0.25(2)+0.10(1)+0.08(1)+0.12(3)+0.05(1) = 1.49$.
1.4 CPI after removing instructions (renormalize)