diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/treebench/Kconfig | 6 | ||||
-rw-r--r-- | src/app/treebench/Makefile.inc | 9 | ||||
-rw-r--r-- | src/app/treebench/main.cc | 32 |
3 files changed, 47 insertions, 0 deletions
diff --git a/src/app/treebench/Kconfig b/src/app/treebench/Kconfig new file mode 100644 index 0000000..f41e805 --- /dev/null +++ b/src/app/treebench/Kconfig @@ -0,0 +1,6 @@ +# Copyright 2020 Daniel Friesel +# +# SPDX-License-Identifier: CC0-1.0 + +prompt "Tree Evaluation Benchmark" +depends on loop && !wakeup diff --git a/src/app/treebench/Makefile.inc b/src/app/treebench/Makefile.inc new file mode 100644 index 0000000..0eea52a --- /dev/null +++ b/src/app/treebench/Makefile.inc @@ -0,0 +1,9 @@ +# vim:ft=make +# +# Copyright 2020 Daniel Friesel +# +# SPDX-License-Identifier: CC0-1.0 + +ifdef app + loop = 1 +endif diff --git a/src/app/treebench/main.cc b/src/app/treebench/main.cc new file mode 100644 index 0000000..e2ddfe3 --- /dev/null +++ b/src/app/treebench/main.cc @@ -0,0 +1,32 @@ +/* + * Copyright 2020 Daniel Friesel + * + * SPDX-License-Identifier: BSD-2-Clause + */ +#include "arch.h" +#include "driver/gpio.h" +#include "driver/stdout.h" +#include "driver/uptime.h" +#include "driver/counter.h" + +#include "tree.c.inc" + +void loop(void) +{ + counter.start(); + counter.stop(); + kout << "nop @ " << counter.value << "/" << counter.overflow << " cycles" << endl << endl; + + run_benchmark(); +} + +int main(void) +{ + arch.setup(); + gpio.setup(); + kout.setup(); + + arch.idle_loop(); + + return 0; +} |