rules: Fail if VSIM_PATH is undefined

You might think these are too many checks, but in fact each is needed to
cover all possible edge cases.

For example you could remove all the VSIM_PATH checks when creating the
symlink and force the creation of symlink (-f flag), but this will fail
for /boot, since on many machines /boot does actually exist.

Removing VSIM_PATH from the run target can cause problems when calling
run with a pre-compiled build directory etc.
This commit is contained in:
bluew 2020-12-16 18:31:07 +01:00
parent 3b2079e1bc
commit 14e29fb342

View file

@ -212,15 +212,31 @@ endif
ifeq '$(platform)' 'rtl'
$(TARGET_BUILD_DIR)/modelsim.ini:
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ln -s $(VSIM_PATH)/modelsim.ini $@
$(TARGET_BUILD_DIR)/boot:
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ln -s $(VSIM_PATH)/boot $@
$(TARGET_BUILD_DIR)/tcl_files:
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ln -s $(VSIM_PATH)/tcl_files $@
$(TARGET_BUILD_DIR)/waves:
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ln -s $(VSIM_PATH)/waves $@
$(TARGET_BUILD_DIR)/stdout:
@ -232,7 +248,10 @@ $(TARGET_BUILD_DIR)/fs:
run: $(TARGET_BUILD_DIR)/modelsim.ini $(TARGET_BUILD_DIR)/boot $(TARGET_BUILD_DIR)/tcl_files \
$(TARGET_BUILD_DIR)/stdout $(TARGET_BUILD_DIR)/fs
$(PULPRT_HOME)/bin/stim_utils.py --binary=$(TARGETS) --vectors=$(TARGET_BUILD_DIR)/vectors/stim.txt
ifndef VSIM_PATH
$(error "VSIM_PATH is undefined. Either call \
'source $$YOUR_HW_DIR/setup/vsim.sh' or set it manually.")
endif
ifdef gui
cd $(TARGET_BUILD_DIR) && export VSIM_RUNNER_FLAGS="+ENTRY_POINT=0x1c008080 -gLOAD_L2=JTAG -dpicpppath /usr/bin/g++ -permit_unmatched_virtual_intf -gBAUDRATE=115200" && 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