bf0_hal_cache.h

Header file of CACHE HAL module.

Author

Sifli software development team

Attention

Defines

HAL_CACHE_RESET()

Clear all counters, i.e. reset to 0.

返回值:

void

HAL_CACHE_ICACHE_MPI1

Enable MPI1 ICache profiling

HAL_CACHE_ICACHE_MPI2

Enable MPI2 ICache profiling

HAL_CACHE_ICACHE_MPI3

Enable MPI3 ICache profiling

HAL_CACHE_ICACHE_MPI5

Enable MPI5 ICache profiling

HAL_CACHE_ICACHE_ALL

Enable all ICache profiling

HAL_CACHE_DCACHE_MPI1

Enable MPI1 ICache profiling

HAL_CACHE_DCACHE_MPI2

Enable MPI2 ICache profiling

HAL_CACHE_DCACHE_MPI3

Enable MPI3 ICache profiling

HAL_CACHE_DCACHE_MPI5

Enable MPI5 ICache profiling

HAL_CACHE_DCACHE_ALL

Enable all ICache profiling

HAL_CACHE_GET_ICACHE_SNAPSHOT()

Get ICACHE miss counter snapshot value when access counter overflows.

返回值:

icache – miss counter snapshot value

HAL_CACHE_GET_DCACHE_SNAPSHOT()

Get DCACHE miss counter snapshot value when access counter overflows.

返回值:

dcache – miss counter snapshot value

Functions

void HAL_CACHE_Enable(uint32_t imode, uint32_t dmode)

Enable cache profiling.

参数:
  • imode[in] ICache profiling mode bitmap, see icache profiling mode, could select multiple modes, such as HAL_CACHE_ICACHE_QSPI1_4|HAL_CACHE_ICACHE_QSPI2 for SF32LB55X

  • dmode[in] DCache profiling mode bitmap, see dcache profiling mode, could select multiple modes, such as HAL_CACHE_DCACHE_QSPI1_4|HAL_CACHE_DCACHE_QSPI2 for SF32LB55X

返回值:

void

void HAL_CACHE_Disable(void)

Disable cache profiling.

返回值:

void

void HAL_CACHE_GetMissRate(float *irate, float *drate, bool reset)

Get ICACHE and DCACHE miss rate.

参数:
  • irate[out] pointer of output icache miss rate, unit: percentage

  • drate[out] pointer of output dcache miss rate, unit: percentage

  • reset[in] true: reset all counters, false: do not reset counters

返回值:

void