What is Cache Memory?

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

A CPU cache is a separate small block of memory used to compensate for the slower access time of the main memory. A cache described as a Level 1 cache uses memory that is as fast as the CPU, so that as long as the CPU is accessing the cache, it will never have to wait for an instruction or data. Level 2 and Level 3 caches are used in conjunction with a Level 1 cache and have memory whose access times are greater than the CPU, but are less than the main memory.

Cache block diagram

The PIC32MZ family uses a Level 1 (L1) cache only. The L1 cache is divided into two parts, an instruction cache, and a data cache. The use of the cache is critical to achieving maximum performance from the PIC32MZ family. Memory access to and from the cache always occurs in a single clock cycle. Accessing the main memory could take three or more cycles.

"Single cycle" refers to one instruction cycle, which is one PBCLK7 clock.

Reads and writes to consecutive main memory locations can occur in a single cycle after filling a pipeline. The pipeline for main data memory is up to 10 cycles and the pipeline for main program memory is up to three cycles.