NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
CPU Core Functions HW driver source file. More...
#include <neorv32.h>
Functions | |
uint64_t | neorv32_cpu_get_cycle (void) |
void | neorv32_cpu_set_mcycle (uint64_t value) |
uint64_t | neorv32_cpu_get_instret (void) |
void | neorv32_cpu_set_minstret (uint64_t value) |
void | neorv32_cpu_delay_ms (uint32_t time_ms) |
uint32_t | neorv32_cpu_get_clk_from_prsc (int prsc) |
uint32_t | neorv32_cpu_pmp_get_num_regions (void) |
uint32_t | neorv32_cpu_pmp_get_granularity (void) |
int | neorv32_cpu_pmp_configure_region (int index, uint32_t addr, uint8_t config) |
uint32_t | neorv32_cpu_hpm_get_num_counters (void) |
uint32_t | neorv32_cpu_hpm_get_size (void) |
void | neorv32_cpu_goto_user_mode (void) |
CPU Core Functions HW driver source file.
void neorv32_cpu_delay_ms | ( | uint32_t | time_ms | ) |
Delay function using busy wait.
[in] | time_ms | Time in ms to wait (unsigned 32-bit). |
uint32_t neorv32_cpu_get_clk_from_prsc | ( | int | prsc | ) |
Get actual clocking frequency from prescaler select NEORV32_CLOCK_PRSC_enum
[in] | prsc | Prescaler select NEORV32_CLOCK_PRSC_enum. return Actual raw clock frequency in Hz. |
uint64_t neorv32_cpu_get_cycle | ( | void | ) |
Unavailable extensions warnings. Get cycle counter from cycle[h].
uint64_t neorv32_cpu_get_instret | ( | void | ) |
Get retired instructions counter from instret[h].
void neorv32_cpu_goto_user_mode | ( | void | ) |
Switch from privilege mode MACHINE to privilege mode USER.
uint32_t neorv32_cpu_hpm_get_num_counters | ( | void | ) |
Hardware performance monitors (HPM): Get number of available HPM counters.
uint32_t neorv32_cpu_hpm_get_size | ( | void | ) |
Hardware performance monitors (HPM): Get total counter width
int neorv32_cpu_pmp_configure_region | ( | int | index, |
uint32_t | addr, | ||
uint8_t | config ) |
Physical memory protection (PMP): Configure region.
[in] | index | Region number (index, 0..PMP_NUM_REGIONS-1). |
[in] | addr | Region address (bits [33:2]). |
[in] | config | Region configuration byte (see NEORV32_PMPCFG_ATTRIBUTES_enum). |
uint32_t neorv32_cpu_pmp_get_granularity | ( | void | ) |
Physical memory protection (PMP): Get minimal region size (granularity).
uint32_t neorv32_cpu_pmp_get_num_regions | ( | void | ) |
Physical memory protection (PMP): Get number of available regions.
void neorv32_cpu_set_mcycle | ( | uint64_t | value | ) |
Set machine cycle counter mcycle[h].
[in] | value | New value for mcycle[h] CSR (64-bit). |
void neorv32_cpu_set_minstret | ( | uint64_t | value | ) |
Set machine retired instructions counter minstret[h].
[in] | value | New value for mcycle[h] CSR (64-bit). |