summaryrefslogtreecommitdiff
path: root/software/dhrystone
diff options
context:
space:
mode:
authorAndrew Waterman <aswaterman@gmail.com>2017-01-05 15:14:28 -0500
committerGitHub <noreply@github.com>2017-01-05 15:14:28 -0500
commitd69f4cb8653f4974374f98debf9ce2cc820a2b57 (patch)
treecc6889cdc8877bcf4b1a8e8760c773e9ec0ef76f /software/dhrystone
parente641c398daa91d896ce37fbb73015c054a4e0b21 (diff)
parentb8057b191231dea4b973f1d5066f59afa3881dba (diff)
Merge pull request #38 from sifive/benchmarking
Benchmarking
Diffstat (limited to 'software/dhrystone')
-rw-r--r--software/dhrystone/Makefile2
-rw-r--r--software/dhrystone/dhry_stubs.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/software/dhrystone/Makefile b/software/dhrystone/Makefile
index a55b1ec..78a7b23 100644
--- a/software/dhrystone/Makefile
+++ b/software/dhrystone/Makefile
@@ -5,7 +5,7 @@ C_SRCS := dhry_stubs.c dhry_printf.c
HEADERS := dhry.h
DHRY_SRCS := dhry_1.c dhry_2.c
-DHRY_CFLAGS := -O2 -DTIME -fno-inline -fno-builtin-printf -Wno-implicit
+DHRY_CFLAGS := -O2 -DTIME -fno-inline -fno-builtin-printf -Wno-implicit -march=rv32ima
XLEN ?= 32
CFLAGS := -Os -fno-common
diff --git a/software/dhrystone/dhry_stubs.c b/software/dhrystone/dhry_stubs.c
index d3bd14c..0616f86 100644
--- a/software/dhrystone/dhry_stubs.c
+++ b/software/dhrystone/dhry_stubs.c
@@ -3,16 +3,13 @@
/* The functions in this file are only meant to support Dhrystone on an
* embedded RV32 system and are obviously incorrect in general. */
-// return the cycle counter as though it were the current time
long time(void)
{
- long t;
- asm volatile ("csrr %0, mcycle" : "=r" (t));
- return t / (get_cpu_freq() / 1000);
+ return get_timer_value() / get_timer_freq();
}
// set the number of dhrystone iterations
void __wrap_scanf(const char* fmt, int* n)
{
- *n = 1500000;
+ *n = 100000000;
}