
S3C3410X RISC MICROPROCESSOR
UNIFIED CACHE & INTERNAL SRAM
5-3
CACHE OPERATION
CACHE ORGANIZATION
The S3C3410X cache has a 4KB or 2KB cache memory and Tag RAM. The cache architecture consists of 2-way
set associative, has 4 word as line size, and uses the LRU replacement policy. To maintain the data coherence
between cache and main memory, the S3C3410X supports the WT(Write Through). The Tag RAM has a 2-bit
CS(Cache Status) field as well as Tag data for set 0 and 1 as shown in Figure 5-1. Each Tag set has a 16-bits/17-
bits Tag address of A[26:11] / A[26:10] for 4KB /2KB cache if the address of A[26:0] is cached in the cache
memory. The 2-bit CS indicates the validity of cached data of the corresponding cache memory line. It is also
used for the cache replacing algorithm and for selecting the data coming from set 0 and 1. Because the cache
consists of 2-way set associative, each set should have 2KB. The one line is 4-word(4
×32 = 128bit), and there
should be 128 lines in each set. If users specify the 2KB cache, one line is 4-word(4
×32 = 128bit) and there
should be 64 lines in each set. The TAG and Cache array memory are mapped to the specific address range and
users can access these memory by S/W, which will be explained in Cache Flush.
CACHE REPLACE OPERATION
After the system is initialized, the value of CS is set to "00", notifying that the memory content in set 0 and 1 are
invalid. When a cache fill occurs, the value of CS is changed to "01" at the specified line, which notifies that the
set 0 is only valid. When the subsequent cache fill occurs, the value of CS will be "11" at the specified line, which
notifies that the memory content in both set 0 and set 1 are valid. When the memory content in both set 0 and set
1 are valid, there should be cache replacement when the cache miss happens. During the miss cycle, the value
of CS should be changed to "10" at the specified line, notifying that the memory content in set 0 will be replaced.
After the completion of miss cycle, the value of CS will be changed to "11", again because the specified cache
was re-filled. If there happens other miss cycle on the same line, the value of CS should be changed to "01" at
the specified line, notifying that the memory content in set 1 will be replaced. After the completion of miss cycle,
the value of CS will be changed to "11", again because the specified cache was re-filled. To indicate the Least
Recently Used line, there is an internal toggling bit which determines that the recent access was to set 0 or set 1.
; Set0, set1 all invalid
; Cache miss occurs
; Set0 = valid and Set1 = invalid
It does not change status on hit
; Read miss
; AV_S1D = All valid and Set1 dirty.
"Dirty" means to be accessed just before.
It does not change the status on hit.
; AV_S0D = All valid and Set0 is dirty.
S0 only: 01
Miss
Hit
Reset(/)
INVALID: 00
AV-S1D: 11
Hit 1
AV-S0D: 10
Miss
Hit 0
Miss or Hit 1
Miss or Hit 0
Figure 5-2. CS-Bit Status Diagram