[PATCH] Add CoreMark Benchmark

Hesham Almatary Hesham.Almatary at cl.cam.ac.uk
Fri Feb 21 17:00:26 UTC 2020


CoreMark's primary goals are simplicity and providing a method for testing only a processor's core features.
It is used primarily here as a performance benchmark

Built and tested for RISC-V rv64imafdc_medany on QEMU and HW
---
 .gitmodules                  |  3 +++
 benchmarks/coremark/coremark |  1 +
 benchmarks/coremark/wscript  | 48 ++++++++++++++++++++++++++++++++++++
 benchmarks/wscript           |  2 ++
 4 files changed, 54 insertions(+)
 create mode 160000 benchmarks/coremark/coremark
 create mode 100644 benchmarks/coremark/wscript

diff --git a/.gitmodules b/.gitmodules
index ae86e49..2bcba90 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "rtems_waf"]
 	path = rtems_waf
 	url = git://git.rtems.org/rtems_waf.git
+[submodule "benchmarks/coremark/coremark"]
+	path = benchmarks/coremark/coremark
+	url = git at github.com:CTSRD-CHERI/coremark.git
diff --git a/benchmarks/coremark/coremark b/benchmarks/coremark/coremark
new file mode 160000
index 0000000..cdafe98
--- /dev/null
+++ b/benchmarks/coremark/coremark
@@ -0,0 +1 @@
+Subproject commit cdafe986865cf46a3222f7bf28be82fc8d96fa8f
diff --git a/benchmarks/coremark/wscript b/benchmarks/coremark/wscript
new file mode 100644
index 0000000..c2c225a
--- /dev/null
+++ b/benchmarks/coremark/wscript
@@ -0,0 +1,48 @@
+#-
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2020 Hesham Almatary
+#
+# This software was developed by SRI International and the University of
+# Cambridge Computer Laboratory (Department of Computer Science and
+# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
+# DARPA SSITH research programme.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+import rtems_waf.rtems as rtems
+
+def build(bld):
+    rtems.build(bld)
+
+    bld(features = 'c cprogram',
+        target = 'coremark.bin',
+        includes = 'coremark/ coremark/rtems',
+        source = ['coremark/rtems/core_portme.c',
+                  'coremark/core_list_join.c', 'coremark/core_main.c', 'coremark/core_matrix.c', 'coremark/core_state.c', 'coremark/core_util.c'],
+
+        defines = [
+        # FLAGS_STR is used within CoreMark to print the compiler flags used
+        'FLAGS_STR="'+' '.join([str(flag) for flag in bld.env.CFLAGS])+'"'
+        ]
+    )
diff --git a/benchmarks/wscript b/benchmarks/wscript
index 12741e7..24db85b 100644
--- a/benchmarks/wscript
+++ b/benchmarks/wscript
@@ -1,3 +1,4 @@
+# Copyright 2020 Hesham Almatary (hesham.almatary at cl.cam.ac.uk)
 # Copyright 2013 Gedare Bloom (gedare at rtems.org)
 #
 # This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
@@ -7,4 +8,5 @@ import rtems_waf.rtems as rtems
 
 def build(bld):
     bld.recurse('nbench')
+    bld.recurse('coremark')
 
-- 
2.17.1



More information about the devel mailing list