The Memory simply contains data values.
The processors are modelled as arrays containing sequences of read and
write requests to locations in the memory address space, e.g.
R | 0 | 0 |
R | 9 | 0 |
W | 1 | 475 |
W | 1 | 541 |
Z | 0 | 0 |
The caches each contain 8 lines, each of which contains the following fields:
Valid | Modified | Address | Data |
The caches send and receive packets to/from their respective processors and to/from the Bus. The actions that occur in response to a processor packet depend on whether it is a read or write request, whether the request gets a hit or a miss, and the current state of the line to which the request is mapped. Many of the actions involve the exchange of packets between the cache and the Bus. Bus packets contain the following fields:
Packet Type |
IV | Invalidate | |
MA | Memory Read Acknowledge | ||
MR | Memory Read Request | ||
MW | Memory Write Request | ||
RR | Read Request | ||
WR | Write Request | ||
Address | |||
Data | |||
Source | Number of the originating cache |
Outcome | State | Action |
Read Hit Unmodified | RH | Supply data to processor; state remains unchanged |
Read Hit Modified | RH | Supply data to processor; state remains unchanged |
Read Miss Umodified | RM |
1. Send Read Request (RR) to Bus 2. Wait one clock cycle; if another cache has a modified value, it writes the value to memory during this cycle and sets itself Valid 3. Issue Memory Read (MR) 4. When memory replies (MA), write data to and supply to processor |
Read Miss Modified | RMM |
1. Write existing data to memory (MW) 2. Proceed as for Read Miss Unmodified |
Outcome | State | Action |
Write Hit Unmodified | WH | 1. Send Invalidate packet to Bus 2. Write data to cache 3. Set state to Modified when Invalidate (IV) packet has been sent |
Write Hit Modified | WHM | Write data to cache; state remains unchanged |
Write Miss Unmodified | WM | 1. Send Write Request (WR) to Bus|
Write Miss Modified | WMM |
1. Write existing data to memory (MW) 2. Proceed as for Write Miss Unmodified |
IV | Set state to Invalid |
MA | Write data to cache and (for read requests) send to processor |
RR | If state is Modified, send MW request to Bus to write value back to memory; set state to Valid & Unmodified |
WR | If state is Modified, send MW request to Bus to write
value back to memory; set to Invalid & Unmodified If state is Unmodified, set to Invalid & Unmodified |
If a read or write request is pending when an IV, RR or WR packet is processed (i.e. the cache is waiting for a turn on the Bus), the cache must recheck its entries for a hit or miss.
The processor array files included in the model contain a series of Read and Write requests which demonstrate several of the protocol actions. Users of the model are invited to observe the simulation play-back to see their effects.