190 likes | 313 Views
Computer Architecture. CS423: Lecture 12 Dynamic Scheduling Jahangir Ikram. COMPARISON . FP PIPELINE VS SCOREBOARD. Revision. EX. IF. ID. A 1. A 2. A 3. A 4. Mem. WB. M 1. M 2. M 7. Divide. Multiple Cycle Floating Point Pipeline. Register File. Scoreboard of CDC 6600.
E N D
Computer Architecture CS423: Lecture 12 Dynamic Scheduling Jahangir Ikram
COMPARISON • FP PIPELINE VS SCOREBOARD
EX IF ID A 1 A 2 A 3 A 4 Mem WB M 1 M 2 .. M 7 Divide Multiple Cycle Floating Point Pipeline
Register File Scoreboard of CDC 6600 EX Mem Read Operands Read Operands WB EX ISSUE Read Operands A 1 A 2 A 3 A 4 Register File M 1 M 2 .. M 7 Read Operands Read Operands Divide Check for WAR Check for RAW, Read Values from Register File when free Check for WAW, FU
Data Hazards • RAW Hazard ADD.D F3, F1, F2 SUB.D F5, F6, F3 • WAW Hazard DIV.D F3, F1, F2 SUB.D F3, F6, F5 • WAR Hazard DIV.D F3, F1, F2 SUB.D F5, F6, F3 ADD.D F3, F6, F7
TRUE and False Dependencies Find Dependencies in this code • DIV.D F0,F2,F4 • ADD.D F6,F0,F8 • S.D F6,0(R1) • SUB.D F8,F10,F14 • MUL.D F6,F10,F8
WAR and WAW Data Dependencies • DIV.D F0,F2,F4 • ADD.D F6,F0,F8 • S.D F6,0(R1) • SUB.D F8,F10,F14 • MUL.D F6,F10,F8
Name Dependencies • WAW and WAR dependencies are also called name dependencies: they do not carry a value between two instructions • Can be removed by avoiding use of the same name: rename the destination register whenever a new value is created • Both compiler (statically) and processor (dynamically) can do that
Register Renaming: Compiler • DIV.D F0,F2,F4 • ADD.D F6,F0,F8 • S.D F6,0(R1) • SUB.D F20,F10,F14 • MUL.D F21,F10,F20 • Only RAW or struc. hazards left
Dynamic Register Renaming • Use some architecture invisible registers for renaming, called rename registers to avoid WAW. • Read and keep a copy of available operands at the time of issue, this will avoid WAR. The values are stored in reservation station.
Tomasulo’s Algorithm LD/ST Wait for Operands Wait for Operands EX TAC Mem Access Mem Access DATA Register FILE Tag Integer Integer Wait for Operands Wait for Operands Wait for Operands EX CDB CDB ISSUE/ Rename to RS ISSUE/ Rename to RS FP FP ADD Wait for Operands Wait for Operands Wait for Operands A 1 A 1 A 2 A 2 A 3 A 3 A 4 A 4 Register FILE Check for RS Wait for Operands Wait for Operands Wait for Operands M 1 M 1 M 2 M 2 .. .. M 7 M 7 Wait for Operands Wait for Operands Wait for Operands Divide Divide Check for RAW
MIPS FP Unit Using Tomasulo’s Algorithm From Instruction Unit FP registers Instruction Queue Load / Store Unit FP Operations Operand Busses Address unit Stop Buffers Reservation Stations Address Data FP multipliers Memory unit FP Adders Common Data Bus (CDB)
Structure of Reservation Station • Qj,Qk: Like scoreboard • Vj, Vk: Contains values of two operands. Value are valid if Qj and Qk is zero • Busy • OpCode • A: For Target address TA or Imm value • Registers have Qi field as before