GD32W51x User Manual
120
Figure 4-1. ICACHE block diagram
Cortex-M33
C-AHB
Execution port
Configuration
interface
Region0 config
Region1 config
Region2 config
Region3 config
Hit monitor
Miss monitor
control
status
Cache control
logic
Execution port
interface
pLRU
REMAP
Master port
interface
CACHE
TAG
memory
CACHE
data
memory
AHB
Master 1 Port
Master 0 Port
AHB
Configuration
Slave port
4.3.1.
ICACHE initialization
Set the EN bit of ICACHE_CTL register, then ICACHE function is enabled, in the same
clock period. While, if ICACHE is disabled, means that ICACHE is ignored, ICACHE
default state is disabled at boot.
Once released reset signal, cache invalidate operation is automatically started, each TAG
valid bit to 0, INVAL bit is automatically cleared, and ICACHE_STAT BUSY flag will be
set. When cache invalidate operation is ended, all cache line valid bit will be cleared, and
BUSY flag is reset, while END flag is set.
To ensure performance, it is necessary to check if cache invalidate operation completed
before enabling the ICACHE. Application necessarily check BUSY and END flag in
ICACHE_STAT before enabling the ICACHE. In case that ICACHE is enabled before
invalidate operation ended, during this period, on the condition that BUSY flag is set, any
cache access is uncacheable actually and its accessing performance depends on the
main memory.
4.3.2.
Paired master cache
There is a paired AHB master ports: master0 and master1 port, which support ICACHE
to classify the address access to different destination memories. Master0 port (fast bus)
access internal flash and internal SRAM, and master1 port (slow bus) access external
flash through QSPI interface. By programming the MSEL bit of ICACHE_CFGx, master0
port is selected for mapped access to internal memories, master 1 is selected for
remapped traffic to external memories.