mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-24 06:07:52 -04:00
[sw/example] benchmarks: minor fixes
This commit is contained in:
parent
ff7874eabd
commit
2f6c8aa57b
2 changed files with 28 additions and 31 deletions
|
@ -87,7 +87,7 @@ Original Author: Shay Gal-on
|
|||
FLAGS_STR /* "Please put compiler flags here (e.g. -o3)" */
|
||||
#endif
|
||||
#ifndef MEM_LOCATION
|
||||
#define MEM_LOCATION "STACK"
|
||||
#define MEM_LOCATION "STATIC"
|
||||
#endif
|
||||
|
||||
/* Data Types :
|
||||
|
@ -142,7 +142,7 @@ typedef ee_u64 CORE_TICKS;
|
|||
MEM_STACK - to allocate the data block on the stack (NYI).
|
||||
*/
|
||||
#ifndef MEM_METHOD
|
||||
#define MEM_METHOD MEM_STACK
|
||||
#define MEM_METHOD MEM_STATIC
|
||||
#endif
|
||||
|
||||
/* Configuration : MULTITHREAD
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
#ifndef DHRY_ITERS
|
||||
#define DHRY_ITERS 2000
|
||||
#define DHRY_ITERS 10000
|
||||
#endif
|
||||
|
||||
/* Global Variables: */
|
||||
|
@ -341,38 +341,35 @@ int main (void)
|
|||
/ (float) User_Time;
|
||||
#endif
|
||||
*/
|
||||
{ /* ***** NEORV32-SPECIFIC ***** */
|
||||
neorv32_uart_printf ("Microseconds for one run through Dhrystone: ");
|
||||
neorv32_uart_printf ("%u \n", (uint32_t)(((User_Time/NEORV32_SYSINFO.CLK) * Mic_secs_Per_Second) / Number_Of_Runs));
|
||||
neorv32_uart_printf ("Dhrystones per Second: ");
|
||||
neorv32_uart_printf ("%u \n", (uint32_t)(Number_Of_Runs / (User_Time/NEORV32_SYSINFO.CLK)));
|
||||
neorv32_uart_printf ("\n");
|
||||
{ /* ***** NEORV32-SPECIFIC ***** */
|
||||
neorv32_uart_printf ("Microseconds for one run through Dhrystone: %u \n", (uint32_t)((User_Time * (Mic_secs_Per_Second / Number_Of_Runs)) / NEORV32_SYSINFO.CLK));
|
||||
|
||||
uint32_t dhry_per_sec = (uint32_t)(Number_Of_Runs / (User_Time/NEORV32_SYSINFO.CLK));
|
||||
uint32_t vax_per_sec = dhry_per_sec / 1757;
|
||||
uint32_t dhry_per_sec = (uint32_t)(NEORV32_SYSINFO.CLK / (User_Time / Number_Of_Runs));
|
||||
|
||||
neorv32_uart_printf("NEORV32: << DETAILED RESULTS (integer parts only) >>\n");
|
||||
neorv32_uart_printf("NEORV32: Total cycles: %u\n", (uint32_t)User_Time);
|
||||
neorv32_uart_printf("NEORV32: Cycles per second: %u\n", (uint32_t)NEORV32_SYSINFO.CLK);
|
||||
neorv32_uart_printf("NEORV32: Total runs: %u\n", (uint32_t)Number_Of_Runs);
|
||||
neorv32_uart_printf ("Dhrystones per Second: %u \n\n", (uint32_t)dhry_per_sec);
|
||||
|
||||
neorv32_uart_printf("\n");
|
||||
neorv32_uart_printf("NEORV32: DMIPS/s: %u\n", (uint32_t)dhry_per_sec);
|
||||
neorv32_uart_printf("NEORV32: DMIPS/MHz: %u\n", (uint32_t)(dhry_per_sec / (NEORV32_SYSINFO.CLK / 1000000)));
|
||||
neorv32_uart_printf("NEORV32: << DETAILED RESULTS (integer parts only) >>\n");
|
||||
neorv32_uart_printf("NEORV32: Total cycles: %u\n", (uint32_t)User_Time);
|
||||
neorv32_uart_printf("NEORV32: Cycles per second: %u\n", (uint32_t)NEORV32_SYSINFO.CLK);
|
||||
neorv32_uart_printf("NEORV32: Total runs: %u\n", (uint32_t)Number_Of_Runs);
|
||||
|
||||
neorv32_uart_printf("\n");
|
||||
neorv32_uart_printf("NEORV32: VAX DMIPS/s: %u\n", (uint32_t)vax_per_sec);
|
||||
neorv32_uart_printf("NEORV32: VAX DMIPS/MHz: %u/%u\n", (uint32_t)vax_per_sec, (uint32_t)(NEORV32_SYSINFO.CLK / 1000000));
|
||||
} /* ***** /NEORV32-SPECIFIC ***** */
|
||||
/*
|
||||
neorv32_uart_printf ("Microseconds for one run through Dhrystone: ");
|
||||
//neorv32_uart_printf ("%6.1f \n", Microseconds);
|
||||
neorv32_uart_printf ("%d \n", (int)Microseconds);
|
||||
neorv32_uart_printf ("Dhrystones per Second: ");
|
||||
//neorv32_uart_printf ("%6.1f \n", Dhrystones_Per_Second);
|
||||
neorv32_uart_printf ("%d \n", (int)Dhrystones_Per_Second);
|
||||
neorv32_uart_printf ("\n");
|
||||
*/
|
||||
neorv32_uart_printf("\n");
|
||||
neorv32_uart_printf("NEORV32: DMIPS/s: %u\n", (uint32_t)dhry_per_sec);
|
||||
neorv32_uart_printf("NEORV32: DMIPS/s/MHz: %u\n", (uint32_t)(dhry_per_sec / (NEORV32_SYSINFO.CLK / 1000000)));
|
||||
|
||||
neorv32_uart_printf("\n");
|
||||
neorv32_uart_printf("NEORV32: VAX DMIPS/s: %u\n", (uint32_t)dhry_per_sec/1757);
|
||||
neorv32_uart_printf("NEORV32: VAX DMIPS/s/MHz: %u/1757\n", (uint32_t)(dhry_per_sec / (NEORV32_SYSINFO.CLK / 1000000)));
|
||||
} /* ***** /NEORV32-SPECIFIC ***** */
|
||||
/*
|
||||
neorv32_uart_printf ("Microseconds for one run through Dhrystone: ");
|
||||
//neorv32_uart_printf ("%6.1f \n", Microseconds);
|
||||
neorv32_uart_printf ("%d \n", (int)Microseconds);
|
||||
neorv32_uart_printf ("Dhrystones per Second: ");
|
||||
//neorv32_uart_printf ("%6.1f \n", Dhrystones_Per_Second);
|
||||
neorv32_uart_printf ("%d \n", (int)Dhrystones_Per_Second);
|
||||
neorv32_uart_printf ("\n");
|
||||
*/
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue