mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-11-16 08:38:32 +00:00
Align to Verilatable PULPissimo
This commit is contained in:
parent
326f85ce9a
commit
26f3f15a15
3 changed files with 53 additions and 10 deletions
|
|
@ -21,7 +21,7 @@ if args.output_file is None:
|
||||||
raise Exception('Specify the output file with --output=<path> (ex. --output=./build/pulpissimo/slm_files/hyper_flash_stim.slm')
|
raise Exception('Specify the output file with --output=<path> (ex. --output=./build/pulpissimo/slm_files/hyper_flash_stim.slm')
|
||||||
|
|
||||||
delimiter=" "
|
delimiter=" "
|
||||||
with open(args.input_file, "rU") as fi:
|
with open(args.input_file, "r") as fi:
|
||||||
data = list(map(lambda x:x.split(delimiter), fi.read().strip().split("\n")))
|
data = list(map(lambda x:x.split(delimiter), fi.read().strip().split("\n")))
|
||||||
fo=open(args.output_file, "w")
|
fo=open(args.output_file, "w")
|
||||||
A=np.array(data)
|
A=np.array(data)
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ endif
|
||||||
ifeq '$(platform)' 'fpga'
|
ifeq '$(platform)' 'fpga'
|
||||||
PULP_CFLAGS += -D__PLATFORM__=ARCHI_PLATFORM_FPGA
|
PULP_CFLAGS += -D__PLATFORM__=ARCHI_PLATFORM_FPGA
|
||||||
endif
|
endif
|
||||||
|
ifeq '$(platform)' 'verilator'
|
||||||
|
PULP_CFLAGS += -D__PLATFORM__=ARCHI_PLATFORM_RTL
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_NB_PE
|
ifdef CONFIG_NB_PE
|
||||||
PULP_CFLAGS += -DARCHI_CLUSTER_NB_PE=$(CONFIG_NB_PE)
|
PULP_CFLAGS += -DARCHI_CLUSTER_NB_PE=$(CONFIG_NB_PE)
|
||||||
|
|
@ -146,6 +149,13 @@ else
|
||||||
LOAD_MODE := JTAG
|
LOAD_MODE := JTAG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# VERILATOR Flags
|
||||||
|
#
|
||||||
|
verilator_flags ?= --trace
|
||||||
|
verilator_flags += +bootmode=jtag
|
||||||
|
verilator_flags += +log_file=trace_core.log +itb_file=$(TARGETS).itb
|
||||||
|
|
||||||
#
|
#
|
||||||
# VSIM Flags
|
# VSIM Flags
|
||||||
#
|
#
|
||||||
|
|
@ -353,3 +363,28 @@ help:
|
||||||
@echo "Makefile options:"
|
@echo "Makefile options:"
|
||||||
@echo " CONFIG_TRACE_LEVEL=<level> Activate traces for the specified level (0=none, 1=fatal, 2=error, 3=warning, 4=info, 5=debug, 6=trace)."
|
@echo " CONFIG_TRACE_LEVEL=<level> Activate traces for the specified level (0=none, 1=fatal, 2=error, 3=warning, 4=info, 5=debug, 6=trace)."
|
||||||
@echo " CONFIG_TRACE_ALL=1 Activate all traces. Other traces can be individually activated with CONFIG_TRACE_<NAME>."
|
@echo " CONFIG_TRACE_ALL=1 Activate all traces. Other traces can be individually activated with CONFIG_TRACE_<NAME>."
|
||||||
|
|
||||||
|
ifeq '$(platform)' 'verilator'
|
||||||
|
|
||||||
|
$(TARGET_BUILD_DIR)/Vtb_pulp:
|
||||||
|
ifndef VERILATOR_PATH
|
||||||
|
$(error "VERILATOR_PATH is undefined. Either call \
|
||||||
|
'source $$YOUR_HW_DIR/setup/verilator.sh' or set it manually.")
|
||||||
|
endif
|
||||||
|
ln -sfn $(VERILATOR_PATH)/obj_dir/Vtb_pulp $@
|
||||||
|
|
||||||
|
# ITB file needed by CV32E40X tracer
|
||||||
|
$(TARGETS).itb:
|
||||||
|
$(PULP_OBJDUMP) -d -l -s $(disopt) $(TARGETS) > $(TARGETS).dis
|
||||||
|
$(PULPRT_HOME)/bin/objdump2itb.py $(TARGETS).dis > $(TARGETS).itb
|
||||||
|
|
||||||
|
run: $(TARGET_BUILD_DIR)/Vtb_pulp $(TARGETS).itb
|
||||||
|
$(PULPRT_HOME)/bin/stim_utils.py --binary=$(TARGETS) --vectors=$(TARGET_BUILD_DIR)/vectors/stim.txt
|
||||||
|
$(PULPRT_HOME)/bin/plp_mkflash --flash-boot-binary=$(TARGETS) --stimuli=$(TARGET_BUILD_DIR)/vectors/qspi_stim.slm --flash-type=spi --qpi
|
||||||
|
$(PULPRT_HOME)/bin/slm_hyper.py --input=$(TARGET_BUILD_DIR)/vectors/qspi_stim.slm --output=$(TARGET_BUILD_DIR)/vectors/hyper_stim.slm
|
||||||
|
ifndef VERILATOR_PATH
|
||||||
|
$(error "VERILATOR_PATH is undefined. Either call \
|
||||||
|
'source $$YOUR_HW_DIR/setup/verilator.sh' or set it manually.")
|
||||||
|
endif
|
||||||
|
cd $(TARGET_BUILD_DIR) && ./Vtb_pulp $(verilator_flags) +stimuli=$(TARGET_BUILD_DIR)/vectors/stim.txt
|
||||||
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
ifdef USE_IBEX
|
ifdef USE_IBEX
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc
|
||||||
PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32
|
PULP_CFLAGS += -D__ibex__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32
|
||||||
PULP_ARCH_CFLAGS ?= -march=rv32imc
|
PULP_ARCH_CFLAGS ?= -march=rv32imc
|
||||||
PULP_ARCH_LDFLAGS ?= -march=rv32imc
|
PULP_ARCH_LDFLAGS ?= -march=rv32imc
|
||||||
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc
|
PULP_ARCH_OBJDFLAGS ?= -Mmarch=rv32imc
|
||||||
else ifdef USE_CV32E40P
|
else ifdef USE_CV32E40P
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc
|
||||||
PULP_CFLAGS += -D__cv32e40p__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2
|
PULP_CFLAGS += -D__cv32e40p__ -U__riscv__ -UARCHI_CORE_HAS_PULPV2
|
||||||
ifdef CONFIG_USE_ZFINX
|
ifdef CONFIG_USE_ZFINX
|
||||||
PULP_ARCH_CFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop
|
PULP_ARCH_CFLAGS ?= -march=rv32imc_zfinx_xcorev -mno-pulp-hwloop
|
||||||
|
|
@ -16,13 +16,18 @@ PULP_ARCH_LDFLAGS ?= -march=rv32imfc_xcorev -mno-pulp-hwloop
|
||||||
endif
|
endif
|
||||||
PULP_ARCH_OBJDFLAGS ?=
|
PULP_ARCH_OBJDFLAGS ?=
|
||||||
else ifdef USE_CV32E40X
|
else ifdef USE_CV32E40X
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld
|
||||||
PULP_CFLAGS += -D__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 -DPULP_LLVM
|
PULP_CFLAGS += -D__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 -DPULP_LLVM
|
||||||
PULP_ARCH_CFLAGS ?= -march=rv32imcxfir --target=riscv32
|
PULP_ARCH_CFLAGS ?= -march=rv32imcxfir --target=riscv32
|
||||||
PULP_ARCH_LDFLAGS ?= -march=rv32imcxfir --target=riscv32
|
PULP_ARCH_LDFLAGS ?= -march=rv32imcxfir --target=riscv32
|
||||||
PULP_ARCH_OBJDFLAGS ?= -D
|
PULP_ARCH_OBJDFLAGS ?= -D
|
||||||
|
# use LLVM for CV32E40X
|
||||||
|
PULP_CC = clang
|
||||||
|
PULP_AR = llvm-ar
|
||||||
|
PULP_LD = clang
|
||||||
|
PULP_OBJDUMP = llvm-objdump
|
||||||
else
|
else
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld -lgcc
|
||||||
PULP_CFLAGS += -D__riscv__
|
PULP_CFLAGS += -D__riscv__
|
||||||
PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9
|
PULP_ARCH_CFLAGS ?= -march=rv32imcxgap9
|
||||||
PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9
|
PULP_ARCH_LDFLAGS ?= -march=rv32imcxgap9
|
||||||
|
|
@ -31,12 +36,11 @@ endif
|
||||||
|
|
||||||
PULP_CFLAGS += -fdata-sections -ffunction-sections -include chips/pulpissimo/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo
|
PULP_CFLAGS += -fdata-sections -ffunction-sections -include chips/pulpissimo/config.h -I$(PULPRT_HOME)/include/chips/pulpissimo
|
||||||
PULP_OMP_CFLAGS += -fopenmp -mnativeomp
|
PULP_OMP_CFLAGS += -fopenmp -mnativeomp
|
||||||
PULP_LDFLAGS += -nostartfiles -nostdlib -Wl,--gc-sections -L$(PULPRT_HOME)/kernel -Tchips/pulpissimo/link.ld
|
|
||||||
|
|
||||||
PULP_CC = clang
|
PULP_CC ?= riscv32-unknown-elf-gcc
|
||||||
PULP_AR ?= llvm-ar
|
PULP_AR ?= riscv32-unknown-elf-ar
|
||||||
PULP_LD ?= clang
|
PULP_LD ?= riscv32-unknown-elf-gcc
|
||||||
PULP_OBJDUMP ?= llvm-objdump
|
PULP_OBJDUMP ?= riscv32-unknown-elf-objdump
|
||||||
|
|
||||||
fc/archi=riscv
|
fc/archi=riscv
|
||||||
pe/archi=riscv
|
pe/archi=riscv
|
||||||
|
|
@ -73,6 +77,10 @@ ifeq '$(platform)' 'rtl'
|
||||||
PULP_SRCS += drivers/pulpissimo/rtl_sim/io_mux/src/io_mux.c
|
PULP_SRCS += drivers/pulpissimo/rtl_sim/io_mux/src/io_mux.c
|
||||||
PULP_CFLAGS += -I$(PULPRT_HOME)/drivers/pulpissimo/rtl_sim/io_mux/include
|
PULP_CFLAGS += -I$(PULPRT_HOME)/drivers/pulpissimo/rtl_sim/io_mux/include
|
||||||
endif
|
endif
|
||||||
|
ifeq '$(platform)' 'verilator'
|
||||||
|
PULP_SRCS += drivers/pulpissimo/rtl_sim/io_mux/src/io_mux.c
|
||||||
|
PULP_CFLAGS += -I$(PULPRT_HOME)/drivers/pulpissimo/rtl_sim/io_mux/include
|
||||||
|
endif
|
||||||
|
|
||||||
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
include $(PULPRT_HOME)/rules/pulpos/configs/default.mk
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue