From 8545fe09d0adcb220696cfa081dd7fe02a6e66a4 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:46:18 +0100 Subject: [PATCH 1/9] Update to cope with last GCC version (14++). Signed-off-by: Pascal Gouedo --- cv32e40p/tests/programs/custom/matmul_32b_float/test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv32e40p/tests/programs/custom/matmul_32b_float/test.c b/cv32e40p/tests/programs/custom/matmul_32b_float/test.c index 0bdbd3e3fb..e9d3bfb2ed 100644 --- a/cv32e40p/tests/programs/custom/matmul_32b_float/test.c +++ b/cv32e40p/tests/programs/custom/matmul_32b_float/test.c @@ -76,9 +76,9 @@ int main() static volatile int nb_cycles; int error = 0; - float *A = A_int; - float *B = B_int; - float *C = C_int; + float *A = (float *)A_int; + float *B = (float *)B_int; + float *C = (float *)C_int; volatile float fdiv; From 67593dcf306309dc6c30bbc1a9573f3a603c58d4 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:49:18 +0100 Subject: [PATCH 2/9] Removal of save-restore compiler option which degrades Coremark performances. Signed-off-by: Pascal Gouedo --- cv32e40p/tests/programs/custom/coremark/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/cv32e40p/tests/programs/custom/coremark/test.yaml b/cv32e40p/tests/programs/custom/coremark/test.yaml index 64b6f00651..766c742cae 100644 --- a/cv32e40p/tests/programs/custom/coremark/test.yaml +++ b/cv32e40p/tests/programs/custom/coremark/test.yaml @@ -4,7 +4,6 @@ default_cflags: > -O3 -mabi=ilp32 -march=$(RISCV_MARCH) - -msave-restore -falign-functions=16 -funroll-all-loops -falign-jumps=4 From ba08ce15d25a3689703fdcdf753d300c40c43ea9 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:52:28 +0100 Subject: [PATCH 3/9] Some updates in Embench default/v1 and pulp config. Replacement of TB timer by internal cycle counter to be platform independent. Signed-off-by: Pascal Gouedo --- .../embench/config/corev32/chips/size/chip.cfg | 2 +- .../config/corev32/chips/size/chipsupport.c | 5 ++--- .../config/corev32/chips/size/chipsupport.h | 2 -- .../config/corev32/chips/speed/chip.cfg | 4 ++-- .../config/corev32/chips/speed/chipsupport.c | 18 +++++++++++++----- .../config/corev32/chips/speed/chipsupport.h | 2 -- .../config/corev32_pulp/chips/size/chip.cfg | 4 ++-- .../corev32_pulp/chips/size/chipsupport.c | 5 ++--- .../corev32_pulp/chips/size/chipsupport.h | 2 -- .../config/corev32_pulp/chips/speed/chip.cfg | 4 ++-- .../corev32_pulp/chips/speed/chipsupport.c | 18 +++++++++++++----- .../corev32_pulp/chips/speed/chipsupport.h | 2 -- 12 files changed, 37 insertions(+), 31 deletions(-) diff --git a/cv32e40p/tests/embench/config/corev32/chips/size/chip.cfg b/cv32e40p/tests/embench/config/corev32/chips/size/chip.cfg index ca520cb6a4..25b067cf5c 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/size/chip.cfg +++ b/cv32e40p/tests/embench/config/corev32/chips/size/chip.cfg @@ -76,7 +76,7 @@ # - we garbage collect unused sections on linking cflags = [ - '-c', '-Os', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imc_zicsr' + '-c', '-Os', '-ffunction-sections', '-msave-restore', '-mabi=ilp32', '-march=rv32imc_zicsr' ] ldflags = [ diff --git a/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.c b/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.c index c540d4ad43..35346e4469 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.c +++ b/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.c @@ -19,6 +19,7 @@ #include #include +#include #include "chipsupport.h" void @@ -31,8 +32,6 @@ initialise_board () void __attribute__ ((noinline)) __attribute__ ((externally_visible)) start_trigger () { - - __asm__ volatile ("li a0, 0" : : : "memory"); } @@ -41,4 +40,4 @@ stop_trigger () { } - \ No newline at end of file + diff --git a/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.h b/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.h index 72a58c8a31..bd174c3151 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.h +++ b/cv32e40p/tests/embench/config/corev32/chips/size/chipsupport.h @@ -22,6 +22,4 @@ #define CPU_MHZ 1 -#define TICKS_ADDR (*((volatile uint32_t*)0x15001004)) - #endif diff --git a/cv32e40p/tests/embench/config/corev32/chips/speed/chip.cfg b/cv32e40p/tests/embench/config/corev32/chips/speed/chip.cfg index da0600a653..76a1ff3407 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/speed/chip.cfg +++ b/cv32e40p/tests/embench/config/corev32/chips/speed/chip.cfg @@ -76,11 +76,11 @@ # - we garbage collect unused sections on linking cflags = [ - '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32im_zicsr' + '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imc_zicsr' ] ldflags = [ - '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32im_zicsr' + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32imc_zicsr' ] user_libs = ['-lm'] diff --git a/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.c b/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.c index d3c89e72b7..b3ed4582cd 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.c +++ b/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.c @@ -19,8 +19,13 @@ #include #include +#include #include "chipsupport.h" +extern void _exit(); + +static uint32_t start_time, stop_time; + void initialise_board () { @@ -32,20 +37,23 @@ void __attribute__ ((noinline)) __attribute__ ((externally_visible)) start_trigger () { printf("start of test \n"); - //reset cycle counter - TICKS_ADDR = 0; - + + // Enable mcycle counter and read value + __asm__ volatile("csrci mcountinhibit, 0x1"); // mcountinhibit.cy = 0 + __asm__ volatile("rdcycle %0" : "=r"(start_time)); + __asm__ volatile ("li a0, 0" : : : "memory"); } void __attribute__ ((noinline)) __attribute__ ((externally_visible)) stop_trigger () { - uint32_t cycle_cnt = TICKS_ADDR; + __asm__ volatile("rdcycle %0" : "=r"(stop_time)); + uint32_t cycle_cnt = stop_time - start_time; printf("end of test \n"); printf("Result is given in CPU cycles \n"); printf("RES: %d \n", cycle_cnt); _exit(0); } - \ No newline at end of file + diff --git a/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.h b/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.h index 72a58c8a31..bd174c3151 100644 --- a/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.h +++ b/cv32e40p/tests/embench/config/corev32/chips/speed/chipsupport.h @@ -22,6 +22,4 @@ #define CPU_MHZ 1 -#define TICKS_ADDR (*((volatile uint32_t*)0x15001004)) - #endif diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chip.cfg index 458cfe11f0..69dd49cc2c 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chip.cfg +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chip.cfg @@ -76,11 +76,11 @@ # - we garbage collect unused sections on linking cflags = [ - '-c', '-Os', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imc_zicsr_zifencei_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' + '-c', '-Os', '-ffunction-sections', '-msave-restore', '-mabi=ilp32', '-march=rv32imc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' ] ldflags = [ - '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-nostdlib', '-mabi=ilp32', '-march=rv32imc_zicsr_zifencei_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-nostdlib', '-mabi=ilp32', '-march=rv32imc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' ] dummy_libs = ['crt0', 'libm', 'libc', 'libgcc'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.c index c540d4ad43..35346e4469 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.c +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.c @@ -19,6 +19,7 @@ #include #include +#include #include "chipsupport.h" void @@ -31,8 +32,6 @@ initialise_board () void __attribute__ ((noinline)) __attribute__ ((externally_visible)) start_trigger () { - - __asm__ volatile ("li a0, 0" : : : "memory"); } @@ -41,4 +40,4 @@ stop_trigger () { } - \ No newline at end of file + diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.h index 72a58c8a31..bd174c3151 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.h +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/size/chipsupport.h @@ -22,6 +22,4 @@ #define CPU_MHZ 1 -#define TICKS_ADDR (*((volatile uint32_t*)0x15001004)) - #endif diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chip.cfg index 434b05a4e5..2b95b0b98a 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chip.cfg +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chip.cfg @@ -76,11 +76,11 @@ # - we garbage collect unused sections on linking cflags = [ - '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32im_zicsr_zifencei_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' + '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' ] ldflags = [ - '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32im_zicsr_zifencei_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32imc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' ] user_libs = ['-lm'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.c index d3c89e72b7..b3ed4582cd 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.c +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.c @@ -19,8 +19,13 @@ #include #include +#include #include "chipsupport.h" +extern void _exit(); + +static uint32_t start_time, stop_time; + void initialise_board () { @@ -32,20 +37,23 @@ void __attribute__ ((noinline)) __attribute__ ((externally_visible)) start_trigger () { printf("start of test \n"); - //reset cycle counter - TICKS_ADDR = 0; - + + // Enable mcycle counter and read value + __asm__ volatile("csrci mcountinhibit, 0x1"); // mcountinhibit.cy = 0 + __asm__ volatile("rdcycle %0" : "=r"(start_time)); + __asm__ volatile ("li a0, 0" : : : "memory"); } void __attribute__ ((noinline)) __attribute__ ((externally_visible)) stop_trigger () { - uint32_t cycle_cnt = TICKS_ADDR; + __asm__ volatile("rdcycle %0" : "=r"(stop_time)); + uint32_t cycle_cnt = stop_time - start_time; printf("end of test \n"); printf("Result is given in CPU cycles \n"); printf("RES: %d \n", cycle_cnt); _exit(0); } - \ No newline at end of file + diff --git a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.h index 72a58c8a31..bd174c3151 100644 --- a/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.h +++ b/cv32e40p/tests/embench/config/corev32_pulp/chips/speed/chipsupport.h @@ -22,6 +22,4 @@ #define CPU_MHZ 1 -#define TICKS_ADDR (*((volatile uint32_t*)0x15001004)) - #endif From ed85c850c81f64eb618170ee3ea072723c1bfe57 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:53:15 +0100 Subject: [PATCH 4/9] Addition of Embench v2 pulp fpu config. Signed-off-by: Pascal Gouedo --- .../embench/config/corev32_pulp_fpu/arch.cfg | 67 ++++++++++++++ .../boards/corev32_pulp_fpu/board.cfg | 69 +++++++++++++++ .../boards/corev32_pulp_fpu/boardsupport.c | 21 +++++ .../boards/corev32_pulp_fpu/boardsupport.h | 21 +++++ .../corev32_pulp_fpu/chips/size/chip.cfg | 86 ++++++++++++++++++ .../corev32_pulp_fpu/chips/size/chipsupport.c | 55 ++++++++++++ .../corev32_pulp_fpu/chips/size/chipsupport.h | 25 ++++++ .../corev32_pulp_fpu/chips/speed/chip.cfg | 87 +++++++++++++++++++ .../chips/speed/chipsupport.c | 71 +++++++++++++++ .../chips/speed/chipsupport.h | 25 ++++++ 10 files changed, 527 insertions(+) create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/arch.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/board.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.h create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chip.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.h create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chip.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.h diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/arch.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu/arch.cfg new file mode 100644 index 0000000000..0583bdfe6e --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/arch.cfg @@ -0,0 +1,67 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the architecture. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/board.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/board.cfg new file mode 100644 index 0000000000..5d7d45435f --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/board.cfg @@ -0,0 +1,69 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the board. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +cpu_mhz = 1 diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.c new file mode 100644 index 0000000000..f2e674dea5 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.c @@ -0,0 +1,21 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include "boardsupport.h" + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.h new file mode 100644 index 0000000000..6223cd6846 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/boards/corev32_pulp_fpu/boardsupport.h @@ -0,0 +1,21 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + + + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chip.cfg new file mode 100644 index 0000000000..faedb24457 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chip.cfg @@ -0,0 +1,86 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the chip. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +# This is the generic framework for compilers, where the only common set up +# is: + +# '-c' is used to specify generation of object files when compiling a + +# each global data and function is put in its own section + +# - we garbage collect unused sections on linking + +cflags = [ + '-c', '-Os', '-ffunction-sections', '-msave-restore', '-mabi=ilp32', '-march=rv32imafc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +ldflags = [ + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-nostdlib', '-mabi=ilp32', '-march=rv32imafc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +dummy_libs = ['crt0', 'libm', 'libc', 'libgcc'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.c new file mode 100644 index 0000000000..7a60c2cebe --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.c @@ -0,0 +1,55 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include +#include +#include +#include "chipsupport.h" + +static uint32_t start_time, stop_time; + +void +initialise_board () +{ + printf("Initialize board corev32 \n"); + __asm__ volatile ("li a0, 0" : : : "memory"); + + printf("Initialize mstatus.fs to intial \n"); + + unsigned int fs = 0x00002000; + + asm volatile("csrs mstatus, %0;" + "csrwi fcsr, 0;" + "csrs mstatus, %0;" + : : "r"(fs) + ); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +start_trigger () +{ + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +stop_trigger () +{ + +} + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.h new file mode 100644 index 0000000000..bd174c3151 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/size/chipsupport.h @@ -0,0 +1,25 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#ifndef CHIPSUPPORT_H +#define CHIPSUPPORT_H + +#define CPU_MHZ 1 + +#endif diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chip.cfg new file mode 100644 index 0000000000..37165dd48a --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chip.cfg @@ -0,0 +1,87 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the chip. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +# This is the generic framework for compilers, where the only common set up +# is: + +# '-c' is used to specify generation of object files when compiling a + +# each global data and function is put in its own section + +# - we garbage collect unused sections on linking + +cflags = [ + '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imafc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +ldflags = [ + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32imafc_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] +user_libs = ['-lm'] + +#dummy_libs = ['libm'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.c new file mode 100644 index 0000000000..7c7de45ad8 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.c @@ -0,0 +1,71 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include +#include +#include +#include "chipsupport.h" + +extern void _exit(); + +static uint32_t start_time, stop_time; + +static uint32_t start_time, stop_time; + +void +initialise_board () +{ + printf("Initialize board corev32 \n"); + __asm__ volatile ("li a0, 0" : : : "memory"); + + printf("Initialize mstatus.fs to intial \n"); + + unsigned int fs = 0x00002000; + + __asm__ volatile("csrs mstatus, %0;" + "csrwi fcsr, 0;" + "csrs mstatus, %0;" + : : "r"(fs) + ); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +start_trigger () +{ + printf("start of test \n"); + + // Enable mcycle counter and read value + __asm__ volatile("csrci mcountinhibit, 0x1"); // mcountinhibit.cy = 0 + __asm__ volatile("rdcycle %0" : "=r"(start_time)); + + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +stop_trigger () +{ + __asm__ volatile("rdcycle %0" : "=r"(stop_time)); + uint32_t cycle_cnt = stop_time - start_time; + printf("end of test \n"); + printf("Result is given in CPU cycles \n"); + printf("RES: %d \n", cycle_cnt); + + _exit(0); +} + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.h new file mode 100644 index 0000000000..bd174c3151 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu/chips/speed/chipsupport.h @@ -0,0 +1,25 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#ifndef CHIPSUPPORT_H +#define CHIPSUPPORT_H + +#define CPU_MHZ 1 + +#endif From a273af73e83d087d7f900d291fbc91e5f9b00d8a Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:54:00 +0100 Subject: [PATCH 5/9] Addition of Embench v2 pulp zfinx config. Signed-off-by: Pascal Gouedo --- .../config/corev32_pulp_fpu_zfinx/arch.cfg | 67 ++++++++++++++ .../boards/corev32_pulp_fpu_zfinx/board.cfg | 69 +++++++++++++++ .../corev32_pulp_fpu_zfinx/boardsupport.c | 21 +++++ .../corev32_pulp_fpu_zfinx/boardsupport.h | 21 +++++ .../chips/size/chip.cfg | 86 ++++++++++++++++++ .../chips/size/chip.cfg.save | 88 +++++++++++++++++++ .../chips/size/chipsupport.c | 45 ++++++++++ .../chips/size/chipsupport.h | 25 ++++++ .../chips/speed/chip.cfg | 87 ++++++++++++++++++ .../chips/speed/chipsupport.c | 59 +++++++++++++ .../chips/speed/chipsupport.h | 25 ++++++ 11 files changed, 593 insertions(+) create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/arch.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/board.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.h create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg.save create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.h create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chip.cfg create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.c create mode 100644 cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.h diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/arch.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/arch.cfg new file mode 100644 index 0000000000..0583bdfe6e --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/arch.cfg @@ -0,0 +1,67 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the architecture. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/board.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/board.cfg new file mode 100644 index 0000000000..5d7d45435f --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/board.cfg @@ -0,0 +1,69 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the board. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +cpu_mhz = 1 diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.c new file mode 100644 index 0000000000..f2e674dea5 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.c @@ -0,0 +1,21 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include "boardsupport.h" + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.h new file mode 100644 index 0000000000..6223cd6846 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/boards/corev32_pulp_fpu_zfinx/boardsupport.h @@ -0,0 +1,21 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + + + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg new file mode 100644 index 0000000000..fe63fb9440 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg @@ -0,0 +1,86 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the chip. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +# This is the generic framework for compilers, where the only common set up +# is: + +# '-c' is used to specify generation of object files when compiling a + +# each global data and function is put in its own section + +# - we garbage collect unused sections on linking + +cflags = [ + '-c', '-Os', '-ffunction-sections', '-msave-restore', '-mabi=ilp32', '-march=rv32imac_zfinx_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +ldflags = [ + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-nostdlib', '-mabi=ilp32', '-march=rv32imac_zfinx_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +dummy_libs = ['crt0', 'libm', 'libc', 'libgcc'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg.save b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg.save new file mode 100644 index 0000000000..66f9d3ad9a --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chip.cfg.save @@ -0,0 +1,88 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the chip. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +# This is the generic framework for compilers, where the only common set up +# is: + +# '-c' is used to specify generation of object files when compiling a + +# each global data and function is put in its own section + +# - we garbage collect unused sections on linking + +# '-ffunction-sections', '-fdata-sections', '-msave-restore', + +cflags = [ + '-c', '-Os', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imc_zicsr_zifencei_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +ldflags = [ + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-nostdlib', '-mabi=ilp32', '-march=rv32imc_zicsr_zifencei_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +dummy_libs = ['crt0', 'libm', 'libc', 'libgcc'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.c new file mode 100644 index 0000000000..e5a63a3c83 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.c @@ -0,0 +1,45 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include +#include +#include +#include "chipsupport.h" + +static uint32_t start_time, stop_time; + +void +initialise_board () +{ + printf("Initialize board corev32 \n"); + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +start_trigger () +{ + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +stop_trigger () +{ + +} + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.h new file mode 100644 index 0000000000..bd174c3151 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/size/chipsupport.h @@ -0,0 +1,25 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#ifndef CHIPSUPPORT_H +#define CHIPSUPPORT_H + +#define CPU_MHZ 1 + +#endif diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chip.cfg b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chip.cfg new file mode 100644 index 0000000000..d92d68ccf7 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chip.cfg @@ -0,0 +1,87 @@ +############################################################################### +# +# Copyright 2020 OpenHW Group +# +# Licensed under the Solderpad Hardware Licence, 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 +# +# https://solderpad.org/licenses/ +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 +# +############################################################################### + +# This is a python setting of parameters for the chip. The following +# parameters may be set (other keys are silently ignored). Defaults are shown +# in brackets +# - cc ('cc') +# - ld (same value as for cc) +# - cflags ([]) +# - ldflags ([]) +# - cc_define_pattern ('-D{0}') +# - cc_incdir_pattern ('-I{0}') +# - cc_input_pattern ('{0}') +# - cc_output_pattern ('-o {0}') +# - ld_input_pattern ('{0}') +# - ld_output_pattern ('-o {0}') +# - user_libs ([]) +# - dummy_libs ([]) +# - cpu_mhz (1) +# - warmup_heat (1) + +# The "flags" and "libs" parameters (cflags, ldflags, user_libs, dummy_libs) +# should be lists of arguments to be passed to the compile or link line as +# appropriate. Patterns are Python format patterns used to create arguments. +# Thus for GCC or Clang/LLVM defined constants can be passed using the prefix +# '-D', and the pattern '-D{0}' would be appropriate (which happens to be the +# default). + +# "user_libs" may be absolute file names or arguments to the linker. In the +# latter case corresponding arguments in ldflags may be needed. For example +# with GCC or Clang/LLVM is "-l" flags are used in "user_libs", the "-L" flags +# may be needed in "ldflags". + +# Dummy libs have their source in the "support" subdirectory. Thus if 'crt0' +# is specified, there should be a source file 'dummy-crt0.c' in the support +# directory. + +# There is no need to set an unused parameter, and this file may be empty to +# set no flags. + +# Parameter values which are duplicated in architecture, board, chip or +# command line are used in the following order of priority +# - default value +# - architecture specific value +# - chip specific value +# - board specific value +# - command line value + +# For flags, this priority is applied to individual flags, not the complete +# list of flags. + +# This is the generic framework for compilers, where the only common set up +# is: + +# '-c' is used to specify generation of object files when compiling a + +# each global data and function is put in its own section + +# - we garbage collect unused sections on linking + +cflags = [ + '-c', '-O2', '-ffunction-sections', '-mabi=ilp32', '-march=rv32imac_zfinx_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] + +ldflags = [ + '-Wl,-gc-sections', '-Wl,-A,elf32lriscv', '-nostartfiles', '-mabi=ilp32', '-march=rv32imac_zfinx_zicsr_xcvhwlp_xcvmem_xcvmac_xcvbi_xcvalu_xcvsimd_xcvbitmanip' +] +user_libs = ['-lm'] + +#dummy_libs = ['libm'] diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.c b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.c new file mode 100644 index 0000000000..b3ed4582cd --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.c @@ -0,0 +1,59 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#include +#include +#include +#include "chipsupport.h" + +extern void _exit(); + +static uint32_t start_time, stop_time; + +void +initialise_board () +{ + printf("Initialize board corev32 \n"); + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +start_trigger () +{ + printf("start of test \n"); + + // Enable mcycle counter and read value + __asm__ volatile("csrci mcountinhibit, 0x1"); // mcountinhibit.cy = 0 + __asm__ volatile("rdcycle %0" : "=r"(start_time)); + + __asm__ volatile ("li a0, 0" : : : "memory"); +} + +void __attribute__ ((noinline)) __attribute__ ((externally_visible)) +stop_trigger () +{ + __asm__ volatile("rdcycle %0" : "=r"(stop_time)); + uint32_t cycle_cnt = stop_time - start_time; + printf("end of test \n"); + printf("Result is given in CPU cycles \n"); + printf("RES: %d \n", cycle_cnt); + + _exit(0); +} + diff --git a/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.h b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.h new file mode 100644 index 0000000000..bd174c3151 --- /dev/null +++ b/cv32e40p/tests/embench/config/corev32_pulp_fpu_zfinx/chips/speed/chipsupport.h @@ -0,0 +1,25 @@ +/* +** +** Copyright 2020 OpenHW Group +** +** Licensed under the Solderpad Hardware Licence, 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 +** +** https://solderpad.org/licenses/ +** +** 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. +** +******************************************************************************* +*/ + +#ifndef CHIPSUPPORT_H +#define CHIPSUPPORT_H + +#define CPU_MHZ 1 + +#endif From af2f83e7dd4543664b23e682acf3ffa819589a5b Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 14:56:58 +0100 Subject: [PATCH 6/9] Addition of fpu and zfinx configs. Additional updates to run multiple Embench runs in parallel (different configs, sequential or parallel mode). Signed-off-by: Pascal Gouedo --- bin/run_embench.py | 17 ++++++++++++++--- cv32e40p/tests/embench/pylib/run_corev32.py | 9 ++------- mk/Common.mk | 3 +++ mk/uvmt/uvmt.mk | 8 ++++---- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/bin/run_embench.py b/bin/run_embench.py index 8f92ff436c..fe8688b287 100755 --- a/bin/run_embench.py +++ b/bin/run_embench.py @@ -64,8 +64,12 @@ def main(): core_config = 'corev32' elif args.cfg == 'pulp': core_config = 'corev32_pulp' + elif args.cfg == 'pulp_fpu': + core_config = 'corev32_pulp_fpu' + elif args.cfg == 'pulp_fpu_zfinx': + core_config = 'corev32_pulp_fpu_zfinx' else: - logger.info(f"Invalid config selected: {args.cfg}, must be 'default' or 'pulp'") + logger.info(f"Invalid config selected: {args.cfg}, must be 'default', 'pulp', 'pulp_fpu' or 'pulp_fpu_zfinx'") sys.exit(1) if args.ccomp == 'notset': @@ -229,14 +233,21 @@ def main(): logger.fatal(f"Failed to generate folder {paths['testsem']}/{folder_ext}") sys.exit(1) + logger.debug(f"Creating folder {args.builddir}/{folder_ext}") + try: + subprocess.run(['mkdir', f"{args.builddir}/{folder_ext}"]) + except: + logger.fatal(f"Failed to generate folder {args.builddir}/{folder_ext}") + sys.exit(1) + # copy test files into the tests/programs/embench directories for file in os.listdir(f"{paths['emres']}/{folder}"): if not file.endswith('.o'): logger.debug(f"Copying file {file}") try: - subprocess.run(['cp', f"{paths['emres']}/{folder}/{file}", f"{paths['testsem']}/{folder_ext}/emb_{file}.elf"]) + subprocess.run(['cp', f"{paths['emres']}/{folder}/{file}", f"{args.builddir}/{folder_ext}/emb_{file}.elf"]) except: - logger.fatal(f"Copying file {file} to {paths['emres']}/{folder_ext}/ failed") + logger.fatal(f"Copying file {file} to {args.builddir}/{folder_ext}/ failed") sys.exit(1) break diff --git a/cv32e40p/tests/embench/pylib/run_corev32.py b/cv32e40p/tests/embench/pylib/run_corev32.py index 7fd2b9be94..66b403edc4 100644 --- a/cv32e40p/tests/embench/pylib/run_corev32.py +++ b/cv32e40p/tests/embench/pylib/run_corev32.py @@ -100,16 +100,11 @@ def build_benchmark_cmd(bench, args): global cpu_per cpu_per = float(1/(args.cpu_mhz*1_000_000)) - if args.cfg == 'default': - core_config = f'CFG=default' - else: - core_config = f'CFG=pulp' - #Utilize "make test" environment in core-v-verif if args.sim_parallel == 'YES': - return ['make', '-C', args.make_path, 'test', f"TEST=emb_{bench}", f"SIMULATOR={args.simulator}", 'USE_ISS=NO', core_config, 'COMP=NO', 'USER_RUN_FLAGS=+rand_stall_obi_disable'] + return ['make', '-C', args.make_path, 'test', f"TEST=emb_{bench}", f"SIMULATOR={args.simulator}", 'USE_ISS=NO', f"CFG={args.cfg}", 'COMP=NO'] else: - return ['make', '-C', args.make_path, 'test', f"TEST=emb_{bench}", f"SIMULATOR={args.simulator}", 'USE_ISS=NO', core_config, 'USER_RUN_FLAGS=+rand_stall_obi_disable'] + return ['make', '-C', args.make_path, 'test', f"TEST=emb_{bench}", f"SIMULATOR={args.simulator}", 'USE_ISS=NO', f"CFG={args.cfg}"] def decode_results(stdout_str, stderr_str): diff --git a/mk/Common.mk b/mk/Common.mk index b46654ce28..957c62dab4 100644 --- a/mk/Common.mk +++ b/mk/Common.mk @@ -215,6 +215,9 @@ TEST_FLAGS_MAKE := $(shell $(YAML2MAKE) --test=$(TEST) --yaml=test.yaml $(YAML2 ifeq ($(TEST_FLAGS_MAKE),) $(error ERROR Could not find test.yaml for test: $(TEST)) endif +ifeq (,$(findstring "emb_",$(TEST))) + $(shell sed -i "s?TEST_TEST_DIR.*emb_?TEST_TEST_DIR=$(SIM_CFG_RESULTS)/bd/emb_?" $(TEST_FLAGS_MAKE)) +endif include $(TEST_FLAGS_MAKE) endif diff --git a/mk/uvmt/uvmt.mk b/mk/uvmt/uvmt.mk index 5a29233170..409d3b3bcb 100644 --- a/mk/uvmt/uvmt.mk +++ b/mk/uvmt/uvmt.mk @@ -373,8 +373,8 @@ clean_hex: rm -rf $(SIM_TEST_PROGRAM_RESULTS) clean_test_programs: clean_bsp - if [ -d "$(SIM_RESULTS)" ]; then \ - find $(SIM_RESULTS) -depth -type d -name test_program | xargs rm -rf; \ + if [ -d "$(SIM_CFG_RESULTS)" ]; then \ + find $(SIM_CFG_RESULTS) -depth -type d -name test_program | xargs rm -rf; \ fi clean_riscv-dv: @@ -385,8 +385,8 @@ clean_embench: rm -rf $(EMBENCH_PKG) cd $(EMBENCH_TESTS) && \ find . ! -path . ! -path ./README.md -delete - if [ -d "$(SIM_RESULTS)" ]; then \ - cd $(SIM_RESULTS) && find . -depth -type d -name "emb_*" | xargs rm -rf; \ + if [ -d "$(SIM_CFG_RESULTS)" ]; then \ + cd $(SIM_CFG_RESULTS) && find . -depth -type d -name "emb_*" | xargs rm -rf; \ fi clean_dpi_dasm_spike: From 79058d1756d98233c6e2dad8467eff43ffeaf272 Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Tue, 20 Feb 2024 15:15:57 +0100 Subject: [PATCH 7/9] Changed link script to use GP relaxation for (normally) better performances. Signed-off-by: Pascal Gouedo --- bin/run_embench.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run_embench.py b/bin/run_embench.py index fe8688b287..fe7010f0c1 100755 --- a/bin/run_embench.py +++ b/bin/run_embench.py @@ -191,7 +191,7 @@ def main(): f'--cc={args.ccomp}', f'--warmup-heat=0', f'--cpu-mhz={args.cpu_mhz}', - f'--ldflags=-T{paths["bsp"]}/link.ld', + f'--ldflags=-T{paths["bsp"]}/link_gp_relax.ld', f'--builddir={args.builddir}', f'--logdir={args.logdir}', f'--timeout=15', From 544c5d1d6f54f44afcad61b10629101734d4f8ff Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Thu, 22 Feb 2024 14:42:54 +0100 Subject: [PATCH 8/9] Corrected log file name. Signed-off-by: Pascal Gouedo --- bin/templates/regress_sh.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/templates/regress_sh.j2 b/bin/templates/regress_sh.j2 index 41fe6880ec..c3632779c5 100644 --- a/bin/templates/regress_sh.j2 +++ b/bin/templates/regress_sh.j2 @@ -118,11 +118,10 @@ popd > /dev/null {% else %} {% set results_dir = t.simulator + '_results' %} {% endif %} +{% set sim_log = t.simulator + '-' + test_log + '.log' %} {% if t.test_cfg is defined %} - {% set sim_log = t.simulator + '-' + test_log + '_' + t.test_cfg + '.log' %} {% set test_cfg_path = t.test_cfg %} {% else %} - {% set sim_log = t.simulator + '-' + test_log + '.log' %} {% set test_cfg_path = '' %} {% endif %} From e189412e6ba08be957bb92eb63bd723efbe73d9d Mon Sep 17 00:00:00 2001 From: Pascal Gouedo Date: Thu, 22 Feb 2024 14:48:36 +0100 Subject: [PATCH 9/9] Added pulp, pulp_fpu and pulp_fpu_zfinx configuration runs on standard tests. Added FPU and PULP tests. Signed-off-by: Pascal Gouedo --- cv32e40p/regress/cv32e40p_ci_check.yaml | 112 +++++++++++++++++++++--- 1 file changed, 101 insertions(+), 11 deletions(-) diff --git a/cv32e40p/regress/cv32e40p_ci_check.yaml b/cv32e40p/regress/cv32e40p_ci_check.yaml index a523e84de4..e2f1f1053d 100644 --- a/cv32e40p/regress/cv32e40p_ci_check.yaml +++ b/cv32e40p/regress/cv32e40p_ci_check.yaml @@ -3,28 +3,88 @@ name: cv32e40p_ci_check description: Commit sanity for the cv32e40p builds: - corev-dv: - cmd: make comp_corev-dv - dir: cv32e40p/sim/uvmt - uvmt_cv32e40p: - cmd: make comp + cmd: make comp comp_corev-dv + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp: + cmd: make comp comp_corev-dv + cfg: pulp + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu: + cmd: make comp comp_corev-dv + cfg: pulp_fpu + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu_1cyclat: + cmd: make comp comp_corev-dv + cfg: pulp_fpu_1cyclat + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu_2cyclat: + cmd: make comp comp_corev-dv + cfg: pulp_fpu_2cyclat + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu_zfinx: + cmd: make comp comp_corev-dv + cfg: pulp_fpu_zfinx + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu_zfinx_1cyclat: + cmd: make comp comp_corev-dv + cfg: pulp_fpu_zfinx_1cyclat + dir: cv32e40p/sim/uvmt + + uvmt_cv32e40p_pulp_fpu_zfinx_2cyclat: + cmd: make comp comp_corev-dv + cfg: pulp_fpu_zfinx_2cyclat dir: cv32e40p/sim/uvmt tests: hello-world: - build: uvmt_cv32e40p + builds: + - uvmt_cv32e40p + - uvmt_cv32e40p_pulp + - uvmt_cv32e40p_pulp_fpu + - uvmt_cv32e40p_pulp_fpu_1cyclat + - uvmt_cv32e40p_pulp_fpu_2cyclat + - uvmt_cv32e40p_pulp_fpu_zfinx + - uvmt_cv32e40p_pulp_fpu_zfinx_1cyclat + - uvmt_cv32e40p_pulp_fpu_zfinx_2cyclat description: UVM Hello World Test dir: cv32e40p/sim/uvmt - cmd: make hello-world cmd: make test COREV=YES TEST=hello-world - + interrupt_test: - build: uvmt_cv32e40p + builds: + - uvmt_cv32e40p + - uvmt_cv32e40p_pulp + description: Interrupt directed test + dir: cv32e40p/sim/uvmt + cmd: make test COREV=YES TEST=interrupt_test + + interrupt_test: + builds: + - uvmt_cv32e40p_pulp_fpu + - uvmt_cv32e40p_pulp_fpu_1cyclat + - uvmt_cv32e40p_pulp_fpu_2cyclat + description: Interrupt directed test + dir: cv32e40p/sim/uvmt + cmd: make test COREV=YES TEST=interrupt_test + test_cfg: floating_pt_instr_en + + interrupt_test: + builds: + - uvmt_cv32e40p_pulp_fpu_zfinx + - uvmt_cv32e40p_pulp_fpu_zfinx_1cyclat + - uvmt_cv32e40p_pulp_fpu_zfinx_2cyclat description: Interrupt directed test dir: cv32e40p/sim/uvmt cmd: make test COREV=YES TEST=interrupt_test - + test_cfg: floating_pt_zfinx_instr_en + corev_rand_interrupt: build: uvmt_cv32e40p description: Interrupt random test @@ -38,7 +98,9 @@ tests: cmd: make test COREV=YES TEST=illegal debug_test: - build: uvmt_cv32e40p + builds: + - uvmt_cv32e40p + - uvmt_cv32e40p_pulp dir: cv32e40p/sim/uvmt cmd: make test COREV=YES TEST=debug_test @@ -75,3 +137,31 @@ tests: cmd: make gen_corev-dv test COREV=YES TEST=corev_rand_jump_stress_test num: 2 + corev_rand_fp_instr_sanity_test: + builds: + - uvmt_cv32e40p_pulp_fpu + - uvmt_cv32e40p_pulp_fpu_1cyclat + - uvmt_cv32e40p_pulp_fpu_2cyclat + dir: cv32e40p/sim/uvmt + cmd: make gen_corev-dv test TEST=corev_rand_fp_instr_sanity_test + test_cfg: floating_pt_instr_en + + corev_rand_fp_instr_sanity_test: + builds: + - uvmt_cv32e40p_pulp_fpu_zfinx + - uvmt_cv32e40p_pulp_fpu_zfinx_1cyclat + - uvmt_cv32e40p_pulp_fpu_zfinx_2cyclat + dir: cv32e40p/sim/uvmt + cmd: make gen_corev-dv test TEST=corev_rand_fp_instr_sanity_test + test_cfg: floating_pt_zfinx_instr_en + + corev_rand_pulp_instr_test: + build: uvmt_cv32e40p_pulp + dir: cv32e40p/sim/uvmt + cmd: make gen_corev-dv test COREV=YES TEST=corev_rand_pulp_instr_test + + corev_rand_pulp_hwloop_test: + build: uvmt_cv32e40p_pulp + dir: cv32e40p/sim/uvmt + cmd: make gen_corev-dv test COREV=YES TEST=corev_rand_pulp_hwloop_test +