From 564ca51f85da06936221112fceb7f9405f1f1b75 Mon Sep 17 00:00:00 2001 From: bluew Date: Fri, 8 Apr 2022 01:00:46 +0200 Subject: [PATCH 1/3] pulpissimo_cv32e40p: Use plusargs to pass simulation parameters --- configs/pulpissimo_cv32e40p.sh | 2 ++ rules/pulpos/default_rules.mk | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configs/pulpissimo_cv32e40p.sh b/configs/pulpissimo_cv32e40p.sh index 24a391f..33820d1 100644 --- a/configs/pulpissimo_cv32e40p.sh +++ b/configs/pulpissimo_cv32e40p.sh @@ -3,6 +3,8 @@ export PULPRT_TARGET=pulpissimo export PULPRUN_TARGET=pulpissimo export USE_CV32E40P=1 +# use plusarg to pass simulation boot parameters instead of floating parameters +export CONFIG_PLUSARG_SIM=1 if [ -n "${ZSH_VERSION:-}" ]; then DIR="$(readlink -f -- "${(%):-%x}")" diff --git a/rules/pulpos/default_rules.mk b/rules/pulpos/default_rules.mk index a9c3d7c..105510f 100644 --- a/rules/pulpos/default_rules.mk +++ b/rules/pulpos/default_rules.mk @@ -151,7 +151,29 @@ endif # # VSIM Flags # -vsim_flags ?= +ENTRY_POINT=0x1c008080 -dpicpppath /usr/bin/g++ -permit_unmatched_virtual_intf -gBAUDRATE=115200 +vsim_flags ?= +ENTRY_POINT=0x1c008080 -permit_unmatched_virtual_intf -gBAUDRATE=115200 + +ifdef CONFIG_PLUSARG_SIM + +ifdef bootmode +ifeq ($(bootmode), spi) +vsim_flags += +bootmode=spi_flash +else ifeq ($(bootmode), hyperflash) +vsim_flags += +bootmode=hyper_flash +else ifeq ($(bootmode), fast_debug) +vsim_flags += +bootmode=fast_debug_preload +else ifeq ($(bootmode), jtag) +vsim_flags += +bootmode=jtag +else +$(error Illegal value supplied for bootmode. Legal values are 'spi', 'hyperflash', 'fast_debug' and 'jtag') +endif +else +# default bootmode +vsim_flags += +bootmode=jtag +endif + +else + ifdef bootmode ifeq ($(bootmode), spi) vsim_flags += -gSTIM_FROM=SPI_FLASH -gLOAD_L2=STANDALONE -gUSE_S25FS256S_MODEL=1 @@ -173,6 +195,9 @@ endif else vsim_flags += -gLOAD_L2=JTAG endif +endif + + ifdef vsim_additional_flags vsim_flags += $(vsim_additional_flags) endif From cc161f4134a6bedc7d4c63f78dbaa4a5ca5628d1 Mon Sep 17 00:00:00 2001 From: bluew Date: Fri, 8 Apr 2022 01:09:59 +0200 Subject: [PATCH 2/3] rules/pulpos/default_rules: Be verbose by default Hides too many bugs --- rules/pulpos/default_rules.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules/pulpos/default_rules.mk b/rules/pulpos/default_rules.mk index 105510f..c710574 100644 --- a/rules/pulpos/default_rules.mk +++ b/rules/pulpos/default_rules.mk @@ -1,5 +1,6 @@ TARGET_BUILD_DIR = $(CURDIR)/build$(build_dir_ext) -ifndef VERBOSE + +ifdef QUIET V = @ endif From 01df5a78eb053711bcf3bb9abe0fa71bf0d6ed10 Mon Sep 17 00:00:00 2001 From: bluew Date: Fri, 8 Apr 2022 01:10:39 +0200 Subject: [PATCH 3/3] Add and update CV32E40P + PULPissimo configurations --- ...pissimo_cv32e40p.sh => pulpissimo_cv32.sh} | 1 + configs/pulpissimo_cv32_zfinx.sh | 19 +++++++++++++++++++ rules/pulpos/targets/pulpissimo.mk | 11 ++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) rename configs/{pulpissimo_cv32e40p.sh => pulpissimo_cv32.sh} (94%) create mode 100644 configs/pulpissimo_cv32_zfinx.sh diff --git a/configs/pulpissimo_cv32e40p.sh b/configs/pulpissimo_cv32.sh similarity index 94% rename from configs/pulpissimo_cv32e40p.sh rename to configs/pulpissimo_cv32.sh index 33820d1..d366e9b 100644 --- a/configs/pulpissimo_cv32e40p.sh +++ b/configs/pulpissimo_cv32.sh @@ -5,6 +5,7 @@ export PULPRUN_TARGET=pulpissimo export USE_CV32E40P=1 # use plusarg to pass simulation boot parameters instead of floating parameters export CONFIG_PLUSARG_SIM=1 +unset CONFIG_USE_ZFINX if [ -n "${ZSH_VERSION:-}" ]; then DIR="$(readlink -f -- "${(%):-%x}")" diff --git a/configs/pulpissimo_cv32_zfinx.sh b/configs/pulpissimo_cv32_zfinx.sh new file mode 100644 index 0000000..bb80583 --- /dev/null +++ b/configs/pulpissimo_cv32_zfinx.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e + +export PULPRT_TARGET=pulpissimo +export PULPRUN_TARGET=pulpissimo +export USE_CV32E40P=1 +# use plusarg to pass simulation boot parameters instead of floating parameters +export CONFIG_PLUSARG_SIM=1 +export CONFIG_USE_ZFINX=1 + +if [ -n "${ZSH_VERSION:-}" ]; then + DIR="$(readlink -f -- "${(%):-%x}")" + scriptDir="$(dirname $DIR)" +else + + scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" + +fi + +source $scriptDir/common.sh diff --git a/rules/pulpos/targets/pulpissimo.mk b/rules/pulpos/targets/pulpissimo.mk index f2aafc6..79492b0 100644 --- a/rules/pulpos/targets/pulpissimo.mk +++ b/rules/pulpos/targets/pulpissimo.mk @@ -7,9 +7,14 @@ PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc else ifdef USE_CV32E40P PULP_LDFLAGS += PULP_CFLAGS += -D__cv32e40p__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9 -PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9 -PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9 +ifdef CONFIG_USE_ZFINX +PULP_ARCH_CFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop +PULP_ARCH_LDFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop +else +PULP_ARCH_CFLAGS ?= -march=rv32imfc_xcorev -mno-pulp-hwloop +PULP_ARCH_LDFLAGS ?= -march=rv32imfc_xcorev -mno-pulp-hwloop +endif +PULP_ARCH_OBJDFLAGS ?= else PULP_LDFLAGS += PULP_CFLAGS += -D__riscv__