beautypg.com

Motorola DSP96002 User Manual

Page 792

background image

10

MOTOROLA

cache sector is unlocked. As a result of this sequence, the unlocked cache sector is
placed at the top of the LRU stack, as it is the most recently used.

Unlocking a locked cache sector using the PUNLOCK or PUNLOCKR instructions does
not affect the sector’s contents, its tag, or its valid-bits. If the specified effective address
does not belong to one of the current cache sectors, a memory sector containing the spec-
ified address will be allocated into the cache, thereby flushing the least recently used
cache sector. The unlocked cache sector will be placed at the top of the LRU stack and it
will be readied for replacement by the LRU algorithm.

All of the locked sectors can be unlocked simultaneously using PFREE instruction, which
provides a software reset of the locking mechanism. Unlocking the sectors using PFREE
does not affect the sectors’ contents (instructions already fetched into the sector storage
area), their valid-bits, their tag register contents or the LRU stack status.

The locked sectors could also be unlocked by the PFLUSH instruction as part of a total
cache flush. Unlocking the sectors using PFLUSH clears all the sector’s valid-bits and sets
the LRU stack and tag registers to their default values.

2.6.1.2

Sector Locked Mode

The sector locked mode is useful for latching some time critical code parts in the cache
memory. The sector locked mode is set by the user to lock the memory sector that cur-
rently resides in the cache sector. When a cache sector is in sector locked mode the sector
replacement unit (SRU) cannot replace it even if it is the least recently used sector (bottom
of LRU stack).

The sector locked mode allows the processor to fetch instructions from addresses con-
tained in the current memory sector and it will either update the storage area (during a
word miss), or it will be read directly from the sector area (during a cache hit). On the other
hand, replacement of the current sector by the SRU is disabled. When a sector is locked,
its LRU status continues to be updated, but when choosing the cache sector to be re-
placed, this sector is ignored and will never be the destination for the new memory sector.

The PLOCK and the PLOCKR instructions can lock a sector. The instructions’ operand is
an effective memory address. The cache sector to which the address belongs (if there is
one) is locked. If the specified effective address does not belong to one of the current
cache sectors, a memory sector containing the address will be allocated into the cache,
thereby replacing the least recently used cache sector. This cache sector will be locked
but empty. As a result, the locked cache sector is placed at the top of the LRU stack indi-
cating that it is the most recently used sector.