
8-38
ColdFire CF4e Core User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Cache Overview
Normally, cache-inhibited reads bypass the cache and are performed on the external bus.
The exception to this normal operation occurs when all of the following conditions are true
during a cache-inhibited read:
The cache-inhibited fill buffer bit, CACR[DNFB], is set.
The access is an instruction read.
The access is normal (that is, transfer type (TT) equals 0).
In this case, an entire line is fetched and stored in the fill buffer, where it remains valid. The
cache can service additional read accesses from this buffer until either another fill or a
cache-invalidate-all operation occurs.
Valid cache entries that match during cache-inhibited address accesses are neither pushed
nor invalidated. Such a scenario suggests that the associated cache mode for this address
space was changed.
To avoid this, it is generally recommended to use the CPUSHL
instruction to push or invalidate the cache entry or set CACR[DCINVA] to invalidate the
data cache before switching cache modes.
8.7.4 Caching Modes
For every memory reference generated by the processor or debug module, a set of effective
attributes is determined based on the address and the ACRs. Caching modes determine how
the cache handles an access. A data access can be cacheable in either write-through or
copyback mode; it can be cache-inhibited in precise or imprecise modes. For normal
accesses, the ACR
n
[CM] bit corresponding to the address of the access specifies the
caching modes. If an address does not match an ACR, the default caching mode is defined
by CACR[DDCM,IDCM]. The specific algorithm for the data cache prioritization (which
uses ACR0 and ACR1) is as follows:
if (address == ACR0-address including mask)
effective attributes = ACR0 attributes
else if (address == ACR1-address including mask)
effective attributes = ACR1 attributes
else effective attributes = CACR default attributes
Addresses matching an ACR can also be write-protected using ACR[W]. Addresses that do
not match either ACR can be write-protected using CACR[DW].
Reset disables the cache and clears all CACR bits. As shown in Figure 8-12, reset does not
automatically invalidate cache entries; they must be invalidated through software.
The ACRs allow the defaults selected in the CACR to be overridden. In addition, some
instructions (for example, CPUSHL) and processor core operations perform accesses that
have an implicit caching mode associated with them. The following sections discuss the
different caching accesses and their associated cache modes.
F
Freescale Semiconductor, Inc.
n
.