2021-11-17

1. MSP430 cache for FRAM access

Bits per cache line

  • Valid — 

  • Tag — 

  • Index — 

  • Block data — 

  • × Nlines — 

How many bits of SRAM total are used for the cache?

2. Principle of locality

How are each of these principles engaged with the parameters of a cache?

  • Temporal locality

  • Spatial locality

Graph comparing miss rate and block size. For block sizes 16 to 256 bits

Increasing the size of the block also increases the penalty of a miss, how so?

2.1. Miss penalty

Although it is hard to do anything about the longer latency component of the miss penalty for large blocks, we may be able to hide some of the transfer time so that the miss penalty is effectively smaller. The simplest method for doing this, called early restart, is simply to resume execution as soon as the requested word of the block is returned, rather than wait for the entire block. Many processors use this technique for instruction access, where it works best. Instruction accesses are largely sequential, so if the memory system can deliver a word every clock cycle, the processor may be able to restart operation when the requested word is returned, with the memory system delivering new instruction words just in time. This technique is usually less effective for data caches because it is likely that the words will be requested from the block in a less predictable way, and the probability that the processor will need another word from a different cache block before the transfer completes is high. If the processor cannot access the data cache because a transfer is ongoing, then it must stall.

An even more sophisticated scheme is to organize the memory so that the requested word is transferred from the memory to the cache first. The remainder of the block is then transferred, starting with the address after the requested word and wrapping around to the beginning of the block. This technique, called requested word first or critical word first, can be slightly faster than early restart, but it is limited by the same properties that limit early restart.