Skip to content

Commit

Permalink
Merge pull request #32 from pulp-platform/cv32
Browse files Browse the repository at this point in the history
Add PULPissimo/CV32E40P support
  • Loading branch information
bluewww authored Apr 7, 2022
2 parents 1fd6eeb + 01df5a7 commit dd39b06
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 5 deletions.
3 changes: 3 additions & 0 deletions configs/pulpissimo_cv32e40p.sh → configs/pulpissimo_cv32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
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
unset CONFIG_USE_ZFINX

if [ -n "${ZSH_VERSION:-}" ]; then
DIR="$(readlink -f -- "${(%):-%x}")"
Expand Down
19 changes: 19 additions & 0 deletions configs/pulpissimo_cv32_zfinx.sh
Original file line number Diff line number Diff line change
@@ -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
30 changes: 28 additions & 2 deletions rules/pulpos/default_rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
TARGET_BUILD_DIR = $(CURDIR)/build$(build_dir_ext)
ifndef VERBOSE

ifdef QUIET
V = @
endif

Expand Down Expand Up @@ -151,7 +152,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
Expand All @@ -173,6 +196,9 @@ endif
else
vsim_flags += -gLOAD_L2=JTAG
endif
endif


ifdef vsim_additional_flags
vsim_flags += $(vsim_additional_flags)
endif
Expand Down
11 changes: 8 additions & 3 deletions rules/pulpos/targets/pulpissimo.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit dd39b06

Please sign in to comment.