Professional Documents
Culture Documents
Midterm Recap: Performance Evaluation
Midterm Recap: Performance Evaluation
Basic concepts
Midterm Recap
Response time
Throughput
Speedup
CPI
IPC
Sections 1.1 ~ 1.4, 1.8~1.10,
Amdahl’s law
Sections 2.1, 2.4 ~ 2.8,
Appendices A&B
1
Basics of MIPS Pipelined 5-Stage Data Path
Instruction format
I-type, R-type, J-type
Instruction types
ALU, load/store, control, FP
5-stage pipeline
IF, ID, EX, MEM, WB
2
MIPS Five-Stage Pipeline With/
Dependences vs. Hazards
Without Data Forwarding
Data
Without data forwarding
i: ADD R3, R1, R2
RAW (if j gets the “old” j: ADD R5, R3, R4
value of R3) Resultexchanges via register file
Anti i: ADD R3, R2, R1
Producer: WB consumer: ID
WAR (if i gets the “new”
With data forwarding
j: ADD R2, R4, R5
value of R2)
Result produced result used
Output i: ADD R3, R2, R1
WAW (if final result in R3 is
j: SUB R3, R4, R5
produced by i)
3
Tomasulo Components Three Stages of Tomasulo Algorithm
RS entry 1.
Issue—get instruction from Inst Queue
Op—Operation to perform in the unit If reservation station free (no structural hazard),
Vj, Vk—Value of source operands control issues inst & sends operands (renames registers).
2.
Execution—operate on operands (EX)
Qj, Qk—Reservation stations producing source
When both operands ready then execute;
registers if not ready, watch Common Data Bus for result
Qj,Qk = 0 ready 3.
Write result—finish execution (WB)
Write on Common Data Bus to all awaiting units;
Busy—Indicates reservation station or FU is busy mark reservation station available
Register result status
Nospeculation
Indicates which RS will write each register
In-orderissue, out-of-order execution, and out-of-order
Blank: no pending instructions writing the register completion
4
Dynamic Scheduling vs.
Reorder Buffer
Speculative Execution
Dynamic scheduling (w/o speculation) Contain all in-flight instructions
A branch must be resolved before actually executing any
instructions in the successor basic block (those instruction Reorder out-of-order inst to program
can be issued)
Issue, Exec, Memory (R/W), Write CDB order at the time of writing reg/
Speculative execution (using dynamic scheduling) memory (commit)
Allow the execution of later instructions before the branch
is resolved (with the ability to undo the effect of an Buffer results/supply operands between
incorrectly speculated sequence)
Issue, Exec, Read memory, Write CDB, Commit (Write execution complete and commit
memory)