3
$\begingroup$

I'm practicing data and control dependencies, but having trouble detecting them. For this example, I'm assuming this pipeline is fully bypassed (with forwarding). I think the only data dependency is i3 on i2. Is this correct? I also don't know how to detect the control dependency. I know there will be one because of the bne, but not sure how and on which one...

i1: lw $t0, 10($t1)
i2: lw $t4, 3($t2)
i3: addiu $t0, $t4, 3
i4: addu $t0, $t0, $t2
i5: addiu $t2, $t2, -8
i6: addiu $t1, $t1, -4
i7: bne $t1, $0, i1
$\endgroup$

1 Answer 1

1
$\begingroup$

There are no control dependencies in the code fragment. The non-transitive true (read-after-write) dependencies are:

  • $i_2\ \delta^f\ i_3$ via register $t_4$
  • $i_3\ \delta^f\ i_4$ via register $t_0$
  • $i_6\ \delta^f\ i_7$ via register $t_1$

There are also output (write-after-write) dependencies:

  • $i_1\ \delta^o\ i_3$ via register $t_0$
  • $i_3\ \delta^o\ i_4$ via register $t_0$
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.