From 7fff977c8853a9c30f0017f4e47dd838b529997d Mon Sep 17 00:00:00 2001 From: Bunnaroath Sou Date: Wed, 27 Mar 2019 18:05:49 -0700 Subject: Update Makefile to handle special ENV require for coremark, dhrystone --- Makefile | 19 ++++++++++++++++--- scripts/standalone.mk | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c19045b..e742c35 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,13 @@ endif PROGRAM ?= hello TARGET ?= sifive-hifive1 +# Coremark require PORT_DIR set for different OS, freedom-metal for us! +ifeq ($(PROGRAM),coremark) +ifeq ($(PORT_DIR),) +PORT_DIR = freedom-metal +endif +endif + TARGET_ROOT ?= $(abspath .) PROGRAM_ROOT ?= $(abspath .) @@ -102,9 +109,9 @@ clean: ############################################################# # Enumerate BSPs and Programs # -# List all available boards and programs in a form that -# Freedom Studio knows how to parse. Do not change the -# format or fixed text of the output without consulting the +# List all available boards and programs in a form that +# Freedom Studio knows how to parse. Do not change the +# format or fixed text of the output without consulting the # Freedom Studio dev team. ############################################################# @@ -194,6 +201,9 @@ standalone: \ cp release.mk $ $ $> $> $ $ $> $> $ Date: Wed, 27 Mar 2019 18:06:37 -0700 Subject: Update readme, and doc/sphinx to include coremark --- README.md | 3 +++ doc/sphinx/contents.rst | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 922e588..d1c1a5c 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,9 @@ operating systems to RISC-V. - Prints the SiFive banner and blinks LEDs - dhrystone - "Dhrystone" Benchmark Program by Reinhold P. Weicker + - coremark + - "CoreMark" Benchmark Program that measures the performance of embedded + microcrontrollers (MCU) ### Setting up the SDK ### diff --git a/doc/sphinx/contents.rst b/doc/sphinx/contents.rst index cad7f78..3a20bad 100644 --- a/doc/sphinx/contents.rst +++ b/doc/sphinx/contents.rst @@ -153,3 +153,7 @@ The example programs can be found under the ``software/`` directory. - "Dhrystone" Benchmark Program by Reinhold P. Weicker +- coremark + + - "CoreMark" Benchmark Program that measures the performance of embedded + microcrontrollers (MCU) -- cgit v1.2.1-18-gbd029 From 85a442db0dd3f2440019fe8586d28c2dec148cd3 Mon Sep 17 00:00:00 2001 From: "Hsiang-Chia.Huang" Date: Sat, 25 May 2019 01:19:53 -0700 Subject: add sifive/coremark repo --- .gitmodules | 3 +++ software/coremark | 1 + 2 files changed, 4 insertions(+) create mode 160000 software/coremark diff --git a/.gitmodules b/.gitmodules index 40b88d9..a166706 100644 --- a/.gitmodules +++ b/.gitmodules @@ -52,3 +52,6 @@ [submodule "software/example-user-syscall"] path = software/example-user-syscall url = https://github.com/sifive/example-user-syscall.git +[submodule "software/coremark"] + path = software/coremark + url = https://github.com/sifive/benchmark-coremark.git diff --git a/software/coremark b/software/coremark new file mode 160000 index 0000000..2a15fbb --- /dev/null +++ b/software/coremark @@ -0,0 +1 @@ +Subproject commit 2a15fbb3ecae618f978a1c6f9eaa1fb469aa688c -- cgit v1.2.1-18-gbd029 From 9ed1c05e3b202ef2ef17cae4bfc0ca6425541d13 Mon Sep 17 00:00:00 2001 From: "Hsiang-Chia.Huang" Date: Wed, 29 May 2019 05:58:13 -0700 Subject: Add compile options for coremark and update freedom-metal repo. Regenerate files in bsps. --- bsp/coreip-e20-arty/metal.ramrodata.lds | 14 +++++++++----- freedom-metal | 2 +- scripts/standalone.mk | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/bsp/coreip-e20-arty/metal.ramrodata.lds b/bsp/coreip-e20-arty/metal.ramrodata.lds index 513e567..0c6fffa 100644 --- a/bsp/coreip-e20-arty/metal.ramrodata.lds +++ b/bsp/coreip-e20-arty/metal.ramrodata.lds @@ -9,8 +9,9 @@ ENTRY(_enter) MEMORY { - ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x10000 + ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x8000 flash (rxai!w) : ORIGIN = 0x40400000, LENGTH = 0x1fc00000 + itim (wx!rai) : ORIGIN = 0x80008000, LENGTH = 0x8000 } PHDRS @@ -127,13 +128,17 @@ SECTIONS { . = ALIGN(4); PROVIDE( metal_segment_itim_target_start = . ); - } >ram AT>flash :ram_init + } >itim AT>flash :itim_init .itim : { *(.itim .itim.*) - } >flash AT>flash :flash + *(.text.unlikely .text.unlikely.*) + *(.text.startup .text.startup.*) + *(.text .text.*) + *(.gnu.linkonce.t.*) + } >itim AT>flash :itim_init . = ALIGN(8); @@ -144,8 +149,7 @@ SECTIONS *(.text.startup .text.startup.*) *(.text .text.*) *(.gnu.linkonce.t.*) - *(.itim .itim.*) - } >flash AT>flash :flash + } >itim AT>flash :flash .lalign : diff --git a/freedom-metal b/freedom-metal index 7eb6be9..2c101d0 160000 --- a/freedom-metal +++ b/freedom-metal @@ -1 +1 @@ -Subproject commit 7eb6be9e76019ab6c20c78c529b747bf6bc2b160 +Subproject commit 2c101d05a09afaf8f00469e5b0565069055d6a2d diff --git a/scripts/standalone.mk b/scripts/standalone.mk index 0526bd1..d0740cd 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -49,6 +49,14 @@ ifeq ($(LINK_TARGET),) endif endif +ifeq ($(PROGRAM),coremark) +ifeq ($(CONFIGURATION),release) +ifeq ($(LINK_TARGET),) +LINK_TARGET = ramrodata +endif +endif +endif + ifeq ($(LINK_TARGET),) LINK_TARGET = default endif @@ -127,6 +135,15 @@ endif RISCV_XCFLAGS += -DDHRY_ITERS=$(TARGET_DHRY_ITERS) endif +ifeq ($(PROGRAM),coremark) +ifeq ($(RISCV_SERIES),sifive-7-series) +RISCV_XCFLAGS += -O2 -fno-common -funroll-loops -finline-functions -funroll-all-loops --param max-inline-insns-auto=20 -falign-functions=8 -falign-jumps=8 -falign-loops=8 --param inline-min-speedup=10 -mtune=sifive-7-series -ffast-math +else +RISCV_XCFLAGS += -O2 -fno-common -funroll-loops -finline-functions --param max-inline-insns-auto=20 -falign-functions=4 -falign-jumps=4 -falign-loops=4 --param inline-min-speedup=10 +endif +RISCV_XCFLAGS += -DITERATIONS=$(TARGET_CORE_ITERS) +endif + # Turn on garbage collection for unused sections RISCV_LDFLAGS += -Wl,--gc-sections # Turn on linker map file generation -- cgit v1.2.1-18-gbd029