I have a question on MESI protocol.
(1)Consider the following code fragment that runs on a uniprocessor system that Implements the MESI cache coherence protocol:
I1: load $s1, [A] I2: load $s2, [B] I3: add $s1, $s2, $s3 I4: store $s3, [C] I5: sub $s3, 1, $s4 I6: store $s3, [A]
Assume write-thru cache policy. If memory block A, B, and C are loaded (if needed) onto two different cache blocks (initially empty) on a single processor, complete the following table to identify the cache state of the blocks containing A, B, C, after each instruction executes.
My answer to that is:
Step/State A B C
I1 E I I
I2 E E I
I3 E E I
I4 I I E
I5 I I E
I6 E I I
(2) In the following RTL
I1: R1 <-[6]
I2: R2 <-[4]
I3: R3 <- R1 + R2
I4: [6]<- R3
I5: R4 <- R4 - 1
I6: [4]<- R4
Assume write-thru cache policy. If memory block 4 and 6 are loaded onto two different cache blocks (initially empty) on a single processor
My answer is
Step/state Block 4 Block 6
Initial I I
I1 I E
I2 E E
I3 E E
I4 I E(write miss, AOW)
I5 I E
I6 E(write miss, AOW) I
Is my answer correct please? Thank you very much in advance.