L1 Cache

A Central Processing Unit (CPU) cache is a separate small block of memory used to compensate for the slower access time of 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 main memory.

cache-memory.png

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. Use of the cache is critical to achieving the maximum performance from the PIC32MZ family. Memory access to and from the cache always occurs in a single clock cycle. Accessing main memory could take three or more cycles.

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

Application Note AN1600 covers detailed use of L1 Cache memory on PIC32MZ devices.

Also, there is a PIC32MZ Cache Tutorial that goes into further details on configuration/use of L1 cache.

By default, MPLAB® XC32 start-up code enables the cache and configures it in write-back with write allocation mode.

This policy is the easiest for the hardware to implement, and consumes the least system bus resources and power. It is also the least useful for keeping shared data coherent. Combining this cache policy with using uncached (KSEG1) memory for shared data is the simplest cache management approach, and is recommended for getting your project up and running.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.