BCM1250/BCM1125/BCM1125H
User Manual
10/21/02
B r o a d c o m C o r p o r a t i o n
Page
96
Section 5: L2 Cache
Document
1250_1125-UM100CB-R
Management accesses may be done with cacheable or non-cacheable operations. However, the L2 cache will
always operate on a full 32 byte cache line. On reads there is not a problem since the destination will filter the
data (data is always carried on its natural byte lane on the ZBbus), but writes that are smaller than a cache
block will cause random values to be written to the other bytes in the line. Uncacheable writes will normally be
smaller than a full cache block (the exception being uncached-accelerated writes that have merged to a full
block in the CPU write buffer), so they cannot be used to set particular values in the cache. However, uncached
writes may be used for initializing the cache (where the data is unimportant, since the goal is to clear the valid
bit for all the lines in the cache) or clearing data ECC errors by overwriting the bad data. This works because
the other bytes on the bus during an uncached write will always be driven with valid (although
UNPREDICTABLE) data.
The management accesses will still signal hit or miss to the performance counters based on the comparison
between the management access address and the cache tags.
Following any management access to the cache that is to an enabled way, the replacement algorithm state is
set such that the way of the cache that was accessed is used for the victim (if one is needed) on the next cache
access (note this is the next access
not
the next miss). Therefore a line can be flushed from the cache by doing
a management read of the line to be flushed followed by a regular cacheable read of a block that uses the
same index and is not currently in the L2. The management access selects the way as the victim for the
subsequent fill. To avoid the line being flushed ending up in the L1 cache, the management access is likely to
be uncacheable, however the regular access must be cacheable. The ordering must be maintained by
software (an ALU operation can be performed on the data returned by the uncached management access to
ensure it has completed before the cacheable load is issued). If multiple lines are to be flushed care should be
taken that the dummy cacheable fetch has completed before the next uncacheable management access (i.e.
an ALU operation should be performed on the dummy data or a SYNC used).
Management mode accesses flow through the same paths as normal accesses. If a write is done to a line
followed by a read of the same address, the data used to satisfy the read may be bypassed from the cache
input queue. This increases the performance in normal operation, but is a problem when the cache RAM is
being tested. There must be more than six ZBbus cycles between the write data (i.e. the ZBbus D-phase for
the write transaction) and the read request (i.e. the ZBbus A-phase for the read transaction) arriving at the
cache to ensure the read is from the RAM array. This can be arranged by doing two reads from the same
location. Alternatively, a sequence of writes to other addresses can be done before the read.