GR740-UM-DS, Nov 2017, Version 1.7
57
www.cobham.com/gaisler
GR740
6.3.3
Address mapping
The addresses seen by the CPU are divided into tag, index and offset bits. The index is used to select
the set in the cache, therefore only a limited number of cache lines with the same index part can be
stored at one time in the cache. The tag is stored in the cache and compared upon read.
6.3.4
Data cache policy
The data cache employs a write-through policy, meaning that every store made on the CPU will prop-
agate, via the write buffer, to the bus and there are no “dirty” lines in the cache that has not yet been
written out apart from what is in the buffer. The store will also update the cache if the address is pres-
ent, however a new line will not be allocated in that case.
6.3.5
Write buffer
The data cache contains a write buffer able to hold a single 8,16,32, or 64-bit write. For half-word or
byte stores, the stored data replicated into proper byte alignment for writing to a word-addressed
device. The write is processed in the background so the system can keep executing while the write is
being processed. However, any following instruction that requires bus access will block until the write
buffer has been emptied. Loads served from cache will however not block, due to the cache policy
used there can not be a mismatch between cache data and store buffer (the effect of this behavior on
SMP systems is discussed in section 6.7).
Since the processor executes in parallel with the write buffer, a write error will not cause an exception
to the store instruction. Depending on memory and cache activity, the write cycle may not occur until
several clock cycles after the store instructions has completed. If a write error occurs, the currently
Table 39.
LEON4 Data caching behavior
Operation
In cache
Cacheable
Bus action
Cache action
Load data
Data load
No
No
Read
No change
Bus
No
Yes
Read
Line allocated/replaced
Bus
Yes
-
None
No change
Cache
Data load with
forced cache
miss (ASI 1)
No
No
Read
No change
Bus
No
Yes
Read
Line allocated/replaced
Bus
Yes
-
Read
Data updated
Bus
Data load with
MMU bypass
(ASI 0x1C)
-
-
Read (phys addr)
No change
Bus
Data store
No
No
Write (via buffer)
No change
(N/A)
No
Yes
Write (via buffer)
No change
(N/A)
Yes
-
Write (via buffer)
Data updated
(N/A)
Data store with
MMU bypass
(ASI 0x1C)
-
-
Write (via buffer,
phys addr)
No change
(N/A)
Figure 4.
Cache address mapping
0
4
5
11
12
31
Tag
4 KiB way, 32 bytes/line
Offset
Index