Question

I use a Cortex A9 CPU with two L1 caches: One for data and the other for the instructions. Cache policy could be either "write-back" or "write-through". The Cortex-A9 Technical Reference Manual part "7.1. About the L1 memory system" said that the data L1 cache has :

  • one 32-byte eviction buffer
  • a 4-entry, 64-bit merging store buffer

I don't understand the difference between these two buffers. In my opinion :

  • "eviction buffer" is used to hold dirty evicted lines before it is written to the RAM
  • "merging store buffer" is used to hold data before it is written to the RAM

I guess that "eviction buffer" is only used with write-back policy while "merging store buffer" is only used with write-through policy but i'm not sure of that hypothesis.

Thanks and sorry for my basic English.

Était-ce utile?

La solution

The cache policy of write-back or write-through applies only to cache-able accesses. For device or strongly ordered, the data must be written without entering the cache. For a device access, the merging store buffer can be used to temporarily hold the data while the write to the device completes. The CPU can go and do other things.

As per Wikipedia's write buffer, a write-through cache does not need the eviction buffer. The merging store buffer is not really a cache feature and could be looked at as a completely different entity. But it has to do with memory access optimization (like a cache) and is in the same functional block.

Autres conseils

The merging store buffer is situated between the CPU and the cache; its goal is to merge adjacent writes. For example, if your doing a sequence of adjacent 8bit writes, those writes will first accumulate in the merge buffer before being written into the cache in bigger chunks and with less cache transactions.

The eviction buffer is situated between the cache and the memory (or maybe the next cache level); its goal is just to be a temporary storage for a cacheline being evicted from to cache so that the cache can already reuse the now unallocated line without having to wait fro the acknowledgment telling the whole line have been written to memory.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top