Cache Policy Comparison Chart

Last modified by Microchip on 2023/11/09 09:01

The following table summarizes some of the pros and cons of each cache policy. The default cache policy for the PIC32MZ family, as is present in the start-up code supplied in the development tools, is write-back with write allocation.

PolicyProsCons
UncachedNo cache coherency issues.Greatly impaired performance since every memory access must account for bus transfer time and memory wait states.
Write-back with Write AllocationBest performance is achieved with this policy. All transactions are done using the cache with memory accesses performed only when needed.Application must address coherency on both reads and writes to memory.
Write-through with no Write AllocationCache coherency issues are eliminated for writes as memory is always updated.Results in the CPU taking a larger percentage of the memory bus bandwidth since every CPU write results in a bus transaction. Even back-to-back writes are written to memory. Cache coherency for CPU reads must still be addressed.
Write-through with Write AllocationCache coherency issues are eliminated for writes as memory is always updated. Writes to memory and also fills cache so the data written is immediately available for a CPU read.Results in the CPU taking a larger percentage of the memory bus bandwidth since every CPU write results in a bus transaction. Even back-to-back writes are written to memory. Cache coherency for CPU reads must still be addressed. Writes to memory also fill the cache which can result in needed data being evicted from the cache.