
288
Evaluating and Programming the 29K RISC Family
in the cache tag is used to support the protocol. The S bit becomes set when a write is
performed to an address which causes block reload, and the block is supplied by
another cache –– more on this in the following
Cache Consistency
section.
The Am29040 processor, unlike the Am29240, does not allocate cache blocks
for data fetched with a LOADM instruction. This prevents needless displacement of
valid cache blocks when a register stack fill is performed. Block allocation during a
LOADM in conjunction with a copy–back policy would have poor performance
given that the copy–back buffer is only four words deep. The copy–back buffer and
the LOADM instruction would both be competing for access to the system bus.
5.14.3 Cache Locking and Invalidating
Valid data cache blocks can be locked by appropriately setting the DL field of
the CFG configuration register. The entire cache can be locked or only column 0. If a
block is locked but still invalid, it can be allocated for caching. Critical data can be
placed in the cache by first locking the cache and then loading the required data. This
effectively turns the cache into a small fast RAM for critical data. (However, a
write–through policy, if used, will still cause all writes to be duplicated in off–chip
memory). If only column 0 is locked the remaining column 1 will still cache entries
with a direct–mapping replacement scheme. Typical applications show best
performance when the cache is not locked but left to the default scheme of caching
the most recently accessed data.
The cache can be invalidated in a single cycle by issuing an INV or IRETINV
type instruction. All blocks are marked invalid during this process unless the cache is
locked. A locked cache can only be marked invalid if it is first disabled before
invalidating.
The copy–back policy of the Am29040 makes cache invalidation more difficult.
Valid cache blocks which have been modified can not be simply marked invalid.
Failure to write–back modified blocks would leave the memory in an out–of–date
state. Because the data cache operates with physical address tags and performs bus
snooping, there is very little reason to invalidate the cache. Cache invalidation can be
safely performed by using the cache interface registers (CIR and CDR) to examine
each block to determine if the block is valid and if the modified bit (M bit) is set.
When set, the block must be written out to memory before an INV type instruction is
used.
5.14.4 Cache Consistency
The Am29040 is currently the only processor in the 29K family which contains
on–chip data cache consistency hardware. Cache consistency becomes an issue
when there is more than one cache in a multiprocessor system or when a DMA type
device is also accessing data regions which are cached. When there is more than one
agent
trying to access data, it is important that all agents agree upon a single (and