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... | |
The hardware access layer for managing the CACHE peripheral.
enum nrf_cache_region_t |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | set | Set that contains the data to get. |
[in] | way | Way that contains the data to get. |
[in] | word | Data word index to 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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Cache region. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Cache region. |
NRF_STATIC_INLINE void nrf_cache_disable | ( | NRF_CACHE_Type * | p_reg | ) |
Function for disabling the CACHE peripheral.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_cache_enable | ( | NRF_CACHE_Type * | p_reg | ) |
Function for enabling the CACHE peripheral.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_cache_erase | ( | NRF_CACHE_Type * | p_reg | ) |
Function for erasing the cache content.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE bool nrf_cache_erase_status_check | ( | NRF_CACHE_Type const * | p_reg | ) |
Function for checking the status of nrf_cache_erase().
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | Erase is finished. |
false | Erase is not complete or has not started. |
NRF_STATIC_INLINE void nrf_cache_erase_status_clear | ( | NRF_CACHE_Type * | p_reg | ) |
Function for clearing the status of the cache erase.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Cache region. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Cache region. |
NRF_STATIC_INLINE void nrf_cache_invalidate | ( | NRF_CACHE_Type * | p_reg | ) |
Function for invalidating the cache content.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | set | Set that contains the cache line to check. |
[in] | way | Way that contains the cache line to check. |
true | Cache line is valid. |
false | Cache line is invalid. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | set | Specified set. |
NRF_STATIC_INLINE void nrf_cache_profiling_counters_clear | ( | NRF_CACHE_Type * | p_reg | ) |
Function for clearing the cache profiling counters.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_cache_profiling_set | ( | NRF_CACHE_Type * | p_reg, |
bool | enable | ||
) |
Function for setting the cache profiling.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if cache profiling is to be enabled, false otherwise. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if the cache RAM mode is to be enabled, false otherwise. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | set | Set that contains the tag to get. |
[in] | way | Way that contains the tag to get. |
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.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if cache content update lock is to be enabled, false otherwise. |