User Manual
BCM1250/BCM1125/BCM1125H
10/21/02
B r o a d c o m C o r p o r a t i o n
Document
1250_1125-UM100CB-R
Section 5: L2 Cache
Page
89
S e c t i o n 5 : L 2 C a c h e
I
NTRODUCTION
The on-chip second level cache is shared by the processors and any I/O DMA masters. On the BCM1250 the
L2 cache is 512 KBytes, on the BCM1125/H it is 256 KBytes. This section describes the normal operation of
the L2 cache, a mode where banks of it can be used as an on-chip SRAM and the management interface to
it. After reset the management interface must be used to initialize the L2 cache before it can be used, if a
cacheable reference is made before the L2 is initialized multiple cache lines may be selected causing an
internal bus clash.
N
ORMAL
O
PERATION
The L2 cache is 256 or 512 KBytes, organized into 32 byte cache lines four way set associative. All accesses
to the L2 are in full cache blocks. It is a non-inclusive/non-exclusive cache, thus there are no restrictions on
which cache blocks can be in the L2. A random replacement policy is used when a victim line must be found.
The L2 runs internally at the CPU core speed and is fully pipelined. This allows one access per ZBbus cycle,
including all the required housekeeping needed to evict dirty lines.
The L2 cache tags and the data blocks are ECC protected. Single bit errors in either are corrected while an
access is in progress (the L2 will internally take time to perform the full recovery, but the system continues
running). The ECC cleanup is started by a cache hit on a line with a single bit error. Cleanup will be pre-empted
by a write to another way at the same index, so occasionally a single bit error will be flagged twice. Tags with
uncorrectable errors result in UNPREDICTABLE data being returned to the requestor with an uncorrectable
tag error signalled. Data with uncorrectable errors will be returned to the requestor with an uncorrectable data
error signalled. In either error case software recovery is required. The bus watcher in the SCD will log the data
associated with the error and raise an interrupt. The L2 will record the tag associated with the error in the
l2_ecc_tag
register (this can be read to give the tag from the most recent ECC error). The management
interface to the L2 can be used to invalidate the line and clear the ECC bits. Any data that is received by the
L2 cache marked with an error is written into the cache with an uncorrectable ECC error, so subsequent reads
will also get an error.
The L2 cache is physically one of the ZBbus agents, but architecturally it sits between the system bus and the
main memory, and there are dedicated signals between the L2 and memory controller that coordinate them.
Every bus access is accompanied with the L1 cache and coherence attributes for the access. In the CPU these
are set in the TLB and indicate cacheable-coherent, cacheable-non-coherent, uncacheable, and uncacheable-
accelerated (which indicates writes may have been merged). For DMA accesses the L1 attributes are provided
from the DMA control registers and should match the attributes the CPUs use for that area of memory. The L2
is coherent with memory for all L1 cacheable accesses (non-cacheable accesses to main memory will bypass
the L2 cache, they should never be done to areas of memory that have previously been cacheable). The L2
c a c h e i s c h e c k e d b y a l l L 1 c a c h e a b l e m e m o r y a c c e s s e s p u t o n Z B b u s . A s d e s c r i b e d i n
Section: “Coherence” on page 12
, it acts in conjunction with the memory controller to provide any blocks that
are not owned exclusively by another bus agent.