From d5c672c28853c5ab560b4b927995bfceb9faf6c3 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 07:38:40 +0100 Subject: [PATCH] updates coremark build system to use BSP definitions --- bare-metal-bsp | 2 +- benchmarks/coremark/tgc/core_portme.mak | 12 ++++++++++-- benchmarks/coremark/tgc/ee_printf.c | 4 ++-- benchmarks/dhrystone/Makefile | 2 +- benchmarks/dhrystone/dhry_printf.c | 15 --------------- 5 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 benchmarks/dhrystone/dhry_printf.c diff --git a/bare-metal-bsp b/bare-metal-bsp index ab2b721..e051cf1 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit ab2b7214fec518979cc25b561d6a0ce116b8f92c +Subproject commit e051cf180ec46fbbbdb99d28231f9700f45490d0 diff --git a/benchmarks/coremark/tgc/core_portme.mak b/benchmarks/coremark/tgc/core_portme.mak index 8dcac1c..8f08ae7 100755 --- a/benchmarks/coremark/tgc/core_portme.mak +++ b/benchmarks/coremark/tgc/core_portme.mak @@ -16,8 +16,16 @@ #File : core_portme.mak ISA?=imc +BOARD?=iss + RISCV_ARCH:=rv32$(ISA)_zicsr_zifencei -RISCV_ABI:=ilp32 +ifeq ($(ISA),e) + RISCV_ABI:=ilp32e +else + RISCV_ABI:=ilp32 +endif +BSP_BASE = ../../../bare-metal-bsp + TRIPLET?=riscv64-unknown-elf # Flag : OUTFLAG # Use this flag to define how to to get an executable (e.g -o) @@ -36,7 +44,7 @@ AS = $(TRIPLET)-as PORT_CFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs \ -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" -CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" +CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" -I$(BSP_BASE)/env/$(BOARD) #Flag : LFLAGS_END # Define any libraries needed for linking or other flags that should come at the end of the link line (e.g. linker scripts). # Note : On certain platforms, the default clock_gettime implementation is supported but requires linking of librt. diff --git a/benchmarks/coremark/tgc/ee_printf.c b/benchmarks/coremark/tgc/ee_printf.c index 161f582..5adcec2 100644 --- a/benchmarks/coremark/tgc/ee_printf.c +++ b/benchmarks/coremark/tgc/ee_printf.c @@ -16,6 +16,7 @@ limitations under the License. #include #include +#include "../../../bare-metal-bsp/libwrap/sys/puts.c" #define ZEROPAD (1 << 0) /* Pad with zero */ #define SIGN (1 << 1) /* Unsigned/signed long */ @@ -675,8 +676,7 @@ ee_vsprintf(char *buf, const char *fmt, va_list args) void uart_send_char(char c) { - while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ; - UART0_REG(UART_REG_TXFIFO) = (unsigned char)c; + __wrap_puts(c); } int diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile index 2c867e9..c82e0b3 100644 --- a/benchmarks/dhrystone/Makefile +++ b/benchmarks/dhrystone/Makefile @@ -2,7 +2,7 @@ TARGET := dhrystone ISA?=imc ASM_SRCS := -C_SRCS := dhry_stubs.c dhry_printf.c dhry_1.c dhry_2.c +C_SRCS := dhry_stubs.c dhry_1.c dhry_2.c HEADERS := dhry.h BOARD=iss diff --git a/benchmarks/dhrystone/dhry_printf.c b/benchmarks/dhrystone/dhry_printf.c deleted file mode 100644 index d1c6b0c..0000000 --- a/benchmarks/dhrystone/dhry_printf.c +++ /dev/null @@ -1,15 +0,0 @@ -/* The functions in this file are only meant to support Dhrystone on an - * embedded RV32 system and are obviously incorrect in general. */ - -#include -#include -#include -#include -#include -#include - -//#undef putchar -//int putchar(int ch) -//{ -// return write(1, &ch, 1) == 1 ? ch : -1; -//}