![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_550.png)
Applications
MOTOROLA
MPC801 USER’S MANUAL
B-5
B
B.1.2 MPC801 MMU/Cache Example
B.1.2.1 BASIC MMU AND CACHE CONCEPT.
how to initialize the memory management unit (MMU) and cache. It provides configuration
and background information on the memory management unit and cache from a general
conceptual viewpoint.
This concept is a step-by-step example of
B.1.2.2 GENERAL CONCEPT.
for the best productivity. The MPC801 incorporates on-chip cache memory that consists of
two fully independent caches for improving overall performance. One cache is implemented
as a core instruction cache and is used to store instruction prefetch accesses from main
(system) memory. The second cache is implemented as a core data cache and stores data
prefetched from the data cache. The data cache can also be used as a temporary location
to store data, thus saving time by updating only the cache and not memory (writethrough
mode).
A basic review of cache and MMU concepts is necessary
Performance throughput is improved when instruction or data words required by a program
are available in the on-chip cache and the time required to access them from external
memory is eliminated. In the MPC801, having on-chip multiple bus masters result in reduced
external bus activity by the core, which in turn increases overall performance by increasing
the availability of the bus for use by other bus masters (SDMA) without degrading the
performance of the core. Notice that throughout the rest of this section that the term problem
mode refers to what is known as user mode in 68K terms.
B.1.2.2.1 Instruction Cache.
beginning of a cycle the instruction is read by the core from main memory and then stored
in cache for the next access by the core. However, the core can never directly alter the
content of an instruction cache. Since an instruction cache can only be accessed by the
core, you must assure that other bus masters never alter the contents of memory that is
defined as cacheable. This can be done by using the IMMU. During normal operation, the
following sequence of operations must be performed before enabling the instruction cache.
An instruction cache is a unidirectional cache. At the
1. The cache must be unlocked in all locations by writing 101 (bin) to the CMD field of the
IC_CST register.
2. All cache locations must be invalidated by writing 101 (bin) to the CMD field of the
IC_CST register. This reset sequence guarantees that the instruction cache has no
garbage data marked as valid before it is turned on.
3. Define cacheable and noncacheable regions of main memory by appropriately
initializing the memory management unit before enabling the instruction cache.
Only after performing this sequence should you turn the instruction cache on by writing 001
(bin) to the CMD field of the IC_CST register.