![]() |
NMSIS-Core
Version 1.5.0
NMSIS-Core support for Nuclei processor-based devices
|
Functions that generate RISC-V CPU instructions. More...
Enumerations | |
| enum | WFI_SleepMode_Type { WFI_SHALLOW_SLEEP = 0 , WFI_DEEP_SLEEP = 1 } |
| WFI Sleep Mode enumeration. More... | |
Functions | |
| __STATIC_FORCEINLINE void | __NOP (void) |
| NOP Instruction. More... | |
| __STATIC_FORCEINLINE void | __WFI (void) |
| Wait For Interrupt. More... | |
| __STATIC_FORCEINLINE void | __WFE (void) |
| Wait For Event. More... | |
| __STATIC_FORCEINLINE void | __EBREAK (void) |
| Breakpoint Instruction. More... | |
| __STATIC_FORCEINLINE void | __ECALL (void) |
| Environment Call Instruction. More... | |
| __STATIC_FORCEINLINE void | __set_wfi_sleepmode (WFI_SleepMode_Type mode) |
| Set Sleep mode of WFI. More... | |
| __STATIC_FORCEINLINE void | __TXEVT (void) |
| Send TX Event. More... | |
| __STATIC_FORCEINLINE void | __enable_mcycle_counter (void) |
| Enable MCYCLE counter. More... | |
| __STATIC_FORCEINLINE void | __disable_mcycle_counter (void) |
| Disable MCYCLE counter. More... | |
| __STATIC_FORCEINLINE void | __enable_minstret_counter (void) |
| Enable MINSTRET counter. More... | |
| __STATIC_FORCEINLINE void | __disable_minstret_counter (void) |
| Disable MINSTRET counter. More... | |
| __STATIC_FORCEINLINE void | __enable_mhpm_counter (unsigned long idx) |
| Enable selected hardware performance monitor counter. More... | |
| __STATIC_FORCEINLINE void | __disable_mhpm_counter (unsigned long idx) |
| Disable selected hardware performance monitor counter. More... | |
| __STATIC_FORCEINLINE void | __enable_mhpm_counters (unsigned long mask) |
| Enable hardware performance counters with mask. More... | |
| __STATIC_FORCEINLINE void | __disable_mhpm_counters (unsigned long mask) |
| Disable hardware performance counters with mask. More... | |
| __STATIC_FORCEINLINE void | __enable_all_counter (void) |
| Enable all MCYCLE & MINSTRET & MHPMCOUNTER counter. More... | |
| __STATIC_FORCEINLINE void | __disable_all_counter (void) |
| Disable all MCYCLE & MINSTRET & MHPMCOUNTER counter. More... | |
| __STATIC_INLINE void | __set_hpm_event (unsigned long idx, unsigned long event) |
| Set event for selected high performance monitor event. More... | |
| __STATIC_INLINE unsigned long | __get_hpm_event (unsigned long idx) |
| Get event for selected high performance monitor event. More... | |
| __STATIC_INLINE void | __set_hpm_counter (unsigned long idx, uint64_t value) |
| Set value for selected high performance monitor counter. More... | |
| __STATIC_INLINE uint64_t | __get_hpm_counter (unsigned long idx) |
| Get value of selected high performance monitor counter. More... | |
| __STATIC_INLINE unsigned long | __read_hpm_counter (unsigned long idx) |
| Get value of selected high performance monitor counter. More... | |
| __STATIC_FORCEINLINE void | __set_medeleg (unsigned long mask) |
| Set exceptions delegation to S mode. More... | |
| __STATIC_FORCEINLINE void | __set_mideleg (unsigned long mask) |
| Set interrupt delegation to S mode. More... | |
| __STATIC_FORCEINLINE uint8_t | __LB (volatile void *addr) |
| Load 8bit value from address (8 bit) More... | |
| __STATIC_FORCEINLINE uint16_t | __LH (volatile void *addr) |
| Load 16bit value from address (16 bit) More... | |
| __STATIC_FORCEINLINE uint32_t | __LW (volatile void *addr) |
| Load 32bit value from address (32 bit) More... | |
| __STATIC_FORCEINLINE void | __SB (volatile void *addr, uint8_t val) |
| Write 8bit value to address (8 bit) More... | |
| __STATIC_FORCEINLINE void | __SH (volatile void *addr, uint16_t val) |
| Write 16bit value to address (16 bit) More... | |
| __STATIC_FORCEINLINE void | __SW (volatile void *addr, uint32_t val) |
| Write 32bit value to address (32 bit) More... | |
| __STATIC_INLINE uint32_t | __CAS_W (volatile uint32_t *addr, uint32_t oldval, uint32_t newval) |
| Compare and Swap 32bit value using LR and SC. More... | |
| __STATIC_FORCEINLINE uint32_t | __AMOSWAP_W (volatile uint32_t *addr, uint32_t newval) |
| Atomic Swap 32bit value into memory. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOADD_W (volatile int32_t *addr, int32_t value) |
| Atomic Add with 32bit value. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOAND_W (volatile int32_t *addr, int32_t value) |
| Atomic And with 32bit value. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOOR_W (volatile int32_t *addr, int32_t value) |
| Atomic OR with 32bit value. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOXOR_W (volatile int32_t *addr, int32_t value) |
| Atomic XOR with 32bit value. More... | |
| __STATIC_FORCEINLINE uint32_t | __AMOMAXU_W (volatile uint32_t *addr, uint32_t value) |
| Atomic unsigned MAX with 32bit value. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOMAX_W (volatile int32_t *addr, int32_t value) |
| Atomic signed MAX with 32bit value. More... | |
| __STATIC_FORCEINLINE uint32_t | __AMOMINU_W (volatile uint32_t *addr, uint32_t value) |
| Atomic unsigned MIN with 32bit value. More... | |
| __STATIC_FORCEINLINE int32_t | __AMOMIN_W (volatile int32_t *addr, int32_t value) |
| Atomic signed MIN with 32bit value. More... | |
| __STATIC_FORCEINLINE void | __enable_ic_prefetch (void) |
| Enable ICache prefetch. More... | |
| __STATIC_FORCEINLINE void | __disable_ic_prefetch (void) |
| Disable ICache prefetch. More... | |
| __STATIC_FORCEINLINE void | __enable_ic_cmo_prefetch (void) |
| Enable ICache CMO prefetch. More... | |
| __STATIC_FORCEINLINE void | __disable_ic_cmo_prefetch (void) |
| Disable ICache CMO prefetch. More... | |
| __STATIC_FORCEINLINE void | __enable_dc_cmo_prefetch (void) |
| Enable DCache CMO prefetch. More... | |
| __STATIC_FORCEINLINE void | __disable_dc_cmo_prefetch (void) |
| Disable DCache CMO prefetch. More... | |
| __STATIC_FORCEINLINE void | __cmo_prefetch_i (const void *addr) |
| Instruction prefetch operation. More... | |
| __STATIC_FORCEINLINE void | __cmo_prefetch_r (const void *addr) |
| Read prefetch operation. More... | |
| __STATIC_FORCEINLINE void | __cmo_prefetch_w (const void *addr) |
| Write prefetch operation. More... | |
Functions that generate RISC-V CPU instructions.
The following functions generate specified RISC-V instructions that cannot be directly accessed by compiler.
| enum WFI_SleepMode_Type |
WFI Sleep Mode enumeration.
| Enumerator | |
|---|---|
| WFI_SHALLOW_SLEEP | Shallow sleep mode, the core_clk will poweroff. |
| WFI_DEEP_SLEEP | Deep sleep mode, the core_clk and core_ano_clk will poweroff. |
Definition at line 1568 of file core_feature_base.h.
| __STATIC_FORCEINLINE int32_t __AMOADD_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic Add with 32bit value.
Atomically ADD 32bit value with value in memory using amoadd.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be ADDed |
Definition at line 2357 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE int32_t __AMOAND_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic And with 32bit value.
Atomically AND 32bit value with value in memory using amoand.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be ANDed |
Definition at line 2373 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE int32_t __AMOMAX_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic signed MAX with 32bit value.
Atomically signed max compare 32bit value with value in memory using amomax.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be compared |
Definition at line 2437 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE uint32_t __AMOMAXU_W | ( | volatile uint32_t * | addr, |
| uint32_t | value | ||
| ) |
Atomic unsigned MAX with 32bit value.
Atomically unsigned max compare 32bit value with value in memory using amomaxu.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be compared |
Definition at line 2421 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE int32_t __AMOMIN_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic signed MIN with 32bit value.
Atomically signed min compare 32bit value with value in memory using amomin.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be compared |
Definition at line 2469 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE uint32_t __AMOMINU_W | ( | volatile uint32_t * | addr, |
| uint32_t | value | ||
| ) |
Atomic unsigned MIN with 32bit value.
Atomically unsigned min compare 32bit value with value in memory using amominu.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be compared |
Definition at line 2453 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE int32_t __AMOOR_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic OR with 32bit value.
Atomically OR 32bit value with value in memory using amoor.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be ORed |
Definition at line 2389 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE uint32_t __AMOSWAP_W | ( | volatile uint32_t * | addr, |
| uint32_t | newval | ||
| ) |
Atomic Swap 32bit value into memory.
Atomically swap new 32bit value into memory using amoswap.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | newval | New value to be stored into the address |
Definition at line 2341 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE int32_t __AMOXOR_W | ( | volatile int32_t * | addr, |
| int32_t | value | ||
| ) |
Atomic XOR with 32bit value.
Atomically XOR 32bit value with value in memory using amoxor.d.
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | value | value to be XORed |
Definition at line 2405 of file core_feature_base.h.
References __ASM.
| __STATIC_INLINE uint32_t __CAS_W | ( | volatile uint32_t * | addr, |
| uint32_t | oldval, | ||
| uint32_t | newval | ||
| ) |
Compare and Swap 32bit value using LR and SC.
Compare old value with memory, if identical, store new value in memory. Return the initial value in memory. Success is indicated by comparing return value with OLD. memory address, return 0 if successful, otherwise return !0
| [in] | addr | Address pointer to data, address need to be 4byte aligned |
| [in] | oldval | Old value of the data in address |
| [in] | newval | New value to be stored into the address |
Definition at line 2317 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __cmo_prefetch_i | ( | const void * | addr | ) |
Instruction prefetch operation.
Performs an instruction prefetch operation for the specified address using the RISC-V prefetch.i instruction.
| [in] | addr | Address to prefetch |
_zicbop extension enabled. Here is a code example to check if CMO prefetch is supported:Definition at line 2731 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __cmo_prefetch_r | ( | const void * | addr | ) |
Read prefetch operation.
Performs a read prefetch operation for the specified address using the RISC-V prefetch.r instruction.
| [in] | addr | Address to prefetch |
_zicbop extension enabled. Here is a code example to check if CMO prefetch is supported:Definition at line 2755 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __cmo_prefetch_w | ( | const void * | addr | ) |
Write prefetch operation.
Performs a write prefetch operation for the specified address using the RISC-V prefetch.w instruction.
| [in] | addr | Address to prefetch |
_zicbop extension enabled. Here is a code example to check if CMO prefetch is supported:Definition at line 2779 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __disable_all_counter | ( | void | ) |
Disable all MCYCLE & MINSTRET & MHPMCOUNTER counter.
Set all to one to disable all counters, such as cycle, instret, high performance monitor counters
Definition at line 1699 of file core_feature_base.h.
References __RV_CSR_SET, and CSR_MCOUNTINHIBIT.
| __STATIC_FORCEINLINE void __disable_dc_cmo_prefetch | ( | void | ) |
Disable DCache CMO prefetch.
Clear the DC_CMO_PF_EN bit in the MCACHE_CTL CSR to disable DCache prefetch.
Definition at line 2707 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_DC_CMO_PF_EN.
| __STATIC_FORCEINLINE void __disable_ic_cmo_prefetch | ( | void | ) |
Disable ICache CMO prefetch.
Clear the IC_CMO_PF_EN bit in the MCACHE_CTL CSR to disable ICache prefetch.
Definition at line 2687 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_CMO_PF_EN.
| __STATIC_FORCEINLINE void __disable_ic_prefetch | ( | void | ) |
Disable ICache prefetch.
Clear the IC_PF_EN bit in the MCACHE_CTL CSR to disable ICache prefetch.
Definition at line 2667 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCACHE_CTL, and MCACHE_CTL_IC_PF_EN.
| __STATIC_FORCEINLINE void __disable_mcycle_counter | ( | void | ) |
Disable MCYCLE counter.
Set the CY bit of MCOUNTINHIBIT to 1 to disable MCYCLE Counter
Definition at line 1611 of file core_feature_base.h.
References __RV_CSR_SET, CSR_MCOUNTINHIBIT, and MCOUNTINHIBIT_CY.
| __STATIC_FORCEINLINE void __disable_mhpm_counter | ( | unsigned long | idx | ) |
Disable selected hardware performance monitor counter.
| [in] | idx | the index of the hardware performance monitor counter |
Disable selected hardware performance monitor counter mhpmcounterx.
Definition at line 1653 of file core_feature_base.h.
References __RV_CSR_SET, and CSR_MCOUNTINHIBIT.
| __STATIC_FORCEINLINE void __disable_mhpm_counters | ( | unsigned long | mask | ) |
Disable hardware performance counters with mask.
| [in] | mask | mask of selected hardware performance monitor counters |
Disable mhpmcounterx with mask, only the masked ones will be disabled. mhpmcounter3-mhpmcount31 are for high performance monitor counters.
Definition at line 1677 of file core_feature_base.h.
References __RV_CSR_SET, and CSR_MCOUNTINHIBIT.
| __STATIC_FORCEINLINE void __disable_minstret_counter | ( | void | ) |
Disable MINSTRET counter.
Set the IR bit of MCOUNTINHIBIT to 1 to disable MINSTRET Counter
Definition at line 1631 of file core_feature_base.h.
References __RV_CSR_SET, CSR_MCOUNTINHIBIT, and MCOUNTINHIBIT_IR.
| __STATIC_FORCEINLINE void __EBREAK | ( | void | ) |
Breakpoint Instruction.
Causes the processor to enter Debug state. Debug tools can use this to investigate system state when the instruction at a particular address is reached.
Definition at line 1549 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __ECALL | ( | void | ) |
Environment Call Instruction.
The ECALL instruction is used to make a service request to the execution environment.
Definition at line 1560 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __enable_all_counter | ( | void | ) |
Enable all MCYCLE & MINSTRET & MHPMCOUNTER counter.
Clear all to zero to enable all counters, such as cycle, instret, high performance monitor counters
Definition at line 1688 of file core_feature_base.h.
References __RV_CSR_CLEAR, and CSR_MCOUNTINHIBIT.
Referenced by __prepare_bench_env().
| __STATIC_FORCEINLINE void __enable_dc_cmo_prefetch | ( | void | ) |
Enable DCache CMO prefetch.
Set the DC_CMO_PF_EN bit in the MCACHE_CTL CSR to enable DCache prefetch.
Definition at line 2697 of file core_feature_base.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_DC_CMO_PF_EN.
| __STATIC_FORCEINLINE void __enable_ic_cmo_prefetch | ( | void | ) |
Enable ICache CMO prefetch.
Set the IC_CMO_PF_EN bit in the MCACHE_CTL CSR to enable ICache prefetch.
Definition at line 2677 of file core_feature_base.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_CMO_PF_EN.
| __STATIC_FORCEINLINE void __enable_ic_prefetch | ( | void | ) |
Enable ICache prefetch.
Set the IC_PF_EN bit in the MCACHE_CTL CSR to enable ICache prefetch.
Definition at line 2657 of file core_feature_base.h.
References __RV_CSR_SET, CSR_MCACHE_CTL, and MCACHE_CTL_IC_PF_EN.
| __STATIC_FORCEINLINE void __enable_mcycle_counter | ( | void | ) |
Enable MCYCLE counter.
Clear the CY bit of MCOUNTINHIBIT to 0 to enable MCYCLE Counter
Definition at line 1601 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCOUNTINHIBIT, and MCOUNTINHIBIT_CY.
| __STATIC_FORCEINLINE void __enable_mhpm_counter | ( | unsigned long | idx | ) |
Enable selected hardware performance monitor counter.
| [in] | idx | the index of the hardware performance monitor counter |
enable selected hardware performance monitor counter mhpmcounterx.
Definition at line 1642 of file core_feature_base.h.
References __RV_CSR_CLEAR, and CSR_MCOUNTINHIBIT.
| __STATIC_FORCEINLINE void __enable_mhpm_counters | ( | unsigned long | mask | ) |
Enable hardware performance counters with mask.
| [in] | mask | mask of selected hardware performance monitor counters |
enable mhpmcounterx with mask, only the masked ones will be enabled. mhpmcounter3-mhpmcount31 are for high performance monitor counters.
Definition at line 1665 of file core_feature_base.h.
References __RV_CSR_CLEAR, and CSR_MCOUNTINHIBIT.
| __STATIC_FORCEINLINE void __enable_minstret_counter | ( | void | ) |
Enable MINSTRET counter.
Clear the IR bit of MCOUNTINHIBIT to 0 to enable MINSTRET Counter
Definition at line 1621 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCOUNTINHIBIT, and MCOUNTINHIBIT_IR.
| __STATIC_INLINE uint64_t __get_hpm_counter | ( | unsigned long | idx | ) |
Get value of selected high performance monitor counter.
| [in] | idx | HPMCOUNTERx CSR index(3-31) |
Get high performance monitor counter register value
Definition at line 1934 of file core_feature_base.h.
References __get_rv_cycle(), __get_rv_instret(), __RV_CSR_READ, __RWMB, CSR_MHPMCOUNTER10, CSR_MHPMCOUNTER10H, CSR_MHPMCOUNTER11, CSR_MHPMCOUNTER11H, CSR_MHPMCOUNTER12, CSR_MHPMCOUNTER12H, CSR_MHPMCOUNTER13, CSR_MHPMCOUNTER13H, CSR_MHPMCOUNTER14, CSR_MHPMCOUNTER14H, CSR_MHPMCOUNTER15, CSR_MHPMCOUNTER15H, CSR_MHPMCOUNTER16, CSR_MHPMCOUNTER16H, CSR_MHPMCOUNTER17, CSR_MHPMCOUNTER17H, CSR_MHPMCOUNTER18, CSR_MHPMCOUNTER18H, CSR_MHPMCOUNTER19, CSR_MHPMCOUNTER19H, CSR_MHPMCOUNTER20, CSR_MHPMCOUNTER20H, CSR_MHPMCOUNTER21, CSR_MHPMCOUNTER21H, CSR_MHPMCOUNTER22, CSR_MHPMCOUNTER22H, CSR_MHPMCOUNTER23, CSR_MHPMCOUNTER23H, CSR_MHPMCOUNTER24, CSR_MHPMCOUNTER24H, CSR_MHPMCOUNTER25, CSR_MHPMCOUNTER25H, CSR_MHPMCOUNTER26, CSR_MHPMCOUNTER26H, CSR_MHPMCOUNTER27, CSR_MHPMCOUNTER27H, CSR_MHPMCOUNTER28, CSR_MHPMCOUNTER28H, CSR_MHPMCOUNTER29, CSR_MHPMCOUNTER29H, CSR_MHPMCOUNTER3, CSR_MHPMCOUNTER30, CSR_MHPMCOUNTER30H, CSR_MHPMCOUNTER31, CSR_MHPMCOUNTER31H, CSR_MHPMCOUNTER3H, CSR_MHPMCOUNTER4, CSR_MHPMCOUNTER4H, CSR_MHPMCOUNTER5, CSR_MHPMCOUNTER5H, CSR_MHPMCOUNTER6, CSR_MHPMCOUNTER6H, CSR_MHPMCOUNTER7, CSR_MHPMCOUNTER7H, CSR_MHPMCOUNTER8, CSR_MHPMCOUNTER8H, CSR_MHPMCOUNTER9, and CSR_MHPMCOUNTER9H.
| __STATIC_INLINE unsigned long __get_hpm_event | ( | unsigned long | idx | ) |
Get event for selected high performance monitor event.
| [in] | idx | HPMEVENTx CSR index(3-31) |
| [in] | event | HPMEVENTx Register value to set |
Get high performance monitor event register value
Definition at line 1755 of file core_feature_base.h.
References __RV_CSR_READ, CSR_MHPMEVENT10, CSR_MHPMEVENT11, CSR_MHPMEVENT12, CSR_MHPMEVENT13, CSR_MHPMEVENT14, CSR_MHPMEVENT15, CSR_MHPMEVENT16, CSR_MHPMEVENT17, CSR_MHPMEVENT18, CSR_MHPMEVENT19, CSR_MHPMEVENT20, CSR_MHPMEVENT21, CSR_MHPMEVENT22, CSR_MHPMEVENT23, CSR_MHPMEVENT24, CSR_MHPMEVENT25, CSR_MHPMEVENT26, CSR_MHPMEVENT27, CSR_MHPMEVENT28, CSR_MHPMEVENT29, CSR_MHPMEVENT3, CSR_MHPMEVENT30, CSR_MHPMEVENT31, CSR_MHPMEVENT4, CSR_MHPMEVENT5, CSR_MHPMEVENT6, CSR_MHPMEVENT7, CSR_MHPMEVENT8, and CSR_MHPMEVENT9.
| __STATIC_FORCEINLINE uint8_t __LB | ( | volatile void * | addr | ) |
Load 8bit value from address (8 bit)
Load 8 bit value.
| [in] | addr | Address pointer to data |
Definition at line 2208 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE uint16_t __LH | ( | volatile void * | addr | ) |
Load 16bit value from address (16 bit)
Load 16 bit value.
| [in] | addr | Address pointer to data |
Definition at line 2222 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE uint32_t __LW | ( | volatile void * | addr | ) |
Load 32bit value from address (32 bit)
Load 32 bit value.
| [in] | addr | Address pointer to data |
Definition at line 2236 of file core_feature_base.h.
References __ASM.
Referenced by CIDU_GetBroadcastModeStatus(), CIDU_GetClaimStatus(), CIDU_GetCoreNum(), CIDU_GetIntNum(), CIDU_GetSemaphoreStatus(), CIDU_QueryCoreIntSenderMask(), CIDU_SetFirstClaimMode(), ECC_DLMErrInject(), ECC_DLMErrRestore(), ECC_ILMErrInject(), ECC_ILMErrRestore(), SMPCC_CLMErrInject(), SysTimer_GetHartCompareValue(), SysTimer_GetHartMsipValue(), SysTimer_GetHartSsipValue(), and SysTimer_GetLoadValue().
| __STATIC_FORCEINLINE void __NOP | ( | void | ) |
NOP Instruction.
No Operation does nothing. This instruction can be used for code alignment purposes.
Definition at line 1508 of file core_feature_base.h.
References __ASM.
| __STATIC_INLINE unsigned long __read_hpm_counter | ( | unsigned long | idx | ) |
Get value of selected high performance monitor counter.
| [in] | idx | HPMCOUNTERx CSR index(3-31) |
Get high performance monitor counter register value without high 32 bits when XLEN=32
Definition at line 2139 of file core_feature_base.h.
References __read_cycle_csr(), __read_instret_csr(), __RV_CSR_READ, CSR_MHPMCOUNTER10, CSR_MHPMCOUNTER11, CSR_MHPMCOUNTER12, CSR_MHPMCOUNTER13, CSR_MHPMCOUNTER14, CSR_MHPMCOUNTER15, CSR_MHPMCOUNTER16, CSR_MHPMCOUNTER17, CSR_MHPMCOUNTER18, CSR_MHPMCOUNTER19, CSR_MHPMCOUNTER20, CSR_MHPMCOUNTER21, CSR_MHPMCOUNTER22, CSR_MHPMCOUNTER23, CSR_MHPMCOUNTER24, CSR_MHPMCOUNTER25, CSR_MHPMCOUNTER26, CSR_MHPMCOUNTER27, CSR_MHPMCOUNTER28, CSR_MHPMCOUNTER29, CSR_MHPMCOUNTER3, CSR_MHPMCOUNTER30, CSR_MHPMCOUNTER31, CSR_MHPMCOUNTER4, CSR_MHPMCOUNTER5, CSR_MHPMCOUNTER6, CSR_MHPMCOUNTER7, CSR_MHPMCOUNTER8, and CSR_MHPMCOUNTER9.
| __STATIC_FORCEINLINE void __SB | ( | volatile void * | addr, |
| uint8_t | val | ||
| ) |
Write 8bit value to address (8 bit)
Write 8 bit value.
| [in] | addr | Address pointer to data |
| [in] | val | Value to set |
Definition at line 2266 of file core_feature_base.h.
References __ASM.
| __STATIC_INLINE void __set_hpm_counter | ( | unsigned long | idx, |
| uint64_t | value | ||
| ) |
Set value for selected high performance monitor counter.
| [in] | idx | HPMCOUNTERx CSR index(3-31) |
| [in] | value | HPMCOUNTERx Register value to set |
Set value for high performance monitor couner register
Definition at line 1798 of file core_feature_base.h.
References __RV_CSR_WRITE, CSR_MHPMCOUNTER10, CSR_MHPMCOUNTER10H, CSR_MHPMCOUNTER11, CSR_MHPMCOUNTER11H, CSR_MHPMCOUNTER12, CSR_MHPMCOUNTER12H, CSR_MHPMCOUNTER13, CSR_MHPMCOUNTER13H, CSR_MHPMCOUNTER14, CSR_MHPMCOUNTER14H, CSR_MHPMCOUNTER15, CSR_MHPMCOUNTER15H, CSR_MHPMCOUNTER16, CSR_MHPMCOUNTER16H, CSR_MHPMCOUNTER17, CSR_MHPMCOUNTER17H, CSR_MHPMCOUNTER18, CSR_MHPMCOUNTER18H, CSR_MHPMCOUNTER19, CSR_MHPMCOUNTER19H, CSR_MHPMCOUNTER20, CSR_MHPMCOUNTER20H, CSR_MHPMCOUNTER21, CSR_MHPMCOUNTER21H, CSR_MHPMCOUNTER22, CSR_MHPMCOUNTER22H, CSR_MHPMCOUNTER23, CSR_MHPMCOUNTER23H, CSR_MHPMCOUNTER24, CSR_MHPMCOUNTER24H, CSR_MHPMCOUNTER25, CSR_MHPMCOUNTER25H, CSR_MHPMCOUNTER26, CSR_MHPMCOUNTER26H, CSR_MHPMCOUNTER27, CSR_MHPMCOUNTER27H, CSR_MHPMCOUNTER28, CSR_MHPMCOUNTER28H, CSR_MHPMCOUNTER29, CSR_MHPMCOUNTER29H, CSR_MHPMCOUNTER3, CSR_MHPMCOUNTER30, CSR_MHPMCOUNTER30H, CSR_MHPMCOUNTER31, CSR_MHPMCOUNTER31H, CSR_MHPMCOUNTER3H, CSR_MHPMCOUNTER4, CSR_MHPMCOUNTER4H, CSR_MHPMCOUNTER5, CSR_MHPMCOUNTER5H, CSR_MHPMCOUNTER6, CSR_MHPMCOUNTER6H, CSR_MHPMCOUNTER7, CSR_MHPMCOUNTER7H, CSR_MHPMCOUNTER8, CSR_MHPMCOUNTER8H, CSR_MHPMCOUNTER9, and CSR_MHPMCOUNTER9H.
| __STATIC_INLINE void __set_hpm_event | ( | unsigned long | idx, |
| unsigned long | event | ||
| ) |
Set event for selected high performance monitor event.
| [in] | idx | HPMEVENTx CSR index(3-31) |
| [in] | event | HPMEVENTx Register value to set |
Set event for high performance monitor event register
Definition at line 1711 of file core_feature_base.h.
References __RV_CSR_WRITE, CSR_MHPMEVENT10, CSR_MHPMEVENT11, CSR_MHPMEVENT12, CSR_MHPMEVENT13, CSR_MHPMEVENT14, CSR_MHPMEVENT15, CSR_MHPMEVENT16, CSR_MHPMEVENT17, CSR_MHPMEVENT18, CSR_MHPMEVENT19, CSR_MHPMEVENT20, CSR_MHPMEVENT21, CSR_MHPMEVENT22, CSR_MHPMEVENT23, CSR_MHPMEVENT24, CSR_MHPMEVENT25, CSR_MHPMEVENT26, CSR_MHPMEVENT27, CSR_MHPMEVENT28, CSR_MHPMEVENT29, CSR_MHPMEVENT3, CSR_MHPMEVENT30, CSR_MHPMEVENT31, CSR_MHPMEVENT4, CSR_MHPMEVENT5, CSR_MHPMEVENT6, CSR_MHPMEVENT7, CSR_MHPMEVENT8, and CSR_MHPMEVENT9.
| __STATIC_FORCEINLINE void __set_medeleg | ( | unsigned long | mask | ) |
Set exceptions delegation to S mode.
Set certain exceptions of supervisor mode or user mode delegated from machined mode to supervisor mode.
Definition at line 2184 of file core_feature_base.h.
References __RV_CSR_WRITE, and CSR_MEDELEG.
| __STATIC_FORCEINLINE void __set_mideleg | ( | unsigned long | mask | ) |
Set interrupt delegation to S mode.
Set certain interrupt of supervisor mode or user mode delegated from machined mode to supervisor mode.
Definition at line 2196 of file core_feature_base.h.
References __RV_CSR_WRITE, and CSR_MIDELEG.
| __STATIC_FORCEINLINE void __set_wfi_sleepmode | ( | WFI_SleepMode_Type | mode | ) |
Set Sleep mode of WFI.
Set the SLEEPVALUE CSR register to control the WFI Sleep mode.
| [in] | mode | The sleep mode to be set |
Definition at line 1580 of file core_feature_base.h.
References __RV_CSR_WRITE, and CSR_SLEEPVALUE.
| __STATIC_FORCEINLINE void __SH | ( | volatile void * | addr, |
| uint16_t | val | ||
| ) |
Write 16bit value to address (16 bit)
Write 16 bit value.
| [in] | addr | Address pointer to data |
| [in] | val | Value to set |
Definition at line 2277 of file core_feature_base.h.
References __ASM.
| __STATIC_FORCEINLINE void __SW | ( | volatile void * | addr, |
| uint32_t | val | ||
| ) |
Write 32bit value to address (32 bit)
Write 32 bit value.
| [in] | addr | Address pointer to data |
| [in] | val | Value to set |
Definition at line 2288 of file core_feature_base.h.
References __ASM.
Referenced by CIDU_AcquireSemaphore(), CIDU_BroadcastExtInterrupt(), CIDU_ClearInterCoreIntReq(), CIDU_ReleaseSemaphore(), CIDU_ResetFirstClaimMode(), CIDU_SetFirstClaimMode(), CIDU_TriggerInterCoreInt(), ECC_DLMErrInject(), ECC_DLMErrRestore(), ECC_ILMErrInject(), ECC_ILMErrRestore(), SMPCC_CLMErrInject(), SysTimer_ClearHartSWIRQ(), SysTimer_ClearHartSWIRQ_S(), SysTimer_ClearIPI(), SysTimer_ClearIPI_S(), SysTimer_SendIPI(), SysTimer_SendIPI_S(), SysTimer_SetHartCompareValue(), SysTimer_SetHartMsipValue(), SysTimer_SetHartSsipValue(), SysTimer_SetHartSWIRQ(), SysTimer_SetHartSWIRQ_S(), and SysTimer_SetLoadValue().
| __STATIC_FORCEINLINE void __TXEVT | ( | void | ) |
Send TX Event.
Set the CSR TXEVT to control send a TX Event. The Core will output signal tx_evt as output event signal.
Definition at line 1591 of file core_feature_base.h.
References __RV_CSR_SET, and CSR_TXEVT.
| __STATIC_FORCEINLINE void __WFE | ( | void | ) |
Wait For Event.
Wait For Event is executed using CSR_WFE.WFE=1 and WFI instruction. It will suspends execution until event, NMI or Debug happened. When Core is waked up, Core will resume previous execution
Definition at line 1535 of file core_feature_base.h.
References __ASM, __RV_CSR_CLEAR, __RV_CSR_SET, CSR_WFE, and WFE_WFE.
| __STATIC_FORCEINLINE void __WFI | ( | void | ) |
Wait For Interrupt.
Wait For Interrupt is is executed using CSR_WFE.WFE=0 and WFI instruction. It will suspends execution until interrupt, NMI or Debug happened. When Core is waked up by interrupt, if
Definition at line 1522 of file core_feature_base.h.
References __ASM, __RV_CSR_CLEAR, CSR_WFE, and WFE_WFE.