05.08.2014 Views

Lecture Notes for Computer Architecture II - St. Cloud State University

Lecture Notes for Computer Architecture II - St. Cloud State University

Lecture Notes for Computer Architecture II - St. Cloud State University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Instruction<br />

Forward B:<br />

00 D/X<br />

10 X/M<br />

01 M/W<br />

Hazard detection conditions<br />

Page | 210<br />

EX hazard<br />

If (EX/Mem.regwrite<br />

And (EX/Mem.RegRd =/=0)<br />

And (Ex/Mem.RegRd = ID/EX. RegisterRs))<br />

Then<br />

ForwardA = 10<br />

If (EX/Mem.regwrite<br />

And (EX/Mem.RegRd =/=0)<br />

And (Ex/Mem.RegRd = ID/EX. RegisterRt))<br />

Then<br />

ForwardB = 10<br />

Mem Hazard<br />

If (mem/wb.Regwrite<br />

And (mem/wb.registerRd =/=0)<br />

And (mem/wb.registerRd = ID/Ex.registe rs))<br />

Then<br />

ForwardA = 01<br />

If(mem/WB.regwrite<br />

And(mem/wb.registerRd=/=0<br />

And (mem/wb.registerRd = ID/Ex.registerRt))<br />

Then<br />

ForwardB = 01<br />

ID/EX<br />

WB<br />

EX/MEM<br />

Control<br />

M<br />

WB<br />

MEM/WB<br />

IF/ID<br />

EX<br />

M<br />

WB<br />

M<br />

u<br />

x<br />

PC<br />

Instruction<br />

memory<br />

Registers<br />

M<br />

u<br />

x<br />

ALU<br />

Data<br />

memory<br />

M<br />

u<br />

x<br />

IF/ID.RegisterRs<br />

Rs<br />

IF/ID.RegisterRt<br />

Rt<br />

IF/ID.RegisterRt<br />

IF/ID.RegisterRd<br />

Rt<br />

Rd<br />

M<br />

u<br />

x<br />

EX/MEM.RegisterRd<br />

Forwarding<br />

unit<br />

MEM/WB.RegisterRd

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

Saved successfully!

Ooh no, something went wrong!