UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
18 of 362
NXP Semiconductors
UM10208
Chapter 4: LPC2800 Cache
4.1 Cache enabling and function
Following reset, the cache is disabled. The address, data, and control signals of the CPU
AHB bus is routed directly to the multilayer AHB matrix. The response from whichever
functional block is targeted by the address is routed directly to the CPU.
The cache can be enabled by setting the DATA_ENABLE and/or
INSTRUCTION_ENABLE bits in the CACHE_SETTINGS register.
4.1.1 Cache function details
For each page of the cache which is enabled, the following points apply:
•
If data is read, and not in the cache (a cache miss), a line of eight 32-bit words is read
from the AHB bus. In the meantime, the CPU is stalled (and in low power mode if
clock gating is enabled.)
•
If data is read and is found in the cache (a cache hit), data is read from cache with 0
wait states.
•
If data is written and the location is not in the cache (a cache miss), the data is written
directly to memory.
•
If data is written, and the location is in the cache because this location has been read
before (a cache hit), then data is written to the cache with 0 wait states, and the line is
marked as dirty.
•
If a dirty line is about to be discarded because of a cache miss (the cache line needs
to be reused for a different memory region), the old line is first written back to memory
(a cache line flush).
•
When a cache line is read from memory and stored in the cache (in Way_0 or
Way_1), the cache controller will mark the other half of the cache line at the same
address as Least Recently Used (LRU) in its tag memory.
5.
Register description
The cache controller includes the registers shown in
. These registers are
accessible in the APB2 address space. It is recommended that the clock gating option be
enabled in the CGU for the APB interface of the CPU in order to reduce power
consumption. Each register is described in more detail in the following sections.
Note: the APB interface of the CPU configuration hardware must be set to run at the same
BASE_CLK frequency as the AHB interface of the CPU before any register is written.
Table 5.
Cache and memory mapping registers
Address
Register name
Description
Reset
value
Access
0x8010 4000
CACHE_RST_STAT
Monitors the reset state of the cache.
0
RO
0x8010 4004
CACHE_SETTINGS
Controls the overall configuration of the cache.
0
R/W
0x8010 4008
CACHE_PAGE_CTRL
Allows individual enabling or disabling of caching for the
16 configurable pages.
0
R/W
0x8010 400C
C_RD_MISSES
If cache performance analysis is enabled in the
CACHE_SETTINGS register, this register indicates the
number of times that a cache line is read from memory
(cache read misses).
0
RO