Data dependency

Consider the following instructions:

I1: R1 =100

I2: R1=R2+R4

I3:R2=R4+25

I4:R4=R1+R3

I5:R1=R1+30

Calculate sum of (WAR,WAW,RAW) dependencies the above instructions.

5Comments
Anjan @prab_1 15 Jan 2016 10:05 am

 11 ( 4+3+4)  

                WAR WAW RAW
 2-3 , 3-4 , 4-5 , 2-5  1-2 , 1 - 5 , 2 - 5  1-4, 2-4 ,1-5, 2-5

 

 

lucky @luckysunda 15 Jan 2016 09:53 am

can you show what are they??

lucky @luckysunda 15 Jan 2016 10:03 am

Main point here to note:

while counting RAW dependencies, we will consider only adjacent instructions.

So, there are 0 RAW dependeny.

The answer is 7.

Anjan @prab_1 15 Jan 2016 10:29 am

No we don't care about adjacent instructions CHECK THIS

http://cs.stackexchange.com/questions/47622/read-after-writeraw-hazard

lucky @luckysunda 15 Jan 2016 12:12 pm

@ prabhanjan .. actually I saw the adjacency point in made easy explaination, initially I also counted without considering this point. Which is more reliable ??