logo

Crowdly

Browser

Add to Chrome

W-A-W hazard This type of hazard may occur when two adjacent instructions (i) ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

W-A-W hazard

This type of hazard may occur when two adjacent instructions (i) and (j) save the result of their execution to the same resource (register, memory cell) and the time of the execution of the earlier instruction (i) is longer than the time of the execution instruction (j). It may cause an erroneous result of executing this sequence of instructions to be written into the resource. The typical way to remove such a dependency is to delay the completion of the execution instruction (j) until the execution of the instruction (i) is completed. 

To illustrate this problem, the following code will be used:

;WinMIPS64 WAW hazard example

    .data

A:    .double 15.0

B:    .double 5.0

C:    .double 4.4

D:    .double 1.0

E:    .double 3.14.0

res:    .double 0.0

    

    .text

main:    l.d f2,A(r0)

    l.d f3,B(r0)

    l.d f4,C(r0)

    l.d f5,D(r0)

    l.d f6,E(r0)

    nop

    mul.d f6,f2,f4

    sub.d f6,f2,f3

    add.d f3,f6,f4

    s.d f3,res(r0)

    halt

Very important note! : Before you execute this program, be sure that the data forwarding mechanism is disabled.  If  data forwarding is enabled the MIPS hardware cannot detect, signal and prevent WAW hazard. 

Execute the example program. Analyze the clock cycle diagram and find the instruction that causes  WAW stall.

Mark the instruction that caused the WAW hazard.

❌
❌
❌
✅
❌
More questions like this

Want instant access to all verified answers on moodle.lab.ii.agh.edu.pl?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome