Tom Kelliher, CS 220
Nov. 21, 2011
Date for second exam?
Single-cycle implementation.
Pipeline hazards.
The laundry analogy:
![\begin{figure}\centering\includegraphics[width=4in]{Figures/f0601.eps}\end{figure}](nov21img1.png) 
The five stage MIPS pipeline:
The consistent placement of the source registers permits this.
Assume:
Instruction class times:
| Instruction | Register | ALU | Data | Register | Total | |
| Instruction Class | fetch | read | operation | access | write | time | 
| lw | 200 ps | 100 ps | 200 ps | 200 ps | 100 ps | 800 ps | 
| sw | 200 ps | 100 ps | 200 ps | 200 ps | 700 ps | |
| R-format | 200 ps | 100 ps | 200 ps | 100 ps | 600 ps | |
| beq | 200 ps | 100 ps | 200 ps | 500 ps | 
Clock periods for the two implementations?
Execution example:
![\begin{figure}\centering\includegraphics[width=6in]{Figures/f0603.eps}\end{figure}](nov21img2.png) 
Note that pipelined register file reads are done during the second half of the clock cycle and writes are done during the first half. Why?
Consider the speedup:
Do we achieve that?
Consider the execution of 1,000 instructions and compute the actual speedup.
What happened? The cost of the pipeline registers.
Consider:
sw/lw instructions:
simplifies pipeline design and decreases pipeline depth.