NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Functions
legacy.h File Reference

Wrappers and functions for backwards compatibility. More...

Go to the source code of this file.

Macros

Backward-compatibility layer (before version v1.7.8.2)
Warning
This function is deprecated!
#define neorv32_cfu_cmd0(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 0, rs1, rs2)
 
#define neorv32_cfu_cmd1(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 1, rs1, rs2)
 
#define neorv32_cfu_cmd2(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 2, rs1, rs2)
 
#define neorv32_cfu_cmd3(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 3, rs1, rs2)
 
#define neorv32_cfu_cmd4(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 4, rs1, rs2)
 
#define neorv32_cfu_cmd5(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 5, rs1, rs2)
 
#define neorv32_cfu_cmd6(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 6, rs1, rs2)
 
#define neorv32_cfu_cmd7(funct7, rs1, rs2)   neorv32_cfu_r3_instr(funct7, 7, rs1, rs2)
 

Functions

void neorv32_uart0_print (const char *s)
 
void neorv32_uart1_print (const char *s)
 
int neorv32_rte_exception_install (uint8_t id, void(*handler)(void))
 
int neorv32_rte_exception_uninstall (uint8_t id)
 
uint64_t neorv32_cpu_get_systime (void)
 
void neorv32_cpu_eint (void)
 
void neorv32_cpu_dint (void)
 
int neorv32_cpu_irq_enable (uint8_t irq_sel)
 
int neorv32_cpu_irq_disable (uint8_t irq_sel)
 

Detailed Description

Wrappers and functions for backwards compatibility.

Warning
Do not use these functions for new designs as they are not supported and might get removed in the future.

Macro Definition Documentation

◆ neorv32_cfu_cmd0

#define neorv32_cfu_cmd0 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 0, rs1, rs2)

R3-type CFU custom instruction 0 (funct3 = 000)

◆ neorv32_cfu_cmd1

#define neorv32_cfu_cmd1 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 1, rs1, rs2)

R3-type CFU custom instruction 1 (funct3 = 001)

◆ neorv32_cfu_cmd2

#define neorv32_cfu_cmd2 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 2, rs1, rs2)

R3-type CFU custom instruction 2 (funct3 = 010)

◆ neorv32_cfu_cmd3

#define neorv32_cfu_cmd3 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 3, rs1, rs2)

R3-type CFU custom instruction 3 (funct3 = 011)

◆ neorv32_cfu_cmd4

#define neorv32_cfu_cmd4 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 4, rs1, rs2)

R3-type CFU custom instruction 4 (funct3 = 100)

◆ neorv32_cfu_cmd5

#define neorv32_cfu_cmd5 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 5, rs1, rs2)

R3-type CFU custom instruction 5 (funct3 = 101)

◆ neorv32_cfu_cmd6

#define neorv32_cfu_cmd6 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 6, rs1, rs2)

R3-type CFU custom instruction 6 (funct3 = 110)

◆ neorv32_cfu_cmd7

#define neorv32_cfu_cmd7 (   funct7,
  rs1,
  rs2 
)    neorv32_cfu_r3_instr(funct7, 7, rs1, rs2)

R3-type CFU custom instruction 7 (funct3 = 111)

Function Documentation

◆ neorv32_cpu_dint()

void neorv32_cpu_dint ( void  )
inline

Disable global CPU interrupts (via MIE flag in mstatus CSR).

Note
Interrupts are always enabled when the CPU is in user-mode.

◆ neorv32_cpu_eint()

void neorv32_cpu_eint ( void  )
inline

Enable global CPU interrupts (via MIE flag in mstatus CSR).

Note
Interrupts are always enabled when the CPU is in user-mode.

◆ neorv32_cpu_get_systime()

uint64_t neorv32_cpu_get_systime ( void  )
inline

Get current system time from time[h] CSR.

Note
This function requires the MTIME system timer to be implemented.
Returns
Current system time (64 bit).

◆ neorv32_cpu_irq_disable()

int neorv32_cpu_irq_disable ( uint8_t  irq_sel)
inline

Disable specific interrupt source.

Parameters
[in]irq_selCPU interrupt select. See NEORV32_CSR_MIE_enum.
Returns
0 if success, 1 if error (invalid irq_sel).

◆ neorv32_cpu_irq_enable()

int neorv32_cpu_irq_enable ( uint8_t  irq_sel)
inline

Enable specific interrupt source.

Parameters
[in]irq_selCPU interrupt select. See NEORV32_CSR_MIE_enum.
Returns
0 if success, 1 if error (invalid irq_sel).

◆ neorv32_rte_exception_install()

int neorv32_rte_exception_install ( uint8_t  id,
void(*)(void)  handler 
)
inline

Install trap handler function to NEORV32 runtime environment.

Warning
This function is deprecated!
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_exception_uninstall()

int neorv32_rte_exception_uninstall ( uint8_t  id)
inline

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

Warning
This function is deprecated!
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_uart0_print()

void neorv32_uart0_print ( const char *  s)
inline

Print string (zero-terminated) via UART0. Print full line break "\r\n" for every '
'.

Note
This function is blocking.
Warning
This function is deprecated!
Parameters
[in]sPointer to string.

◆ neorv32_uart1_print()

void neorv32_uart1_print ( const char *  s)
inline

Print string (zero-terminated) via UART1. Print full line break "\r\n" for every '
'.

Note
This function is blocking.
Warning
This function is deprecated!
Parameters
[in]sPointer to string.