Fix run target for pulp_cluster and execute exit

This commit is contained in:
Luca Valente 2023-03-23 17:06:10 +01:00
parent 0c78338e34
commit 4c5afc03a2
2 changed files with 15 additions and 1 deletions

View file

@ -68,6 +68,10 @@ void cluster_entry_stub()
{
cluster_retval = retval;
cluster_running = 0;
#ifdef ARCHI_NO_FC
pos_init_stop();
exit(cluster_retval);
#endif
}
pos_wait_forever();

View file

@ -28,6 +28,8 @@ endif
ifdef gui
override runner_args += --config-opt=**/vsim/gui=true
else
vsim-flags = -c
endif
ifdef io
@ -317,16 +319,22 @@ $(TARGET_BUILD_DIR)/stdout:
$(TARGET_BUILD_DIR)/fs:
mkdir -p $@
ifeq '$(pulp_chip)' 'pulp_cluster'
run:
vsim $(vsim-flags) -do "set VSIM_PATH $(VSIM_PATH); source $(VSIM_PATH)/scripts/start.tcl"
else
run: $(TARGET_BUILD_DIR)/modelsim.ini $(TARGET_BUILD_DIR)/work $(TARGET_BUILD_DIR)/boot $(TARGET_BUILD_DIR)/tcl_files $(TARGET_BUILD_DIR)/stdout $(TARGET_BUILD_DIR)/fs $(TARGET_BUILD_DIR)/waves
$(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
endif
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ifneq '$(pulp_chip)' 'pulp_cluster'
ifdef gui
cd $(TARGET_BUILD_DIR) && export VSIM_RUNNER_FLAGS='$(vsim_flags)' && export VOPT_ACC_ENA="YES" && $(VSIM) -64 -do 'source $(VSIM_PATH)/tcl_files/config/run_and_exit.tcl' -do 'source $(VSIM_PATH)/tcl_files/run.tcl; '
else
@ -335,6 +343,8 @@ endif
endif
endif
ifeq '$(platform)' 'fpga'
run:
$(PULPRT_HOME)/bin/elf_run_genesys2.sh $(TARGETS)