OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /neorv32/trunk/sw/example/bitmanip_test
    from Rev 64 to Rev 65
    Reverse comparison

Rev 64 → Rev 65

/main.c
78,7 → 78,7
neorv32_rte_setup();
 
// init UART at default baud rate, no parity bits, ho hw flow control
neorv32_uart_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
neorv32_uart0_setup(BAUD_RATE, PARITY_NONE, FLOW_CONTROL_NONE);
 
// Disable compilation by default
#ifndef RUN_CHECK
85,13 → 85,13
#warning Program HAS NOT BEEN COMPILED! Use >>make USER_FLAGS+=-DRUN_CHECK clean_all exe<< to compile it.
 
// inform the user if you are actually executing this
neorv32_uart_printf("ERROR! Program has not been compiled. Use >>make USER_FLAGS+=-DRUN_CHECK clean_all exe<< to compile it.\n");
neorv32_uart0_printf("ERROR! Program has not been compiled. Use >>make USER_FLAGS+=-DRUN_CHECK clean_all exe<< to compile it.\n");
 
return 1;
#endif
 
// intro
neorv32_uart_printf("NEORV32 'Zbb' Bit-Manipulation Extension Test\n\n");
neorv32_uart0_printf("NEORV32 'Zbb' Bit-Manipulation Extension Test\n\n");
 
// check available hardware extensions and compare with compiler flags
neorv32_rte_check_isa(0); // silent = 0 -> show message if isa mismatch
98,14 → 98,14
 
// check if Zbb extension is implemented at all
if ((NEORV32_SYSINFO.CPU & (1<<SYSINFO_CPU_ZBB)) == 0) {
neorv32_uart_print("Error! <Zbb> extension not synthesized!\n");
neorv32_uart0_print("Error! <Zbb> extension not synthesized!\n");
return 1;
}
 
neorv32_uart_printf("Starting Zbb bit-manipulation extension tests (%i test cases per instruction)...\n", num_tests);
neorv32_uart0_printf("Starting Zbb bit-manipulation extension tests (%i test cases per instruction)...\n", num_tests);
 
// ANDN
neorv32_uart_printf("\nANDN:\n");
neorv32_uart0_printf("\nANDN:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
117,7 → 117,7
print_report(err_cnt, num_tests);
 
// ORN
neorv32_uart_printf("\nORN:\n");
neorv32_uart0_printf("\nORN:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
129,7 → 129,7
print_report(err_cnt, num_tests);
 
// XNOR
neorv32_uart_printf("\nXNOR:\n");
neorv32_uart0_printf("\nXNOR:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
143,7 → 143,7
 
 
// CLZ
neorv32_uart_printf("\nCLZ:\n");
neorv32_uart0_printf("\nCLZ:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
154,7 → 154,7
print_report(err_cnt, num_tests);
 
// CTZ
neorv32_uart_printf("\nCTZ:\n");
neorv32_uart0_printf("\nCTZ:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
167,7 → 167,7
 
 
// CPOP
neorv32_uart_printf("\nCPOP:\n");
neorv32_uart0_printf("\nCPOP:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
180,7 → 180,7
 
 
// MAX
neorv32_uart_printf("\nMAX:\n");
neorv32_uart0_printf("\nMAX:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
192,7 → 192,7
print_report(err_cnt, num_tests);
 
// MAXU
neorv32_uart_printf("\nMAXU:\n");
neorv32_uart0_printf("\nMAXU:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
204,7 → 204,7
print_report(err_cnt, num_tests);
 
// MIN
neorv32_uart_printf("\nMIN:\n");
neorv32_uart0_printf("\nMIN:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
216,7 → 216,7
print_report(err_cnt, num_tests);
 
// MINU
neorv32_uart_printf("\nMINU:\n");
neorv32_uart0_printf("\nMINU:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
230,7 → 230,7
 
 
// SEXT.B
neorv32_uart_printf("\nSEXT.B:\n");
neorv32_uart0_printf("\nSEXT.B:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
241,7 → 241,7
print_report(err_cnt, num_tests);
 
// SEXT.H
neorv32_uart_printf("\nSEXT.H:\n");
neorv32_uart0_printf("\nSEXT.H:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
252,7 → 252,7
print_report(err_cnt, num_tests);
 
// ZEXT.H
neorv32_uart_printf("\nZEXT.H:\n");
neorv32_uart0_printf("\nZEXT.H:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
265,7 → 265,7
 
 
// ROL
neorv32_uart_printf("\nROL:\n");
neorv32_uart0_printf("\nROL:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
277,7 → 277,7
print_report(err_cnt, num_tests);
 
// ROR
neorv32_uart_printf("\nROR:\n");
neorv32_uart0_printf("\nROR:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
289,7 → 289,7
print_report(err_cnt, num_tests);
 
// RORI
neorv32_uart_printf("\nRORI (imm=20):\n"); // FIXME: static immediate
neorv32_uart0_printf("\nRORI (imm=20):\n"); // FIXME: static immediate
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
302,7 → 302,7
 
 
// ORC.B
neorv32_uart_printf("\nORCB:\n");
neorv32_uart0_printf("\nORCB:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
315,7 → 315,7
 
 
// REV8
neorv32_uart_printf("\nREV8:\n");
neorv32_uart0_printf("\nREV8:\n");
err_cnt = 0;
for (i=0;i<num_tests; i++) {
opa = xorshift32();
326,7 → 326,7
print_report(err_cnt, num_tests);
 
 
neorv32_uart_printf("\nBit manipulation extension tests done.\n");
neorv32_uart0_printf("\nBit manipulation extension tests done.\n");
 
return 0;
}
362,8 → 362,8
uint32_t check_result(uint32_t num, uint32_t opa, uint32_t opb, uint32_t ref, uint32_t res) {
 
if (ref != res) {
neorv32_uart_printf("%u: opa = 0x%x, opb = 0x%x : ref = 0x%x vs res = 0x%x ", num, opa, opb, ref, res);
neorv32_uart_printf("%c[1m[FAILED]%c[0m\n", 27, 27);
neorv32_uart0_printf("%u: opa = 0x%x, opb = 0x%x : ref = 0x%x vs res = 0x%x ", num, opa, opb, ref, res);
neorv32_uart0_printf("%c[1m[FAILED]%c[0m\n", 27, 27);
return 1;
}
else {
380,12 → 380,12
**************************************************************************/
void print_report(int num_err, int num_tests) {
 
neorv32_uart_printf("Errors: %i/%i ", num_err, num_tests);
neorv32_uart0_printf("Errors: %i/%i ", num_err, num_tests);
 
if (num_err == 0) {
neorv32_uart_printf("%c[1m[ok]%c[0m\n", 27, 27);
neorv32_uart0_printf("%c[1m[ok]%c[0m\n", 27, 27);
}
else {
neorv32_uart_printf("%c[1m[FAILED]%c[0m\n", 27, 27);
neorv32_uart0_printf("%c[1m[FAILED]%c[0m\n", 27, 27);
}
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.