Most important effect of this change: rfnoc_image_builder is now required to build bitfiles, 'make' alone won't suffice any longer! This is a huge changeset to the image builder that combines multiple new features: - There no longer is a separate edge file for the static router. The static routes are generated as a Verilog parameter directly into the rfnoc_core_kernel (which is also modified). - image_builder.py is split up into several smaller files. Code is moved into yaml_utils.py, and the new files grc.py, builder_config.py - Generic module support is added. Aside from noc blocks and stream endpoints, we can now instantiate arbitrary modules (they also require a YAML description file). - To enable such modules, resets are now also tracked the same way that clock domains are. - The ImageBuilderConfig config object now more closes matches the original YAML file. The attributes 'clk_domain_con' and 'block_con' are removed. Instead, the attributes 'connections' and 'clk_domains' are sanitized and amended with extra annotations. The templates are updated to reflect this change. - IO ports can now carry parameters, e.g., to have variable wire widths based on the configuration. - Many Pylint warnings were resolved. - Add inheritance support for image core YAML files. This allows image core files to (recursively) inherit from other image core files. To do so, simply put an 'inherit' entry at the top of the file: ```yaml inherit: 'x410_radio_base.yml' ``` - The inheritance feature is used as part of the image core files. - Image core and DTS files are now generated as a build artefact into the build directory. This requires the usage of rfnoc_image_builder to build images. As a consequence, it is no longer required to check in image core Verilog files. - As another consequence, rfnoc_image_builder is required to build bitfiles! - Image flavours are no longer defined through Makefiles, but purely from the image core YAML files. - Remove all image core YAML files that do not generate a shipping image. Because of the inheritance feature and the requirement to use the image builder, it is trivial to add new YAML files. - Add support for transport adapters through the YAML files. Before, transport adapters were inferred from the make target (e.g., X410_X4_200 would have four 10GbE links based on the 'X4' substring). Now, transport adapters are defined via the image core YAML. - This feature is currently only used (or can be used) by the X4xx series. Older devices may or may not be ported to allow custom transport adapters in the future. - Add parameters to the BSP YAMLs and the devices itself. This allows setting global parameters in the image core files. For example, the X4x0 devices use this to decide if they instantiate DRAM channels. - DTS includes and constraint files can now be requested by blocks/transport adapter through their YAML files. They do no longer need to be listed in the Makefile. - Support for secure image cores. These are image cores that allow incorporating RFNoC blocks that require license keys and thus can't live in an open-source environment. This solution adds the option for secure image cores without touching the open source feature set. - Add --reuse option to allow manual editing of generated artefacts - Allow IO signatures from any module: until now IO signatures had to be defined in a single file (io_signatures). This file will persist. In addition each module can add its own IO signature as with the same format the core IO signatures placed under the top level key `io_signatures`. IO signatures are still maintained in a global dictionary. The consequence is that they can be shared among independent modules as well as they have to have a globally unique name. The image builder will warn about detected name clashes for the signatures. - As a consequence, some less commonly used IO signatures were moved to their corresponding module YAML files. Co-authored-by: Wade Fife <wade.fife@ni.com> Co-authored-by: Lars Amsel <lars.amsel@ni.com> Original-commit: a98ce2621e2a2dc25535fc700b49bfcb00b8eb59
165 lines
5.6 KiB
Makefile
165 lines
5.6 KiB
Makefile
#
|
|
# Copyright 2012-2016 Ettus Research LLC
|
|
#
|
|
|
|
# NOTE: All comments prefixed with a "##" will be displayed as a part of the "make help" target
|
|
##-------------------
|
|
##USRP X3X0 FPGA Help
|
|
##-------------------
|
|
##Usage:
|
|
## make <Targets> <Options>
|
|
##
|
|
##Output:
|
|
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.bit: Configuration bitstream with header
|
|
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.bin: Configuration bitstream without header
|
|
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.lvbitx: Configuration bitstream for PCIe (NI-RIO)
|
|
## $(BUILD_OUTPUT_DIR)/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
|
|
|
# Debug Options
|
|
# Uncomment the following line to add a debug UART on GPIO 10 & 11
|
|
#OPTIONS += DEBUG_UART=1
|
|
|
|
CREATE_LVBITX=python3 ../../lib/io_port2/create-lvbitx.py
|
|
|
|
# Base output directory for all builds.
|
|
BUILD_BASE_DIR ?= .
|
|
# Base directory for the build outputs.
|
|
BUILD_OUTPUT_DIR ?= $(BUILD_BASE_DIR)/build
|
|
|
|
# Initialize a build seed. This can be changed to randomly affect build results.
|
|
BUILD_SEED ?= 0
|
|
# The image core name is something like 'usrp_x310_fpga_XG'
|
|
IMAGE_CORE_NAME ?= usrp_fpga
|
|
|
|
GIGE_DEFS=BUILD_1G=1 SFP0_1GBE=1 SFP1_1GBE=1 $(OPTIONS) BUILD_SEED=$(BUILD_SEED)
|
|
HG_DEFS=BUILD_1G=1 BUILD_10G=1 SFP0_1GBE=1 SFP1_10GBE=1 $(OPTIONS) BUILD_SEED=$(BUILD_SEED)
|
|
XG_DEFS=BUILD_10G=1 SFP0_10GBE=1 SFP1_10GBE=1 $(OPTIONS) BUILD_SEED=$(BUILD_SEED)
|
|
HA_DEFS=BUILD_1G=1 BUILD_AURORA=1 SFP0_1GBE=1 SFP1_AURORA=1 $(OPTIONS) BUILD_SEED=$(BUILD_SEED)
|
|
XA_DEFS=BUILD_10G=1 BUILD_AURORA=1 SFP0_10GBE=1 SFP1_AURORA=1 $(OPTIONS) BUILD_SEED=$(BUILD_SEED)
|
|
|
|
# Set build option (check RTL, run synthesis, or do a full build)
|
|
ifndef TARGET
|
|
ifeq ($(CHECK), 1)
|
|
TARGET = rtl
|
|
else ifeq ($(SYNTH), 1)
|
|
TARGET = synth
|
|
else ifeq ($(IP_ONLY), 1)
|
|
TARGET = viv_ip
|
|
else
|
|
TARGET = bin
|
|
endif
|
|
endif
|
|
TOP ?= x300
|
|
|
|
# vivado_build($1=Device, $2=Definitions)
|
|
vivado_build = make -f Makefile.x300.inc $(TARGET) NAME=$@ ARCH=$(XIL_ARCH_$1) PART_ID=$(XIL_PART_ID_$1) $2 TOP_MODULE=$(TOP) EXTRA_DEFS="$2"
|
|
vivado_ip = make -f Makefile.x300.inc viv_ip NAME=$@ ARCH=$(XIL_ARCH_$1) PART_ID=$(XIL_PART_ID_$1) $2 TOP_MODULE=$(TOP) EXTRA_DEFS="$2"
|
|
|
|
# post_build($1=Device, $2=Option)
|
|
ifeq ($(TARGET),bin)
|
|
post_build = @\
|
|
mkdir -p $(BUILD_OUTPUT_DIR); \
|
|
echo "Exporting bitstream files..."; \
|
|
cp $(ARTIFACT_DIR)/x300.bin $(BUILD_OUTPUT_DIR)/$(IMAGE_CORE_NAME).bin; \
|
|
cp $(ARTIFACT_DIR)/x300.bit $(BUILD_OUTPUT_DIR)/$(IMAGE_CORE_NAME).bit; \
|
|
echo "Generating LVBITX..."; \
|
|
$(CREATE_LVBITX) --input-bin=$(ARTIFACT_DIR)/x300.bin --output-lvbitx=$(BUILD_OUTPUT_DIR)/$(IMAGE_CORE_NAME).lvbitx --device="USRP $(1)" x3x0_base.lvbitx; \
|
|
cp -f x3x0_base.lvbitx $(BUILD_OUTPUT_DIR)/`echo $(1) | tr A-Z a-z`.lvbitx_base; \
|
|
echo "Exporting build report..."; \
|
|
cp $(ARTIFACT_DIR)/build.rpt $(BUILD_OUTPUT_DIR)/$(IMAGE_CORE_NAME).rpt; \
|
|
echo "Build DONE ... $(1)_$(2)";
|
|
else
|
|
post_build = @echo "Skipping bitfile export."
|
|
endif
|
|
|
|
##
|
|
##Supported Targets
|
|
##-----------------
|
|
##all: X300_HG X310_HG X300_XG X310_XG (Default target)
|
|
all: X300_HG X310_HG X300_XG X310_XG
|
|
|
|
##X300_IP: Build IP for X300 only.
|
|
X300_IP:
|
|
+$(call vivado_ip,X300,$(HG_DEFS) X300=1)
|
|
|
|
##X310_IP: Build IP for X310 only.
|
|
X310_IP:
|
|
+$(call vivado_ip,X310,$(HG_DEFS) X310=1)
|
|
|
|
##X310_1G: 1GigE on both SFP+ ports.
|
|
X310_1G: X310_IP
|
|
$(call vivado_build,X310,$(GIGE_DEFS) X310=1)
|
|
$(call post_build,X310,1G)
|
|
|
|
##X300_1G: 1GigE on both SFP+ ports.
|
|
X300_1G: X300_IP
|
|
$(call vivado_build,X300,$(GIGE_DEFS) X300=1)
|
|
$(call post_build,X300,1G)
|
|
|
|
##X310_HG: 1GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
|
X310_HG: X310_IP
|
|
$(call vivado_build,X310,$(HG_DEFS) X310=1)
|
|
$(call post_build,X310,HG)
|
|
|
|
##X300_HG: 1GigE on SFP+ Port0, 10Gig on SFP+ Port1.
|
|
X300_HG: X300_IP
|
|
$(call vivado_build,X300,$(HG_DEFS) X300=1)
|
|
$(call post_build,X300,HG)
|
|
|
|
##X310_XG: 10GigE on both SFP+ ports.
|
|
X310_XG: X310_IP
|
|
$(call vivado_build,X310,$(XG_DEFS) X310=1)
|
|
$(call post_build,X310,XG)
|
|
|
|
##X300_XG: 10GigE on both SFP+ ports.
|
|
X300_XG: X300_IP
|
|
$(call vivado_build,X300,$(XG_DEFS) X300=1)
|
|
$(call post_build,X300,XG)
|
|
|
|
##X310_HA: 1Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
|
X310_HA: X310_IP
|
|
$(call vivado_build,X310,$(HA_DEFS) X310=1)
|
|
$(call post_build,X310,HA)
|
|
|
|
##X300_HA: 1Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
|
X300_HA: X300_IP
|
|
$(call vivado_build,X300,$(HA_DEFS) X300=1)
|
|
$(call post_build,X300,HA)
|
|
|
|
##X310_XA: 10Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
|
X310_XA: X310_IP
|
|
$(call vivado_build,X310,$(XA_DEFS) X310=1)
|
|
$(call post_build,X310,XA)
|
|
|
|
##X300_XA: 10Gig on SFP+ Port0, Aurora on SFP+ Port1.
|
|
X300_XA: X300_IP
|
|
$(call vivado_build,X300,$(XA_DEFS) X300=1)
|
|
$(call post_build,X300,XA)
|
|
|
|
clean: ##Clean up all target build outputs.
|
|
@echo "Cleaning targets..."
|
|
@rm -rf $(BUILD_BASE_DIR)/build-X3*_* $(BUILD_BASE_DIR)/build-x3*
|
|
@rm -rf $(BUILD_OUTPUT_DIR)
|
|
|
|
cleanall: ##Clean up all target and ip build outputs.
|
|
@echo "Cleaning targets and IP..."
|
|
@rm -rf build-ip
|
|
@rm -rf $(BUILD_BASE_DIR)/build-X3*_* $(BUILD_BASE_DIR)/build-x3*
|
|
@rm -rf $(BUILD_OUTPUT_DIR)
|
|
|
|
help: ##Show this help message.
|
|
@grep -h "##" Makefile | grep -v "\"##\"" | sed -e 's/\\$$//' | sed -e 's/##//'
|
|
|
|
##
|
|
##Supported Options
|
|
##-----------------
|
|
##GUI=1 Launch the build in the Vivado GUI.
|
|
##PROJECT=1 Save Vivado project file, otherwise it's created in memory.
|
|
##CHECK=1 Launch the syntax checker instead of building a bitfile.
|
|
##IP_ONLY=1 Launch the build but stop after IP generation.
|
|
##SYNTH=1 Launch the build but stop after synthesis.
|
|
##BUILD_SEED=<N> Build seed to used to affect build results. (Default is 0)
|
|
##TOP=<module> Specify a top module for syntax checking. (Default is the bitfile top)
|
|
|
|
.PHONY: all clean cleanall help
|