NMSIS-Core
Version 1.3.1
NMSIS-Core support for Nuclei processor-based devices
|
Functions that generate RISC-V CPU instructions. More...
Macros | |
#define | __FENCE(p, s) __ASM volatile ("fence " #p "," #s : : : "memory") |
Execute fence instruction, p -> pred, s -> succ. More... | |
#define | __RWMB() __FENCE(iorw,iorw) |
Read & Write Memory barrier. More... | |
#define | __RMB() __FENCE(ir,ir) |
Read Memory barrier. More... | |
#define | __WMB() __FENCE(ow,ow) |
Write Memory barrier. More... | |
#define | __SMP_RWMB() __FENCE(rw,rw) |
SMP Read & Write Memory barrier. More... | |
#define | __SMP_RMB() __FENCE(r,r) |
SMP Read Memory barrier. More... | |
#define | __SMP_WMB() __FENCE(w,w) |
SMP Write Memory barrier. More... | |
#define | __CPU_RELAX() __ASM volatile ("" : : : "memory") |
CPU relax for busy loop. More... | |
Enumerations | |
enum | WFI_SleepMode { 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_FORCEINLINE void | __set_hpm_event (unsigned long idx, unsigned long event) |
Set event for selected high performance monitor event. More... | |
__STATIC_FORCEINLINE unsigned long | __get_hpm_event (unsigned long idx) |
Get event for selected high performance monitor event. More... | |
__STATIC_FORCEINLINE void | __set_hpm_counter (unsigned long idx, uint64_t value) |
Set value for selected high performance monitor counter. More... | |
__STATIC_FORCEINLINE unsigned long | __get_hpm_counter (unsigned long idx) |
Get value of selected high performance monitor couner. More... | |
__STATIC_FORCEINLINE void | __set_medeleg (unsigned long mask) |
Set exceptions delegation to S mode. More... | |
__STATIC_FORCEINLINE void | __FENCE_I (void) |
Fence.i Instruction. 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_FORCEINLINE 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... | |
Functions that generate RISC-V CPU instructions.
The following functions generate specified RISC-V instructions that cannot be directly accessed by compiler.
#define __CPU_RELAX | ( | ) | __ASM volatile ("" : : : "memory") |
CPU relax for busy loop.
Definition at line 1786 of file core_feature_base.h.
#define __FENCE | ( | p, | |
s | |||
) | __ASM volatile ("fence " #p "," #s : : : "memory") |
Execute fence instruction, p -> pred, s -> succ.
the FENCE instruction ensures that all memory accesses from instructions preceding the fence in program order (the predecessor set
) appear earlier in the global memory order than memory accesses from instructions appearing after the fence in program order (the successor set
). For details, please refer to The RISC-V Instruction Set Manual
p | predecessor set, such as iorw, rw, r, w |
s | successor set, such as iorw, rw, r, w |
Definition at line 1754 of file core_feature_base.h.
#define __RMB | ( | ) | __FENCE(ir,ir) |
Read Memory barrier.
Definition at line 1771 of file core_feature_base.h.
#define __RWMB | ( | ) | __FENCE(iorw,iorw) |
Read & Write Memory barrier.
Definition at line 1768 of file core_feature_base.h.
#define __SMP_RMB | ( | ) | __FENCE(r,r) |
SMP Read Memory barrier.
Definition at line 1780 of file core_feature_base.h.
#define __SMP_RWMB | ( | ) | __FENCE(rw,rw) |
SMP Read & Write Memory barrier.
Definition at line 1777 of file core_feature_base.h.
#define __SMP_WMB | ( | ) | __FENCE(w,w) |
SMP Write Memory barrier.
Definition at line 1783 of file core_feature_base.h.
#define __WMB | ( | ) | __FENCE(ow,ow) |
Write Memory barrier.
Definition at line 1774 of file core_feature_base.h.
enum WFI_SleepMode |
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 1169 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 1945 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 1961 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 2025 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 2009 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 2057 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 2041 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 1977 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 1929 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 1993 of file core_feature_base.h.
References __ASM.
__STATIC_FORCEINLINE 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 1905 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 1300 of file core_feature_base.h.
References __RV_CSR_SET, and CSR_MCOUNTINHIBIT.
__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 1212 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 1254 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 1278 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 1232 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 1150 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 1161 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 1289 of file core_feature_base.h.
References __RV_CSR_CLEAR, and CSR_MCOUNTINHIBIT.
__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 1202 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 1243 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 1266 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 1222 of file core_feature_base.h.
References __RV_CSR_CLEAR, CSR_MCOUNTINHIBIT, and MCOUNTINHIBIT_IR.
__STATIC_FORCEINLINE void __FENCE_I | ( | void | ) |
Fence.i Instruction.
The FENCE.I instruction is used to synchronize the instruction and data streams.
Definition at line 1762 of file core_feature_base.h.
References __ASM.
Referenced by __ECLIC_SetVector(), and __ECLIC_SetVector_S().
__STATIC_FORCEINLINE unsigned long __get_hpm_counter | ( | unsigned long | idx | ) |
Get value of selected high performance monitor couner.
[in] | idx | HPMCOUNTERx CSR index(3-31) |
[in] | event | HPMCOUNTERx Register value to set |
Get high performance monitor counter register value
Definition at line 1536 of file core_feature_base.h.
References __get_rv_cycle(), __get_rv_instret(), __RV_CSR_READ, 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_FORCEINLINE 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 1356 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 1796 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 1810 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 1824 of file core_feature_base.h.
References __ASM.
Referenced by SysTimer_GetHartCompareValue(), SysTimer_GetHartMsipValue(), 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 1109 of file core_feature_base.h.
References __ASM.
__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 1854 of file core_feature_base.h.
References __ASM.
__STATIC_FORCEINLINE 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 1399 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_FORCEINLINE 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 1312 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 1739 of file core_feature_base.h.
References __RV_CSR_WRITE, and CSR_MEDELEG.
__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 1181 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 1865 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 1876 of file core_feature_base.h.
References __ASM.
Referenced by SysTimer_ClearHartSWIRQ(), SysTimer_ClearIPI(), SysTimer_SendIPI(), SysTimer_SetHartCompareValue(), SysTimer_SetHartMsipValue(), SysTimer_SetHartSWIRQ(), 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 1192 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 1136 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 1123 of file core_feature_base.h.
References __ASM, __RV_CSR_CLEAR, CSR_WFE, and WFE_WFE.