31.01.2015 Views

Problem 1: Loop Unrolling [18 points] In this problem, we will use the ...

Problem 1: Loop Unrolling [18 points] In this problem, we will use the ...

Problem 1: Loop Unrolling [18 points] In this problem, we will use the ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>In</strong>struction Reservation Station IS EX WR Comments (if appropriate)<br />

L.D F2, 0(R1) <strong>In</strong>teger 1 1 2 3<br />

L.D F4, 8(R1) <strong>In</strong>teger 2 2 3 4<br />

DIV.D F6,F2,F4 FP Mul/Div 1 3 5-19 20 RAW on F4<br />

MUL.D F8,F6,F6 FP Mul/Div 2 4 26-40 41 RAW on F6, Structural Hazard on FU<br />

ADD.D F6,F2,F4 FP Add 1 5 6-9 10<br />

MUL.D F10,F6,F6 FP Mul/Div 3 6 11-25 26 RAW on F6<br />

S.D F8, 0(R1) <strong>In</strong>teger 1 7 42 RAW on F8<br />

S.D F10, 8(R1) <strong>In</strong>teger 2 8 27 RAW on F10<br />

DADDI R1,R1,16 <strong>In</strong>teger 3 9 10 11<br />

BNEZ R1, LOOP <strong>In</strong>teger 4 10 12 RAW on R1<br />

L.D F2, 0(R1) <strong>In</strong>teger 3 11 13 14 Structural Hazard on FU<br />

L.D F4, 8(R1) <strong>In</strong>teger 5 12 14 15 Structural Hazard on FU<br />

DIV.D F6,F2,F4 FP Mul/Div 4 13 20-34 35 RAW on F2 and F4, Str. Haz. On FU<br />

MUL.D F8,F6,F6 FP Mul/Div 1 20 41-55 56 Str. Haz. on Reservation Station + FU<br />

ADD.D F6,F2,F4 FP Add 1 21 22-25 27 CDB Conflict<br />

MUL.D F10,F6,F6 FP Mul/Div 3 26 35-49 50 RAW on F6, Str. Haz. on Res. Sta. + FU<br />

S.D F8, 0(R1) <strong>In</strong>teger 3 27 57 RAW on F8<br />

S.D F10, 8(R1) <strong>In</strong>teger 2 28 51 RAW on F10<br />

DADDI R1,R1,16 <strong>In</strong>teger 4 29 30 31<br />

BNEZ R1, LOOP <strong>In</strong>teger 5 30 32 RAW on R1<br />

Table 2. Execution profile using Tomasulo’s algorithm.<br />

<strong>Problem</strong> 3 [8 <strong>points</strong>]<br />

Part A [3 <strong>points</strong>]<br />

What technique does Tomasulo’s employ to eliminate WAR and WAW hazards Why does it<br />

work Why doesn’t it also eliminate RAW<br />

Tomasulo’s <strong>use</strong>s register renaming to avoid <strong>the</strong>se hazards. It works beca<strong>use</strong> by changing <strong>the</strong><br />

5<br />

destination registers, <strong>the</strong> 2 instructions which ca<strong>use</strong> <strong>the</strong> hazard no longer need to access <strong>the</strong><br />

same<br />

register thus eliminating <strong>the</strong> hazards. It doesn’t work on RAW dependencies beca<strong>use</strong> no<br />

matter<br />

what <strong>we</strong> rename <strong>the</strong> register to, <strong>the</strong> ’reading’ instruction still needs <strong>the</strong> result from <strong>the</strong><br />

’writing’<br />

instruction in order to execute.<br />

Part B [2 <strong>points</strong>]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!