18 #ifndef __CORE_FEATURE_CACHE_H__
19 #define __CORE_FEATURE_CACHE_H__
44 #include "core_feature_base.h"
47 #if defined(__CCM_PRESENT) && (__CCM_PRESENT == 1)
49 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
63 __IM uint8_t RESERVED0[16];
66 __IM uint8_t RESERVED1[168];
69 __IM uint8_t RESERVED2[20];
73 #define SMPCC_CMD_CTRL_SUP_EN_Pos 9U
74 #define SMPCC_CMD_CTRL_SUP_EN_Msk (0x1UL << SMPCC_CMD_CTRL_SUP_EN_Pos)
75 #define SMPCC_CMD_CTRL_SUP_EN_ENABLE 1U
76 #define SMPCC_CMD_CTRL_SUP_EN_DISABLE 0U
78 #define SMPCC_CMD_CTRL_USE_EN_Pos 10U
79 #define SMPCC_CMD_CTRL_USE_EN_Msk (0x1UL << SMPCC_CMD_CTRL_USE_EN_Pos)
80 #define SMPCC_CMD_CTRL_USE_EN_ENABLE 1U
81 #define SMPCC_CMD_CTRL_USE_EN_DISABLE 0U
83 #define SMPCC_CMD_xCMD_CMD_Pos 0U
84 #define SMPCC_CMD_xCMD_CMD_Msk (0x1FUL << SMPCC_CMD_xCMD_CMD_Pos)
85 #define SMPCC_CMD_xCMD_CMD_WB_ALL 0x7U
86 #define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL 0x6U
88 #define SMPCC_CMD_xCMD_RESULT_Pos 26U
89 #define SMPCC_CMD_xCMD_RESULT_Msk (0x1FUL << SMPCC_CMD_xCMD_RESULT_Pos)
90 #define SMPCC_CMD_xCMD_RESULT_SUCCESS 0x0U
91 #define SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT 0x1U
92 #define SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR 0x3U
93 #define SMPCC_CMD_xCMD_RESULT_ECC_ERROR 0x4U
94 #define SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR 0x5U
96 #define SMPCC_CMD_xCMD_COMPLETE_Pos 31U
97 #define SMPCC_CMD_xCMD_COMPLETE_Msk (0x1UL << SMPCC_CMD_xCMD_COMPLETE_Pos)
99 #define SMPCC_CMD_INVALID_ALL_Pos 0U
100 #define SMPCC_CMD_INVALID_ALL_Msk (0x1UL << SMPCC_CMD_INVALID_ALL_Pos)
102 #ifndef __SMPCC_BASEADDR
104 #error "__SMPCC_BASEADDR is not defined, please check!"
108 #define SMPCC_CMD_BASE __SMPCC_BASEADDR
109 #define SMPCC_CMD ((SMPCC_CMD_Type *)SMPCC_CMD_BASE)
139 typedef enum CCM_OP_FINFO {
150 typedef enum CCM_CMD {
170 typedef struct CacheInfo {
177 #if __riscv_xlen == 32
178 #define CCM_SUEN_SUEN_Msk (0xFFFFFFFFUL)
180 #define CCM_SUEN_SUEN_Msk (0xFFFFFFFFFFFFFFFFUL)
198 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
219 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
240 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
283 for (i = 0; i < cnt; i++) {
333 for (i = 0; i < cnt; i++) {
383 for (i = 0; i < cnt; i++) {
429 for (i = 0; i < cnt; i++) {
470 for (i = 0; i < cnt; i++) {
511 for (i = 0; i < cnt; i++) {
524 #if defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1)
610 #if defined(__CCM_PRESENT) && (__CCM_PRESENT == 1)
630 if (csr_ccfg.
b.
lsize == 0) {
673 for (i = 0; i < cnt; i++) {
715 for (i = 0; i < cnt; i++) {
757 for (i = 0; i < cnt; i++) {
765 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
802 for (i = 0; i < cnt; i++) {
848 for (i = 0; i < cnt; i++) {
894 for (i = 0; i < cnt; i++) {
942 for (i = 0; i < cnt; i++) {
992 for (i = 0; i < cnt; i++) {
1042 for (i = 0; i < cnt; i++) {
1088 for (i = 0; i < cnt; i++) {
1129 for (i = 0; i < cnt; i++) {
1170 for (i = 0; i < cnt; i++) {
1226 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
1325 #if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1)
1410 #if defined(__CCM_PRESENT) && (__CCM_PRESENT == 1)
1430 if (csr_ccfg.
b.
lsize == 0) {
1473 for (i = 0; i < cnt; i++) {
1515 for (i = 0; i < cnt; i++) {
1557 for (i = 0; i < cnt; i++) {
1598 for (i = 0; i < cnt; i++) {
1639 for (i = 0; i < cnt; i++) {
1680 for (i = 0; i < cnt; i++) {
1721 for (i = 0; i < cnt; i++) {
1762 for (i = 0; i < cnt; i++) {
1803 for (i = 0; i < cnt; i++) {
1811 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
1820 #define MInvalDCacheCCacheLine(addr) MInvalDCacheLine(addr)
1831 #define MInvalDCacheCCacheLines(addr, cnt) MInvalDCacheLines(addr, cnt)
1841 #define SInvalDCacheCCacheLine(addr) SInvalDCacheLine(addr)
1852 #define SInvalDCacheCCacheLines(addr, cnt) SInvalDCacheLines(addr, cnt)
1862 #define UInvalDCacheCCacheLine(addr) UInvalDCacheLine(addr)
1873 #define UInvalDCacheCCacheLines(addr, cnt) UInvalDCacheLines(addr, cnt)
1882 #define MFlushDCacheCCacheLine(addr) MFlushDCacheLine(addr)
1893 #define MFlushDCacheCCacheLines(addr, cnt) MFlushDCacheLines(addr, cnt)
1903 #define SFlushDCacheCCacheLine(addr) SFlushDCacheLine(addr)
1914 #define SFlushDCacheCCacheLines(addr, cnt) SFlushDCacheLines(addr, cnt)
1924 #define UFlushDCacheCCacheLine(addr) UFlushDCacheLine(addr)
1935 #define UFlushDCacheCCacheLines(addr, cnt) UFlushDCacheLines(addr, cnt)
1944 #define MFlushInvalDCacheCCacheLine(addr) MFlushInvalDCacheLine(addr)
1955 #define MFlushInvalDCacheCCacheLines(addr, cnt) MFlushInvalDCacheLines(addr, cnt)
1965 #define SFlushInvalDCacheCCacheLine(addr) SFlushInvalDCacheLine(addr)
1976 #define SFlushInvalDCacheCCacheLines(addr, cnt) SFlushInvalDCacheLines(addr, cnt)
1986 #define UFlushInvalDCacheCCacheLine(addr) UFlushInvalDCacheLine(addr)
1997 #define UFlushInvalDCacheCCacheLines(addr, cnt) UFlushInvalDCacheLines(addr, cnt)
2037 for (i = 0; i < cnt; i++) {
2087 for (i = 0; i < cnt; i++) {
2137 for (i = 0; i < cnt; i++) {
2183 for (i = 0; i < cnt; i++) {
2224 for (i = 0; i < cnt; i++) {
2265 for (i = 0; i < cnt; i++) {
2419 #if defined(__SMPCC_PRESENT) && (__SMPCC_PRESENT == 1)
__STATIC_INLINE void UUnlockCCacheLine(unsigned long addr)
Unlock one Cluster Cache line specified by address in U-Mode.
__STATIC_INLINE void SUnlockCCacheLine(unsigned long addr)
Unlock one Cluster Cache line specified by address in S-Mode.
#define SMPCC_CMD_CTRL_USE_EN_ENABLE
SMPCC_CMD CC_CTRL USE_EN Enable.
__STATIC_INLINE unsigned long MLockCCacheLine(unsigned long addr)
Lock one Cluster Cache line specified by address in M-Mode.
#define SMPCC_CMD
SMPCC CMD configuration struct.
__STATIC_INLINE unsigned long SLockCCacheLine(unsigned long addr)
Lock one Cluster Cache line specified by address in S-Mode.
__STATIC_INLINE void UUnlockCCacheLines(unsigned long addr, unsigned long cnt)
Unlock several Cluster Cache lines specified by address in U-Mode.
#define SMPCC_CMD_xCMD_CMD_WB_ALL
SMPCC_CMD xCMD CMD WB_ALL.
__STATIC_INLINE unsigned long MLockCCacheLines(unsigned long addr, unsigned long cnt)
Lock several Cluster Cache lines specified by address in M-Mode.
__STATIC_INLINE unsigned long ULockCCacheLine(unsigned long addr)
Lock one Cluster Cache line specified by address in U-Mode.
__STATIC_INLINE void SUnlockCCacheLines(unsigned long addr, unsigned long cnt)
Unlock several Cluster Cache lines specified by address in S-Mode.
__STATIC_INLINE void MUnlockCCacheLines(unsigned long addr, unsigned long cnt)
Unlock several Cluster Cache lines specified by address in M-Mode.
#define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL
SMPCC_CMD xCMD CMD WBINVAL_ALL.
#define SMPCC_CMD_xCMD_CMD_Msk
SMPCC_CMD register xCMD field CMD Mask.
#define SMPCC_CMD_CTRL_USE_EN_DISABLE
SMPCC_CMD CC_CTRL USE_EN Disable.
#define SMPCC_CMD_CTRL_SUP_EN_DISABLE
SMPCC_CMD CC_CTRL SUP_EN Disable.
__STATIC_INLINE unsigned long ULockCCacheLines(unsigned long addr, unsigned long cnt)
Lock several Cluster Cache lines specified by address in U-Mode.
__STATIC_INLINE unsigned long SLockCCacheLines(unsigned long addr, unsigned long cnt)
Lock several Cluster Cache lines specified by address in S-Mode.
#define SMPCC_CMD_CTRL_SUP_EN_ENABLE
SMPCC_CMD CC_CTRL SUP_EN Enable.
__STATIC_INLINE void MUnlockCCacheLine(unsigned long addr)
Unlock one Cluster Cache line specified by address in M-Mode.
#define MCACHE_CTL_DC_ECC_EN
#define MCACHE_CTL_IC_ECC_EN
#define __RV_CSR_CLEAR(csr, val)
CSR operation Macro for csrc instruction.
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
#define __RWMB()
Read & Write Memory barrier.
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
#define __RV_CSR_SET(csr, val)
CSR operation Macro for csrs instruction.
#define CSR_CCM_MBEGINADDR
#define CSR_CCM_SBEGINADDR
#define CSR_CCM_UBEGINADDR
CCM_OP_FINFO_Type
Cache CCM Operation Fail Info.
__STATIC_FORCEINLINE void FlushPipeCCM(void)
Flush pipeline after CCM operation.
CCM_CMD_Type
Cache CCM Command Types.
__STATIC_FORCEINLINE void DisableSUCCM(void)
Disable CCM operation in Supervisor/User Mode.
#define CCM_SUEN_SUEN_Msk
CSR CCM_SUEN: SUEN Mask.
__STATIC_FORCEINLINE void EnableSUCCM(void)
Enable CCM operation in Supervisor/User Mode.
@ CCM_OP_REFILL_BUS_ERR
Refill has Bus Error.
@ CCM_OP_ECC_ERR
Deprecated, ECC Error, this error code is removed in later Nuclei CCM RTL design, please don't use it...
@ CCM_OP_PERM_CHECK_ERR
PMP/sPMP/Page-Table X(I-Cache)/R(D-Cache) permission check failed, or belong to Device/Non-Cacheable ...
@ CCM_OP_SUCCESS
Lock Succeed.
@ CCM_OP_EXCEED_ERR
Exceed the the number of lockable ways(N-Way I/D-Cache, lockable is N-1)
@ CCM_DC_WB
Flush the specific D-Cache line and Cluster Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_DC_INVAL
Unlock and invalidate D-Cache line and Cluster Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_DC_WBINVAL
Unlock, flush and invalidate the specific D-Cache line and Cluster Cache line specified by CSR CCM_XB...
@ CCM_DC_LOCK
Lock the specific D-Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_IC_INVAL
Unlock and invalidate I-Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_IC_LOCK
Lock the specific I-Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_DC_WB_ALL
Flush all the valid and dirty D-Cache lines.
@ CCM_DC_INVAL_ALL
Unlock and invalidate all the D-Cache lines.
@ CCM_IC_INVAL_ALL
Unlock and invalidate all the I-Cache lines.
@ CCM_CC_LOCK
Lock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_DC_WBINVAL_ALL
Unlock and flush and invalidate all the valid and dirty D-Cache lines.
@ CCM_DC_UNLOCK
Unlock the specific D-Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_CC_UNLOCK
Unlock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.
@ CCM_IC_UNLOCK
Unlock the specific I-Cache line specified by CSR CCM_XBEGINADDR.
#define __STATIC_FORCEINLINE
Define a static function that should be always inlined by the compiler.
#define __STATIC_INLINE
Define a static function that may be inlined by the compiler.
__STATIC_INLINE void MFlushDCache(void)
Flush all D-Cache lines in M-Mode.
__STATIC_INLINE unsigned long SLockDCacheLine(unsigned long addr)
Lock one D-Cache line specified by address in S-Mode.
__STATIC_INLINE void MInvalDCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several D-Cache lines specified by address in M-Mode.
__STATIC_INLINE void UInvalDCacheLine(unsigned long addr)
Invalidate one D-Cache line specified by address in U-Mode.
__STATIC_INLINE void UUnlockDCacheLine(unsigned long addr)
Unlock one D-Cache line specified by address in U-Mode.
__STATIC_INLINE void UInvalDCache(void)
Invalidate all D-Cache lines in U-Mode.
__STATIC_INLINE void UFlushDCacheLines(unsigned long addr, unsigned long cnt)
Flush several D-Cache lines specified by address in U-Mode.
__STATIC_INLINE int32_t SFlushDCacheCCache(void)
Flush all D-Cache and Cluster Cache in S-Mode.
__STATIC_INLINE void SInvalDCacheCCache(void)
Invalidate all D-Cache and Cluster Cache in S-Mode.
__STATIC_INLINE void MFlushDCacheLines(unsigned long addr, unsigned long cnt)
Flush several D-Cache lines specified by address in M-Mode.
__STATIC_INLINE unsigned long ULockDCacheLines(unsigned long addr, unsigned long cnt)
Lock several D-Cache lines specified by address in U-Mode.
__STATIC_INLINE int32_t UFlushDCacheCCache(void)
Flush all D-Cache and Cluster Cache in U-Mode.
__STATIC_INLINE void MInvalDCacheLine(unsigned long addr)
Invalidate one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void SInvalDCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several D-Cache lines specified by address in S-Mode.
__STATIC_INLINE int32_t GetDCacheInfo(CacheInfo_Type *info)
Get D-Cache Information.
__STATIC_INLINE int32_t SFlushInvalCCache(void)
Flush and invalidate all Cluster Cache in S-Mode.
__STATIC_INLINE void SUnlockDCacheLine(unsigned long addr)
Unlock one D-Cache line specified by address in S-Mode.
__STATIC_INLINE void UFlushDCache(void)
Flush all D-Cache lines in U-Mode.
__STATIC_INLINE void MUnlockDCacheLine(unsigned long addr)
Unlock one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void MFlushInvalDCache(void)
Flush and invalidate all D-Cache lines in M-Mode.
__STATIC_INLINE void UFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in U-Mode.
__STATIC_FORCEINLINE void EnableDCacheECC(void)
Enable DCache ECC.
__STATIC_INLINE void SUnlockDCacheLines(unsigned long addr, unsigned long cnt)
Unlock several D-Cache lines specified by address in S-Mode.
__STATIC_INLINE void MFlushInvalDCacheLine(unsigned long addr)
Flush and invalidate one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void UFlushInvalDCacheLine(unsigned long addr)
Flush and invalidate one D-Cache line specified by address in U-Mode.
__STATIC_INLINE int32_t UFlushInvalDCacheCCache(void)
Flush and invalidate all D-Cache and Cluster Cache in U-Mode.
__STATIC_INLINE unsigned long ULockDCacheLine(unsigned long addr)
Lock one D-Cache line specified by address in U-Mode.
__STATIC_INLINE void SFlushInvalDCacheLine(unsigned long addr)
Flush and invalidate one D-Cache line specified by address in S-Mode.
__STATIC_INLINE void SFlushDCache(void)
Flush all D-Cache lines in S-Mode.
__STATIC_INLINE int32_t DCachePresent(void)
Check DCache Unit Present or Not.
__STATIC_INLINE void MUnlockDCacheLines(unsigned long addr, unsigned long cnt)
Unlock several D-Cache lines specified by address in M-Mode.
__STATIC_INLINE int32_t UFlushCCache(void)
Flush all Cluster Cache in U-Mode.
__STATIC_INLINE void SFlushInvalDCacheLines(unsigned long addr, unsigned long cnt)
Flush and invalidate several D-Cache lines specified by address in S-Mode.
__STATIC_INLINE void UUnlockDCacheLines(unsigned long addr, unsigned long cnt)
Unlock several D-Cache lines specified by address in U-Mode.
__STATIC_INLINE void MInvalDCacheCCache(void)
Invalidate all D-Cache and Cluster Cache in M-Mode.
__STATIC_INLINE int32_t SFlushInvalDCacheCCache(void)
Flush and invalidate all D-Cache and Cluster Cache in S-Mode.
__STATIC_INLINE void SFlushDCacheLines(unsigned long addr, unsigned long cnt)
Flush several D-Cache lines specified by address in S-Mode.
__STATIC_FORCEINLINE void DisableDCache(void)
Disable DCache.
__STATIC_INLINE unsigned long MLockDCacheLine(unsigned long addr)
Lock one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void UInvalDCacheCCache(void)
Invalidate all D-Cache and Cluster Cache in U-Mode.
__STATIC_INLINE void MFlushInvalDCacheLines(unsigned long addr, unsigned long cnt)
Flush and invalidate several D-Cache lines specified by address in M-Mode.
__STATIC_INLINE void SInvalDCacheLine(unsigned long addr)
Invalidate one D-Cache line specified by address in S-Mode.
__STATIC_INLINE void UInvalDCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several D-Cache lines specified by address in U-Mode.
__STATIC_INLINE void UFlushInvalDCache(void)
Flush and invalidate all D-Cache lines in U-Mode.
__STATIC_FORCEINLINE void DisableDCacheECC(void)
Disable DCache ECC.
__STATIC_INLINE unsigned long MLockDCacheLines(unsigned long addr, unsigned long cnt)
Lock several D-Cache lines specified by address in M-Mode.
__STATIC_INLINE int32_t UFlushInvalCCache(void)
Flush and invalidate all Cluster Cache in U-Mode.
__STATIC_INLINE void MFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void SInvalDCache(void)
Invalidate all D-Cache lines in S-Mode.
__STATIC_INLINE int32_t SFlushCCache(void)
Flush all Cluster Cache in S-Mode.
__STATIC_INLINE int32_t MFlushDCacheCCache(void)
Flush all D-Cache and Cluster Cache in M-Mode.
__STATIC_INLINE void MInvalDCache(void)
Invalidate all D-Cache lines in M-Mode.
__STATIC_INLINE int32_t MFlushInvalCCache(void)
Flush and invalidate all Cluster Cache in M-Mode.
__STATIC_INLINE int32_t MFlushInvalDCacheCCache(void)
Flush and invalidate all D-Cache and Cluster Cache in M-Mode.
__STATIC_INLINE void SFlushInvalDCache(void)
Flush and invalidate all D-Cache lines in S-Mode.
__STATIC_INLINE void UFlushInvalDCacheLines(unsigned long addr, unsigned long cnt)
Flush and invalidate several D-Cache lines specified by address in U-Mode.
__STATIC_FORCEINLINE void EnableDCache(void)
Enable DCache.
__STATIC_INLINE unsigned long SLockDCacheLines(unsigned long addr, unsigned long cnt)
Lock several D-Cache lines specified by address in S-Mode.
__STATIC_INLINE int32_t MFlushCCache(void)
Flush all Cluster Cache in M-Mode.
__STATIC_INLINE void SFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in S-Mode.
__STATIC_INLINE unsigned long MLockICacheLines(unsigned long addr, unsigned long cnt)
Lock several I-Cache lines specified by address in M-Mode.
__STATIC_INLINE void MInvalICacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache lines specified by address in M-Mode.
__STATIC_INLINE void SInvalICacheCCache(void)
Invalidate all I-Cache and Cluster Cache in S-Mode.
__STATIC_INLINE void SInvalCCache(void)
Invalidate all Cluster Cache in S-Mode.
__STATIC_INLINE void MInvalCCache(void)
Invalidate all Cluster Cache in M-Mode.
__STATIC_INLINE void UUnlockICacheLines(unsigned long addr, unsigned long cnt)
Unlock several I-Cache lines specified by address in U-Mode.
__STATIC_INLINE void MInvalICacheCCache(void)
Invalidate all I-Cache and Cluster Cache in M-Mode.
__STATIC_INLINE void MInvalICacheCCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache and Cluster Cache lines specified by address in M-Mode.
__STATIC_INLINE void MInvalICache(void)
Invalidate all I-Cache lines in M-Mode.
__STATIC_INLINE void UInvalICacheCCache(void)
Invalidate all I-Cache and Cluster Cache in U-Mode.
__STATIC_INLINE void MInvalICacheCCacheLine(unsigned long addr)
Invalidate one I-Cache and Cluster Cache line specified by address in M-Mode.
__STATIC_INLINE unsigned long ULockICacheLines(unsigned long addr, unsigned long cnt)
Lock several I-Cache lines specified by address in U-Mode.
__STATIC_INLINE void SInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in S-Mode.
__STATIC_INLINE unsigned long MLockICacheLine(unsigned long addr)
Lock one I-Cache line specified by address in M-Mode.
__STATIC_FORCEINLINE void DisableICache(void)
Disable ICache.
__STATIC_INLINE void UInvalICacheCCacheLine(unsigned long addr)
Invalidate one I-Cache and Cluster Cache line specified by address in U-Mode.
__STATIC_INLINE unsigned long ULockICacheLine(unsigned long addr)
Lock one I-Cache line specified by address in U-Mode.
__STATIC_FORCEINLINE void EnableICache(void)
Enable ICache.
__STATIC_INLINE int32_t ICachePresent(void)
Check ICache Unit Present or Not.
__STATIC_INLINE void SInvalICacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache lines specified by address in S-Mode.
__STATIC_INLINE void UInvalICache(void)
Invalidate all I-Cache lines in U-Mode.
__STATIC_INLINE void MUnlockICacheLine(unsigned long addr)
Unlock one I-Cache line specified by address in M-Mode.
__STATIC_INLINE void UInvalICacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache lines specified by address in U-Mode.
__STATIC_FORCEINLINE void EnableICacheECC(void)
Enable ICache ECC.
__STATIC_INLINE int32_t GetICacheInfo(CacheInfo_Type *info)
Get I-Cache Information.
__STATIC_INLINE void UUnlockICacheLine(unsigned long addr)
Unlock one I-Cache line specified by address in U-Mode.
__STATIC_FORCEINLINE void DisableICacheECC(void)
Disable ICache ECC.
__STATIC_INLINE void SInvalICacheCCacheLine(unsigned long addr)
Invalidate one I-Cache and Cluster Cache line specified by address in S-Mode.
__STATIC_INLINE void SUnlockICacheLines(unsigned long addr, unsigned long cnt)
Unlock several I-Cache lines specified by address in S-Mode.
__STATIC_INLINE void UInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in U-Mode.
__STATIC_INLINE unsigned long SLockICacheLine(unsigned long addr)
Lock one I-Cache line specified by address in S-Mode.
__STATIC_INLINE void MUnlockICacheLines(unsigned long addr, unsigned long cnt)
Unlock several I-Cache lines specified by address in M-Mode.
__STATIC_INLINE void UInvalCCache(void)
Invalidate all Cluster Cache in U-Mode.
__STATIC_INLINE void SInvalICache(void)
Invalidate all I-Cache lines in S-Mode.
__STATIC_INLINE void SUnlockICacheLine(unsigned long addr)
Unlock one I-Cache line specified by address in S-Mode.
__STATIC_INLINE unsigned long SLockICacheLines(unsigned long addr, unsigned long cnt)
Lock several I-Cache lines specified by address in S-Mode.
__STATIC_INLINE void UInvalICacheCCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache and Cluster Cache lines specified by address in U-Mode.
__STATIC_INLINE void MInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in M-Mode.
__STATIC_INLINE void SInvalICacheCCacheLines(unsigned long addr, unsigned long cnt)
Invalidate several I-Cache and Cluster Cache lines specified by address in S-Mode.
#define _FLD2VAL(field, value)
Mask and shift a register value to extract a bit filed value.
#define _VAL2FLD(field, value)
Mask and shift a bit field value for use in a register bit range.
#define __IM
Defines 'read only' structure member permissions.
#define __IOM
Defines 'read/write' structure member permissions.
uint32_t setperway
Cache set per way.
uint32_t linesize
Cache Line size in bytes.
uint32_t size
Cache total size in bytes.
Cluster Cache Control and Command Registers.
__IOM uint32_t CC_CTRL
Offset: 0x10 (R/W) Cluster Cache Control Register.
__IOM uint32_t CC_uCMD
Offset: 0xC4 (R/W) Cluster Cache U-mode Command Register.
__IOM uint32_t CC_INVALID_ALL
Offset: 0xDC (R/W) Cluster Cache Invalid All Register.
__IOM uint32_t CC_mCMD
Offset: 0x14 (R/W) Cluster Cache M-mode Command Register.
__IOM uint32_t CC_sCMD
Offset: 0xC0 (R/W) Cluster Cache S-mode Command Register.
Union type to access MDCFG_INFO CSR register.
rv_csr_t set
bit: 0..3 D-Cache sets per way
struct CSR_MDCFGINFO_Type::@16 b
Structure used for bit access.
rv_csr_t d
Type used for csr data access.
rv_csr_t lsize
bit: 7..9 D-Cache line size
rv_csr_t way
bit: 4..6 D-Cache way
Union type to access MICFG_INFO CSR register.
rv_csr_t d
Type used for csr data access.
rv_csr_t set
bit: 0..3 I-Cache sets per way
rv_csr_t lsize
bit: 7..9 I-Cache line size
struct CSR_MICFGINFO_Type::@15 b
Structure used for bit access.
rv_csr_t way
bit: 4..6 I-Cache way