NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Macros | Functions
main.c File Reference

Example program showing how to use the CFU's custom instructions. More...

#include <neorv32.h>

Macros

#define madd_lo(a, b, c)   neorv32_cfu_r4_instr(0b000, a, b, c)
 
#define madd_hi(a, b, c)   neorv32_cfu_r4_instr(0b001, a, b, c)
 
User configuration
#define BAUD_RATE   19200
 
#define TESTCASES   4
 

Functions

uint32_t xorshift32 (void)
 
int main ()
 

Detailed Description

Example program showing how to use the CFU's custom instructions.

Author
Stephan Nolting
Note
Take a look at the highly-commented "hardware-counterpart" of this CFU example in 'rtl/core/neorv32_cpu_cp_cfu.vhd'.

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

◆ TESTCASES

#define TESTCASES   4

Number of test cases per CFU instruction

Function Documentation

◆ main()

int main ( void  )

Main function

Note
This program requires the CFU and UART0.
Returns
0 if execution was successful

◆ xorshift32()

uint32_t xorshift32 ( void  )

Pseudo-random number generator (to generate deterministic test data).

Returns
Random data (32-bit).