Files
b210-k7-fpga/tools/make/viv_ip_builder.mak
adf6f576c6 mpm/fpga: x4xx: Major updates in preparation for future devices
FPGA:
- Split up MB registers that control daughterboard specific settings so
  that daughterboards 0 and 1 could have different setings, in
  preparation for future devices that require different settings.
  This requires a compat number bump to 8.0.
- Add registers for additional RFDC information, including the
  block/tile mapping of the individual channels, and information about
  resampling capabilities
- Identify sections of code that would be specific to X410/ZBX and move
  them to their own headers, so it's trivial to add device-specific
  sections of code instead for other devices in the future.
  - This includes constraints for clocks and I/O pins.
- Remove ability to do timed ctrlport transactions to the MB CPLD, this
  was unused and possibly broken.
- Move daughterboard-specific code into its own code location
  (dboards/zbx)
- Move X410-specific register documentation to its own location
  (doc/X410)
- Refactor Makefiles to split out X410/ZBX specific components and allow
  switching between device types
- Add 512-bit AXI interconnects
- Make number of timekeepers configurable (X410 keeps the single
  timekeeper)

MPM:
- Required compat is bumped to 8.0
- Now supports new registers for detecting DSP capabilities and
  multi-rate settings for the daughterboards
- Adds MMCM controls (currently unused)

Co-authored-by: Wade Fife <wade.fife@ni.com>
Co-authored-by: Ryan Marlow <ryan@lmarlow.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>


Original-commit: c1d268917ea65dd9c5a42366014cb96d3c025223
2023-05-23 09:06:17 +02:00

177 lines
8.2 KiB
Makefile

