GR740-UM-DS, Nov 2017, Version 1.7
64
www.cobham.com/gaisler
GR740
In the LEON4 case this happens because cache hits are served without blocking even when there is
data in the write buffer. The loaded data will always return the stored data in case of reading the same
address, because if it is cached, the store updates the cache before being put in the write buffer, and if
it was not in cache then the load will result in a miss which waits for the write buffer to complete.
Loaded data from a different address can be older than the store if it is served by cache before the
write has completed, or newer if it results in a cache miss or if there is a long enough delay for the
store to propagate to memory before reading.
See relevant literature on shared memory systems for more information. These details are mainly of
concern for complex applications using lock-free data structures such as the Linux kernel, the recom-
mendation for applications is to instead avoid concurrent access to shared structures by using
mutexes/semaphores based on atomic instructions, or to use message passing schemes with one-direc-
tional circular buffers.
6.8.3
Memory-mapped hardware
Hardware resource (peripheral registers) are memory mapped on uncacheable address spaces. They
will be accessible from all the CPU:s in a sequentially consistent manner. Since software drivers usu-
ally expect to be “alone” accessing the peripheral and the peripheral’s register interfaces are not
designed for concurrent use by multiple masters, using a bare-C application designed for single-pro-
cessor usage on multiple cores at the same time will generally not work. This can be solved by parti-
tioning the applications so that each peripheral is only accessed by one of the CPU:s. This partitioning
also need to be done between the interrupts so the peripheral’s interrupts will be received by the cor-
rect processor.
6.9
ASI assignments
6.9.1
Summary
The table shows the ASI usage for LEON.
Table 43.
ASI usage
ASI
Usage
0x01
Forced cache miss.
0x02
System control registers (cache control register)
0x08, 0x09, 0x0A, 0x0B
Normal cached access (replace if cacheable)
0x0C
Instruction cache tags
0x0D
Instruction cache data
0x0E
Data cache tags
0x0F
Data cache data
0x10
Flush instruction cache (and also data cache when system is implemented with MMU)
0x11
Flush data cache
0x13
MMU only: Flush instruction and data cache
0x14
MMU only: MMU diagnostic D context cache access (deprecated, do not use in new SWapplications)
0x15
MMU only: MMU diagnostic I cache context access (deprecated, do not use in new SW applications)
0x18
MMU only: Flush TLB and I/D cache
0x19
MMU only: MMU registers
0x1C
MMU only: MMU and cache bypass
0x1D
MMU only: MMU diagnostic access (deprecated, do not use in new SW applications)
0x1E
MMU only: MMU snoop tags diagnostic access