Skip to content

Commit 19f0560

Browse files
Update README.md
1 parent dae6301 commit 19f0560

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ To fix this, I split the execute stage into two stages, similar to the approach
3737

3838
This reduced the critical path from 19 logic levels to 7, closing timing at 100 MHz with +0.135 ns of slack. The tradeoff is that mispredictions now flush 3 stages instead of 2, adding one cycle of branch latency. But a pipelined processor's performance is determined by throughput, not single-instruction latency. Throughput = IPC × frequency, and the 56% frequency gain (64 → 101 MHz) far exceeds the minor IPC reduction from the occasional extra flush cycle. The gshare predictor with BTB and RAS further minimizes the IPC impact by predicting both direction and target in the fetch stage, so the deeper pipeline rarely pays the full 3-cycle penalty in practice.
3939

40+
The simulation numbers from the comprehensive test suite (which includes 8 multi-cycle divides at 33 cycles each, making it a worst-case workload for IPC) confirm this:
41+
42+
| Metric | 5-stage @ 64 MHz | 6-stage @ 101 MHz |
43+
|--------|------------------|-------------------|
44+
| Frequency | 64.3 MHz | 101.4 MHz |
45+
| Cycles (comprehensive test) | 329 | 342 |
46+
| Instructions retired | 99 | 87 |
47+
| IPC (measured, divide-heavy) | 0.30 | 0.25 |
48+
| Throughput (MIPS) | 19.3 | 25.4 |
49+
| **Throughput improvement** || **+31%** |
50+
51+
The IPC dropped from 0.30 to 0.25 (17%) due to the deeper pipeline and additional stall cycles around multi-cycle operations, but the frequency increased by 56%, yielding a net throughput gain of 31% even on a divide-heavy workload. On integer-only code without divides, the IPC difference between the two designs is much smaller (the extra pipeline stage only costs cycles on mispredictions and load-use hazards), and the throughput advantage of the 6-stage design would be closer to the full 56%.
52+
4053
## Pipeline Architecture
4154

4255
![6-Stage Pipeline Diagram](docs/pipeline.svg)

0 commit comments

Comments
 (0)