Docsity

Computer Architecture Homework: Pipeline Optimization and Hazards, Assignments of Advanced Computer Architecture

Toggle sidebar
bg1
Computer Architecture Homework #3
Assigned Question #3
(a) We can reverse the order of EX and MEM, in other words, move
MEM before EX as IF-ID-MEM-EX-WB.
(b) There’re 2 forwarding paths needs to be added in the new pipeline:
I. EX→MEM, ALU options to Load/Store
II. MEM→MEM, Load/Store to Load/Store
and there’re 3 forwarding paths that were there in the earlier
design and that are also needed in the new pipeline:
I. EX→EX, ALU options to ALU options
II. MEM→ID, Load/Store to Branch
III. EX→ID, ALU options to Branch
(c) There is a new hazard when an ALU operation is followed by an
instr. using the ALU operation’s result to perform a memory
operation.
e.g.
ADD R1, R2, R3
LD R4 (R1)
pf2

Partial preview of the text

Download Computer Architecture Homework: Pipeline Optimization and Hazards and more Assignments Advanced Computer Architecture in PDF only on Docsity!

Computer Architecture Homework # 3

Assigned Question # 3 (a) We can reverse the order of EX and MEM, in other words, move MEM before EX as IF-ID-MEM-EX-WB. (b)There’re 2 forwarding paths needs to be added in the new pipeline: I. EX → MEM , ALU options to Load/Store II. MEM → MEM , Load/Store to Load/Store and there’re 3 forwarding paths that were there in the earlier design and that are also needed in the new pipeline: I. EX → EX , ALU options to ALU options II. MEM → ID , Load/Store to Branch III. EX → ID , ALU options to Branch (c) There is a new hazard when an ALU operation is followed by an instr. using the ALU operation’s result to perform a memory operation. e.g. ADD R1, R2, R LD R4 (R1)

(cont’d) (d) (i) Shorter sequence on the new machine when loading from zero offset addresses. Original code: New code: (ii) Shorter sequence on the original machine when loading from non-zero offset addresses. Original code: New code:

LD R1, 0(R2)

ADD R4, R1, R

ADD R4, R3, (R2)

LD R1, 4(R2)

ADD R2, R2,

LD R1 (R2)