aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/dhrystone
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@eecs.berkeley.edu>2014-02-06 01:36:26 -0800
committerAndrew Waterman <waterman@eecs.berkeley.edu>2014-02-06 01:36:26 -0800
commit71330800b89cb4c6ae8716a7e78bdcf574fe04ab (patch)
tree5395bdf46cccee8f6c94538b63ab161fa41648db /benchmarks/dhrystone
parent6fdd12c130d0c0c13934364a4dfe12d8dcf28e27 (diff)
downloadriscv-tests-71330800b89cb4c6ae8716a7e78bdcf574fe04ab.zip
riscv-tests-71330800b89cb4c6ae8716a7e78bdcf574fe04ab.tar.gz
riscv-tests-71330800b89cb4c6ae8716a7e78bdcf574fe04ab.tar.bz2
Clean up benchmarks; support uarch-specific counters
Diffstat (limited to 'benchmarks/dhrystone')
-rw-r--r--benchmarks/dhrystone/bmark.mk1
-rw-r--r--benchmarks/dhrystone/dhrystone.h8
-rw-r--r--benchmarks/dhrystone/dhrystone_main.c12
3 files changed, 5 insertions, 16 deletions
diff --git a/benchmarks/dhrystone/bmark.mk b/benchmarks/dhrystone/bmark.mk
index 6e45706..06b4ab8 100644
--- a/benchmarks/dhrystone/bmark.mk
+++ b/benchmarks/dhrystone/bmark.mk
@@ -11,6 +11,7 @@
dhrystone_c_src = \
dhrystone_main.c \
dhrystone.c \
+ syscalls.c \
dhrystone_riscv_src = \
crt.S \
diff --git a/benchmarks/dhrystone/dhrystone.h b/benchmarks/dhrystone/dhrystone.h
index 8abb874..f274c57 100644
--- a/benchmarks/dhrystone/dhrystone.h
+++ b/benchmarks/dhrystone/dhrystone.h
@@ -381,13 +381,9 @@ extern clock_t clock();
#define HZ 976563
#define Too_Small_Time 50
-#define rdcycle() ({ \
- long __x; \
- asm volatile("rdcycle %0; srl %0, %0, 10" : "=r"(__x)); \
- __x; })
#define CLOCK_TYPE "rdcycle()"
-#define Start_Timer() Begin_Time = rdcycle()
-#define Stop_Timer() End_Time = rdcycle()
+#define Start_Timer() Begin_Time = rdcycle()/1024
+#define Stop_Timer() End_Time = rdcycle()/1024
#else
/* Use times(2) time function unless */
diff --git a/benchmarks/dhrystone/dhrystone_main.c b/benchmarks/dhrystone/dhrystone_main.c
index 93b79da..a755743 100644
--- a/benchmarks/dhrystone/dhrystone_main.c
+++ b/benchmarks/dhrystone/dhrystone_main.c
@@ -8,9 +8,6 @@
#include "dhrystone.h"
-int ncores = 1;
-#include "util.h"
-
//--------------------------------------------------------------------------
// Macros
@@ -47,12 +44,7 @@ int __attribute__((noinline)) do_fprintf(FILE* f, const char* str, ...)
}
#endif
-void setStats( int enable )
-{
-#if ( !HOST_DEBUG && SET_STATS )
- asm( "mtpcr %0, cr10" : : "r" (enable) );
-#endif
-}
+#include "util.h"
#include <alloca.h>
@@ -299,7 +291,7 @@ int main (int argc, char** argv)
do_fprintf (stdout, "\n");
#endif
- finishTest(1);
+ return 0;
}