NEORV32 Runtime Environment.
More...
#include <stdint.h>
Go to the source code of this file.
|
|
void | neorv32_rte_setup (void) |
|
void | neorv32_rte_core (void) |
|
int | neorv32_rte_handler_install (int id, void(*handler)(void)) |
|
void | neorv32_rte_debug_handler (void) |
|
uint32_t | neorv32_rte_context_get (int x) |
|
void | neorv32_rte_context_put (int x, uint32_t data) |
|
#define | NEORV32_RTE_NUM_TRAPS 29 |
|
enum | NEORV32_RTE_TRAP_enum {
RTE_TRAP_I_ACCESS = 0
, RTE_TRAP_I_ILLEGAL = 1
, RTE_TRAP_I_MISALIGNED = 2
, RTE_TRAP_BREAKPOINT = 3
,
RTE_TRAP_L_MISALIGNED = 4
, RTE_TRAP_L_ACCESS = 5
, RTE_TRAP_S_MISALIGNED = 6
, RTE_TRAP_S_ACCESS = 7
,
RTE_TRAP_UENV_CALL = 8
, RTE_TRAP_MENV_CALL = 9
, RTE_TRAP_MSI = 10
, RTE_TRAP_MTI = 11
,
RTE_TRAP_MEI = 12
, RTE_TRAP_FIRQ_0 = 13
, RTE_TRAP_FIRQ_1 = 14
, RTE_TRAP_FIRQ_2 = 15
,
RTE_TRAP_FIRQ_3 = 16
, RTE_TRAP_FIRQ_4 = 17
, RTE_TRAP_FIRQ_5 = 18
, RTE_TRAP_FIRQ_6 = 19
,
RTE_TRAP_FIRQ_7 = 20
, RTE_TRAP_FIRQ_8 = 21
, RTE_TRAP_FIRQ_9 = 22
, RTE_TRAP_FIRQ_10 = 23
,
RTE_TRAP_FIRQ_11 = 24
, RTE_TRAP_FIRQ_12 = 25
, RTE_TRAP_FIRQ_13 = 26
, RTE_TRAP_FIRQ_14 = 27
,
RTE_TRAP_FIRQ_15 = 28
} |
|
◆ NEORV32_RTE_NUM_TRAPS
#define NEORV32_RTE_NUM_TRAPS 29 |
NEORV32 runtime environment trap IDs. < Trap ID enumeration
◆ NEORV32_RTE_TRAP_enum
NEORV32 runtime environment trap IDs. < Trap ID enumeration
Enumerator |
---|
RTE_TRAP_I_ACCESS | Instruction access fault
|
RTE_TRAP_I_ILLEGAL | Illegal instruction
|
RTE_TRAP_I_MISALIGNED | Instruction address misaligned
|
RTE_TRAP_BREAKPOINT | Breakpoint (EBREAK instruction)
|
RTE_TRAP_L_MISALIGNED | Load address misaligned
|
RTE_TRAP_L_ACCESS | Load access fault
|
RTE_TRAP_S_MISALIGNED | Store address misaligned
|
RTE_TRAP_S_ACCESS | Store access fault
|
RTE_TRAP_UENV_CALL | Environment call from user mode (ECALL instruction)
|
RTE_TRAP_MENV_CALL | Environment call from machine mode (ECALL instruction)
|
RTE_TRAP_MSI | Machine software interrupt
|
RTE_TRAP_MTI | Machine timer interrupt
|
RTE_TRAP_MEI | Machine external interrupt
|
RTE_TRAP_FIRQ_0 | Fast interrupt channel 0
|
RTE_TRAP_FIRQ_1 | Fast interrupt channel 1
|
RTE_TRAP_FIRQ_2 | Fast interrupt channel 2
|
RTE_TRAP_FIRQ_3 | Fast interrupt channel 3
|
RTE_TRAP_FIRQ_4 | Fast interrupt channel 4
|
RTE_TRAP_FIRQ_5 | Fast interrupt channel 5
|
RTE_TRAP_FIRQ_6 | Fast interrupt channel 6
|
RTE_TRAP_FIRQ_7 | Fast interrupt channel 7
|
RTE_TRAP_FIRQ_8 | Fast interrupt channel 8
|
RTE_TRAP_FIRQ_9 | Fast interrupt channel 9
|
RTE_TRAP_FIRQ_10 | Fast interrupt channel 10
|
RTE_TRAP_FIRQ_11 | Fast interrupt channel 11
|
RTE_TRAP_FIRQ_12 | Fast interrupt channel 12
|
RTE_TRAP_FIRQ_13 | Fast interrupt channel 13
|
RTE_TRAP_FIRQ_14 | Fast interrupt channel 14
|
RTE_TRAP_FIRQ_15 | Fast interrupt channel 15
|
◆ neorv32_rte_context_get()
uint32_t neorv32_rte_context_get |
( |
int | x | ) |
|
NEORV32 runtime environment (RTE): Read register from application context (on stack).
- Note
- This function operates on the RTE instance of the core on which this function is executed.
- Parameters
-
[in] | x | Register number (0..31, corresponds to register x0..x31). |
- Returns
- Content of register x.
◆ neorv32_rte_context_put()
void neorv32_rte_context_put |
( |
int | x, |
|
|
uint32_t | data ) |
NEORV32 runtime environment (RTE): Write register to application context (on stack).
- Note
- This function operates on the RTE instance of the core on which this function is executed.
- Parameters
-
[in] | x | Register number (0..31, corresponds to register x0..x31). |
[in] | data | Data to be written to register x. |
◆ neorv32_rte_core()
void neorv32_rte_core |
( |
void | | ) |
|
NEORV32 runtime environment (RTE): This is the core of the NEORV32 RTE (first-level trap handler, executed in machine mode).
◆ neorv32_rte_debug_handler()
void neorv32_rte_debug_handler |
( |
void | | ) |
|
NEORV32 runtime environment (RTE): Debug trap handler, printing information via UART0.
- Note
- This function operates on the RTE instance of the core on which this function is executed.
◆ neorv32_rte_handler_install()
int neorv32_rte_handler_install |
( |
int | id, |
|
|
void(* | handler )(void) ) |
NEORV32 runtime environment (RTE): Install trap handler function (second-level trap handler).
- Note
- Trap handler installation applies to both cores. Hence, both cores will execute the same handler for the same trap.
- Parameters
-
[in] | id | Identifier (type) of the targeted trap See NEORV32_RTE_TRAP_enum. |
[in] | handler | The actual handler function for the specified trap (function MUST be of type "void function(void);"). |
- Returns
- 0 if success, -1 if invalid trap ID.
◆ neorv32_rte_setup()
void neorv32_rte_setup |
( |
void | | ) |
|
NEORV32 runtime environment (RTE): Setup RTE.
- Note
- This function must be called on all cores that wish to use the RTE.
-
This function installs a debug handler for ALL trap sources, which gives detailed information about the trap via UART0 (if available). Actual handlers can be installed afterwards via neorv32_rte_handler_install().