nrfx 2.5
Enumerations | Functions
CACHE HAL

The hardware access layer for managing the CACHE peripheral. More...

Enumerations

enum  nrf_cache_region_t {
  NRF_CACHE_REGION_FLASH = 0,
  NRF_CACHE_REGION_XIP = 1
}
 Cache regions. More...
 

Functions

NRF_STATIC_INLINE void nrf_cache_enable (NRF_CACHE_Type *p_reg)
 Function for enabling the CACHE peripheral. More...
 
NRF_STATIC_INLINE void nrf_cache_disable (NRF_CACHE_Type *p_reg)
 Function for disabling the CACHE peripheral. More...
 
NRF_STATIC_INLINE void nrf_cache_invalidate (NRF_CACHE_Type *p_reg)
 Function for invalidating the cache content. More...
 
NRF_STATIC_INLINE void nrf_cache_erase (NRF_CACHE_Type *p_reg)
 Function for erasing the cache content. More...
 
NRF_STATIC_INLINE bool nrf_cache_erase_status_check (NRF_CACHE_Type const *p_reg)
 Function for checking the status of nrf_cache_erase(). More...
 
NRF_STATIC_INLINE void nrf_cache_erase_status_clear (NRF_CACHE_Type *p_reg)
 Function for clearing the status of the cache erase. More...
 
NRF_STATIC_INLINE void nrf_cache_profiling_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for setting the cache profiling. More...
 
NRF_STATIC_INLINE void nrf_cache_profiling_counters_clear (NRF_CACHE_Type *p_reg)
 Function for clearing the cache profiling counters. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_instruction_hit_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache hits for instruction fetch from the specified cache region. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_instruction_miss_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache misses for instruction fetch from the specified cache region. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_hit_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache hits for data fetch from the specified cache region. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_miss_counter_get (NRF_CACHE_Type const *p_reg, nrf_cache_region_t region)
 Function for getting the number of cache misses for data fetch from the specified cache region. More...
 
NRF_STATIC_INLINE void nrf_cache_ram_mode_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for setting the cache RAM mode. More...
 
NRF_STATIC_INLINE void nrf_cache_read_lock_enable (NRF_CACHE_Type *p_reg)
 Function for blocking the cache content access. More...
 
NRF_STATIC_INLINE void nrf_cache_update_lock_set (NRF_CACHE_Type *p_reg, bool enable)
 Function for blocking the cache content updates. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_data_get (NRF_CACHEDATA_Type const *p_reg, uint32_t set, uint8_t way, uint8_t word)
 Function for getting the cache data word. More...
 
NRF_STATIC_INLINE uint32_t nrf_cache_tag_get (NRF_CACHEINFO_Type const *p_reg, uint32_t set, uint8_t way)
 Function for getting the tag associated with the specified set and way. More...
 
NRF_STATIC_INLINE bool nrf_cache_line_validity_check (NRF_CACHEINFO_Type const *p_reg, uint32_t set, uint8_t way)
 Function for checking the validity of a cache line associated with the specified set and way. More...
 
NRF_STATIC_INLINE uint8_t nrf_cache_mru_get (NRF_CACHEINFO_Type const *p_reg, uint32_t set)
 Function for getting the most recently used way in the specified set. More...
 

Detailed Description

The hardware access layer for managing the CACHE peripheral.

Enumeration Type Documentation

◆ nrf_cache_region_t

Cache regions.

Enumerator
NRF_CACHE_REGION_FLASH 

Cache region related to Flash access.

NRF_CACHE_REGION_XIP 

Cache region related to XIP access.

Function Documentation

◆ nrf_cache_data_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_get ( NRF_CACHEDATA_Type const *  p_reg,
uint32_t  set,
uint8_t  way,
uint8_t  word 
)

Function for getting the cache data word.

Note
When operating in the RAM mode, the cache data is accessible as a general purpose RAM.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the data to get.
[in]wayWay that contains the data to get.
[in]wordData word index to get.
Returns
32-bit data word.

◆ nrf_cache_data_hit_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_hit_counter_get ( NRF_CACHE_Type const *  p_reg,
nrf_cache_region_t  region 
)

Function for getting the number of cache hits for data fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of data fetch cache hits.

◆ nrf_cache_data_miss_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_data_miss_counter_get ( NRF_CACHE_Type const *  p_reg,
nrf_cache_region_t  region 
)

Function for getting the number of cache misses for data fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of data fetch cache misses.

◆ nrf_cache_disable()

NRF_STATIC_INLINE void nrf_cache_disable ( NRF_CACHE_Type *  p_reg)

Function for disabling the CACHE peripheral.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_enable()

NRF_STATIC_INLINE void nrf_cache_enable ( NRF_CACHE_Type *  p_reg)

