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

Test program for the NEORV32 'Zicond' ISA extension using pseudo-random data as input; compares results from hardware against pure-sw reference functions. More...

#include <neorv32.h>
#include "zicond_intrinsics.h"

User configuration

#define BAUD_RATE   (19200)
 
#define NUM_TEST_CASES   (1000000)
 
#define SILENT_MODE   (1)
 
uint32_t xorshift32 (void)
 
uint32_t check_result (uint32_t num, uint32_t opa, uint32_t opb, uint32_t ref, uint32_t res)
 
void print_report (int num_err, int num_tests)
 
int main ()
 

Detailed Description

Test program for the NEORV32 'Zicond' ISA extension using pseudo-random data as input; compares results from hardware against pure-sw reference functions.

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   (19200)

UART BAUD rate

◆ NUM_TEST_CASES

#define NUM_TEST_CASES   (1000000)

UART BAUD rate

◆ SILENT_MODE

#define SILENT_MODE   (1)

UART BAUD rate

Function Documentation

◆ check_result()

uint32_t check_result ( uint32_t  num,
uint32_t  opa,
uint32_t  opb,
uint32_t  ref,
uint32_t  res 
)

Check results (reference (SW) vs actual hardware).

Parameters
[in]numTest case number
[in]opaOperand 1
[in]opbOperand 2
[in]refSoftware reference
[in]resActual results
Returns
zero if results are equal.

◆ main()

int main ( void  )

Main function; test all available operations of the NEORV32 'B' extension using bit manipulation intrinsics and software-only reference functions (emulation).

Note
This program requires the bit-manipulation CPU extension.
Returns
Irrelevant.

◆ print_report()

void print_report ( int  num_err,
int  num_tests 
)

Print test report.

Parameters
[in]num_errNumber or errors in this test.
[in]num_testsTotal number of conducted tests.

◆ xorshift32()

uint32_t xorshift32 ( void  )

Pseudo-Random Number Generator (to generate deterministic test vectors).

Returns
Random data (32-bit).