From 8891d83838c3ff0a9cc9c5e7d4c9461606a6674a Mon Sep 17 00:00:00 2001 From: Luca Valente Date: Tue, 18 May 2021 19:59:34 +0200 Subject: [PATCH] target: Add pulp with cv32e40p --- configs/pulp_cv32e40p.sh | 16 ++++++++++++++++ include/archi/chips/pulp/pulp.h | 4 +++- include/hal/chips/pulp/pulp.h | 4 +++- rules/pulpos/targets/pulp.mk | 6 ++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 configs/pulp_cv32e40p.sh diff --git a/configs/pulp_cv32e40p.sh b/configs/pulp_cv32e40p.sh new file mode 100644 index 0000000..2027403 --- /dev/null +++ b/configs/pulp_cv32e40p.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e + +export PULPRT_TARGET=pulp +export PULPRUN_TARGET=pulp +export USE_CV32E40P=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/include/archi/chips/pulp/pulp.h b/include/archi/chips/pulp/pulp.h index 72bf38e..2b4e7b2 100644 --- a/include/archi/chips/pulp/pulp.h +++ b/include/archi/chips/pulp/pulp.h @@ -25,7 +25,9 @@ #include "archi/riscv/priv_1_10.h" #ifdef __ibex__ #include "archi/ibex/mhpm.h" -#else // __ibex__ +#elif defined(__cv32e40p__) +#include "archi/cv32e40p/cv32e40p.h" +#else #include "archi/riscv/pcer_v2.h" #endif // __ibex__ #include "archi/itc/itc_v1.h" diff --git a/include/hal/chips/pulp/pulp.h b/include/hal/chips/pulp/pulp.h index 5b12fb6..2103f20 100644 --- a/include/hal/chips/pulp/pulp.h +++ b/include/hal/chips/pulp/pulp.h @@ -19,7 +19,9 @@ #ifdef __ibex__ #include "hal/ibex/ibex.h" -#else // __ibex__ +#elif defined(__cv32e40p__) +#include "hal/cv32e40p/cv32e40p.h" +#else #include "hal/riscv/riscv_v5.h" #endif // __ibex__ #include "hal/eu/eu_v3.h" diff --git a/rules/pulpos/targets/pulp.mk b/rules/pulpos/targets/pulp.mk index 97f8c51..1872a36 100644 --- a/rules/pulpos/targets/pulp.mk +++ b/rules/pulpos/targets/pulp.mk @@ -4,6 +4,12 @@ PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV PULP_ARCH_CFLAGS ?= -march=rv32imc PULP_ARCH_LDFLAGS ?= -march=rv32imc 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 -mnohwloop +PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9 -mnohwloop +PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imcxgap9 -mnohwloop else PULP_LDFLAGS += PULP_CFLAGS += -D__riscv__