#
# Copyright 2014 Ettus Research
#
ifeq ($(SIMULATION),1)
SYNTH_IP=0
else
SYNTH_IP=1
endif
# -------------------------------------------------------------------
# Usage: BUILD_VIVADO_IP
# Args: $1 = IP_NAME (IP name)
# $2 = ARCH (zynq, kintex7, etc)
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $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)
# $6 = GENERATE_EXAMPLE (0 or 1)
# Prereqs:
# - TOOLS_DIR must be defined globally
# -------------------------------------------------------------------
BUILD_VIVADO_IP = \
@ \
echo "========================================================"; \
echo "BUILDER: Building IP $(1)"; \
echo "========================================================"; \
export XCI_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).xci); \
export PART_NAME=`python3 $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
export GEN_EXAMPLE=$(6); \
export SYNTH_IP=$(SYNTH_IP); \
echo "BUILDER: Staging IP in build directory..."; \
rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting IP to part $(2)/$(3)..."; \
python3 $(TOOLS_DIR)/scripts/viv_ip_xci_editor.py --output_dir=$(5)/$(1) --target=$(2)/$(3) retarget $(4)/$(1)/$(1).xci; \
cd $(5); \
echo "BUILDER: Building IP..."; \
export VIV_ERR=0; \
$(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_ip.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR
# -------------------------------------------------------------------
# Usage: BUILD_VIVADO_IP_WITH_SUBCORES
# Args: $1 = IP_NAME (IP name)
# $2 = ARCH (zynq, kintex7, etc)
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $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)
# $6 = GENERATE_EXAMPLE (0 or 1)
# Prereqs:
# - TOOLS_DIR must be defined globally
# -------------------------------------------------------------------
BUILD_VIVADO_IP_WITH_SUBCORES = \
@ \
echo "========================================================"; \
echo "BUILDER: Building IP $(1)"; \
echo "========================================================"; \
export XCI_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).xci); \
export PART_NAME=`python3 $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
export GEN_EXAMPLE=$(6); \
export SYNTH_IP=$(SYNTH_IP); \
echo "BUILDER: Staging IP in build directory..."; \
rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting IP to part $(2)/$(3)..."; \
python3 $(TOOLS_DIR)/scripts/viv_ip_xci_editor.py --output_dir=$(5)/$(1) --target=$(2)/$(3) retarget $(4)/$(1)/$(1).xci; \
python3 $(TOOLS_DIR)/scripts/viv_ip_retarget_subcores.py --output_dir=$(5)/$(1) --target=$(2)/$(3) $(4)/$(1)/$(1).xci; \
cd $(5); \
echo "BUILDER: Building IP..."; \
export VIV_ERR=0; \
$(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_ip.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR
# -------------------------------------------------------------------
# Usage: REBUILD_VIVADO_IP_WITH_PATCH
# Args: $1 = IP_NAME (IP name)
# $2 = ARCH (zynq, kintex7, etc)
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $4 = IP_SRC_DIR (Absolute path to the top level ip src dir)
# $5 = IP_BUILD_DIR (Not used here, but kept for consistency with BUILD_VIVADO_IP)
# $6 = GENERATE_EXAMPLE (0 or 1)
# $7 = PATCHED_FILE (Patched version of the file from previous IP build)
# $8 = FILE_TO_PATCH (Path to file that needs to be patched)
# Prereqs:
# - TOOLS_DIR must be defined globally
# - This assumes BUILD_VIVADO_IP has been run once
# -------------------------------------------------------------------
REBUILD_VIVADO_IP_WITH_PATCH = \
@ \
echo "========================================================"; \
echo "BUILDER: Building Patched IP $(1)"; \
echo "========================================================"; \
export XCI_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).xci); \
export PART_NAME=`python3 $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
export GEN_EXAMPLE=$(6); \
export SYNTH_IP=$(SYNTH_IP); \
export PATCHED_FILE=$(7); \
export FILE_TO_PATCH=$(8); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cd $(5); \
echo "BUILDER: Building Patched IP..."; \
export VIV_ERR=0; \
$(TOOLS_DIR)/scripts/launch_vivado.py -mode batch -source $(call RESOLVE_PATH,$(TOOLS_DIR)/scripts/viv_generate_patch_ip.tcl) -log $(1).log -nojournal || export VIV_ERR=$$?; \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR
# -------------------------------------------------------------------
# Usage: BUILD_VIVADO_BD
# Args: $1 = BD_NAME (IP name)
# $2 = ARCH (zynq, kintex7, etc)
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $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)
# Prereqs:
# - TOOLS_DIR must be defined globally
# -------------------------------------------------------------------
BUILD_VIVADO_BD = \
@ \
echo "========================================================"; \
echo "BUILDER: Building BD $(1)"; \
echo "========================================================"; \
export BD_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).bd); \
export PART_NAME=`python3 $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
echo "BUILDER: Staging BD in build directory..."; \
rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \
cd $(5)/$(1); \
echo "BUILDER: Building BD..."; \
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/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR
# -------------------------------------------------------------------
# Usage: BUILD_VIVADO_BDTCL
# Args: $1 = BD_NAME (IP name)
# $2 = ARCH (zynq, kintex7, etc)
# $3 = PART_ID (<device>/<package>/<speedgrade>[/<tempgrade>[/<silicon revision>]])
# $4 = BDTCL_SRC_DIR (Absolute path to the top level ip src 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)
# $7 = BD_HDL_SRCS (space-separated list of absolute paths to HDL sources)
# Prereqs:
# - TOOLS_DIR must be defined globally
# -------------------------------------------------------------------
BUILD_VIVADO_BDTCL = \
@ \
echo "========================================================"; \
echo "BUILDER: Generating BD from Tcl $(1)"; \
echo "========================================================"; \
export BD_FILE=$(call RESOLVE_PATH,$(5)/$(1)/$(1).tcl); \
export PART_NAME=`python3 $(TOOLS_DIR)/scripts/viv_gen_part_id.py $(2)/$(3)`; \
export BD_IP_REPOS=$(call RESOLVE_PATH,$(6)); \
export BD_HDL_SRCS=$(call RESOLVE_PATHS,$(7)); \
echo "BUILDER: Staging BD Tcl in build directory..."; \
rm -rf $(5)/$(1); \
mkdir -p $(5)/$(1); \
$(TOOLS_DIR)/scripts/shared-ip-loc-manage.sh --path=$(5)/$(1) reserve; \
cp -rf $(4)/$(1)/* $(5)/$(1); \
echo "BUILDER: Retargeting BD to part $(2)/$(3)..."; \
cd $(5)/$(1); \
echo "BUILDER: Generating BD..."; \
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/shared-ip-loc-manage.sh --path=$(5)/$(1) release; \
exit $$VIV_ERR