4. Cache Organization and Coherency
Figure 4-3 Organization of Primary Data Cache
The data cache uses a write back protocol, which means a cache store writes data into the cache instead of writing it directly to memory. Sometime later this data is independently written to memory, as shown in Figure 4-4.
Figure 4-4 Write Back Protocol
Write back from the primary data cache goes to the secondary cache, and write back from the secondary cache goes to main memory, through the system interface. The primary data cache is written back to the secondary cache before the secondary cache is written back to the system interface.
The data cache is indexed with a virtual address and tagged with a physical address. Each primary cache block is in one of the following four states:
A data cache block can be changed from one state to another as a result of any one of the following events:
Figure 4-5 Primary Data Cache State Diagram
A primary data cache block is said to be Inconsistent when the data in the primary cache has been modified from the corresponding data in the secondary cache. The primary data cache is maintained as a subset of the secondary cache where the state of a block in the primary data cache always matches the state of the corresponding block in the secondary cache.
These events are illustrated in Figure 4-5, which shows the primary data cache state diagram.