![]() |
NMSIS-Core
Version 1.4.1
NMSIS-Core support for Nuclei processor-based devices
|
Functions that configure Instruction Cache. More...
Functions | |
__STATIC_INLINE int32_t | ICachePresent (void) |
Check ICache Unit Present or Not. More... | |
__STATIC_FORCEINLINE void | EnableICache (void) |
Enable ICache. More... | |
__STATIC_FORCEINLINE void | DisableICache (void) |
Disable ICache. More... | |
__STATIC_FORCEINLINE void | EnableICacheECC (void) |
Enable ICache ECC. More... | |
__STATIC_FORCEINLINE void | DisableICacheECC (void) |
Disable ICache ECC. More... | |
__STATIC_INLINE int32_t | GetICacheInfo (CacheInfo_Type *info) |
Get I-Cache Information. More... | |
__STATIC_INLINE void | MInvalICacheLine (unsigned long addr) |
Invalidate one I-Cache line specified by address in M-Mode. More... | |
__STATIC_INLINE void | MInvalICacheLines (unsigned long addr, unsigned long cnt) |
Invalidate several I-Cache lines specified by address in M-Mode. More... | |
__STATIC_INLINE void | SInvalICacheLine (unsigned long addr) |
Invalidate one I-Cache line specified by address in S-Mode. More... | |
__STATIC_INLINE void | SInvalICacheLines (unsigned long addr, unsigned long cnt) |
Invalidate several I-Cache lines specified by address in S-Mode. More... | |
__STATIC_INLINE void | UInvalICacheLine (unsigned long addr) |
Invalidate one I-Cache line specified by address in U-Mode. More... | |
__STATIC_INLINE void | UInvalICacheLines (unsigned long addr, unsigned long cnt) |
Invalidate several I-Cache lines specified by address in U-Mode. More... | |
__STATIC_INLINE unsigned long | MLockICacheLine (unsigned long addr) |
Lock one I-Cache line specified by address in M-Mode. More... | |
__STATIC_INLINE unsigned long | MLockICacheLines (unsigned long addr, unsigned long cnt) |
Lock several I-Cache lines specified by address in M-Mode. More... | |
__STATIC_INLINE unsigned long | SLockICacheLine (unsigned long addr) |
Lock one I-Cache line specified by address in S-Mode. More... | |
__STATIC_INLINE unsigned long | SLockICacheLines (unsigned long addr, unsigned long cnt) |
Lock several I-Cache lines specified by address in S-Mode. More... | |
__STATIC_INLINE unsigned long | ULockICacheLine (unsigned long addr) |
Lock one I-Cache line specified by address in U-Mode. More... | |
__STATIC_INLINE unsigned long | ULockICacheLines (unsigned long addr, unsigned long cnt) |
Lock several I-Cache lines specified by address in U-Mode. More... | |
__STATIC_INLINE void | MUnlockICacheLine (unsigned long addr) |
Unlock one I-Cache line specified by address in M-Mode. More... | |
__STATIC_INLINE void | MUnlockICacheLines (unsigned long addr, unsigned long cnt) |
Unlock several I-Cache lines specified by address in M-Mode. More... | |
__STATIC_INLINE void | SUnlockICacheLine (unsigned long addr) |
Unlock one I-Cache line specified by address in S-Mode. More... | |
__STATIC_INLINE void | SUnlockICacheLines (unsigned long addr, unsigned long cnt) |
Unlock several I-Cache lines specified by address in S-Mode. More... | |
__STATIC_INLINE void | UUnlockICacheLine (unsigned long addr) |
Unlock one I-Cache line specified by address in U-Mode. More... | |
__STATIC_INLINE void | UUnlockICacheLines (unsigned long addr, unsigned long cnt) |
Unlock several I-Cache lines specified by address in U-Mode. More... | |
__STATIC_INLINE void | MInvalICache (void) |
Invalidate all I-Cache lines in M-Mode. More... | |
__STATIC_INLINE void | SInvalICache (void) |
Invalidate all I-Cache lines in S-Mode. More... | |
__STATIC_INLINE void | UInvalICache (void) |
Invalidate all I-Cache lines in U-Mode. More... | |
Functions that configure Instruction Cache.
__STATIC_FORCEINLINE void DisableICache | ( | void | ) |
Disable ICache.
This function Disable I-Cache
Definition at line 211 of file core_feature_cache.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_EN.
__STATIC_FORCEINLINE void DisableICacheECC | ( | void | ) |
Disable ICache ECC.
This function disable I-Cache ECC
Definition at line 241 of file core_feature_cache.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EN.
__STATIC_FORCEINLINE void EnableICache | ( | void | ) |
Enable ICache.
This function enable I-Cache
Definition at line 196 of file core_feature_cache.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_EN.
Referenced by _premain_init().
__STATIC_FORCEINLINE void EnableICacheECC | ( | void | ) |
Enable ICache ECC.
This function enable I-Cache ECC
Definition at line 226 of file core_feature_cache.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EN.
__STATIC_INLINE int32_t GetICacheInfo | ( | CacheInfo_Type * | info | ) |
Get I-Cache Information.
This function get I-Cache Information
Definition at line 257 of file core_feature_cache.h.
References __RV_CSR_READ, CSR_MICFGINFO_Type::b, CSR_MICFG_INFO, CSR_MICFGINFO_Type::d, CacheInfo_Type::linesize, CSR_MICFGINFO_Type::lsize, CSR_MICFGINFO_Type::set, CacheInfo_Type::setperway, CacheInfo_Type::size, CSR_MICFGINFO_Type::way, and CacheInfo_Type::ways.
__STATIC_INLINE int32_t ICachePresent | ( | void | ) |
Check ICache Unit Present or Not.
This function check icache unit present or not via mcfg_info csr
Definition at line 178 of file core_feature_cache.h.
References __RV_CSR_READ, CSR_MCFG_INFO, and MCFG_INFO_ICACHE.
Referenced by _premain_init().
__STATIC_INLINE void MInvalICache | ( | void | ) |
Invalidate all I-Cache lines in M-Mode.
This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 683 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL_ALL, CSR_CCM_MCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void MInvalICacheLine | ( | unsigned long | addr | ) |
Invalidate one I-Cache line specified by address in M-Mode.
This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 285 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().
Referenced by __ECLIC_SetVector().
__STATIC_INLINE void MInvalICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Invalidate several I-Cache lines specified by address in M-Mode.
This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be invalidated |
[in] | cnt | count of cache lines to be invalidated |
Definition at line 304 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().
__STATIC_INLINE unsigned long MLockICacheLine | ( | unsigned long | addr | ) |
Lock one I-Cache line specified by address in M-Mode.
This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be locked |
Definition at line 411 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().
__STATIC_INLINE unsigned long MLockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Lock several I-Cache lines specified by address in M-Mode.
This function lock several I-Cache lines specified by the address and line count. Command CCM_IC_LOCK is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be locked |
[in] | cnt | count of cache lines to be locked |
Definition at line 432 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CCM_OP_SUCCESS, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().
__STATIC_INLINE void MUnlockICacheLine | ( | unsigned long | addr | ) |
Unlock one I-Cache line specified by address in M-Mode.
This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be unlocked |
Definition at line 560 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void MUnlockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Unlock several I-Cache lines specified by address in M-Mode.
This function unlock several I-Cache lines specified by the address and line count. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.
[in] | addr | start address to be unlocked |
[in] | cnt | count of cache lines to be unlocked |
Definition at line 579 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void SInvalICache | ( | void | ) |
Invalidate all I-Cache lines in S-Mode.
This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 699 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL_ALL, CSR_CCM_SCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void SInvalICacheLine | ( | unsigned long | addr | ) |
Invalidate one I-Cache line specified by address in S-Mode.
This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 327 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().
Referenced by __ECLIC_SetVector_S().
__STATIC_INLINE void SInvalICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Invalidate several I-Cache lines specified by address in S-Mode.
This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be invalidated |
[in] | cnt | count of cache lines to be invalidated |
Definition at line 346 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().
__STATIC_INLINE unsigned long SLockICacheLine | ( | unsigned long | addr | ) |
Lock one I-Cache line specified by address in S-Mode.
This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be locked |
Definition at line 461 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().
__STATIC_INLINE unsigned long SLockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Lock several I-Cache lines specified by address in S-Mode.
This function lock several I-Cache lines specified by the address and line count. Command CCM_IC_LOCK is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be locked |
[in] | cnt | count of cache lines to be locked |
Definition at line 482 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CCM_OP_SUCCESS, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().
__STATIC_INLINE void SUnlockICacheLine | ( | unsigned long | addr | ) |
Unlock one I-Cache line specified by address in S-Mode.
This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be unlocked |
Definition at line 601 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void SUnlockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Unlock several I-Cache lines specified by address in S-Mode.
This function unlock several I-Cache lines specified by the address and line count. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.
[in] | addr | start address to be unlocked |
[in] | cnt | count of cache lines to be unlocked |
Definition at line 620 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void UInvalICache | ( | void | ) |
Invalidate all I-Cache lines in U-Mode.
This function invalidate all I-Cache lines. Command CCM_IC_INVAL_ALL is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 715 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL_ALL, CSR_CCM_UCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void UInvalICacheLine | ( | unsigned long | addr | ) |
Invalidate one I-Cache line specified by address in U-Mode.
This function unlock and invalidate one I-Cache line specified by the address. Command CCM_IC_INVAL is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be invalidated |
Definition at line 369 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void UInvalICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Invalidate several I-Cache lines specified by address in U-Mode.
This function unlock and invalidate several I-Cache lines specified by the address and line count. Command CCM_IC_INVAL is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be invalidated |
[in] | cnt | count of cache lines to be invalidated |
Definition at line 388 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_INVAL, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().
__STATIC_INLINE unsigned long ULockICacheLine | ( | unsigned long | addr | ) |
Lock one I-Cache line specified by address in U-Mode.
This function lock one I-Cache line specified by the address. Command CCM_IC_LOCK is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be locked |
Definition at line 511 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().
__STATIC_INLINE unsigned long ULockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Lock several I-Cache lines specified by address in U-Mode.
This function lock several I-Cache lines specified by the address and line count. Command CCM_IC_LOCK is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be locked |
[in] | cnt | count of cache lines to be locked |
Definition at line 532 of file core_feature_cache.h.
References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_IC_LOCK, CCM_OP_SUCCESS, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().
__STATIC_INLINE void UUnlockICacheLine | ( | unsigned long | addr | ) |
Unlock one I-Cache line specified by address in U-Mode.
This function unlock one I-Cache line specified by the address. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be unlocked |
Definition at line 642 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().
__STATIC_INLINE void UUnlockICacheLines | ( | unsigned long | addr, |
unsigned long | cnt | ||
) |
Unlock several I-Cache lines specified by address in U-Mode.
This function unlock several I-Cache lines specified by the address and line count. Command CCM_IC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.
[in] | addr | start address to be unlocked |
[in] | cnt | count of cache lines to be unlocked |
Definition at line 661 of file core_feature_cache.h.
References __RV_CSR_WRITE, __RWMB, CCM_IC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().