Hardware access layer for managing the VPR RISC-V CPU Control and Status Registers (VPR CSR). More...
Enumerations | |
enum | nrf_vpr_csr_trap_cause_t { NRF_VPR_CSR_TRAP_CAUSE_INSTR_ADDR_MISALIGNED = VPRCSR_MCAUSE_EXCEPTIONCODE_INSTADDRMISALIGN , NRF_VPR_CSR_TRAP_CAUSE_INSTR_ACCESS_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_INSTACCESSFAULT , NRF_VPR_CSR_TRAP_CAUSE_INSTR_ILLEGAL = VPRCSR_MCAUSE_EXCEPTIONCODE_ILLEGALINST , NRF_VPR_CSR_TRAP_CAUSE_BREAKPOINT = VPRCSR_MCAUSE_EXCEPTIONCODE_BKPT , NRF_VPR_CSR_TRAP_CAUSE_LOAD_ADDR_MISALIGNED = VPRCSR_MCAUSE_EXCEPTIONCODE_LOADADDRMISALIGN , NRF_VPR_CSR_TRAP_CAUSE_LOAD_ACCESS_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_LOADACCESSFAULT , NRF_VPR_CSR_TRAP_CAUSE_STORE_ADDR_MISALIGNED = VPRCSR_MCAUSE_EXCEPTIONCODE_STOREADDRMISALIGN , NRF_VPR_CSR_TRAP_CAUSE_STORE_ACCESS_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_STOREACCESSFAULT , NRF_VPR_CSR_TRAP_CAUSE_ECALL_M = VPRCSR_MCAUSE_EXCEPTIONCODE_ECALLMMODE , NRF_VPR_CSR_TRAP_CAUSE_STACKING_BUS_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_BUSFAULTSTACKING , NRF_VPR_CSR_TRAP_CAUSE_STACKING_UNALIGNED = VPRCSR_MCAUSE_EXCEPTIONCODE_MISALIGNSTACKING , NRF_VPR_CSR_TRAP_CAUSE_VECTOR_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_INTVECTORFAULT , NRF_VPR_CSR_TRAP_CAUSE_STACKING_UNALIGNED_EX = VPRCSR_MCAUSE_EXCEPTIONCODE_STACKINGEXCFAULT , NRF_VPR_CSR_TRAP_CAUSE_UNSTACKING_UNALIGNED = VPRCSR_MCAUSE_EXCEPTIONCODE_MISALIGNUNSTACKING , NRF_VPR_CSR_TRAP_CAUSE_UNSTACKING_BUS_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_BUSFAULTUNSTACKING , NRF_VPR_CSR_TRAP_CAUSE_STORE_TIMEOUT_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_STORETIMEOUTFAULT , NRF_VPR_CSR_TRAP_CAUSE_LOAD_TIMEOUT_FAULT = VPRCSR_MCAUSE_EXCEPTIONCODE_LOADTIMEOUTFAULT } |
Trap causes. More... | |
enum | nrf_vpr_csr_sleep_state_t { NRF_VPR_CSR_SLEEP_STATE_WAIT = VPRCSR_NORDIC_VPRNORDICSLEEPCTRL_SLEEPSTATE_WAIT , NRF_VPR_CSR_SLEEP_STATE_RESET = VPRCSR_NORDIC_VPRNORDICSLEEPCTRL_SLEEPSTATE_RESET , NRF_VPR_CSR_SLEEP_STATE_SLEEP = VPRCSR_NORDIC_VPRNORDICSLEEPCTRL_SLEEPSTATE_SLEEP , NRF_VPR_CSR_SLEEP_STATE_DEEP_SLEEP = VPRCSR_NORDIC_VPRNORDICSLEEPCTRL_SLEEPSTATE_DEEPSLEEP , NRF_VPR_CSR_SLEEP_STATE_HIBERNATE = VPRCSR_NORDIC_VPRNORDICSLEEPCTRL_SLEEPSTATE_HIBERNATE } |
Sleep states. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_interrupts_enable (void) |
Function for enabling the interrupts in machine mode. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_interrupts_disable (void) |
Function for disabling the interrupts in machine mode. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_machine_interrupts_check (void) |
Function for checking whether interrupts are enabled in machine mode. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_trap_vector_table_addr_set (uint32_t address) |
Function for setting the base address of trap vector table. | |
NRF_STATIC_INLINE uint32_t | nrf_vpr_csr_machine_trap_vector_table_addr_get (void) |
Function for getting the machine trap vector table base address. | |
NRF_STATIC_INLINE uint32_t | nrf_vpr_csr_machine_exception_pc_get (void) |
Function for getting the machine exception program counter. | |
NRF_STATIC_INLINE nrf_vpr_csr_trap_cause_t | nrf_vpr_csr_machine_trap_cause_code_get (void) |
Function for getting the machine trap cause exception code. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_machine_trap_interrupt_check (void) |
Function for checking the state of the interrupt bit for machine trap. | |
NRF_STATIC_INLINE uint32_t | nrf_vpr_csr_machine_trap_value_get (void) |
Function for getting the machine trap value. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_interrupt_threshold_set (uint8_t th) |
Function for setting the machine mode interrupt level threshold. | |
NRF_STATIC_INLINE uint8_t | nrf_vpr_csr_machine_interrupt_threshold_get (void) |
Function for getting the machine mode interrupt level threshold. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_cycle_counter_enable_set (bool enable) |
Function for enabling or disabling the Cycle Counter. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_machine_cycle_counter_enable_check (void) |
Function for checking whether the Cycle Counter is enabled. | |
NRF_STATIC_INLINE uint64_t | nrf_vpr_csr_machine_cycle_counter_get (void) |
Function for getting the machine cycle counter. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_machine_instruction_counter_enable_set (bool enable) |
Function for enabling or disabling the Instruction Counter. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_machine_instruction_counter_enable_check (void) |
Function for checking whether the Instruction Counter is enabled. | |
NRF_STATIC_INLINE uint64_t | nrf_vpr_csr_machine_instruction_counter_get (void) |
Function for getting the machine instruction counter. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_rtperiph_enable_set (bool enable) |
Function for enabling or disabling the Real-Time Peripherals. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_rtperiph_enable_check (void) |
Function for checking whether the Real-Time Peripherals are enabled. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_cnt_irq_enable_set (bool enable) |
Function for enabling or disabling the generation of IRQ at position CNT_IRQ_POSITION. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_cnt_irq_enable_check (void) |
Function for checking whether the generation of IRQ at position CNT_IRQ_POSITION is enabled. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_sleep_state_set (nrf_vpr_csr_sleep_state_t state) |
Function for setting the sleep state. | |
NRF_STATIC_INLINE nrf_vpr_csr_sleep_state_t | nrf_vpr_csr_sleep_state_get (void) |
Function for getting the sleep state. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_return_to_sleep_set (bool enable) |
Function for enabling or disabling the return to sleep functionality. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_return_to_sleep_check (void) |
Function for checking whether the return to sleep functionality is enabled. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_stack_on_sleep_set (bool enable) |
Function for enabling or disabling the stack on sleep functionality. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_stack_on_sleep_check (void) |
Function for checking whether the stack on sleep functionality is enabled. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_clic_round_robin_set (bool enable) |
Function for enabling or disabling the CLIC round robin arbitration. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_clic_round_robin_check (void) |
Function for checking whether the CLIC round robin arbitration is enabled. | |
NRF_STATIC_INLINE void | nrf_vpr_csr_unrecoverable_return_set (bool enable) |
Function for enabling or disabling the unrecoverable return functionality. | |
NRF_STATIC_INLINE bool | nrf_vpr_csr_unrecoverable_return_check (void) |
Function for checking whether the unrecoverable return is enabled. | |
Hardware access layer for managing the VPR RISC-V CPU Control and Status Registers (VPR CSR).
Sleep states.
Trap causes.
NRF_STATIC_INLINE bool nrf_vpr_csr_clic_round_robin_check | ( | void | ) |
Function for checking whether the CLIC round robin arbitration is enabled.
true | CLIC round robin arbitration is enabled. |
false | CLIC round robin arbitration is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_clic_round_robin_set | ( | bool | enable | ) |
Function for enabling or disabling the CLIC round robin arbitration.
[in] | enable | True if round robin arbitration should be used for CLIC interrupt requests, false otherwise. |
NRF_STATIC_INLINE bool nrf_vpr_csr_cnt_irq_enable_check | ( | void | ) |
Function for checking whether the generation of IRQ at position CNT_IRQ_POSITION is enabled.
true | Generation of IRQ is enabled. |
false | Generation of IRQ is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_cnt_irq_enable_set | ( | bool | enable | ) |
Function for enabling or disabling the generation of IRQ at position CNT_IRQ_POSITION.
[in] | enable | True if generation of IRQ at position CNT_IRQ_POSITION is to be enabled, false otherwise. |
NRF_STATIC_INLINE bool nrf_vpr_csr_machine_cycle_counter_enable_check | ( | void | ) |
Function for checking whether the Cycle Counter is enabled.
true | Cycle counter is enabled. |
false | Cycle counter is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_machine_cycle_counter_enable_set | ( | bool | enable | ) |
Function for enabling or disabling the Cycle Counter.
[in] | enable | True if Cycle Counter is to be enabled, false otherwise. |
NRF_STATIC_INLINE uint64_t nrf_vpr_csr_machine_cycle_counter_get | ( | void | ) |
Function for getting the machine cycle counter.
NRF_STATIC_INLINE uint32_t nrf_vpr_csr_machine_exception_pc_get | ( | void | ) |
Function for getting the machine exception program counter.
NRF_STATIC_INLINE bool nrf_vpr_csr_machine_instruction_counter_enable_check | ( | void | ) |
Function for checking whether the Instruction Counter is enabled.
true | Instruction counter is enabled. |
false | Instruction counter is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_machine_instruction_counter_enable_set | ( | bool | enable | ) |
Function for enabling or disabling the Instruction Counter.
[in] | enable | True if Instruction Counter is to be enabled, false otherwise. |
NRF_STATIC_INLINE uint64_t nrf_vpr_csr_machine_instruction_counter_get | ( | void | ) |
Function for getting the machine instruction counter.
NRF_STATIC_INLINE uint8_t nrf_vpr_csr_machine_interrupt_threshold_get | ( | void | ) |
Function for getting the machine mode interrupt level threshold.
NRF_STATIC_INLINE void nrf_vpr_csr_machine_interrupt_threshold_set | ( | uint8_t | th | ) |
Function for setting the machine mode interrupt level threshold.
[in] | th | Machine mode interrupt level threshold to be set. |
NRF_STATIC_INLINE bool nrf_vpr_csr_machine_interrupts_check | ( | void | ) |
Function for checking whether interrupts are enabled in machine mode.
true | Interrupts are enabled. |
false | Interrupts are disabled. |
NRF_STATIC_INLINE nrf_vpr_csr_trap_cause_t nrf_vpr_csr_machine_trap_cause_code_get | ( | void | ) |
Function for getting the machine trap cause exception code.
NRF_STATIC_INLINE bool nrf_vpr_csr_machine_trap_interrupt_check | ( | void | ) |
Function for checking the state of the interrupt bit for machine trap.
true | Trap was caused by an interrupt. |
false | Trap was not caused by an interrupt. |
NRF_STATIC_INLINE uint32_t nrf_vpr_csr_machine_trap_value_get | ( | void | ) |
Function for getting the machine trap value.
NRF_STATIC_INLINE uint32_t nrf_vpr_csr_machine_trap_vector_table_addr_get | ( | void | ) |
Function for getting the machine trap vector table base address.
NRF_STATIC_INLINE void nrf_vpr_csr_machine_trap_vector_table_addr_set | ( | uint32_t | address | ) |
Function for setting the base address of trap vector table.
[in] | address | Machine trap vector table base address to be set. Has to be aligned on 64-byte or greater power-of-two boundary. |
NRF_STATIC_INLINE bool nrf_vpr_csr_return_to_sleep_check | ( | void | ) |
Function for checking whether the return to sleep functionality is enabled.
true | Return to sleep functionality is enabled. |
false | Return to sleep functionality is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_return_to_sleep_set | ( | bool | enable | ) |
Function for enabling or disabling the return to sleep functionality.
[in] | enable | True if CPU should be forced to return to sleep when it returns in a non-handler program, false otherwise. |
NRF_STATIC_INLINE bool nrf_vpr_csr_rtperiph_enable_check | ( | void | ) |
Function for checking whether the Real-Time Peripherals are enabled.
true | RT Peripherals are enabled. |
false | RT Peripherals are disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_rtperiph_enable_set | ( | bool | enable | ) |
Function for enabling or disabling the Real-Time Peripherals.
[in] | enable | True if RT Perhiperals are to be enabled, false otherwise. |
NRF_STATIC_INLINE nrf_vpr_csr_sleep_state_t nrf_vpr_csr_sleep_state_get | ( | void | ) |
Function for getting the sleep state.
NRF_STATIC_INLINE void nrf_vpr_csr_sleep_state_set | ( | nrf_vpr_csr_sleep_state_t | state | ) |
Function for setting the sleep state.
[in] | state | Sleep state to be set. |
NRF_STATIC_INLINE bool nrf_vpr_csr_stack_on_sleep_check | ( | void | ) |
Function for checking whether the stack on sleep functionality is enabled.
true | Stack on sleep functionality is enabled. |
false | Stack on sleep functionality is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_stack_on_sleep_set | ( | bool | enable | ) |
Function for enabling or disabling the stack on sleep functionality.
[in] | enable | True if CPU should be forced to stack the context before going to sleep (used in order to have a fast wake-up), false otherwise. |
NRF_STATIC_INLINE bool nrf_vpr_csr_unrecoverable_return_check | ( | void | ) |
Function for checking whether the unrecoverable return is enabled.
true | Unrecoverable return is enabled. |
false | Unrecoverable return is disabled. |
NRF_STATIC_INLINE void nrf_vpr_csr_unrecoverable_return_set | ( | bool | enable | ) |
Function for enabling or disabling the unrecoverable return functionality.
[in] | enable | True if unrecoverable return from exception is to be forced, false otherwise. |