18. Instruction cache (ICACHE)
18.1 ICACHE introduction
The instruction cache (ICACHE) is introduced on the C-AHB code bus of the Cortex®-M33 processor, to improve performance when fetching instructions and data from internal and external memories.
Some specific features like dual master ports, hit-under-miss, and critical-word-first refill policy, allow close to zero-wait-state performance in most use cases.
18.2 ICACHE main features
The main features of ICACHE are listed below:
- • Bus interface
- – One 32-bit AHB slave port, the execution port (input from Cortex®-M33 C-AHB code interface)
- – Two AHB master ports: master1 and master2 ports (outputs to Fast and Slow buses of main AHB bus matrix, respectively)
- – One 32-bit AHB slave port for control (input from AHB peripherals interconnect, for ICACHE registers access)
- • Cache access
- – 0 wait-state on hits
- – Hit-under-miss capability: ability to serve processor requests (access to cached data) during an ongoing line refill due to a previous cache miss
- – Dual master access: feature used to decouple the traffic according to targeted memory. For example, the ICACHE assigns fast traffic (addressing flash and SRAMs) to the AHB master1 port, and slow traffic (addressing external memories) to the AHB master2 port, thus preventing processor stalls on lines refills from external memories. This allows ISR (interrupt service routine) fetching on internal flash memory to take place in parallel with a cache line refill from external memories.
- – Minimal impact on interrupt latency, thanks to dual master
- – Optimal cache line refill thanks to WRAPw bursts of the size of the cache line (32-bit word size, w, aligned on cache line size)
- – n-way set-associative default configuration with possibility to configure as 1-way, means direct mapped cache, for applications needing very-low-power consumption profile
- • Memory address remap
- – Possibility to remap input address falling into up to four memory regions (used to remap aliased code in external memories to the code region, for execution from the C-AHB code interface)
- • Replacement and refill
- – pLRU-t replacement policy (pseudo-least-recently-used, based on binary tree), algorithm with best complexity/performance balance
- – Critical-word-first refill policy, minimizing processor stalls
- – Possibility to configure burst type of AHB memory transaction for remapped regions: INCRw or WRAPw (size w aligned on cache line size)
- • Performance counters
The ICACHE implements two performance counters:- – Hit monitor counter (32-bit)
- – Miss monitor counter (16-bit)
- • Error management
- – Possibility to detect an unexpected cacheable write access, to flag an error and optionally to raise an interrupt
- • TrustZone® security support
- • Maintenance operation
- – Cache invalidate: full cache invalidation, fast command, noninterruptible
18.3 ICACHE implementation
Table 74. ICACHE features
| Feature | ICACHE |
|---|---|
| Number of ways | 2 |
| Cache size | 16 Kbytes |
| Cache line width | 32 bytes |
| Range granularity of memory regions to be remapped | 2 Mbytes |
| Number of regions to remap | 4 |
| Data size of AHB slave interface | 32 bits |
| Data size of AHB fast master1 interface | 32 bits |
| Data size of AHB slow master2 interface | 32 bits |
18.4 ICACHE functional description
The purpose of the instruction cache is to cache instruction fetches or instruction memories loads, coming from the processor. As such, the ICACHE only manages cacheable read transactions and does not manage cacheable write transactions.
The noncacheable transactions (both read and write ones) bypass the ICACHE.
For the error management purpose, in case a write cacheable transaction is presented (this only happens in case of bad software programming), the ICACHE sets an error flag and, if enabled, raises an interrupt to the processor.
18.4.1 ICACHE block diagram
Figure 49. ICACHE block diagram