Function for enabling the CACHE peripheral.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_erase()

NRF_STATIC_INLINE void nrf_cache_erase ( NRF_CACHE_Type *  p_reg)

Function for erasing the cache content.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_erase_status_check()

NRF_STATIC_INLINE bool nrf_cache_erase_status_check ( NRF_CACHE_Type const *  p_reg)

Function for checking the status of nrf_cache_erase().

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueErase is finished.
falseErase is not complete or has not started.

◆ nrf_cache_erase_status_clear()

NRF_STATIC_INLINE void nrf_cache_erase_status_clear ( NRF_CACHE_Type *  p_reg)

Function for clearing the status of the cache erase.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_instruction_hit_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_instruction_hit_counter_get ( NRF_CACHE_Type const *  p_reg,
nrf_cache_region_t  region 
)

Function for getting the number of cache hits for instruction fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of instruction fetch cache hits.

◆ nrf_cache_instruction_miss_counter_get()

NRF_STATIC_INLINE uint32_t nrf_cache_instruction_miss_counter_get ( NRF_CACHE_Type const *  p_reg,
nrf_cache_region_t  region 
)

Function for getting the number of cache misses for instruction fetch from the specified cache region.

Note
Separate counters are used for flash region and XIP region.
Cache profiling must be enabled first. See nrf_cache_profiling_set.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]regionCache region.
Returns
Number of instruction fetch cache misses.

◆ nrf_cache_invalidate()

NRF_STATIC_INLINE void nrf_cache_invalidate ( NRF_CACHE_Type *  p_reg)

Function for invalidating the cache content.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_line_validity_check()

NRF_STATIC_INLINE bool nrf_cache_line_validity_check ( NRF_CACHEINFO_Type const *  p_reg,
uint32_t  set,
uint8_t  way 
)

Function for checking the validity of a cache line associated with the specified set and way.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the cache line to check.
[in]wayWay that contains the cache line to check.
Return values
trueCache line is valid.
falseCache line is invalid.

◆ nrf_cache_mru_get()

NRF_STATIC_INLINE uint8_t nrf_cache_mru_get ( NRF_CACHEINFO_Type const *  p_reg,
uint32_t  set 
)

Function for getting the most recently used way in the specified set.

The most recently used way is updated on each fetch from the cache and is used for the cache replacement policy.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSpecified set.
Returns
The most recently used way in the specified set.

◆ nrf_cache_profiling_counters_clear()

NRF_STATIC_INLINE void nrf_cache_profiling_counters_clear ( NRF_CACHE_Type *  p_reg)

Function for clearing the cache profiling counters.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_profiling_set()

NRF_STATIC_INLINE void nrf_cache_profiling_set ( NRF_CACHE_Type *  p_reg,
bool  enable 
)

Function for setting the cache profiling.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if cache profiling is to be enabled, false otherwise.

◆ nrf_cache_ram_mode_set()

NRF_STATIC_INLINE void nrf_cache_ram_mode_set ( NRF_CACHE_Type *  p_reg,
bool  enable 
)

Function for setting the cache RAM mode.

When configured in the RAM mode, the accesses to internal or external flash will not be cached. In this mode, the cache data contents can be used as the read/write RAM. Only the data content of the cache is available as RAM.

Note
-Enabling the RAM mode causes the RAM to be cleared.
-Disabling the RAM mode causes the cache to be invalidated.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if the cache RAM mode is to be enabled, false otherwise.

◆ nrf_cache_read_lock_enable()

NRF_STATIC_INLINE void nrf_cache_read_lock_enable ( NRF_CACHE_Type *  p_reg)

Function for blocking the cache content access.

To unlock the cache content access, a reset has to be performed.

Note
Blocking is ignored in the RAM mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_cache_tag_get()

NRF_STATIC_INLINE uint32_t nrf_cache_tag_get ( NRF_CACHEINFO_Type const *  p_reg,
uint32_t  set,
uint8_t  way 
)

Function for getting the tag associated with the specified set and way.

The tag is used to check if an entry in the cache matches the address that is being fetched.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]setSet that contains the tag to get.
[in]wayWay that contains the tag to get.
Returns
Tag value.

◆ nrf_cache_update_lock_set()

NRF_STATIC_INLINE void nrf_cache_update_lock_set ( NRF_CACHE_Type *  p_reg,
bool  enable 
)

Function for blocking the cache content updates.

Blocking of updates prevents updating of cache content on cache misses, but the peripheral will continue to check for instruction/data fetches in the content already present in the cache.

Note
Blocking is ignored in the RAM mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]enableTrue if cache content update lock is to be enabled, false otherwise.

Documentation feedback | Developer Zone | Subscribe | Updated