NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Functions | Variables
neorv32_rte.c File Reference

NEORV32 Runtime Environment. More...

#include "neorv32.h"
#include "neorv32_rte.h"

Functions

static void __neorv32_rte_core (void)
 
static void __neorv32_rte_debug_handler (void)
 
static void __neorv32_rte_print_hex_word (uint32_t num)
 
void neorv32_rte_setup (void)
 
int neorv32_rte_handler_install (int id, void(*handler)(void))
 
int neorv32_rte_handler_uninstall (int id)
 
uint32_t neorv32_rte_context_get (int x)
 
void neorv32_rte_context_put (int x, uint32_t data)
 
void neorv32_rte_print_info (void)
 
void neorv32_rte_print_hw_config (void)
 
void neorv32_rte_print_hw_version (void)
 
void neorv32_rte_print_credits (void)
 
void neorv32_rte_print_logo (void)
 
void neorv32_rte_print_license (void)
 

Variables

static uint32_t __neorv32_rte_vector_lut [NEORV32_RTE_NUM_TRAPS]
 

Detailed Description

NEORV32 Runtime Environment.

Function Documentation

◆ __neorv32_rte_core()

static void __neorv32_rte_core ( void )
static

NEORV32 runtime environment (RTE): This is the core of the NEORV32 RTE (first-level trap handler, executed in machine mode).

◆ __neorv32_rte_debug_handler()

static void __neorv32_rte_debug_handler ( void )
static

NEORV32 runtime environment (RTE): Debug trap handler, printing information via UART0.

◆ __neorv32_rte_print_hex_word()

void __neorv32_rte_print_hex_word ( uint32_t num)
static

NEORV32 runtime environment (RTE): Private function to print 32-bit number as 8-digit hexadecimal value (with "0x" suffix).

Parameters
[in]numNumber to print as hexadecimal via UART0.

◆ neorv32_rte_context_get()

uint32_t neorv32_rte_context_get ( int x)

NEORV32 runtime environment (RTE): Read register from application context.

Parameters
[in]xRegister 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 in application context.

Parameters
[in]xRegister number (0..31, corresponds to register x0..x31).
[in]dataData to be written to register x.

◆ neorv32_rte_handler_install()

int neorv32_rte_handler_install ( int id,
void(*)(void) handler )

NEORV32 runtime environment (RTE): Install trap handler function (second-level trap handler).

Parameters
[in]idIdentifier (type) of the targeted trap. See NEORV32_RTE_TRAP_enum.
[in]handlerThe actual handler function for the specified trap (function MUST be of type "void function(void);").
Returns
0 if success, -1 if error (invalid id or targeted trap not supported).

◆ neorv32_rte_handler_uninstall()

int neorv32_rte_handler_uninstall ( int id)

NEORV32 runtime environment (RTE): Uninstall trap handler function from NEORV32 runtime environment, which was previously installed via neorv32_rte_handler_install(uint8_t id, void (*handler)(void)).

Parameters
[in]idIdentifier (type) of the targeted trap. See NEORV32_RTE_TRAP_enum.
Returns
0 if success, -1 if error (invalid id or targeted trap not supported).

◆ neorv32_rte_print_credits()

void neorv32_rte_print_credits ( void )

NEORV32 runtime environment (RTE): Print project credits via UART0.

◆ neorv32_rte_print_hw_config()

void neorv32_rte_print_hw_config ( void )

NEORV32 runtime environment (RTE): Print hardware configuration information via UART0.

Warning
This function overrides several CSR, CNT and HPM CSRs!

◆ neorv32_rte_print_hw_version()

void neorv32_rte_print_hw_version ( void )

NEORV32 runtime environment (RTE): Print the processor version in human-readable format via UART0.

◆ neorv32_rte_print_info()

void neorv32_rte_print_info ( void )

NEORV32 runtime environment (RTE): Print current RTE configuration via UART0.

◆ neorv32_rte_print_license()

void neorv32_rte_print_license ( void )

NEORV32 runtime environment (RTE): Print project license via UART0.

◆ neorv32_rte_print_logo()

void neorv32_rte_print_logo ( void )

NEORV32 runtime environment (RTE): Print project logo via UART0.

◆ neorv32_rte_setup()

void neorv32_rte_setup ( void )

NEORV32 runtime environment (RTE): Setup RTE.

Note
This function installs a debug handler for ALL trap sources, which gives detailed information about the trap. Actual handlers can be installed afterwards via neorv32_rte_handler_install(uint8_t id, void (*handler)(void)).

Variable Documentation

◆ __neorv32_rte_vector_lut

uint32_t __neorv32_rte_vector_lut[NEORV32_RTE_NUM_TRAPS]
static

NEORV32 runtime environment (RTE): The >private< trap vector look-up table of the NEORV32 RTE.