From: Andrew Waterman Date: Fri, 1 May 2015 22:16:55 +0000 (-0700) Subject: Fix dhrystone timing code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ce97df1c97b4ef39b94041350b910d12f782328;p=riscv-tests.git Fix dhrystone timing code --- diff --git a/benchmarks/dhrystone/dhrystone.c b/benchmarks/dhrystone/dhrystone.c index 418602a..38e3376 100644 --- a/benchmarks/dhrystone/dhrystone.c +++ b/benchmarks/dhrystone/dhrystone.c @@ -180,3 +180,6 @@ Enumeration Enum_Par_Val; return (false); } /* Func_3 */ +void debug_printf(const char* str, ...) +{ +} diff --git a/benchmarks/dhrystone/dhrystone.h b/benchmarks/dhrystone/dhrystone.h index 767a657..37535e7 100644 --- a/benchmarks/dhrystone/dhrystone.h +++ b/benchmarks/dhrystone/dhrystone.h @@ -381,7 +381,7 @@ extern clock_t clock(); #elif defined(__riscv) -#define HZ 976563 +#define HZ 1000000 #define Too_Small_Time 1 #define CLOCK_TYPE "rdcycle()" #define Start_Timer() Begin_Time = rdcycle() diff --git a/benchmarks/dhrystone/dhrystone_main.c b/benchmarks/dhrystone/dhrystone_main.c index 34451f9..f2cd58e 100644 --- a/benchmarks/dhrystone/dhrystone_main.c +++ b/benchmarks/dhrystone/dhrystone_main.c @@ -42,10 +42,7 @@ #if HOST_DEBUG # define debug_printf printf #else -void debug_printf(const char* str, ...) -{ - return 0; -} +void debug_printf(const char* str, ...); #endif #include "util.h" @@ -161,8 +158,8 @@ int main (int argc, char** argv) /* Start timer */ /***************/ - Start_Timer(); setStats(1); + Start_Timer(); for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) { @@ -214,8 +211,8 @@ int main (int argc, char** argv) /* Stop timer */ /**************/ - setStats(0); Stop_Timer(); + setStats(0); User_Time = End_Time - Begin_Time;