The diagram illustrates the internal structure of the ICACHE. At the top, a bidirectional AHB bus connects to a 'Configuration slave port'. This port leads to a 'Configuration interface' block containing several sub-blocks: 'Region 0 cfg', 'Region 2 cfg', 'Hit monitor', 'Control', 'Region 1 cfg', 'Region 3 cfg', 'Miss monitor', and 'Status'. Below this is the 'Cache control logic' block, which includes a 'Cache FSM', 'pLRU-t', and 'REMAP' components. This logic is connected to an 'Execution port interface' on the left and a 'Master port interface' on the right. The 'Execution port interface' connects to the 'C-AHB' bus of the 'Cortex-M33', which also features an 'Execution port' and an 'AHB' bus. An 'icache_it' signal is shown between the C-AHB and the execution port interface. The 'Master port interface' connects to the 'Main AHB' bus, which includes 'Master1 port' and 'Master2 port' AHB buses. The 'Cache control logic' is connected via a 'Cache memory port' to two parallel memory blocks: 'Cache TAG memories' and 'Cache data memories', both labeled 'n ways'. The entire ICACHE block is labeled 'ICACHE' at the bottom left. A reference code 'MSv48191V3' is located at the bottom right.
18.4.2 ICACHE reset and clocks
The ICACHE is clocked on the Cortex®-M33 C-AHB bus clock.
When the ICACHE reset signal is released, a cache invalidate procedure is automatically launched, making the ICACHE busy (ICACHE_SR = 0x0000 0001).
When this procedure is finished:
- • the ICACHE is invalidated: “cold cache”, with all cache line valid bits = 0 (ICACHE must be filled up)
- • ICACHE_SR = 0x0000 0002 (reflecting the cache is no longer busy)
- • the ICACHE is disabled: the EN bit in ICACHE_CR holds its reset state (=0).
Note: When disabled, the ICACHE is bypassed, except the remapping mechanism that is still functional: slave input requests (remapped or not) are forwarded to the master port(s).
18.4.3 ICACHE TAG memory
The ICACHE TAG memory contains:
- • address tags that indicate which data are contained in the cache data memories
- • validity bits
There is one valid bit per cache line (per way).
The valid bit is set when a cache line is refilled (after a miss).
Valid bits are reset in any of the below cases:
- • after the ICACHE reset is released
- • when the cache is disabled, by setting EN = 0 in ICACHE_CR (by software)
- • when executing an ICACHE invalidate command, by setting CACHEINV = 1 in ICACHE_CR (by software)
When a cacheable transaction is received at the execution input port, its AHB address (HADDR_in) is split into the following fields (see Table 75 for B and W definitions):
- • HADDR_in[B-1:0]: address byte offset, indicates which byte to select inside a cache line.
- • HADDR_in[B+W-1:B]: address way index, indicates which cache line to select inside each way.
- • HADDR_in[31:B+W]: tag address, to be compared to the TAG memory address to check if the requested data is already available (meaning valid) inside the ICACHE.
The following table gives a summary of the ICACHE main parameters for TAG memory dimensioning. Figure 50 shows the functional view of TAG and data memories, for an n-way set associative ICACHE.
Table 75. TAG memory dimensioning parameters
for n-way set associative operating mode (default)
| Parameter | Value | Example |
|---|---|---|
| Cache size | S Kbytes = s bytes (s = 1024 × S) | 8 Kbytes = 8192 bytes |
| Cache number of ways | n | 2 |
| Cache line size | L-byte = l-bit (l = 8 × L) | 16-byte = 128-bit |
| Number of cache lines (per way) | LpW = s/(n × L) lines / way | 256 lines / way |
| Address byte offset size | B = log₂(L) bit | 4-bit |
| Address way index size | W = log₂(LpW) bit | 8-bit |
| TAG address size | T = (32-W-B) bit | 20-bit |
Figure 50. ICACHE TAG and data memories functional view

