![]() |
NMSIS-Core
Version 1.5.0
NMSIS-Core support for Nuclei processor-based devices
|
Functions that related to the ECC feature. More...
Macros | |
| #define | ECC_ERROR_RAMID_MASK_ICACHE 1U |
| #define | ECC_ERROR_RAMID_MASK_DCACHE 2U |
| #define | ECC_ERROR_RAMID_MASK_TLB 4U |
| #define | ECC_ERROR_RAMID_MASK_ILM 8U |
| #define | ECC_ERROR_RAMID_MASK_DLM 16U |
Functions | |
| __STATIC_FORCEINLINE int32_t | ECC_IsGlobalSupportECC (void) |
| Check if the core globally supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsICacheSupportECC (void) |
| Check if I-Cache supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDCacheSupportECC (void) |
| Check if D-Cache supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsTLBSupportECC (void) |
| Check if TLB supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsILMSupportECC (void) |
| Check if ILM supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDLMSupportECC (void) |
| Check if DLM supports ECC. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsXorErrorInjectMode (void) |
| Check if XOR error injection mode is supported. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableICacheECC (void) |
| Enable ECC for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableICacheECC (void) |
| Disable ECC for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableICacheECCExcp (void) |
| Enable ECC exception for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableICacheECCExcp (void) |
| Disable ECC exception for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableICacheECCCheck (void) |
| Enable ECC checking for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableICacheECCCheck (void) |
| Disable ECC checking for I-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDCacheECC (void) |
| Enable ECC for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDCacheECC (void) |
| Disable ECC for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDCacheECCExcp (void) |
| Enable ECC exception for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDCacheECCExcp (void) |
| Disable ECC exception for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDCacheECCCheck (void) |
| Enable ECC checking for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDCacheECCCheck (void) |
| Disable ECC checking for D-Cache. More... | |
| __STATIC_FORCEINLINE void | ECC_ICacheTRamErrInject (uint32_t ecc_code, void *addr) |
| Inject error into I-Cache Tag RAM. More... | |
| __STATIC_FORCEINLINE void | ECC_ICacheDRamErrInject (uint32_t ecc_code, void *addr) |
| Inject error into I-Cache Data RAM. More... | |
| __STATIC_FORCEINLINE void | ECC_ICacheErrRestore (void *addr) |
| Restore I-Cache error at specified address. More... | |
| __STATIC_FORCEINLINE void | ECC_DCacheTRamErrInject (uint32_t ecc_code, void *addr) |
| Inject error into D-Cache Tag RAM. More... | |
| __STATIC_FORCEINLINE void | ECC_DCacheDRamErrInject (uint32_t ecc_code, void *addr) |
| Inject error into D-Cache Data RAM. More... | |
| __STATIC_FORCEINLINE void | ECC_DCacheErrRestore (void *addr) |
| Restore D-Cache error at specified address. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableILM (void) |
| Enable ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableILM (void) |
| Disable ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableILMECC (void) |
| Enable ECC for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableILMECC (void) |
| Disable ECC for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableILMECCExcp (void) |
| Enable ECC exception for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableILMECCExcp (void) |
| Disable ECC exception for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableILMECCCheck (void) |
| Enable ECC checking for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableILMECCCheck (void) |
| Disable ECC checking for ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_ILMErrInject (uint32_t ecc_code, void *addr) |
| Inject error into ILM. More... | |
| __STATIC_FORCEINLINE void | ECC_ILMErrRestore (void *addr) |
| Restore ILM error at specified address. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDLM (void) |
| Enable DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDLM (void) |
| Disable DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDLMECC (void) |
| Enable ECC for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDLMECC (void) |
| Disable ECC for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDLMECCExcp (void) |
| Enable ECC exception for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDLMECCExcp (void) |
| Disable ECC exception for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_EnableDLMECCCheck (void) |
| Enable ECC checking for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DisableDLMECCCheck (void) |
| Disable ECC checking for DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DLMErrInject (uint32_t ecc_code, void *addr) |
| Inject error into DLM. More... | |
| __STATIC_FORCEINLINE void | ECC_DLMErrRestore (void *addr) |
| Restore DLM error at specified address. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsAnySingleBitErrorOccured (void) |
| Check if any single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsICacheSingleBitErrorOccured (void) |
| Check if I-Cache single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDCacheSingleBitErrorOccured (void) |
| Check if D-Cache single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsTLBSingleBitErrorOccured (void) |
| Check if TLB single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsILMSingleBitErrorOccured (void) |
| Check if ILM single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDLMSingleBitErrorOccured (void) |
| Check if DLM single-bit error has occurred. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearAllSingleBitError (void) |
| Clear all single-bit errors. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearICacheSingleBitError (void) |
| Clear I-Cache single-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearDCacheSingleBitError (void) |
| Clear D-Cache single-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearTLBSingleBitError (void) |
| Clear TLB single-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearILMSingleBitError (void) |
| Clear ILM single-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearDLMSingleBitError (void) |
| Clear DLM single-bit error. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsAnyDoubleBitErrorOccured (void) |
| Check if any double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsICacheDoubleBitErrorOccured (void) |
| Check if I-Cache double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDCacheDoubleBitErrorOccured (void) |
| Check if D-Cache double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsTLBDoubleBitErrorOccured (void) |
| Check if TLB double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsILMDoubleBitErrorOccured (void) |
| Check if ILM double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE int32_t | ECC_IsDLMDoubleBitErrorOccured (void) |
| Check if DLM double-bit error has occurred. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearAllDoubleBitError (void) |
| Clear all double-bit errors. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearICacheDoubleBitError (void) |
| Clear I-Cache double-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearDCacheDoubleBitError (void) |
| Clear D-Cache double-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearTLBDoubleBitError (void) |
| Clear TLB double-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearILMDoubleBitError (void) |
| Clear ILM double-bit error. More... | |
| __STATIC_FORCEINLINE void | ECC_ClearDLMDoubleBitError (void) |
| Clear DLM double-bit error. More... | |
| static uint8_t | ECC_GenerateECCCodeU32 (uint32_t a) |
| Generate ECC code for a 32-bit value. More... | |
| static uint8_t | ECC_GenerateECCCodeU64 (uint64_t a) |
| Generate ECC code for a 64-bit value. More... | |
Functions that related to the ECC feature.
These functions provide access to the Error Correction Code (ECC) feature available in Nuclei N/NX processor cores. ECC is a memory protection mechanism that can detect and correct single-bit errors and detect double-bit errors in memory systems such as caches and local memories.
The ECC feature includes:
| #define ECC_ERROR_RAMID_MASK_DCACHE 2U |
Definition at line 654 of file core_feature_ecc.h.
| #define ECC_ERROR_RAMID_MASK_DLM 16U |
Definition at line 657 of file core_feature_ecc.h.
| #define ECC_ERROR_RAMID_MASK_ICACHE 1U |
Definition at line 653 of file core_feature_ecc.h.
| #define ECC_ERROR_RAMID_MASK_ILM 8U |
Definition at line 656 of file core_feature_ecc.h.
| #define ECC_ERROR_RAMID_MASK_TLB 4U |
Definition at line 655 of file core_feature_ecc.h.
| __STATIC_FORCEINLINE void ECC_ClearAllDoubleBitError | ( | void | ) |
Clear all double-bit errors.
This function clears all double-bit errors by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 887 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID.
| __STATIC_FORCEINLINE void ECC_ClearAllSingleBitError | ( | void | ) |
Clear all single-bit errors.
This function clears all single-bit errors by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 743 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID.
| __STATIC_FORCEINLINE void ECC_ClearDCacheDoubleBitError | ( | void | ) |
Clear D-Cache double-bit error.
This function clears the double-bit error in the D-Cache by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 909 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID_DC.
| __STATIC_FORCEINLINE void ECC_ClearDCacheSingleBitError | ( | void | ) |
Clear D-Cache single-bit error.
This function clears the single-bit error in the D-Cache by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 765 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID_DC.
| __STATIC_FORCEINLINE void ECC_ClearDLMDoubleBitError | ( | void | ) |
Clear DLM double-bit error.
This function clears the double-bit error in the DLM by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 942 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID_DLM.
| __STATIC_FORCEINLINE void ECC_ClearDLMSingleBitError | ( | void | ) |
Clear DLM single-bit error.
This function clears the single-bit error in the DLM by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 798 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID_DLM.
| __STATIC_FORCEINLINE void ECC_ClearICacheDoubleBitError | ( | void | ) |
Clear I-Cache double-bit error.
This function clears the double-bit error in the I-Cache by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 898 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID_IC.
| __STATIC_FORCEINLINE void ECC_ClearICacheSingleBitError | ( | void | ) |
Clear I-Cache single-bit error.
This function clears the single-bit error in the I-Cache by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 754 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID_IC.
| __STATIC_FORCEINLINE void ECC_ClearILMDoubleBitError | ( | void | ) |
Clear ILM double-bit error.
This function clears the double-bit error in the ILM by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 931 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID_ILM.
| __STATIC_FORCEINLINE void ECC_ClearILMSingleBitError | ( | void | ) |
Clear ILM single-bit error.
This function clears the single-bit error in the ILM by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 787 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID_ILM.
| __STATIC_FORCEINLINE void ECC_ClearTLBDoubleBitError | ( | void | ) |
Clear TLB double-bit error.
This function clears the double-bit error in the TLB by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 920 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_RAMID_TLB.
| __STATIC_FORCEINLINE void ECC_ClearTLBSingleBitError | ( | void | ) |
Clear TLB single-bit error.
This function clears the single-bit error in the TLB by clearing the appropriate bits in the machine ECC code CSR.
Definition at line 776 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MECC_CODE, and MECC_CODE_SRAMID_TLB.
| __STATIC_FORCEINLINE void ECC_DCacheDRamErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into D-Cache Data RAM.
This function injects an error into the D-Cache Data RAM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 389 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, CSR_MCACHE_CTL, CSR_MECC_CODE, ECC_DisableDCacheECCCheck(), ECC_EnableDCacheECCCheck(), MCACHE_CTL_DC_DRAM_ECC_INJ_EN, MFlushInvalDCacheLine(), and MLockDCacheLine().
| __STATIC_FORCEINLINE void ECC_DCacheErrRestore | ( | void * | addr | ) |
Restore D-Cache error at specified address.
This function restores the correct ECC code for the D-Cache line at the specified address.
| [in] | addr | Address to restore |
Definition at line 409 of file core_feature_ecc.h.
References ECC_DisableDCacheECCCheck(), ECC_EnableDCacheECCCheck(), MFlushInvalDCacheLine(), and MLockDCacheLine().
| __STATIC_FORCEINLINE void ECC_DCacheTRamErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into D-Cache Tag RAM.
This function injects an error into the D-Cache Tag RAM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 367 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, CSR_MCACHE_CTL, CSR_MECC_CODE, ECC_DisableDCacheECCCheck(), ECC_EnableDCacheECCCheck(), MCACHE_CTL_DC_TRAM_ECC_INJ_EN, MFlushInvalDCacheLine(), and MLockDCacheLine().
| __STATIC_FORCEINLINE void ECC_DisableDCacheECC | ( | void | ) |
Disable ECC for D-Cache.
This function disables ECC for the data cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 253 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_EN.
| __STATIC_FORCEINLINE void ECC_DisableDCacheECCCheck | ( | void | ) |
Disable ECC checking for D-Cache.
This function disables ECC checking for the data cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 297 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_CHK_EN.
Referenced by ECC_DCacheDRamErrInject(), ECC_DCacheErrRestore(), and ECC_DCacheTRamErrInject().
| __STATIC_FORCEINLINE void ECC_DisableDCacheECCExcp | ( | void | ) |
Disable ECC exception for D-Cache.
This function disables ECC exception for the data cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 275 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_DisableDLM | ( | void | ) |
Disable DLM.
This function disables DLM by clearing the appropriate bit in the machine DLM control CSR.
Definition at line 551 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MDLM_CTL, and MDLM_CTL_DLM_EN.
| __STATIC_FORCEINLINE void ECC_DisableDLMECC | ( | void | ) |
Disable ECC for DLM.
This function disables ECC for DLM by clearing the appropriate bit in the machine DLM control CSR.
Definition at line 571 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_EN.
| __STATIC_FORCEINLINE void ECC_DisableDLMECCCheck | ( | void | ) |
Disable ECC checking for DLM.
This function disables ECC checking for DLM by clearing the appropriate bit in the machine DLM control CSR.
Definition at line 611 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_CHK_EN.
Referenced by ECC_DLMErrInject(), and ECC_DLMErrRestore().
| __STATIC_FORCEINLINE void ECC_DisableDLMECCExcp | ( | void | ) |
Disable ECC exception for DLM.
This function disables ECC exception for DLM by clearing the appropriate bit in the machine DLM control CSR.
Definition at line 591 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_DisableICacheECC | ( | void | ) |
Disable ECC for I-Cache.
This function disables ECC for the instruction cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 187 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EN.
| __STATIC_FORCEINLINE void ECC_DisableICacheECCCheck | ( | void | ) |
Disable ECC checking for I-Cache.
This function disables ECC checking for the instruction cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 231 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_CHK_EN.
| __STATIC_FORCEINLINE void ECC_DisableICacheECCExcp | ( | void | ) |
Disable ECC exception for I-Cache.
This function disables ECC exception for the instruction cache by clearing the appropriate bit in the machine cache control CSR.
Definition at line 209 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_DisableILM | ( | void | ) |
Disable ILM.
This function disables ILM by clearing the appropriate bit in the machine ILM control CSR.
Definition at line 434 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MILM_CTL, and MILM_CTL_ILM_EN.
| __STATIC_FORCEINLINE void ECC_DisableILMECC | ( | void | ) |
Disable ECC for ILM.
This function disables ECC for ILM by clearing the appropriate bit in the machine ILM control CSR.
Definition at line 454 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_EN.
| __STATIC_FORCEINLINE void ECC_DisableILMECCCheck | ( | void | ) |
Disable ECC checking for ILM.
This function disables ECC checking for ILM by clearing the appropriate bit in the machine ILM control CSR.
Definition at line 494 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_CHK_EN.
Referenced by ECC_ILMErrInject(), and ECC_ILMErrRestore().
| __STATIC_FORCEINLINE void ECC_DisableILMECCExcp | ( | void | ) |
Disable ECC exception for ILM.
This function disables ECC exception for ILM by clearing the appropriate bit in the machine ILM control CSR.
Definition at line 474 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_DLMErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into DLM.
This function injects an error into the DLM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 623 of file core_feature_ecc.h.
References __LW(), __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, __SW(), CSR_MDLM_CTL, CSR_MECC_CODE, ECC_DisableDLMECCCheck(), ECC_EnableDLMECCCheck(), and MDLM_CTL_DLM_ECC_INJ_EN.
| __STATIC_FORCEINLINE void ECC_DLMErrRestore | ( | void * | addr | ) |
Restore DLM error at specified address.
This function restores the correct ECC code for the DLM at the specified address.
| [in] | addr | Address to restore |
Definition at line 644 of file core_feature_ecc.h.
References __LW(), __RWMB, __SW(), ECC_DisableDLMECCCheck(), and ECC_EnableDLMECCCheck().
| __STATIC_FORCEINLINE void ECC_EnableDCacheECC | ( | void | ) |
Enable ECC for D-Cache.
This function enables ECC for the data cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 242 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_EN.
| __STATIC_FORCEINLINE void ECC_EnableDCacheECCCheck | ( | void | ) |
Enable ECC checking for D-Cache.
This function enables ECC checking for the data cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 286 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_CHK_EN.
Referenced by ECC_DCacheDRamErrInject(), ECC_DCacheErrRestore(), and ECC_DCacheTRamErrInject().
| __STATIC_FORCEINLINE void ECC_EnableDCacheECCExcp | ( | void | ) |
Enable ECC exception for D-Cache.
This function enables ECC exception for the data cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 264 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_DC_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_EnableDLM | ( | void | ) |
Enable DLM.
This function enables DLM by setting the appropriate bit in the machine DLM control CSR.
Definition at line 541 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MDLM_CTL, and MDLM_CTL_DLM_EN.
| __STATIC_FORCEINLINE void ECC_EnableDLMECC | ( | void | ) |
Enable ECC for DLM.
This function enables ECC for DLM by setting the appropriate bit in the machine DLM control CSR.
Definition at line 561 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_EN.
| __STATIC_FORCEINLINE void ECC_EnableDLMECCCheck | ( | void | ) |
Enable ECC checking for DLM.
This function enables ECC checking for DLM by setting the appropriate bit in the machine DLM control CSR.
Definition at line 601 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_CHK_EN.
Referenced by ECC_DLMErrInject(), and ECC_DLMErrRestore().
| __STATIC_FORCEINLINE void ECC_EnableDLMECCExcp | ( | void | ) |
Enable ECC exception for DLM.
This function enables ECC exception for DLM by setting the appropriate bit in the machine DLM control CSR.
Definition at line 581 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MDLM_CTL, and MDLM_CTL_DLM_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_EnableICacheECC | ( | void | ) |
Enable ECC for I-Cache.
This function enables ECC for the instruction cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 176 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EN.
| __STATIC_FORCEINLINE void ECC_EnableICacheECCCheck | ( | void | ) |
Enable ECC checking for I-Cache.
This function enables ECC checking for the instruction cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 220 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_CHK_EN.
| __STATIC_FORCEINLINE void ECC_EnableICacheECCExcp | ( | void | ) |
Enable ECC exception for I-Cache.
This function enables ECC exception for the instruction cache by setting the appropriate bit in the machine cache control CSR.
Definition at line 198 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_ECC_EXCP_EN.
| __STATIC_FORCEINLINE void ECC_EnableILM | ( | void | ) |
Enable ILM.
This function enables ILM by setting the appropriate bit in the machine ILM control CSR.
Definition at line 424 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MILM_CTL, and MILM_CTL_ILM_EN.
| __STATIC_FORCEINLINE void ECC_EnableILMECC | ( | void | ) |
Enable ECC for ILM.
This function enables ECC for ILM by setting the appropriate bit in the machine ILM control CSR.
Definition at line 444 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_EN.
| __STATIC_FORCEINLINE void ECC_EnableILMECCCheck | ( | void | ) |
Enable ECC checking for ILM.
This function enables ECC checking for ILM by setting the appropriate bit in the machine ILM control CSR.
Definition at line 484 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_CHK_EN.
Referenced by ECC_ILMErrInject(), and ECC_ILMErrRestore().
| __STATIC_FORCEINLINE void ECC_EnableILMECCExcp | ( | void | ) |
Enable ECC exception for ILM.
This function enables ECC exception for ILM by setting the appropriate bit in the machine ILM control CSR.
Definition at line 464 of file core_feature_ecc.h.
References __RV_CSR_SET, CSR_MILM_CTL, and MILM_CTL_ILM_ECC_EXCP_EN.
|
static |
Generate ECC code for a 32-bit value.
This function calculates the ECC code for a 32-bit input value using Hamming code algorithm. It generates a 7-bit ECC code that can be used to detect and correct single-bit errors and detect double-bit errors.
| [in] | a | 32-bit value for which ECC code is to be generated |
Definition at line 956 of file core_feature_ecc.h.
|
static |
Generate ECC code for a 64-bit value.
This function calculates the ECC for a 64-bit input value using Hamming code algorithm. It generates an 8-bit ECC code that can be used to detect and correct single-bit errors and detect double-bit errors.
| [in] | a | 64-bit value for which ECC code is to be generated |
Definition at line 1001 of file core_feature_ecc.h.
| __STATIC_FORCEINLINE void ECC_ICacheDRamErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into I-Cache Data RAM.
This function injects an error into the I-Cache Data RAM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 332 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, CSR_MCACHE_CTL, CSR_MECC_CODE, MCACHE_CTL_IC_DRAM_ECC_INJ_EN, MInvalICacheLine(), and MLockICacheLine().
| __STATIC_FORCEINLINE void ECC_ICacheErrRestore | ( | void * | addr | ) |
Restore I-Cache error at specified address.
This function restores the correct ECC code for the I-Cache line at the specified address.
| [in] | addr | Address to restore |
Definition at line 350 of file core_feature_ecc.h.
References MInvalICacheLine(), and MLockICacheLine().
| __STATIC_FORCEINLINE void ECC_ICacheTRamErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into I-Cache Tag RAM.
This function injects an error into the I-Cache Tag RAM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 312 of file core_feature_ecc.h.
References __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, CSR_MCACHE_CTL, CSR_MECC_CODE, MCACHE_CTL_IC_TRAM_ECC_INJ_EN, MInvalICacheLine(), and MLockICacheLine().
| __STATIC_FORCEINLINE void ECC_ILMErrInject | ( | uint32_t | ecc_code, |
| void * | addr | ||
| ) |
Inject error into ILM.
This function injects an error into the ILM at the specified address with the given ECC code.
| [in] | ecc_code | ECC code to inject |
| [in] | addr | Address where error should be injected |
Definition at line 506 of file core_feature_ecc.h.
References __LW(), __RV_CSR_CLEAR, __RV_CSR_SET, __RV_CSR_WRITE, __RWMB, __SW(), CSR_MECC_CODE, CSR_MILM_CTL, ECC_DisableILMECCCheck(), ECC_EnableILMECCCheck(), and MILM_CTL_ILM_ECC_INJ_EN.
| __STATIC_FORCEINLINE void ECC_ILMErrRestore | ( | void * | addr | ) |
Restore ILM error at specified address.
This function restores the correct ECC code for the ILM at the specified address.
| [in] | addr | Address to restore |
Definition at line 527 of file core_feature_ecc.h.
References __LW(), __RWMB, __SW(), ECC_DisableILMECCCheck(), and ECC_EnableILMECCCheck().
| __STATIC_FORCEINLINE int32_t ECC_IsAnyDoubleBitErrorOccured | ( | void | ) |
Check if any double-bit error has occurred.
This function checks if any double-bit error has occurred by reading the machine ECC code CSR.
Definition at line 809 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsAnySingleBitErrorOccured | ( | void | ) |
Check if any single-bit error has occurred.
This function checks if any single-bit error has occurred by reading the machine ECC code CSR.
Definition at line 665 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsDCacheDoubleBitErrorOccured | ( | void | ) |
Check if D-Cache double-bit error has occurred.
This function checks if a double-bit error has occurred in the D-Cache.
Definition at line 835 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DCACHE, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsDCacheSingleBitErrorOccured | ( | void | ) |
Check if D-Cache single-bit error has occurred.
This function checks if a single-bit error has occurred in the D-Cache.
Definition at line 691 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DCACHE, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsDCacheSupportECC | ( | void | ) |
Check if D-Cache supports ECC.
This function checks if both D-Cache and ECC are supported in the core.
Definition at line 101 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MDCFGINFO_Type::b, CSR_MCFG_INFO, CSR_MDCFG_INFO, CSR_MCFGINFO_Type::d, CSR_MDCFGINFO_Type::d, CSR_MCFGINFO_Type::dcache, and CSR_MDCFGINFO_Type::ecc.
| __STATIC_FORCEINLINE int32_t ECC_IsDLMDoubleBitErrorOccured | ( | void | ) |
Check if DLM double-bit error has occurred.
This function checks if a double-bit error has occurred in the DLM.
Definition at line 874 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DLM, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsDLMSingleBitErrorOccured | ( | void | ) |
Check if DLM single-bit error has occurred.
This function checks if a single-bit error has occurred in the DLM.
Definition at line 730 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DLM, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsDLMSupportECC | ( | void | ) |
Check if DLM supports ECC.
This function checks if both DLM and ECC are supported in the core.
Definition at line 148 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MDCFGINFO_Type::b, CSR_MCFG_INFO, CSR_MDCFG_INFO, CSR_MCFGINFO_Type::d, CSR_MDCFGINFO_Type::d, CSR_MCFGINFO_Type::dlm, and CSR_MDCFGINFO_Type::lm_ecc.
| __STATIC_FORCEINLINE int32_t ECC_IsGlobalSupportECC | ( | void | ) |
Check if the core globally supports ECC.
This function reads the machine configuration info CSR and checks if ECC is supported globally in the core.
Definition at line 73 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MCFG_INFO, CSR_MCFGINFO_Type::d, and CSR_MCFGINFO_Type::ecc.
| __STATIC_FORCEINLINE int32_t ECC_IsICacheDoubleBitErrorOccured | ( | void | ) |
Check if I-Cache double-bit error has occurred.
This function checks if a double-bit error has occurred in the I-Cache.
Definition at line 822 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_ICACHE, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsICacheSingleBitErrorOccured | ( | void | ) |
Check if I-Cache single-bit error has occurred.
This function checks if a single-bit error has occurred in the I-Cache.
Definition at line 678 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_ICACHE, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsICacheSupportECC | ( | void | ) |
Check if I-Cache supports ECC.
This function checks if both I-Cache and ECC are supported in the core.
Definition at line 86 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MICFGINFO_Type::b, CSR_MCFG_INFO, CSR_MICFG_INFO, CSR_MCFGINFO_Type::d, CSR_MICFGINFO_Type::d, CSR_MICFGINFO_Type::ecc, and CSR_MCFGINFO_Type::icache.
| __STATIC_FORCEINLINE int32_t ECC_IsILMDoubleBitErrorOccured | ( | void | ) |
Check if ILM double-bit error has occurred.
This function checks if a double-bit error has occurred in the ILM.
Definition at line 861 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_ILM, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsILMSingleBitErrorOccured | ( | void | ) |
Check if ILM single-bit error has occurred.
This function checks if a single-bit error has occurred in the ILM.
Definition at line 717 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_ILM, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsILMSupportECC | ( | void | ) |
Check if ILM supports ECC.
This function checks if both ILM and ECC are supported in the core.
Definition at line 133 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MICFGINFO_Type::b, CSR_MCFG_INFO, CSR_MICFG_INFO, CSR_MCFGINFO_Type::d, CSR_MICFGINFO_Type::d, CSR_MCFGINFO_Type::ilm, and CSR_MICFGINFO_Type::lm_ecc.
| __STATIC_FORCEINLINE int32_t ECC_IsTLBDoubleBitErrorOccured | ( | void | ) |
Check if TLB double-bit error has occurred.
This function checks if a double-bit error has occurred in the TLB.
Definition at line 848 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DLM, and CSR_MECCCODE_Type::ramid.
| __STATIC_FORCEINLINE int32_t ECC_IsTLBSingleBitErrorOccured | ( | void | ) |
Check if TLB single-bit error has occurred.
This function checks if a single-bit error has occurred in the TLB.
Definition at line 704 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, ECC_ERROR_RAMID_MASK_DLM, and CSR_MECCCODE_Type::sramid.
| __STATIC_FORCEINLINE int32_t ECC_IsTLBSupportECC | ( | void | ) |
Check if TLB supports ECC.
This function checks if both PLIC and TLB ECC are supported in the core. Note: TLB is only present with MMU, and when PLIC is present, MMU will be present.
Definition at line 117 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MCFGINFO_Type::b, CSR_MTLBCFGINFO_Type::b, CSR_MCFG_INFO, CSR_MTLBCFG_INFO, CSR_MCFGINFO_Type::d, CSR_MTLBCFGINFO_Type::d, CSR_MTLBCFGINFO_Type::ecc, and CSR_MCFGINFO_Type::plic.
| __STATIC_FORCEINLINE int32_t ECC_IsXorErrorInjectMode | ( | void | ) |
Check if XOR error injection mode is supported.
This function reads the machine ECC code CSR and checks if error injection mode is suppported.
Definition at line 163 of file core_feature_ecc.h.
References __RV_CSR_READ, CSR_MECCCODE_Type::b, CSR_MECC_CODE, CSR_MECCCODE_Type::d, and CSR_MECCCODE_Type::ecc_inj_mode.