[15 points]
Assume that there are two processors and each processor has a cache
which is described in Problem 5 ( see the below). The processors use the MSI coherence
protocol. The coherence stats are denoted M, S, and I for Modified,
Shared, and Invalid.
A sequence of one or more CPU operations is specified
P#: op, address, -> value.
P# designates the CPU (e.g., P0), op is the CPU operation (LDB: load byte, STB: store byte). address denotes the memory address, and -> value indicates the new word to be assigned on a write operation.
Each action occurs after the previous action is
finished. (1) Show only the cache blocks that change, for example
P0.B0: (I, 1, 0x01) indicates that CPU P0's block B0 (0 is the index
number) has the final state of I, tag of 1, and data 0x1. Assume that
the memory is initialized by all 0 at the beginning of the
program. (2) Show the final state of the caches after all the
following operations. (coherence state, cache tags, data, and index). To
simplify the problem you do not need to draw the entire cache. You
just need to fill out the relevant entries
P0: LDB 0x450
P0: STB 0x448 -> 0x4
P1: STB 0x450 -> 0x5
P1: LDB 0x450
P1: STB 0x448 -> 0x6
P0: LDB 0x450
P0: LDB 0x052
P0: STB 0x452 -> 0x7
P0: STB 0x852 -> 0x8
P0: LDB 0x1850
P1: LDB 0x850
P1: LDB 0x450
SOLUTION:
Address 0x52 falls under block 0x5
Address 0x448 falls under block 0x44
Addresses 0x450 and 0x452 falls under block 0x45
Addresses 0x850 and 0x852 falls under block 0x85
Address 0x1850 falls under block 0x185
All addresses have tag: 0x0
For the given sequence of LDB, STB operations, the following MSI protocol operations occur:
P0: LDB 0x450
P0.B45: (S,0,0x0)
P0: STB 0x448 -> 0x4
P0.B44: (M,0,0x4)
P1: STB 0x450 -> 0x5
P0.B45: (I,0,0x0) | P1.B45: (M,0,0x5)
P1: LDB 0x450
P1.B45: (M,0,0x5)
P1: STB 0x448 -> 0x6
P1.B44: (M,0,0x6) | P0.B44: (I,0,0x4)
P0: LDB 0x450
P0.B45: (S,0,0x5) | P1.B45: (S,0,0x5)
P0: LDB 0x052
P0.B5: (S,0,0x0)
P0: STB 0x452 -> 0x7
P0.B45: (M,0,0x7) | P1.B45: (I,0,0x5)
P0: STB 0x852 -> 0x8
P0.B85: (M,0,0x8)
P0: LDB 0x1850
P0.B185: (S,0,0x0)
P1: LDB 0x850
P1.B85: (S,0,0x8) | P0.B85: (S,0,0x8)
P1: LDB 0x450
P1.B45: (S,0,0x7) | P0.B45: (S,0,0x7)
Final Cache Entries are:
Processor 0
B5 :- State: Shared, Tag: 0x0, Data: 0x0, Index: 0x5
B44:- State: Invalid, Tag: 0x0, Data: 0x4, Index: 0x44
B45:- State: Shared, Tag: 0x0, Data:0x7, Index: 0x45
B85:- State: Shared, Tag: 0x0, Data: 0x8, Index: 0x85
B185:- State: Shared, Tag: 0x0, Data: 0x0, Index: 0x185
Processor 1
B5 :- State: Invalid, Tag: 0x0, Data: 0x0, Index: 0x5
B44:- State: Modified, Tag: 0x0, Data: 0x6, Index: 0x44
B45:- State: Shared, Tag: 0x0, Data: 0x7, Index: 0x45
B85:- State: Shared, Tag: 0x0, Data: 0x8, Index: 0x85
B185:- State: Invalid, Tag: 0x0, Data: 0x0, Index: 0x185