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_true_false (int state)
 
static void __neorv32_rte_print_checkbox (int state)
 
static void __neorv32_rte_print_hex_word (uint32_t num)
 
static void __neorv32_rte_print_hex_half (uint16_t num)
 
void neorv32_rte_setup (void)
 
int neorv32_rte_handler_install (uint8_t id, void(*handler)(void))
 
int neorv32_rte_handler_uninstall (uint8_t id)
 
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)
 
uint32_t neorv32_rte_get_compiler_isa (void)
 
int neorv32_rte_check_isa (int silent)
 

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

This is the [private!] core of the NEORV32 RTE.

Warning
When using the the RTE, this function is the ONLY function that uses the 'interrupt' attribute!

◆ __neorv32_rte_debug_handler()

static void __neorv32_rte_debug_handler ( void  )
static

NEORV32 runtime environment: Debug trap handler, printing various information via UART.

Note
This function is used by neorv32_rte_handler_uninstall(void) only.

◆ __neorv32_rte_print_checkbox()

static void __neorv32_rte_print_checkbox ( int  state)
static

NEORV32 runtime environment: Private function to print [x] or [ ].

Parameters
[in]statePrint '[x]' when !=0, print '[ ]' when 0

◆ __neorv32_rte_print_hex_half()

void __neorv32_rte_print_hex_half ( uint16_t  num)
static

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

Parameters
[in]numNumber to print as hexadecimal.

◆ __neorv32_rte_print_hex_word()

void __neorv32_rte_print_hex_word ( uint32_t  num)
static

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

Parameters
[in]numNumber to print as hexadecimal.

◆ __neorv32_rte_print_true_false()

static void __neorv32_rte_print_true_false ( int  state)
static

NEORV32 runtime environment: Private function to print yes or no.

Parameters
[in]statePrint 'yes' when !=0, print 'no' when 0

◆ neorv32_rte_check_isa()

int neorv32_rte_check_isa ( int  silent)

NEORV32 runtime environment: Check required ISA extensions (via compiler flags) against available ISA extensions (via MISA csr).

Parameters
[in]silentShow error message (via neorv32.uart) if isa_sw > isa_hw when = 0.
Returns
MISA content according to compiler configuration.

◆ neorv32_rte_get_compiler_isa()

uint32_t neorv32_rte_get_compiler_isa ( void  )

NEORV32 runtime environment: Get MISA CSR value according to compiler/toolchain configuration.

Returns
MISA content according to compiler configuration.

◆ neorv32_rte_handler_install()

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

Install trap handler function to NEORV32 runtime environment.

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 ( uint8_t  id)

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: Print project credits

◆ neorv32_rte_print_hw_config()

void neorv32_rte_print_hw_config ( void  )

NEORV32 runtime environment: Print hardware configuration information via UART

◆ neorv32_rte_print_hw_version()

void neorv32_rte_print_hw_version ( void  )

NEORV32 runtime environment: Print the processor version in human-readable format.

◆ neorv32_rte_print_license()

void neorv32_rte_print_license ( void  )

NEORV32 runtime environment: Print project license

◆ neorv32_rte_print_logo()

void neorv32_rte_print_logo ( void  )

NEORV32 runtime environment: Print project logo

◆ neorv32_rte_setup()

void neorv32_rte_setup ( void  )

Setup NEORV32 runtime environment.

Note
This function installs a debug handler for ALL trap sources, which gives detailed information about the trap. Actual handler 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

The >private< trap vector look-up table of the NEORV32 RTE.