![]() |
NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
CPU Core Functions HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Functions | |
void | neorv32_cpu_store_unsigned_word (uint32_t addr, uint32_t wdata) |
void | neorv32_cpu_store_unsigned_half (uint32_t addr, uint16_t wdata) |
void | neorv32_cpu_store_unsigned_byte (uint32_t addr, uint8_t wdata) |
uint32_t | neorv32_cpu_load_unsigned_word (uint32_t addr) |
uint16_t | neorv32_cpu_load_unsigned_half (uint32_t addr) |
int16_t | neorv32_cpu_load_signed_half (uint32_t addr) |
uint8_t | neorv32_cpu_load_unsigned_byte (uint32_t addr) |
int8_t | neorv32_cpu_load_signed_byte (uint32_t addr) |
uint32_t | neorv32_cpu_csr_read (const int csr_id) |
void | neorv32_cpu_csr_write (const int csr_id, uint32_t data) |
void | neorv32_cpu_csr_set (const int csr_id, uint32_t mask) |
void | neorv32_cpu_csr_clr (const int csr_id, uint32_t mask) |
void | neorv32_cpu_sleep (void) |
uint32_t | neorv32_cpu_amolr (uint32_t addr) |
uint32_t | neorv32_cpu_amosc (uint32_t addr, uint32_t wdata) |
Prototypes | |
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 header file.
|
inline |
Atomic memory access: load-reservate word.
[in] | addr | Address (32-bit). |
|
inline |
Atomic memory access: store-conditional word.
[in] | addr | Address (32-bit). |
[in] | wdata | Data word to-be-written conditionally (32-bit). |
|
inline |
Clear bit(s) in CPU control and status register (CSR).
[in] | csr_id | ID of CSR to write. See NEORV32_CSR_enum. |
[in] | mask | Bit mask (high-active) to clear bits (uint32_t). |
|
inline |
Read data from CPU control and status register (CSR).
[in] | csr_id | ID of CSR to read. See NEORV32_CSR_enum. |
|
inline |
Set bit(s) in CPU control and status register (CSR).
[in] | csr_id | ID of CSR to write. See NEORV32_CSR_enum. |
[in] | mask | Bit mask (high-active) to set bits (uint32_t). |
|
inline |
Write data to CPU control and status register (CSR).
[in] | csr_id | ID of CSR to write. See NEORV32_CSR_enum. |
[in] | data | Data to write (uint32_t). |
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
|
inline |
Load signed byte from address space.
[in] | addr | Address (32-bit). |
|
inline |
Load signed half-word from address space.
[in] | addr | Address (32-bit). |
|
inline |
Load unsigned byte from address space.
[in] | addr | Address (32-bit). |
|
inline |
Load unsigned half-word from address space.
[in] | addr | Address (32-bit). |
|
inline |
Load unsigned word from address space.
[in] | addr | Address (32-bit). |
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). |
|
inline |
Put CPU into sleep / power-down mode.
|
inline |
Store unsigned byte to address space.
[in] | addr | Address (32-bit). |
[in] | wdata | Data byte (8-bit) to store. |
|
inline |
Store unsigned half-word to address space.
[in] | addr | Address (32-bit). |
[in] | wdata | Data half-word (16-bit) to store. |
|
inline |
Store unsigned word to address space.
[in] | addr | Address (32-bit). |
[in] | wdata | Data word (32-bit) to store. |