
Instruction Cache Operation
MOTOROLA
Section 5 Instruction Cache
5-3
5.3.2
MEMORY REFERENCE ATTRIBUTES
For every memory reference the ColdFire core or the debug module generates, a set of “effective
attributes” is determined based on the address and the Access Control Registers (ACR0, ACR1). This set
of attributes includes the cacheable/noncacheable definition, the precise/imprecise handling of operand
write, and the write-protect capability.
In particular, each address is compared to the values programmed in the Access Control Registers (ACR).
If the address matches one of the ACR values, the access attributes from that ACR are applied to the
reference. If the address does not match either ACR, then the default value defined in the Cache Control
Register (CACR) is used. The specific algorithm 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
5.3.3
CACHE COHERENCY AND INVALIDATION
The instruction cache does not monitor ColdFire core data references for accesses to cached instructions.
Therefore, software must maintain cache coherency by invalidating the appropriate cache entries after
modifying code segments.
The cache invalidation can be performed in two ways. The assertion of bit 24 in the CACR forces the entire
instruction cache to be marked as invalid. The invalidation operation requires 512 cycles because the
cache sequences through the entire tag array, clearing a single location each cycle. Any subsequent
instruction fetch accesses are postponed until the invalidation sequence is complete.
The privileged CPUSHL instruction can invalidate a single cache line. When this instruction is executed,
the cache entry defined by bits[12:4] of the source address register is invalidated, provided bit 28 of the
CACR is cleared.
These invalidation operations can be initiated from the ColdFire core or the debug module.
5.3.4
RESET
A hardware reset clears the CACR disabling the instruction cache. The contents of the tag array are not
affected by the reset. Accordingly, the system startup code must explicitly perform a cache invalidation by
setting CACR[24] before the cache can be enabled.
5.3.5
CACHE MISS FETCH ALGORITHM/LINE FILLS
includes a 16-byte line fill buffer for providing temporary storage for the last fetched instruction.
With the cache enabled as defined by CACR[31], a cacheable instruction fetch that misses in both the tag
memory and the line-fill buffer generates a external fetch. The size of the external fetch is determined by
the value contained in the 2-bit CLNF field of the CACR and the miss address. Table 5-1 shows the
relationship between the CLNF bits, the miss address, and the size of the external fetch.
Depending on the runtime characteristics of the application and the memory response speed, overall
performance may be increased by programming the CLNF bits to values {00, 01}.