From 542e448f17e6a2238367bf3caa90cc4ffd2fc054 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Thu, 22 Feb 2024 17:11:58 +0100 Subject: [PATCH 01/17] adds new bsp, updates stubs for mrns vp --- bare-metal-bsp | 2 +- hello-world/wrap_stubs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 1d55083..96fa7db 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 1d55083a554450075164af01810361dd37338930 +Subproject commit 96fa7db58704d2130040166eb30a8444f6f6ece5 diff --git a/hello-world/wrap_stubs.c b/hello-world/wrap_stubs.c index 0616f86..644e2d8 100644 --- a/hello-world/wrap_stubs.c +++ b/hello-world/wrap_stubs.c @@ -5,7 +5,7 @@ long time(void) { - return get_timer_value() / get_timer_freq(); + return get_timer_t1_value(timer) / get_timer_freq(); } // set the number of dhrystone iterations From aeef0f314ab6402728880ad6f3ed0edf9080a9c7 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 2 Mar 2024 16:11:24 +0100 Subject: [PATCH 02/17] updates bare-metal-bsp --- bare-metal-bsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 96fa7db..664dd67 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 96fa7db58704d2130040166eb30a8444f6f6ece5 +Subproject commit 664dd6774028452c8e1ef4721ca8828e58296247 From 6498091bfbac9680bb889d3068433680630ffc8a Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 14 Mar 2024 07:58:48 +0100 Subject: [PATCH 03/17] removes unused file --- hello-world/wrap_stubs.c | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 hello-world/wrap_stubs.c diff --git a/hello-world/wrap_stubs.c b/hello-world/wrap_stubs.c deleted file mode 100644 index 644e2d8..0000000 --- a/hello-world/wrap_stubs.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "platform.h" - -/* The functions in this file are only meant to support Dhrystone on an - * embedded RV32 system and are obviously incorrect in general. */ - -long time(void) -{ - return get_timer_t1_value(timer) / get_timer_freq(); -} - -// set the number of dhrystone iterations -void __wrap_scanf(const char* fmt, int* n) -{ - *n = 100000000; -} From 34764d3149e06690f6dd4b28ae44023c9b2e7320 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 14 Mar 2024 08:13:10 +0100 Subject: [PATCH 04/17] updates BSP --- bare-metal-bsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 664dd67..ab2b721 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 664dd6774028452c8e1ef4721ca8828e58296247 +Subproject commit ab2b7214fec518979cc25b561d6a0ce116b8f92c From fabf7cc588fe79848605a56d6285d7378bc2f7a5 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 19 Mar 2024 14:25:58 +0100 Subject: [PATCH 05/17] fixes env name for TGCP --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 726508c..63562eb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,7 +53,7 @@ pipeline { axes { axis{ name 'BOARD' - values 'iss', 'hifive1', 'TGC5L', 'ehrenberg', 'rtl', 'tgc-vp' + values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc-vp' } } stages { From d5c672c28853c5ab560b4b927995bfceb9faf6c3 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 07:38:40 +0100 Subject: [PATCH 06/17] 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; -//} From 6d33d0b0666b3a4ed122df87621d6028cb96b8e1 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 07:46:42 +0100 Subject: [PATCH 07/17] fixes wrone use of bsp in coremark --- benchmarks/coremark/tgc/ee_printf.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/benchmarks/coremark/tgc/ee_printf.c b/benchmarks/coremark/tgc/ee_printf.c index 5adcec2..062388f 100644 --- a/benchmarks/coremark/tgc/ee_printf.c +++ b/benchmarks/coremark/tgc/ee_printf.c @@ -16,7 +16,7 @@ limitations under the License. #include #include -#include "../../../bare-metal-bsp/libwrap/sys/puts.c" +#include "../../../bare-metal-bsp/libwrap/sys/write.c" #define ZEROPAD (1 << 0) /* Pad with zero */ #define SIGN (1 << 1) /* Unsigned/signed long */ @@ -660,23 +660,10 @@ ee_vsprintf(char *buf, const char *fmt, va_list args) return str - buf; } -#define UART0_BASE_ADDR 0xffff0000ULL - -#define UART_REG_TXFIFO 0x00 -#define UART_REG_RXFIFO 0x04 -#define UART_REG_TXCTRL 0x08 -#define UART_REG_RXCTRL 0x0c -#define UART_REG_IE 0x10 -#define UART_REG_IP 0x14 -#define UART_REG_DIV 0x18 -#define UART_TXEN 0x1 - -#define UART0_REG(ADDR) *((ee_u32*) (UART0_BASE_ADDR + ADDR)) - void uart_send_char(char c) { - __wrap_puts(c); + write(STDOUT_FILENO, &c, 1); } int From 2fb5920348bdf47b2dc1b258192279f2a29116f2 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 11:55:48 +0100 Subject: [PATCH 08/17] updates coremark portable part to match BSP --- benchmarks/coremark/tgc/core_portme.c | 1 + benchmarks/coremark/tgc/core_portme.mak | 4 ++-- benchmarks/coremark/tgc/ee_printf.c | 23 +++++++++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/benchmarks/coremark/tgc/core_portme.c b/benchmarks/coremark/tgc/core_portme.c index 56639c7..e986425 100644 --- a/benchmarks/coremark/tgc/core_portme.c +++ b/benchmarks/coremark/tgc/core_portme.c @@ -186,6 +186,7 @@ portable_init(core_portable *p, int *argc, char *argv[]) ee_printf("ERROR! Please define ee_u32 to a 32b unsigned type!\n"); } p->portable_id = 1; + ee_printf("portable_init finished.\n"); } /* Function : portable_fini Target specific final code diff --git a/benchmarks/coremark/tgc/core_portme.mak b/benchmarks/coremark/tgc/core_portme.mak index 8f08ae7..80032cc 100755 --- a/benchmarks/coremark/tgc/core_portme.mak +++ b/benchmarks/coremark/tgc/core_portme.mak @@ -42,7 +42,7 @@ AS = $(TRIPLET)-as # Flag : CFLAGS # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" 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 + -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" -I$(BSP_BASE)/env/$(BOARD) #Flag : LFLAGS_END @@ -52,7 +52,7 @@ SEPARATE_COMPILE=1 # Flag : SEPARATE_COMPILE # You must also define below how to create an object file, and how to link. OBJOUT = -o -LFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) +LFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -g #--specs=nano.specs -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) ASFLAGS = OFLAG = -o diff --git a/benchmarks/coremark/tgc/ee_printf.c b/benchmarks/coremark/tgc/ee_printf.c index 062388f..fc9e506 100644 --- a/benchmarks/coremark/tgc/ee_printf.c +++ b/benchmarks/coremark/tgc/ee_printf.c @@ -16,7 +16,6 @@ limitations under the License. #include #include -#include "../../../bare-metal-bsp/libwrap/sys/write.c" #define ZEROPAD (1 << 0) /* Pad with zero */ #define SIGN (1 << 1) /* Unsigned/signed long */ @@ -660,10 +659,30 @@ ee_vsprintf(char *buf, const char *fmt, va_list args) return str - buf; } +#include + void uart_send_char(char c) { - write(STDOUT_FILENO, &c, 1); +#if defined(BOARD_ehrenberg) + while (get_uart_rx_tx_reg_tx_free(uart)==0) ; + uart_write(uart, c); + if (c == '\n') { + while (get_uart_rx_tx_reg_tx_free(uart)==0) ; + uart_write(uart, '\r'); + } +#elif defined(BOARD_iss) + *((uint32_t*) 0xFFFF0000) = c; +#elif defined(BOARD_TGCP) + //TODO: implement +#else + while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ; + UART0_REG(UART_REG_TXFIFO) = c; + if (c == '\n') { + while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ; + UART0_REG(UART_REG_TXFIFO) = '\r'; + } +#endif } int From 06add2e20df720a68c5b5563d2da65392e5d3c0c Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 12:24:57 +0100 Subject: [PATCH 09/17] reduces dhrystone iterations to 20000 for reasonable RTL sim times --- bare-metal-bsp | 2 +- benchmarks/dhrystone/dhry_stubs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index e051cf1..d530473 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit e051cf180ec46fbbbdb99d28231f9700f45490d0 +Subproject commit d5304739fa8db6a3c16e417c9bc15b6fad749136 diff --git a/benchmarks/dhrystone/dhry_stubs.c b/benchmarks/dhrystone/dhry_stubs.c index 9dfdda0..cbaade5 100644 --- a/benchmarks/dhrystone/dhry_stubs.c +++ b/benchmarks/dhrystone/dhry_stubs.c @@ -11,7 +11,7 @@ long time(void) // set the number of dhrystone iterations void __wrap_scanf(const char* fmt, int* n) { - *n = 200000; + *n = 20000; } extern volatile uint32_t tohost; From a04e6d3c5b35dba6494729878a4aa0897ae1183e Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 20 Mar 2024 12:53:35 +0100 Subject: [PATCH 10/17] fixes TGCP settings in coremark port --- bare-metal-bsp | 2 +- benchmarks/coremark/tgc/core_portme.mak | 2 +- benchmarks/coremark/tgc/ee_printf.c | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index d530473..4d25972 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit d5304739fa8db6a3c16e417c9bc15b6fad749136 +Subproject commit 4d25972e4dd8f0053cc4fbd88be1b85f4b869cae diff --git a/benchmarks/coremark/tgc/core_portme.mak b/benchmarks/coremark/tgc/core_portme.mak index 80032cc..a0b9726 100755 --- a/benchmarks/coremark/tgc/core_portme.mak +++ b/benchmarks/coremark/tgc/core_portme.mak @@ -42,7 +42,7 @@ AS = $(TRIPLET)-as # Flag : CFLAGS # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" 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 -g + -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_$(BOARD) FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" -I$(BSP_BASE)/env/$(BOARD) #Flag : LFLAGS_END diff --git a/benchmarks/coremark/tgc/ee_printf.c b/benchmarks/coremark/tgc/ee_printf.c index fc9e506..8f983b0 100644 --- a/benchmarks/coremark/tgc/ee_printf.c +++ b/benchmarks/coremark/tgc/ee_printf.c @@ -673,8 +673,6 @@ uart_send_char(char c) } #elif defined(BOARD_iss) *((uint32_t*) 0xFFFF0000) = c; -#elif defined(BOARD_TGCP) - //TODO: implement #else while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ; UART0_REG(UART_REG_TXFIFO) = c; From 70ee11ad3de1fd3fb453106a422118ad87189ae3 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 21 Mar 2024 07:32:20 +0100 Subject: [PATCH 11/17] fixes coremark linker setting --- bare-metal-bsp | 2 +- benchmarks/coremark/tgc/core_portme.mak | 4 +++- benchmarks/dhrystone/Makefile | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 4d25972..3389875 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 4d25972e4dd8f0053cc4fbd88be1b85f4b869cae +Subproject commit 33898756434cc490557540dadbfc9bf1f0626d4d diff --git a/benchmarks/coremark/tgc/core_portme.mak b/benchmarks/coremark/tgc/core_portme.mak index a0b9726..2c4deea 100755 --- a/benchmarks/coremark/tgc/core_portme.mak +++ b/benchmarks/coremark/tgc/core_portme.mak @@ -25,6 +25,7 @@ else RISCV_ABI:=ilp32 endif BSP_BASE = ../../../bare-metal-bsp +LINKER_SCRIPT=link.lds TRIPLET?=riscv64-unknown-elf # Flag : OUTFLAG @@ -58,7 +59,8 @@ ASFLAGS = OFLAG = -o COUT = -c -LFLAGS_END = +LFLAGS_END = -T $(BSP_BASE)/env/$(BOARD)/$(LINKER_SCRIPT) + # Flag : PORT_SRCS # Port specific source files can be added here # You may also need cvt.c if the fcvt functions are not provided as intrinsics by your compiler! diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile index c82e0b3..4416463 100644 --- a/benchmarks/dhrystone/Makefile +++ b/benchmarks/dhrystone/Makefile @@ -5,7 +5,7 @@ ASM_SRCS := C_SRCS := dhry_stubs.c dhry_1.c dhry_2.c HEADERS := dhry.h -BOARD=iss +BOARD?=iss LINK_TARGET=link RISCV_ARCH:=rv32$(ISA) ifeq ($(ISA),e) From 749fab2c01a3032fcc1e04bd9dfad88560fc60a5 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 24 Mar 2024 19:16:24 +0100 Subject: [PATCH 12/17] WIP --- CMakeLists.txt | 2 +- bare-metal-bsp | 2 +- benchmarks/coremark/.gitignore | 3 +- benchmarks/coremark/Makefile | 36 +++ benchmarks/coremark/{tgc => }/core_portme.c | 0 benchmarks/coremark/{tgc => }/core_portme.h | 0 benchmarks/coremark/{tgc => }/cvt.c | 0 benchmarks/coremark/{tgc => }/ee_printf.c | 0 benchmarks/coremark/tgc/core_portme.mak | 104 --------- benchmarks/coremark/tgc/tgc.lds | 241 -------------------- 10 files changed, 40 insertions(+), 348 deletions(-) create mode 100644 benchmarks/coremark/Makefile rename benchmarks/coremark/{tgc => }/core_portme.c (100%) rename benchmarks/coremark/{tgc => }/core_portme.h (100%) rename benchmarks/coremark/{tgc => }/cvt.c (100%) rename benchmarks/coremark/{tgc => }/ee_printf.c (100%) delete mode 100755 benchmarks/coremark/tgc/core_portme.mak delete mode 100644 benchmarks/coremark/tgc/tgc.lds diff --git a/CMakeLists.txt b/CMakeLists.txt index cb6ffae..824bae2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,6 @@ add_custom_target(fw-dhrystone ALL USES_TERMINAL WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_custom_target(fw-coremark ALL - COMMAND make -C ${riscvfw_SOURCE_DIR}/benchmarks/coremark/cm PORT_DIR=../tgc BOARD=${BOARD} ISA=${ISA} + COMMAND make -C ${riscvfw_SOURCE_DIR}/benchmarks/coremark BOARD=${BOARD} ISA=${ISA} USES_TERMINAL WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/bare-metal-bsp b/bare-metal-bsp index 3389875..9a78fe2 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 33898756434cc490557540dadbfc9bf1f0626d4d +Subproject commit 9a78fe247376c056cac0e6f716b8ee2a34f46c1d diff --git a/benchmarks/coremark/.gitignore b/benchmarks/coremark/.gitignore index c97b44f..76a47f6 100644 --- a/benchmarks/coremark/.gitignore +++ b/benchmarks/coremark/.gitignore @@ -1,3 +1,4 @@ *.o *.elf -*.log \ No newline at end of file +*.log +/coremark.* diff --git a/benchmarks/coremark/Makefile b/benchmarks/coremark/Makefile new file mode 100644 index 0000000..ffc36d0 --- /dev/null +++ b/benchmarks/coremark/Makefile @@ -0,0 +1,36 @@ +TARGET := coremark +ISA?=imc +ITERATIONS?=0 + +ASM_SRCS := +C_SRCS := core_list_join.c core_main.c core_matrix.c core_state.c core_util.c core_portme.c ee_printf.c +HEADERS := cm/coremark.h + +vpath %.c cm + +BOARD?=iss +LINK_TARGET=link +RISCV_ARCH:=rv32$(ISA) +ifeq ($(ISA),e) + RISCV_ABI:=ilp32e +else + RISCV_ABI:=ilp32 +endif + +PORT_CFLAGS = -DPERFORMANCE_RUN=1 -DCLOCKS_PER_SEC=10000000 -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast +PORT_CFLAGS+= -g -O3 -fno-common -funroll-loops -finline-functions -falign-functions=16 -falign-jumps=4 -falign-loops=4 -finline-limit=1000 -fno-if-conversion2 -fselective-scheduling -fno-crossjumping -freorder-blocks-and-partition + +FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" + +CFLAGS = $(PORT_CFLAGS) -I. -Icm -DFLAGS_STR=\"$(FLAGS_STR)\" +CFLAGS += -DITERATIONS=$(ITERATIONS) +LDFLAGS := -g -Wl,--wrap=scanf -Wl,--wrap=printf -Wl,--wrap=exit -lgcc -lm + +TOOL_DIR=$(dir $(compiler)) + +BSP_BASE = ../../bare-metal-bsp +include $(BSP_BASE)/env/common-gcc.mk + + +#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -I../tgc -I. -DFLAGS_STR=\""-march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -DPERFORMANCE_RUN=1 -T ../../../bare-metal-bsp/env/TGCP/link.lds"\" -I../../../bare-metal-bsp/env/TGCP -DITERATIONS=0 -DPERFORMANCE_RUN=1 -c ../tgc/ee_printf.c -o ee_printf.o +#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -g ./core_list_join.o ./core_main.o ./core_matrix.o ./core_state.o ./core_util.o ./core_portme.o ./ee_printf.o -o ./coremark.elf -T ../../../bare-metal-bsp/env/TGCP/link.lds diff --git a/benchmarks/coremark/tgc/core_portme.c b/benchmarks/coremark/core_portme.c similarity index 100% rename from benchmarks/coremark/tgc/core_portme.c rename to benchmarks/coremark/core_portme.c diff --git a/benchmarks/coremark/tgc/core_portme.h b/benchmarks/coremark/core_portme.h similarity index 100% rename from benchmarks/coremark/tgc/core_portme.h rename to benchmarks/coremark/core_portme.h diff --git a/benchmarks/coremark/tgc/cvt.c b/benchmarks/coremark/cvt.c similarity index 100% rename from benchmarks/coremark/tgc/cvt.c rename to benchmarks/coremark/cvt.c diff --git a/benchmarks/coremark/tgc/ee_printf.c b/benchmarks/coremark/ee_printf.c similarity index 100% rename from benchmarks/coremark/tgc/ee_printf.c rename to benchmarks/coremark/ee_printf.c diff --git a/benchmarks/coremark/tgc/core_portme.mak b/benchmarks/coremark/tgc/core_portme.mak deleted file mode 100755 index 2c4deea..0000000 --- a/benchmarks/coremark/tgc/core_portme.mak +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Original Author: Shay Gal-on - -#File : core_portme.mak -ISA?=imc -BOARD?=iss - -RISCV_ARCH:=rv32$(ISA)_zicsr_zifencei -ifeq ($(ISA),e) - RISCV_ABI:=ilp32e -else - RISCV_ABI:=ilp32 -endif -BSP_BASE = ../../../bare-metal-bsp -LINKER_SCRIPT=link.lds - -TRIPLET?=riscv64-unknown-elf -# Flag : OUTFLAG -# Use this flag to define how to to get an executable (e.g -o) -OUTFLAG= -o -# Flag : CC -# Use this flag to define compiler to use -CC = $(TRIPLET)-gcc -# Flag : LD -# Use this flag to define compiler to use -LD = $(TRIPLET)-gcc -# Flag : AS -# Use this flag to define compiler to use -AS = $(TRIPLET)-as -# Flag : CFLAGS -# Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" -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 -g -DBOARD_$(BOARD) -FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" -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. -SEPARATE_COMPILE=1 -# Flag : SEPARATE_COMPILE -# You must also define below how to create an object file, and how to link. -OBJOUT = -o -LFLAGS = -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -g -#--specs=nano.specs -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -ASFLAGS = -OFLAG = -o -COUT = -c - -LFLAGS_END = -T $(BSP_BASE)/env/$(BOARD)/$(LINKER_SCRIPT) - -# Flag : PORT_SRCS -# Port specific source files can be added here -# You may also need cvt.c if the fcvt functions are not provided as intrinsics by your compiler! -PORT_SRCS = $(PORT_DIR)/core_portme.c $(PORT_DIR)/ee_printf.c -vpath %.c $(PORT_DIR) -vpath %.s $(PORT_DIR) -PORT_OBJS = core_portme.o ee_printf.o -# Flag : LOAD -# For a simple port, we assume self hosted compile and run, no load needed. - -# Flag : RUN -# For a simple port, we assume self hosted compile and run, simple invocation of the executable - -LOAD = echo "" -RUN = echo "" - -OEXT = .o -EXE = .elf - -$(OPATH)$(PORT_DIR)/%$(OEXT) : %.c - $(CC) $(CFLAGS) $(XCFLAGS) $(COUT) $< $(OBJOUT) $@ - -$(OPATH)%$(OEXT) : %.c - $(CC) $(CFLAGS) $(XCFLAGS) $(COUT) $< $(OBJOUT) $@ - -$(OPATH)$(PORT_DIR)/%$(OEXT) : %.s - $(AS) $(ASFLAGS) $< $(OBJOUT) $@ - -# Target : port_pre% and port_post% -# For the purpose of this simple port, no pre or post steps needed. - -.PHONY : port_prebuild port_postbuild port_prerun port_postrun port_preload port_postload -port_pre% port_post% : - -# FLAG : OPATH -# Path to the output folder. Default - current folder. -OPATH = ./ -MKDIR = mkdir -p - -dist-clean: clean - rm -f *.o diff --git a/benchmarks/coremark/tgc/tgc.lds b/benchmarks/coremark/tgc/tgc.lds deleted file mode 100644 index 08de74d..0000000 --- a/benchmarks/coremark/tgc/tgc.lds +++ /dev/null @@ -1,241 +0,0 @@ -OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv", "elf32-littleriscv") -OUTPUT_ARCH(riscv) -MEMORY -{ - RAM (rwx) : ORIGIN = 0x0, LENGTH = 128M -} - -ENTRY(_start) - -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - .interp : { *(.interp) } - .note.gnu.build-id : { *(.note.gnu.build-id) } - .hash : { *(.hash) } - .gnu.hash : { *(.gnu.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rela.dyn : - { - *(.rela.init) - *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) - *(.rela.fini) - *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) - *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) - *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) - *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) - *(.rela.ctors) - *(.rela.dtors) - *(.rela.got) - *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) - *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) - *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) - *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) - *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) - PROVIDE_HIDDEN (__rela_iplt_start = .); - *(.rela.iplt) - PROVIDE_HIDDEN (__rela_iplt_end = .); - } - .rela.plt : - { - *(.rela.plt) - } - .plt : { *(.plt) } - .iplt : { *(.iplt) } - .init : - { - KEEP (*(SORT_NONE(.init))) - *crt0.o(.text .text.*) - } > RAM - .text : - { - *(.text.init) - *(.text.unlikely .text.*_unlikely .text.unlikely.*) - *(.text.exit .text.exit.*) - *(.text.startup .text.startup.*) - *(.text.hot .text.hot.*) - *(.text .stub .text.* .gnu.linkonce.t.*) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } - .fini : - { - KEEP (*(SORT_NONE(.fini))) - } - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } - .sdata2 : - { - *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) - } - .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } - .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } - .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } - /* These sections are generated by the Sun/Oracle C++ compiler. */ - .exception_ranges : ONLY_IF_RO { *(.exception_ranges*) } - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. */ - . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); - /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } - .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } - .exception_ranges : ONLY_IF_RW { *(.exception_ranges*) } - /* Thread Local Storage sections */ - .tdata : - { - PROVIDE_HIDDEN (__tdata_start = .); - *(.tdata .tdata.* .gnu.linkonce.td.*) - } - .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) - KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) - PROVIDE_HIDDEN (__init_array_end = .); - } - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) - KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) - PROVIDE_HIDDEN (__fini_array_end = .); - } - .ctors : - { - /* gcc uses crtbegin.o to find the start of - the constructors, so we make sure it is - first. Because this is a wildcard, it - doesn't matter if the user does not - actually link against crtbegin.o; the - linker won't look for a file to match a - wildcard. The wildcard also means that it - doesn't matter which directory crtbegin.o - is in. */ - KEEP (*crtbegin.o(.ctors)) - KEEP (*crtbegin?.o(.ctors)) - /* We don't want to include the .ctor section from - the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - } - .dtors : - { - KEEP (*crtbegin.o(.dtors)) - KEEP (*crtbegin?.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - } - .jcr : { KEEP (*(.jcr)) } - .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) } - .dynamic : { *(.dynamic) } - . = DATA_SEGMENT_RELRO_END (0, .); - .data : - { - __DATA_BEGIN__ = .; - *(.data .data.* .gnu.linkonce.d.*) - SORT(CONSTRUCTORS) - } - .data1 : { *(.data1) } - .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) } - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : - { - __SDATA_BEGIN__ = .; - *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) - *(.sdata .sdata.* .gnu.linkonce.s.*) - } - _edata = .; PROVIDE (edata = .); - . = .; - __bss_start = .; - .sbss : - { - *(.dynsbss) - *(.sbss .sbss.* .gnu.linkonce.sb.*) - *(.scommon) - } - .bss : - { - *(.dynbss) - *(.bss .bss.* .gnu.linkonce.b.*) - *(COMMON) - /* Align here to ensure that the .bss section occupies space up to - _end. Align after .bss to ensure correct alignment even if the - .bss section disappears because there are no input sections. - FIXME: Why do we need it? When there is no .bss section, we do not - pad the .data section. */ - . = ALIGN(. != 0 ? 32 / 8 : 1); - } - . = ALIGN(32 / 8); - . = SEGMENT_START("ldata-segment", .); - . = ALIGN(32 / 8); - __BSS_END__ = .; - __global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800, - MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800)); - _end = .; PROVIDE (end = .); - . = DATA_SEGMENT_END (.); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* DWARF 3 */ - .debug_pubtypes 0 : { *(.debug_pubtypes) } - .debug_ranges 0 : { *(.debug_ranges) } - /* DWARF Extension. */ - .debug_macro 0 : { *(.debug_macro) } - .debug_addr 0 : { *(.debug_addr) } - .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } - /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } -} From 45b6f24dfcbe47e7da076b7b3e9124f8dd11aee2 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 24 Mar 2024 21:10:19 +0100 Subject: [PATCH 13/17] changes coremark build system to use BSP --- bare-metal-bsp | 2 +- benchmarks/coremark/Makefile | 7 ++----- benchmarks/dhrystone/Makefile | 3 ++- benchmarks/dhrystone/dhry_stubs.c | 5 ++++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 9a78fe2..ef001e5 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 9a78fe247376c056cac0e6f716b8ee2a34f46c1d +Subproject commit ef001e55e8973799bc1b3b204b93708976b1e693 diff --git a/benchmarks/coremark/Makefile b/benchmarks/coremark/Makefile index ffc36d0..4586e49 100644 --- a/benchmarks/coremark/Makefile +++ b/benchmarks/coremark/Makefile @@ -1,6 +1,6 @@ TARGET := coremark ISA?=imc -ITERATIONS?=0 +ITERATIONS?=400 ASM_SRCS := C_SRCS := core_list_join.c core_main.c core_matrix.c core_state.c core_util.c core_portme.c ee_printf.c @@ -10,6 +10,7 @@ vpath %.c cm BOARD?=iss LINK_TARGET=link + RISCV_ARCH:=rv32$(ISA) ifeq ($(ISA),e) RISCV_ABI:=ilp32e @@ -30,7 +31,3 @@ TOOL_DIR=$(dir $(compiler)) BSP_BASE = ../../bare-metal-bsp include $(BSP_BASE)/env/common-gcc.mk - - -#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -I../tgc -I. -DFLAGS_STR=\""-march=rv32imc_zicsr_zifencei -mabi=ilp32 -O3 -DCLOCKS_PER_SEC=10000000 -nostdlib -nostartfiles -nodefaultlibs -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las -flto -g -DBOARD_TGCP -DPERFORMANCE_RUN=1 -T ../../../bare-metal-bsp/env/TGCP/link.lds"\" -I../../../bare-metal-bsp/env/TGCP -DITERATIONS=0 -DPERFORMANCE_RUN=1 -c ../tgc/ee_printf.c -o ee_printf.o -#riscv64-unknown-elf-gcc -march=rv32imc_zicsr_zifencei -mabi=ilp32 -g ./core_list_join.o ./core_main.o ./core_matrix.o ./core_state.o ./core_util.o ./core_portme.o ./ee_printf.o -o ./coremark.elf -T ../../../bare-metal-bsp/env/TGCP/link.lds diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile index 4416463..a1f01e0 100644 --- a/benchmarks/dhrystone/Makefile +++ b/benchmarks/dhrystone/Makefile @@ -1,5 +1,6 @@ TARGET := dhrystone ISA?=imc +ITERATIONS?=20000 ASM_SRCS := C_SRCS := dhry_stubs.c dhry_1.c dhry_2.c @@ -14,7 +15,7 @@ else RISCV_ABI:=ilp32 endif # '-lgcc -lm' are needed to add softfloat routines -CFLAGS := -g -march=$(RISCV_ARCH)_zicsr_zifencei -mabi=$(RISCV_ABI) -mcmodel=medlow -O3 -DHZ=32768 -DTIME -DNO_INIT -fno-inline -fno-builtin-printf -fno-common -Wno-implicit \ +CFLAGS := -g -march=$(RISCV_ARCH)_zicsr_zifencei -mabi=$(RISCV_ABI) -mcmodel=medlow -O3 -DITERATIONS=$(ITERATIONS) -DHZ=32768 -DTIME -DNO_INIT -fno-inline -fno-builtin-printf -fno-common -Wno-implicit \ -funroll-loops -fpeel-loops -fgcse-sm -fgcse-las LDFLAGS := -g -march=$(RISCV_ARCH)_zicsr_zifencei -mabi=$(RISCV_ABI) -mcmodel=medlow -Wl,--wrap=scanf -Wl,--wrap=printf -Wl,--wrap=exit -lgcc -lm diff --git a/benchmarks/dhrystone/dhry_stubs.c b/benchmarks/dhrystone/dhry_stubs.c index cbaade5..a3e7b7c 100644 --- a/benchmarks/dhrystone/dhry_stubs.c +++ b/benchmarks/dhrystone/dhry_stubs.c @@ -1,4 +1,7 @@ #include "platform.h" +#ifndef ITERATIONS +#define ITERATIONS 20000 +#endif /* The functions in this file are only meant to support Dhrystone on an * embedded RV32 system and are obviously incorrect in general. */ @@ -11,7 +14,7 @@ long time(void) // set the number of dhrystone iterations void __wrap_scanf(const char* fmt, int* n) { - *n = 20000; + *n = ITERATIONS; } extern volatile uint32_t tohost; From 877672a5a4c4aa39d210abe923c88159942c1bcd Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 25 Mar 2024 10:56:34 +0100 Subject: [PATCH 14/17] fixes iterations count for benchmarks --- bare-metal-bsp | 2 +- benchmarks/coremark/Makefile | 2 +- benchmarks/dhrystone/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index ef001e5..7218dcf 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit ef001e55e8973799bc1b3b204b93708976b1e693 +Subproject commit 7218dcfa692d18020c11d4e704b0932bd93804dd diff --git a/benchmarks/coremark/Makefile b/benchmarks/coremark/Makefile index 4586e49..aefcba6 100644 --- a/benchmarks/coremark/Makefile +++ b/benchmarks/coremark/Makefile @@ -1,6 +1,6 @@ TARGET := coremark ISA?=imc -ITERATIONS?=400 +ITERATIONS?=600 # 300 for TGC ASM_SRCS := C_SRCS := core_list_join.c core_main.c core_matrix.c core_state.c core_util.c core_portme.c ee_printf.c diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile index a1f01e0..ce88108 100644 --- a/benchmarks/dhrystone/Makefile +++ b/benchmarks/dhrystone/Makefile @@ -1,6 +1,6 @@ TARGET := dhrystone ISA?=imc -ITERATIONS?=20000 +ITERATIONS?=50000 # 20000 for TGC ASM_SRCS := C_SRCS := dhry_stubs.c dhry_1.c dhry_2.c From cfb50381966ccdc0e4a989289677a95d556785e2 Mon Sep 17 00:00:00 2001 From: "Eyck-Alexander Jentzsch (im vscode container)" Date: Tue, 9 Apr 2024 10:58:52 +0000 Subject: [PATCH 15/17] Adds instructions for bear --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9e9abe5..d296598 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Firmware +Using `make clean && bear -- make ` will cause a correct compile_commands.json to be emitted. This allows using completion tools like clangd. \ No newline at end of file From 48b2f773d07eb706303f9e5cbdaaf9c7f4942665 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 15 Apr 2024 12:19:53 +0200 Subject: [PATCH 16/17] updates submodule and Jenkins accordingly --- Jenkinsfile | 4 ++-- bare-metal-bsp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 63562eb..e72d321 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,13 +47,13 @@ pipeline { stage('make TGC5L') {steps { make_hello("TGC5L")}} stage('make rtl') {steps { make_hello("rtl")}} stage('make ehrenberg') {steps { make_hello("ehrenberg")}} - stage('make tgc-vp') {steps { make_hello("tgc-vp")}}*/ + stage('make tgc_vp') {steps { make_hello("tgc_vp")}}*/ stage('make hello-world') { matrix { axes { axis{ name 'BOARD' - values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc-vp' + values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc_vp' } } stages { diff --git a/bare-metal-bsp b/bare-metal-bsp index 7218dcf..71c7fd6 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 7218dcfa692d18020c11d4e704b0932bd93804dd +Subproject commit 71c7fd698176a45313b50428905837b444050aa9 From 6d33f6b29d1c824f8f829e324939c51f9cd383b1 Mon Sep 17 00:00:00 2001 From: stas Date: Wed, 17 Apr 2024 08:35:43 +0200 Subject: [PATCH 17/17] merge develop to main in bare-metal-bsp --- bare-metal-bsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bare-metal-bsp b/bare-metal-bsp index 71c7fd6..87dc0ec 160000 --- a/bare-metal-bsp +++ b/bare-metal-bsp @@ -1 +1 @@ -Subproject commit 71c7fd698176a45313b50428905837b444050aa9 +Subproject commit 87dc0ec2304adcb94a25b397a357aadae1304867