SmartSnippets DA1459x SDK
hw_cache.h
Go to the documentation of this file.
1 
42 #ifndef HW_CACHE_H_
43 #define HW_CACHE_H_
44 
45 #if dg_configUSE_HW_CACHE
46 
47 #include <sdk_defs.h>
48 
49  #include "hw_cache_da1459x.h"
50 
51 /*
52  * COMMON API MRM RELATED FUNCTIONALITY DEFINITIONS
53  *****************************************************************************************
54  */
55 
65 __STATIC_INLINE void hw_cache_mrm_set_misses_thres(uint32_t thres)
66 {
67  CACHE->CACHE_MRM_MISSES_THRES_REG = thres;
68 }
69 
76 __STATIC_INLINE uint32_t hw_cache_mrm_get_misses_thres(void)
77 {
78  return CACHE->CACHE_MRM_MISSES_THRES_REG;
79 }
80 
90 __STATIC_INLINE void hw_cache_mrm_set_hits_thres(uint32_t thres)
91 {
92  CACHE->CACHE_MRM_HITS_THRES_REG = thres;
93 }
94 
101 __STATIC_INLINE uint32_t hw_cache_mrm_get_hits_thres(void)
102 {
103  return CACHE->CACHE_MRM_HITS_THRES_REG;
104 }
105 
112 __STATIC_INLINE bool hw_cache_mrm_get_misses_thres_status(void)
113 {
114  return REG_GETF(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_MISSES_THRES_STATUS);
115 }
116 
122 __STATIC_INLINE void hw_cache_mrm_clr_misses_thres_status(void)
123 {
124  REG_CLR_BIT(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_MISSES_THRES_STATUS);
125 }
126 
133 __STATIC_INLINE bool hw_cache_mrm_get_hits_thres_status(void)
134 {
135  return REG_GETF(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_HITS_THRES_STATUS);
136 }
137 
143 __STATIC_INLINE void hw_cache_mrm_clr_hits_thres_status(void)
144 {
145  REG_CLR_BIT(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_HITS_THRES_STATUS);
146 }
147 
159 __STATIC_INLINE void hw_cache_mrm_set_tint(uint32_t tint)
160 {
161  ASSERT_WARNING((tint & ~CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Msk) == 0)
162  CACHE->CACHE_MRM_TINT_REG = tint;
163 }
164 
171 __STATIC_INLINE uint32_t hw_cache_mrm_get_tint(void)
172 {
173  return CACHE->CACHE_MRM_TINT_REG & CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Msk;
174 }
175 
183 __STATIC_INLINE bool hw_cache_mrm_get_tint_status(void)
184 {
185  return REG_GETF(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_TINT_STATUS);
186 }
187 
192 __STATIC_INLINE void hw_cache_mrm_clr_tint_status(void)
193 {
194  REG_CLR_BIT(CACHE, CACHE_MRM_CTRL_REG, MRM_IRQ_TINT_STATUS);
195 }
196 
205 __STATIC_INLINE void hw_cache_mrm_start_counters(void)
206 {
207  REG_SET_BIT(CACHE, CACHE_MRM_CTRL_REG, MRM_START);
208 }
209 
214 __STATIC_INLINE void hw_cache_mrm_freeze_counters(void)
215 {
216  REG_CLR_BIT(CACHE, CACHE_MRM_CTRL_REG, MRM_START);
217 }
218 
225 __STATIC_INLINE uint32_t hw_cache_mrm_get_misses(void)
226 {
227  return CACHE->CACHE_MRM_MISSES_REG;
228 }
229 
238 __STATIC_INLINE void hw_cache_mrm_set_misses(uint32_t misses)
239 {
240  CACHE->CACHE_MRM_MISSES_REG = misses;
241 }
242 
249 __STATIC_INLINE uint32_t hw_cache_mrm_get_hits(void)
250 {
251  return CACHE->CACHE_MRM_HITS_REG;
252 }
253 
262 __STATIC_INLINE void hw_cache_mrm_set_hits(uint32_t hits)
263 {
264  CACHE->CACHE_MRM_HITS_REG = hits;
265 }
266 
273 typedef void (*hw_cache_mrm_cb_t)(void);
274 
285 
293 
294 #endif /* dg_configUSE_HW_CACHE */
295 
296 #endif /* HW_CACHE_H_ */
297 
REG_CLR_BIT
#define REG_CLR_BIT(base, reg, field)
Clear a bit of a register.
Definition: sdk_defs.h:781
REG_SET_BIT
#define REG_SET_BIT(base, reg, field)
Set a bit of a register.
Definition: sdk_defs.h:766
hw_cache_mrm_enable_interrupt
void hw_cache_mrm_enable_interrupt(hw_cache_mrm_cb_t cb)
Enable the MRM interrupt generation.
hw_cache_mrm_get_hits
__STATIC_INLINE uint32_t hw_cache_mrm_get_hits(void)
Get the cache MRM cache hits number.
Definition: hw_cache.h:249
hw_cache_mrm_start_counters
__STATIC_INLINE void hw_cache_mrm_start_counters(void)
Start MRM counters.
Definition: hw_cache.h:205
hw_cache_mrm_get_misses_thres_status
__STATIC_INLINE bool hw_cache_mrm_get_misses_thres_status(void)
Get the cache MRM misses threshold IRQ status.
Definition: hw_cache.h:112
hw_cache_da1459x.h
Definition of DA1459x specific API for the iCache Controller Low Level Driver.
hw_cache_mrm_get_hits_thres
__STATIC_INLINE uint32_t hw_cache_mrm_get_hits_thres(void)
Get the cache MRM interrupt threshold for hits.
Definition: hw_cache.h:101
sdk_defs.h
Central include header file with platform definitions.
hw_cache_mrm_get_tint
__STATIC_INLINE uint32_t hw_cache_mrm_get_tint(void)
Get the cache MRM monitoring time interval.
Definition: hw_cache.h:171
hw_cache_mrm_disable_interrupt
void hw_cache_mrm_disable_interrupt(void)
Disable the MRM interrupt generation.
hw_cache_mrm_get_hits_thres_status
__STATIC_INLINE bool hw_cache_mrm_get_hits_thres_status(void)
Get the cache MRM hits threshold IRQ status.
Definition: hw_cache.h:133
hw_cache_mrm_set_misses_thres
__STATIC_INLINE void hw_cache_mrm_set_misses_thres(uint32_t thres)
Set the cache MRM interrupt threshold for misses.
Definition: hw_cache.h:65
hw_cache_mrm_set_tint
__STATIC_INLINE void hw_cache_mrm_set_tint(uint32_t tint)
Set the cache MRM monitoring time interval.
Definition: hw_cache.h:159
hw_cache_mrm_freeze_counters
__STATIC_INLINE void hw_cache_mrm_freeze_counters(void)
Freeze MRM counters.
Definition: hw_cache.h:214
hw_cache_mrm_clr_tint_status
__STATIC_INLINE void hw_cache_mrm_clr_tint_status(void)
Clear the cache MRM timer interval IRQ status.
Definition: hw_cache.h:192
hw_cache_mrm_set_misses
__STATIC_INLINE void hw_cache_mrm_set_misses(uint32_t misses)
Set the cache MRM cache misses number.
Definition: hw_cache.h:238
REG_GETF
#define REG_GETF(base, reg, field)
Return the value of a register field.
Definition: sdk_defs.h:711
hw_cache_mrm_clr_hits_thres_status
__STATIC_INLINE void hw_cache_mrm_clr_hits_thres_status(void)
Clear the cache MRM hits threshold IRQ status.
Definition: hw_cache.h:143
hw_cache_mrm_get_misses_thres
__STATIC_INLINE uint32_t hw_cache_mrm_get_misses_thres(void)
Get the cache MRM interrupt threshold for misses.
Definition: hw_cache.h:76
hw_cache_mrm_clr_misses_thres_status
__STATIC_INLINE void hw_cache_mrm_clr_misses_thres_status(void)
Clear the cache MRM misses threshold IRQ status.
Definition: hw_cache.h:122
hw_cache_mrm_set_hits
__STATIC_INLINE void hw_cache_mrm_set_hits(uint32_t hits)
Set the cache MRM cache hits number.
Definition: hw_cache.h:262
CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Msk
#define CACHE_CACHE_MRM_TINT_REG_MRM_TINT_Msk
Definition: DA1459x-00.h:1670
hw_cache_mrm_get_misses
__STATIC_INLINE uint32_t hw_cache_mrm_get_misses(void)
Get the cache MRM misses number.
Definition: hw_cache.h:225
hw_cache_mrm_set_hits_thres
__STATIC_INLINE void hw_cache_mrm_set_hits_thres(uint32_t thres)
Set the cache MRM interrupt threshold for hits.
Definition: hw_cache.h:90
hw_cache_mrm_get_tint_status
__STATIC_INLINE bool hw_cache_mrm_get_tint_status(void)
Get the cache MRM timer interval IRQ status.
Definition: hw_cache.h:183
hw_cache_mrm_cb_t
void(* hw_cache_mrm_cb_t)(void)
Application defined callback for the MRM interrupt.
Definition: hw_cache.h:273