From 9bac2f01b1f182ad8d889db905da1543129a7542 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 9 May 2022 16:07:14 +0200 Subject: add treebench app --- src/app/treebench/Kconfig | 6 ++++++ src/app/treebench/Makefile.inc | 9 +++++++++ src/app/treebench/main.cc | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 src/app/treebench/Kconfig create mode 100644 src/app/treebench/Makefile.inc create mode 100644 src/app/treebench/main.cc (limited to 'src/app/treebench') 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; +} -- cgit v1.2.3