MSv48192V2
18.4.4 Direct-mapped ICACHE (1-way cache)
The default configuration (at reset) is an n-way set associative cache (WAYSEL = 1 in ICACHE_CR), but the user can configure the ICACHE as direct mapped by writing WAYSEL = 0 (only possible when the cache is disabled, EN = 0 in ICACHE_CR).
The following table gives a summary of ICACHE main parameters for TAG memory when the direct-mapped cache operating mode is selected.
Table 76. TAG memory dimensioning parameters for direct-mapped cache mode
| Parameter | Value | Example |
|---|---|---|
| Cache size | S Kbytes = s bytes (s = 1024 x S) | 8 Kbytes = 8192 bytes |
| Cache number of ways | 1 | 1 |
| Cache line size | L-byte = l-bit (l = 8 x L) | 16-byte = 128-bit |
| Number of cache lines | LpW = s / L lines | 512 lines |
| Address byte offset size | B = log2(L) bit | 4-bit |
| Address way index size | W = log2(LpW) bit | 9-bit |
| TAG address size | T = (32 - W - B) bit | 19-bit |
All cache operations (such as read, refill, remapping, invalidation) remain the same in the direct-mapped configuration. The only difference is the absence of a replacement algorithm in case of line eviction (as explained in Section 18.4.8): only one way (the unique one) is possible for any data refill.
18.4.5 ICACHE enable
To activate the ICACHE, the EN bit must be set to 1 in ICACHE_CR.
When the ICACHE is disabled, it is bypassed and all transactions are copied from the slave port to the master ports in the same clock cycle.
It is recommended to initialize or modify the main memory content (region to be later cached) with the ICACHE disabled, and to enable the ICACHE only when this region remains unchanged (an enabled ICACHE detects cacheable write transactions as errors).
To ensure performance determinism, it is recommended to wait for the end of a potential cache invalidate procedure before enabling the ICACHE. This procedure occurs when the hardware reset signal is released, when CACHEINV is set, or when EN is cleared in ICACHE_CR. During the procedure, BUSYF is set in ICACHE_SR, and once finished, BUSYF is cleared and BSYENDF is set in the same register (raising the ICACHE interrupt if enabled on such a busy end condition).
The software must test BUSYF and/or BSYENDF values before enabling the ICACHE. Else, if the ICACHE is enabled before the end of an invalidate procedure, any cache access (while BUSYF = 1) is treated as noncacheable, and its performance depends on the main memory access time.
The address remapping is performed, whether the ICACHE is enabled or not, if the input transaction address falls into the memory regions defined and enabled in ICACHE_CRRx (see Figure 51: ICACHE remapping address mechanism).
The ICACHE is by default disabled at boot.
18.4.6 Cacheable and noncacheable traffic
The ICACHE is developed for the Cortex®-M33 core. It is placed on the C-AHB bus, and thus caches the code memory region, ranging from address 0x0000 0000 to 0x1FFF FFFF of the memory map.
To make some other memory regions cacheable, the ICACHE supports a memory-region-remapping feature. It is used to define up to four external memory regions, which addresses have an alias in the code region. Addressing these external memory regions through their code alias address allows the memory request to be routed to the C-AHB bus, and to be managed by the ICACHE.
Any external memory space physically mapped at an address in the range [0x6000 0000:0xAFFF FFFF] can be aliased with an address in the range [0x0000 0000:0x07FF FFFF] or [0x1000 0000:0x1FFF FFFF].
For a given memory request in the code region, the ICACHE implements the address remapping functionality first. If aliased, it is the remapped address, which is then cached, and, if needed, provided to the master port to address the main AHB bus matrix. The destination physical address does not need further manipulation on the AHB bus.
The remapping functionality is also available for noncacheable traffic, and when the cache is disabled.
Further details on address remapping are provided in Section 18.4.7.
An incoming memory request to the ICACHE is defined as cacheable according to its AHB transaction memory lookup attribute, as shown in Table 77. This AHB attribute depends on the MPU (memory protection unit) programming for the addressed region.
Table 77. ICACHE cacheability for AHB transaction
| AHB lookup attribute | Cacheability |
|---|---|
| 1 | Cacheable |
| 0 | Noncacheable |
In the case of a noncacheable access (either a noncacheable read or a noncacheable write), the ICACHE is bypassed, meaning that the AHB transaction is propagated unchanged to the master output port, except the transaction address, which may be modified due to the address remapping feature (see Section 18.4.7).
The bypass, and eventual remap logic, does not increase the latency of the access to the targeted memory.
In the case of a cacheable access, the ICACHE behaves as explained in Section 18.4.8.
Cacheable memory regions are defined and programmed by the user in the MPU that is responsible for the generation of the AHB attribute signals for any transaction addressing a given region.
The following table summarizes programmable configurations of various memories.
Table 78. Memory configurations
| Memory | Cacheable (MPU programming) | Remapped in the ICACHE (ICACHE_CRRx programming) |
|---|---|---|
| Flash memory | Yes or No | Not required |
| SRAM | Not recommended | Not required |
| External memories | Yes | Required |
| No | Required if the user wants code in external memories fetched on C-AHB bus (else on S-AHB bus) |
18.4.7 Address remapping
The ICACHE allows an alias address to be defined in the code region for up to four external memory regions.
The address remapping is applied on the code alias address, transforming it into the destination external physical address.
The remapping operation is fully software configurable by programming ICACHE_CRRx (x = 0 to 3, number of remapped regions). This programming can be done only when the ICACHE is disabled.
Each region x can be individually enabled with REN in ICACHE_CRRx. Once enabled, the remap operation occurs even if the ICACHE is disabled, or if the transaction is noncacheable.
Remap regions can have different size: each region size can be programmed in RSIZE of its ICACHE_CRRx. The size of each region is a power of two multiple of range granularity (2 Mbytes), with a minimum region size of 2 Mbytes, and a maximum region size of 128 Mbytes.
The address remapping mechanism is based on the matching of an incoming AHB address (HADDR_in) with a given code subregion base-address, and the modification of this address into its (remapped) external physical address, as follows:
- • HADDR_in belongs to region x if \(\text{HADDR\_in}[31:\text{RI}] = 000:\text{BASEADDR}[28:\text{RI}]\), where:
- – 000:BASEADDR is the code subregion base-address programmed in BASEADDR of ICACHE_CRRx.
- – RI defines the number of significant bits to consider. RI = log₂(region size) with a minimum value of 21 (for a 2-Mbyte region) and a maximum value of 27 (for a 128-Mbyte region).
- • If the region x is enabled, the master port output AHB address (HADDR_out) is composed by concatenating the two below parts:
- – REMAPADDR[31:RI] field of ICACHE_CRRx as MSBs
- – HADDR_in[RI-1:0] as LSBs.
The following figure describes the matching and the output address generation.
Figure 51. ICACHE remapping address mechanism
![Figure 51: ICACHE remapping address mechanism diagram. The diagram shows the process of remapping an incoming address HADDR_in to an output address HADDR_out. HADDR_in is a 32-bit bus (bits 31 to 0). A comparison is performed between the upper bits of HADDR_in (bits 31 to RI) and the base address 000:BASEADDR[28:RI]. If they match, the address is in region x. The output address HADDR_out is formed by concatenating the REMAPADDR[31:RI] field (bits 31 to RI) with the lower bits of HADDR_in (bits RI-1 to 0).](/RM0457-STM32MP23-25/72c2f62b18b5e7ca782ae56ef24b58ac_img.jpg)
The diagram illustrates the ICACHE remapping address mechanism. It shows the flow from an incoming address HADDR\_in (bits 31 to 0) to an output address HADDR\_out (bits 31 to 0). The process involves a comparison of the upper bits of HADDR\_in (bits 31 to RI) with the base address 000:BASEADDR[28:RI]. If they match, the address is in region x. The output address HADDR\_out is then formed by concatenating the REMAPADDR[31:RI] field (bits 31 to RI) with the lower bits of HADDR\_in (bits RI-1 to 0). The diagram includes a comparator block labeled = = and a multiplexer block labeled 0/1. The output address HADDR\_out is shown as a 32-bit bus with bits 31 to RI labeled REMAPADDR[31:RI] and bits RI-1 to 0 labeled HADDR\_in[RI-1:0]. The diagram is labeled MSv48194V2.
The following table summarizes all possible configurations of BASEADDR and REMAPADDR sizes (number of significant MSBs) in ICACHE_CRRx, depending on RSIZE.
Table 79. ICACHE remap region size, base address and remap address
| Region size (Mbytes) | Base address size (MSBs) | Remap address (MSBs) |
|---|---|---|
| 2 | 8 | 11 |
| 4 | 7 | 10 |
| 8 | 6 | 9 |
| 16 | 5 | 8 |
| 32 | 4 | 7 |
| 64 | 3 | 6 |
| 128 | 2 | 5 |
Care must be taken while programming BASEADDR and REMAPADDR in ICACHE_CRRx: if the programmed value is bigger than expected (number of MSBs, see Table 79), the unnecessary extra LSBs are ignored.
Typical remapping example: a 128-Mbyte external RAM region physically located in the external address range [0x9000 0000:0x97FF FFFF], remapped in the code section range [0x1800 0000:0x1FFF FFFF]:
- • REMAPADDR[31:21] = 0x480
- • BASEADDR[28:21] = 0xC0
- • HADDR_in[31:27] is compared to 000:BASEADDR[28:27], and HADDR_in/BASEADDR[26:21] are ignored for the comparison.
If the comparison matches:
- • HADDR_out[31:27] gets REMAPADDR[31:27] (in place of HADDR_in[31:27])
- • HADDR_out[26:0] gets HADDR_in[26:0]
The software can program the kind of AHB burst that is generated by the ICACHE master ports on the bus matrix (for cache line refill), by setting HBURST in ICACHE_CRRx with:
- • WRAP for remapped external memories accessed through interfaces that can support WRAP burst mode, providing the benefit of the critical-word-first feature performance:
- – WRAP burst size = cache line size
- – WRAP burst start address = word address of the first data requested by the core
- • INCR: INCR burst mode for external memories accessed through the interfaces that do not support WRAP burst mode (losing the benefit of critical-word-first feature):
- – INCR burst size = cache line size
- – INCR burst start address = address aligned on the boundary of the cache line containing the requested word.
Note: Coherency is needed when programming the SAU (secure attribution unit) and the MPU (memory protection unit) attributes for both the external regions and their aliased code subregions.
18.4.8 Cacheable accesses
When the ICACHE receives a cacheable transaction from the Cortex®-M33, the ICACHE checks if the address requested is present in its TAG memory, and if the corresponding cache line is valid.
There are then three alternatives:
- • The address is present inside the TAG memory, the cache line is valid: cache hit, the data is read from the cache and provided to the processor in the same cycle.
- • The address is not present in the TAG memory: cache miss, the data is read from the main memory and provided to the processor, and a cache line refill is performed.
The critical-word-first policy insures minimum wait cycles for the processor, since read data can be provided while the cache still performs a cache line refill (associated latency is the latency of fetching one word from the main memory).
The burst generated on the ICACHE master bus is WRAPw (w being the cache line width, in words) in case no address remap occurs. If an address remap occurs, the kind of burst depends on the HBURST programmed in corresponding ICACHE_CRRx.
The AHB transaction attributes are also propagated to the main AHB bus matrix on the master port selected for the line refill.
- • The address is not present in TAG memory, but belongs to the refill burst from the main memory currently ongoing: cache hit (hit-under-miss feature).
This happens during cache-line refill. The ICACHE can provide the requested data as soon as the data is available at its master interface, thus avoiding a miss (fetching data from the main memory).
In the case of cache refill (due to cache miss), the ICACHE selects which cache line is written with the refill data:
- • In direct map (1-way) mode, only one line can be used to store the refill data: the line pointed by the index of the input address.
- • In n-way set associative mode, one line among n can be used (the line pointed by the address index, in each of the n ways). The way selection is based on a pLRU-t replacement algorithm that points, for each index, on the way candidate for the next refill.
If ever the cache line where the refill data must be written is already valid, the targeted cache line must be invalidated first. This is true whatever the direct map or n-way set associative cache mode.
18.4.9 Dual-master cache
The ICACHE implements a dual-port AHB master on the main AHB bus matrix: master1 and master2 ports. This is used to split the traffic going to different destination memories.
The nonremapped traffic goes systematically to master1 port. The remapped traffic can be routed on the master2 port by programming MSTSEL in ICACHE_CRRx (on a region basis).
The code can typically be fetched as follows:
- • internal flash memory and internal SRAM on master1 port (Fast bus)
- • external flash memory/RAM on master2 port (Slow bus)
For systems not implementing external memories, the traffic to the internal flash memory can be decoupled from the traffic to the internal SRAM (when remapped by the ICACHE). This feature is used to prevent further processor stalls on misses.
Alongside with hit-under-miss, this dual-master feature allows the processor to have an alternative path in case of fetching from different memories.
18.4.10 ICACHE security
The ICACHE implements an Armv8-M TrustZone.
ICACHE configuration registers are protected at system level.
18.4.11 ICACHE maintenance
The software can invalidate the whole content of the ICACHE by programming CACHEINV in the ICACHE_CR register.
When CACHEINV = 1, the ICACHE control logic sets the BUSYF flag in ICACHE_SR and launches the invalidate cache operation, resetting each TAG valid bit to 0 (one valid bit per cache line). CACHEINV is automatically cleared.
Once the invalidate operation is finished (all valid bits reset to 0), the ICACHE automatically clears BUSYF, and sets BSYENDF in the ICACHE_SR register.
If enabled on this flag condition (BSYENDIE = 1 in ICACHE_IER), the ICACHE interrupt is raised. Then, the (empty) cache is available again.
18.4.12 ICACHE performance monitoring
The ICACHE provides the following monitors for performance analysis:
- • The 32-bit hit monitor counts the cacheable AHB-transactions on the slave cache port that hits the ICACHE content.
It also takes into account all accesses whose address is present in the TAG memory or in the refill buffer (due to a previous miss, and whose data is coming, or is soon to come, from the cache master port) (see Section 18.4.8). - • The 16-bit miss monitor counts the cacheable AHB-transactions on the slave cache port that misses the ICACHE content.
It also takes into account all accesses whose address is not present neither in the TAG memory nor in the refill buffer.
Upon reaching their maximum values, these monitors do not wrap over.
Hit and miss monitors can be enabled and reset by software allowing the analysis of specific pieces of code.
The software can perform the following tasks:
- • Enable/stop the hit monitor through HITMEN in ICACHE_CR.
- • Reset the hit monitor by setting HITMRST in ICACHE_CR.
- • Enable/stop the miss monitor through MISSMEN in ICACHE_CR.
- • Reset the miss monitor by setting MISSMRST in ICACHE_CR.
To reduce power consumption, these monitors are disabled (stopped) by default.
18.4.13 ICACHE boot
The ICACHE is disabled (EN = 0 in ICACHE_CR) at boot.
The code remapping at boot is not needed for a Cortex®-M33 since it implements the VTOR (vector tables) that allows a boot start address definition different than 0x0.
Once the boot is finished, the ICACHE can be enabled (software setting EN = 1 in ICACHE_CR).
18.5 ICACHE low-power modes
At device level, using the ICACHE reduces the power consumption by fetching instructions from the internal ICACHE most of the time, rather than from the bigger and then more power consuming main memories. This reduction is even higher if the cached main memories are external.
Applications with lower performance profile (in terms of hit ratio) and stringent power consumption constraints may benefit from the lower power consumption of an ICACHE configured as direct mapped. This single-way cache configuration is obtained by programming WAYSEL = 0 in ICACHE_CR (see Figure 50). The power consumption is reduced by accessing, for each request, only the necessary cut of TAG and data memories. The cache effect still improves fetch performance, even if for most code execution, it is less efficient than with an n-way set associative cache mode.
18.6 ICACHE error management and interrupts
If an unsupported cacheable write request is detected (functional error), the ICACHE generates an error by setting the ERRF flag in ICACHE_SR. An interrupt is generated if the corresponding interrupt enable bit is set (ERRIE = 1 in ICACHE_IER).
The other possible interrupt generation is at the end of a cache invalidation operation. When the cache-busy state is finished, the ICACHE sets the BSYENDF flag in ICACHE_SR. An interrupt is generated if the corresponding interrupt enable bit is set (BSYENDIE = 1 in ICACHE_IER).
All ICACHE interrupt sources raise the same and unique interrupt signal, icache_it, and then use the same interrupt vector.
Table 80. ICACHE interrupts
| Interrupt vector | Interrupt event | Event flag | Enable control bit | Interrupt clear method |
|---|---|---|---|---|
| ICACHE | Functional error | ERRF in ICACHE_SR | ERRIE in ICACHE_IER | Set CERRF to 1 in ICACHE_FCR |
| End of busy state (invalidate finished) | BSYENDF in ICACHE_SR | BSYENDIE in ICACHE_IER | Set CBSYENDF to 1 in ICACHE_FCR |
The ICACHE also propagates all AHB bus errors (such as security issues, address decoding issues) from the master1 or master2 port back to the execution port.
18.7 ICACHE registers
18.7.1 ICACHE control register (ICACHE_CR)
Address offset: 0x000
Reset value: 0x0000 0004
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MISSM RST | HITM RST | MISSM EN | HITM EN |
| rw | rw | rw | rw | ||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | WAY SEL | CACHE INV | EN |
| rw | w | rw |
Bits 31:20 Reserved, must be kept at reset value.
Bit 19 MISSMRST: miss monitor reset
- 0: release the cache miss monitor reset (needed to enable the counting)
- 1: reset cache miss monitor
Bit 18 HITMRST: hit monitor reset
- 0: release the cache miss monitor reset (needed to enable the counting)
- 1: reset cache hit monitor
Bit 17 MISSMEN: miss monitor enable
- 0: cache miss monitor switched off. Stopping the monitor does not reset it.
- 1: cache miss monitor enabled
Bit 16 HITMEN: hit monitor enable
- 0: cache hit monitor switched off. Stopping the monitor does not reset it.
- 1: cache hit monitor enabled
Bits 15:3 Reserved, must be kept at reset value.
Bit 2 WAYSEL: cache associativity mode selection
This bit allows user to choose ICACHE set-associativity. It can be written by software only when cache is disabled (EN = 0).
- 0: direct mapped cache (1-way cache)
- 1: n-way set associative cache (reset value)
Bit 1 CACHEINV: cache invalidation
Set by software and cleared by hardware when the BUSYF flag is set (during cache maintenance operation). Writing 0 has no effect.
- 0: no effect
- 1: invalidate entire cache (all cache lines valid bit = 0)
Bit 0 EN: enable
- 0: cache disabled
- 1: cache enabled
18.7.2 ICACHE status register (ICACHE_SR)
Address offset: 0x004
Reset value: 0x0000 0001
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | ERRF | BSYENDF | BUSYF |
| r | r | r |
Bits 31:3 Reserved, must be kept at reset value.
Bit 2 ERRF: cache error flag
- 0: no error
- 1: an error occurred during the operation (cacheable write)
Bit 1 BSYENDF: busy end flag
- 0: cache busy
- 1: full invalidate CACHEINV operation finished
Bit 0 BUSYF: busy flag
- 0: cache not busy on a CACHEINV operation
- 1: cache executing a full invalidate CACHEINV operation
18.7.3 ICACHE interrupt enable register (ICACHE_IER)
Address offset: 0x008
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | ERRIE | BSYEN DIE | Res. |
| rw | rw |
Bits 31:3 Reserved, must be kept at reset value.
Bit 2 ERRIE: interrupt enable on cache error
Set by software to enable an interrupt generation in case of cache functional error (cacheable write access)
0: interrupt disabled on error
1: interrupt enabled on error
Bit 1 BSYENDIE: interrupt enable on busy end
Set by software to enable an interrupt generation at the end of a cache invalidate operation.
0: interrupt disabled on busy end
1: interrupt enabled on busy end
Bit 0 Reserved, must be kept at reset value.
18.7.4 ICACHE flag clear register (ICACHE_FCR)
Address offset: 0x00C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CERRF | CBSY ENDF | Res. |
| w | w |
Bits 31:3 Reserved, must be kept at reset value.
Bit 2 CERRF: clear cache error flag
Set by software.
0: no effect
1: clears ERRF flag in ICACHE_SR
Bit 1 CBSYENDF: clear busy end flag
Set by software.
0: no effect
1: clears BSYENDF flag in ICACHE_SR.
Bit 0 Reserved, must be kept at reset value.
18.7.5 ICACHE hit monitor register (ICACHE_HMONR)
Address offset: 0x010
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| HITMON[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| HITMON[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 HITMON[31:0]: cache hit monitor counter
18.7.6 ICACHE miss monitor register (ICACHE_MMONR)
Address offset: 0x014
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| MISSMON[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 MISSMON[15:0]: cache miss monitor counter
18.7.7 ICACHE region x configuration register (ICACHE_CRRx)
Address offset: 0x020 + 0x4 * x, (x = 0 to 3)
Reset value: 0x0000 0200
Define an alias address in the code region for other regions, making them cacheable.
BASEDADDR and REMAPADDR fields are write locked (read only) when EN = 1 in ICACHE_CR.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| HBURST | Res. | Res. | MSTSEL | Res. | REMAPADDR[31:21] | ||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| REN | Res. | Res. | Res. | RSIZE[2:0] | Res. | BASEADDR[28:21] | |||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||||
- Bit 31 HBURST: output burst type for region x
- 0: WRAP
- 1: INCR
- Bits 30:29 Reserved, must be kept at reset value.
- Bit 28 MSTSEL: AHB cache master selection for region x
- 0: no action (master1 selected by default)
- 1: master2 selected
- Bit 27 Reserved, must be kept at reset value.
- Bits 26:16 REMAPADDR[31:21]: remapped address for region x
- This field replaces the alias address defined by BASEADDR field.
- The only useful bits are [31:RI], where 21 ≤ RI ≤ 27 is the number of bits of RSIZE (see Section 18.4.7). If the programmed value has more LSBs, the useless bits are ignored.
- Bit 15 REN: enable for region x
- 0: disabled
- 1: enabled
- Bits 14:12 Reserved, must be kept at reset value.
- Bits 11:9 RSIZE[2:0]: size for region x
- 000: reserved
- 001: 2 Mbytes
- 010: 4 Mbytes
- 011: 8 Mbytes
- 100: 16 Mbytes
- 101: 32 Mbytes
- 110: 64 Mbytes
- 111: 128 Mbytes
- Bit 8 Reserved, must be kept at reset value.
- Bits 7:0 BASEADDR[28:21]: base address for region x
- This alias address is replaced by REMAPADDR field.
- The only useful bits are [28:RI], where 21 ≤ RI ≤ 27 is the number of bits of RSIZE (see Section 18.4.7). If the programmed value has more LSBs, the useless bits are ignored.
18.7.8 ICACHE hardware configuration register (ICACHE_HWCFGR)
Address offset: 0x3F0
Reset value: 0x00A4 1641
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| ECC | Res. | Res. | Res. | GSWIDTH[1:0] | Res. | SMASTER[1:0] | FMASTER[1:0] | Res. | Res. | REGION[2:0] | |||||
| r | r | r | r | r | r | r | r | r | r | ||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RANGE[3:0] | Res. | LWIDTH[1:0] | Res. | Res. | SIZE[2:0] | Res. | Res. | WAYS[1:0] | |||||||
| r | r | r | r | r | r | r | r | r | r | r | |||||
- Bit 31 ECC: error detection and correction support
- 0: no ECC hardware support
- 1: ECC hardware support

- Bits 30:28 Reserved, must be kept at reset value.
- Bits 27:26 GSWIDTH[1:0]: data size of the AHB slave interface
- 00: 32-bit
- 01: 64-bit
- 10: 128-bit
- 11: reserved
- Bit 25 Reserved, must be kept at reset value.
- Bits 24:23 SMASTER[1:0]: data size of the second AHB master interface (master2)
- 00: no second master (single master cache)
- 01: 32-bit
- 10: 64-bit
- 11: reserved
- Bits 22:21 FMASTER[1:0]: data size of the first AHB master interface (master1)
- 00: reserved
- 01: 32-bit
- 10: 64-bit
- 11: 128-bit
- Bits 20:19 Reserved, must be kept at reset value.
- Bits 18:16 REGION[2:0]: number of regions that can be remapped
- 000: no region
- 001: 1 region
- 010: 2 regions
- 011: 3 regions
- 100: 4 regions
- others: reserved
- Bits 15:12 RANGE[3:0]: range granularity of remapped memory regions
- 0000: reserved
- 0001: 2 Mbytes
- 0010: 4 Mbytes
- 0011: 8 Mbytes
- 0100: 16 Mbytes
- 0101: 32 Mbytes
- 0110: 64 Mbytes
- 0111: 128 Mbytes
- others: reserved
- Bit 11 Reserved, must be kept at reset value.
- Bits 10:9 LWIDTH[1:0]: cache line width
- 00: reserved
- 01: 64-bit (8 bytes per line)
- 10: 128-bit (16 bytes per line)
- 11: 256-bit (32 bytes per line)
- Bits 8:7 Reserved, must be kept at reset value.
Bits 6:4 SIZE[2:0]: cache size
- 000: reserved
- 001: 2-Kbyte
- 010: 4-Kbyte
- 011: 8-Kbyte
- 100: 16-Kbyte
- 101: 32-Kbyte
- others: reserved
Bits 3:2 Reserved, must be kept at reset value.
Bits 1:0 WAYS[1:0]: cache associativity, number of ways
- 00: reserved
- 01: 2-way set associative
- 10: 4-way set associative
- 11: reserved
18.7.9 ICACHE version register (ICACHE_VERR)
Address offset: 0x3F4
Reset value: 0x0000 0012
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MAJREV[3:0] | MINREV[3:0] | ||||||
| r | r | r | r | r | r | r | r | ||||||||
Bits 31:8 Reserved, must be kept at reset value.
Bits 7:4 MAJREV[3:0]: ICACHE major revision
Bits 3:0 MINREV[3:0]: ICACHE minor revision
18.7.10 ICACHE identification register (ICACHE_IPIDR)
Address offset: 0x3F8
Reset value: 0x0010 0081
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| ID[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| ID[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 ID[31:0]: ICACHE identification

18.7.11 ICACHE size identification register (ICACHE_SIDR)
Address offset: 0x3FC
Reset value: 0xA3C5 DD01
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| SID[31:16] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SID[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:0 SID[31:0]: ICACHE address space size identification
18.7.12 ICACHE register map
Table 81. ICACHE register map and reset values
| Offset | Register name | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x000 | ICACHE_CR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MISSMRST | HITMRST | MISSMEN | HITMEN | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | WAYSEL | CACHEINV | EN |
| Reset value | 0 | 0 | 0 | 0 | 1 | 0 | 0 | ||||||||||||||||||||||||||
| 0x004 | ICACHE_SR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | ERRF | BSYENDF | BUSYF |
| Reset value | 0 | 0 | 1 | ||||||||||||||||||||||||||||||
| 0x008 | ICACHE_IER | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | ERRIE | BSYENDIE | Res. |
| Reset value | 0 | 0 | |||||||||||||||||||||||||||||||
| 0x00C | ICACHE_FCR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CERRF | CBSYENDF | Res. |
| Reset value | 0 | 0 | |||||||||||||||||||||||||||||||
| 0x010 | ICACHE_HMONR | HITMON[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0x014 | ICACHE_MMONR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MISSMON[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x018- 0x01C | Reserved | Reserved | |||||||||||||||||||||||||||||||
| 0x020 | ICACHE_CRR0 | HBURST | Res. | Res. | MSTSEL | Res. | Res. | REMAPADDR[31:21] | REN | Res. | Res. | Res. | Res. | RSIZE [2:0] | Res. | Res. | BASEADDR[28:21] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||
| 0x024 | ICACHE_CRR1 | HBURST | Res. | Res. | MSTSEL | Res. | Res. | REMAPADDR[31:21] | REN | Res. | Res. | Res. | Res. | RSIZE [2:0] | Res. | Res. | BASEADDR[28:21] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||
| 0x028 | ICACHE_CRR2 | HBURST | Res. | Res. | MSTSEL | Res. | Res. | REMAPADDR[31:21] | REN | Res. | Res. | Res. | Res. | RSIZE [2:0] | Res. | Res. | BASEADDR[28:21] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||
| 0x02C | ICACHE_CRR3 | HBURST | Res. | Res. | MSTSEL | Res. | Res. | REMAPADDR[31:21] | REN | Res. | Res. | Res. | Res. | RSIZE [2:0] | Res. | Res. | BASEADDR[28:21] | ||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||
| 0x030- 0x3EC | Reserved | Reserved | |||||||||||||||||||||||||||||||
| 0x3F0 | ICACHE_HWCFGR | ECC | Res. | Res. | GSWIDTH [1:0] | Res. | Res. | SMASTER [1:0] | FMASTER [1:0] | Res. | Res. | REGION [2:0] | RANGE[3:0] | Res. | LWIDTH [1:0] | Res. | Res. | SIZE[2:0] | Res. | Res. | WAYS [1:0] | ||||||||||||
| Reset value | 0x00A4 1641 | ||||||||||||||||||||||||||||||||
| 0x3F4 | ICACHE_VERR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | MAJREV[3:0] | MINREV[3:0] | ||||||
| Reset value | 0x0000 0012 | ||||||||||||||||||||||||||||||||
| 0x3F8 | ICACHE_IPIDR | ID[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0x0010 0081 | ||||||||||||||||||||||||||||||||

Table 81. ICACHE register map and reset values (continued)
| Offset | Register name | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x3FC | ICACHE_SIDR | SID[31:0] | |||||||||||||||||||||||||||||||
| Reset value | 0xA3C5 DD01 | ||||||||||||||||||||||||||||||||
Refer to Section 2.4 for the register boundary addresses.