Cache

From SEGGER Wiki
Jump to: navigation, search


Cache memory is fast memory that contains a copy of other, slower memory in the system. The purpose of the cache is to minimize delays experienced by the processor, thus making the system faster. Caches are typically used in systems using clock speeds of 200MHz and above. In large systems, such as PCs and servers, there are typically multiple levels of caching, called L1 (first level cache), L2 and L3. Cache sizes vary. Typically, L1 cache sizes are around 16kB. In systems with multiple level caches, the upper levels (L2 and L3) are larger than the L1 cache. In many systems, two L1 caches exist in parallel, one for data (D-Cache), and one for instruction (I-Cache). They typically unify in the L2 cache.

Cache organization

A cache consists of a number of cache lines, organized in sets and ways.

Cache lines

A cache line is typically 32 bytes. Every time a miss occurs, the entire cache line is filled from main memory.