fpga: tools: remove temporary Xilinx directories for BD recreation

During recreation of block diagrams any RTL modules will be kept in
hidden directories within the build directory. Updates of the RTL
sources might not be taken into account. Solution is to remove Xilinx's
hidden project directories before calling vivado.


Original-commit: f17a5113e228ac1bc5312193eb8f687e127184a3
This commit is contained in:
Max Köhler
2020-06-15 13:54:35 -05:00
committed by Wade Fife
parent d16d1e121c
commit 2a8ec5df90
+13 -10
View File
@@ -16,7 +16,7 @@ endif
# $4 = IP_SRC_DIR (Absolute path to the top level ip src dir) # $4 = IP_SRC_DIR (Absolute path to the top level ip src dir)
# $5 = IP_BUILD_DIR (Absolute path to the top level ip build dir) # $5 = IP_BUILD_DIR (Absolute path to the top level ip build dir)
# $6 = GENERATE_EXAMPLE (0 or 1) # $6 = GENERATE_EXAMPLE (0 or 1)
# Prereqs: # Prereqs:
# - TOOLS_DIR must be defined globally # - TOOLS_DIR must be defined globally
# ------------------------------------------------------------------- # -------------------------------------------------------------------
BUILD_VIVADO_IP = \ BUILD_VIVADO_IP = \
@@ -29,7 +29,8 @@ BUILD_VIVADO_IP = \
export GEN_EXAMPLE=$(6); \ export GEN_EXAMPLE=$(6); \
export SYNTH_IP=$(SYNTH_IP); \ export SYNTH_IP=$(SYNTH_IP); \
echo "BUILDER: Staging IP in build directory..."; \ echo "BUILDER: Staging IP in build directory..."; \
rm -rf $(5)/$(1)/*; \ rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \ $(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \ cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting IP to part $(2)/$(3)..."; \ echo "BUILDER: Retargeting IP to part $(2)/$(3)..."; \
@@ -48,7 +49,7 @@ BUILD_VIVADO_IP = \
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]]) # $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $4 = BD_SRC_DIR (Absolute path to the top level ip src dir) # $4 = BD_SRC_DIR (Absolute path to the top level ip src dir)
# $5 = BD_BUILD_DIR (Absolute path to the top level ip build dir) # $5 = BD_BUILD_DIR (Absolute path to the top level ip build dir)
# Prereqs: # Prereqs:
# - TOOLS_DIR must be defined globally # - TOOLS_DIR must be defined globally
# ------------------------------------------------------------------- # -------------------------------------------------------------------
BUILD_VIVADO_BD = \ BUILD_VIVADO_BD = \
@@ -59,15 +60,16 @@ BUILD_VIVADO_BD = \
export BD_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).bd); \ export BD_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).bd); \
export PART_NAME=`python $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \ export PART_NAME=`python $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
echo "BUILDER: Staging BD in build directory..."; \ echo "BUILDER: Staging BD in build directory..."; \
rm $(5)/$(1)/* -rf; \ rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \ $(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \ cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \ echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \
cd $(5)/$(1); \ cd $(5)/$(1); \
echo "BUILDER: Building BD..."; \ echo "BUILDER: Building BD..."; \
export VIV_ERR=0; \ export VIV_ERR=0; \
$(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_bd.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \ $(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_bd.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \ $(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR exit $$VIV_ERR
# ------------------------------------------------------------------- # -------------------------------------------------------------------
@@ -79,7 +81,7 @@ BUILD_VIVADO_BD = \
# $5 = BDTCL_BUILD_DIR (Absolute path to the top level ip build dir) # $5 = BDTCL_BUILD_DIR (Absolute path to the top level ip build dir)
# $6 = BD_IP_REPOS (space-separated list of absolute paths to IP repos) # $6 = BD_IP_REPOS (space-separated list of absolute paths to IP repos)
# $7 = BD_HDL_SRCS (space-separated list of absolute paths to HDL sources) # $7 = BD_HDL_SRCS (space-separated list of absolute paths to HDL sources)
# Prereqs: # Prereqs:
# - TOOLS_DIR must be defined globally # - TOOLS_DIR must be defined globally
# ------------------------------------------------------------------- # -------------------------------------------------------------------
BUILD_VIVADO_BDTCL = \ BUILD_VIVADO_BDTCL = \
@@ -92,13 +94,14 @@ BUILD_VIVADO_BDTCL = \
export BD_IP_REPOS=$(call RESOLVE_PATH,$(6)); \ export BD_IP_REPOS=$(call RESOLVE_PATH,$(6)); \
export BD_HDL_SRCS=$(call RESOLVE_PATHS,$(7)); \ export BD_HDL_SRCS=$(call RESOLVE_PATHS,$(7)); \
echo "BUILDER: Staging BD Tcl in build directory..."; \ echo "BUILDER: Staging BD Tcl in build directory..."; \
rm $(5)/$(1)/* -rf; \ rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \ $(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \ cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \ echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \
cd $(5)/$(1); \ cd $(5)/$(1); \
echo "BUILDER: Generating BD..."; \ echo "BUILDER: Generating BD..."; \
export VIV_ERR=0; \ export VIV_ERR=0; \
$(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_bd.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \ $(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_bd.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \ $(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR exit $$VIV_ERR