fpga: Add BUILD_BASE_DIR option to makefiles
Adds a BUILD_BASE_DIR makefile variable that allows you to specify the base directory for FPGA build outputs. This allows you to put the output from each run of make into a unique directory, or to run multiple instances of make in parallel with each build's output being put in a different directory. For example: make X310_XG BUILD_BASE_DIR=/path/to/builds Original-commit: bc6db8409ba756bbad0d0c158ffb00c614b58fd9
This commit is contained in:
@@ -23,12 +23,12 @@ endif
|
|||||||
TOOLS_DIR = $(BASE_DIR)/../tools
|
TOOLS_DIR = $(BASE_DIR)/../tools
|
||||||
LIB_DIR = $(BASE_DIR)/../lib
|
LIB_DIR = $(BASE_DIR)/../lib
|
||||||
|
|
||||||
O ?= .
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
ifdef NAME
|
ifdef NAME
|
||||||
BUILD_DIR = $(abspath $(O)/build-$(NAME))
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build-$(NAME))
|
||||||
else
|
else
|
||||||
BUILD_DIR = $(abspath $(O)/build)
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ endif
|
|||||||
TOOLS_DIR = $(BASE_DIR)/../tools
|
TOOLS_DIR = $(BASE_DIR)/../tools
|
||||||
LIB_DIR = $(BASE_DIR)/../lib
|
LIB_DIR = $(BASE_DIR)/../lib
|
||||||
|
|
||||||
O ?= .
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
ifdef NAME
|
ifdef NAME
|
||||||
BUILD_DIR = $(abspath $(O)/build-$(NAME))
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build-$(NAME))
|
||||||
else
|
else
|
||||||
BUILD_DIR = $(abspath $(O)/build)
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
||||||
|
|||||||
@@ -24,12 +24,12 @@ SIMLIB_DIR = $(abspath $(BASE_DIR)/../sim)
|
|||||||
LIB_IP_DIR = $(abspath $(LIB_DIR)/ip)
|
LIB_IP_DIR = $(abspath $(LIB_DIR)/ip)
|
||||||
HLS_IP_DIR = $(abspath $(LIB_DIR)/hls)
|
HLS_IP_DIR = $(abspath $(LIB_DIR)/hls)
|
||||||
|
|
||||||
O ?= .
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
ifdef NAME
|
ifdef NAME
|
||||||
BUILD_DIR = $(abspath $(O)/build-$(NAME))
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build-$(NAME))
|
||||||
else
|
else
|
||||||
BUILD_DIR = $(abspath $(O)/build)
|
BUILD_DIR = $(abspath $(BUILD_BASE_DIR)/build)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
IP_BUILD_DIR = $(abspath ./build-ip/$(subst /,,$(PART_ID)))
|
||||||
|
|||||||
+5
-2
@@ -14,6 +14,9 @@
|
|||||||
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
||||||
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
||||||
|
|
||||||
|
# Base output directory for all builds
|
||||||
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
# Initialize a build seed. This can be changed to randomly affect build results.
|
# Initialize a build seed. This can be changed to randomly affect build results.
|
||||||
BUILD_SEED ?= 0
|
BUILD_SEED ?= 0
|
||||||
DEFS += BUILD_SEED=$(BUILD_SEED)
|
DEFS += BUILD_SEED=$(BUILD_SEED)
|
||||||
@@ -42,9 +45,9 @@ ifeq ($(TARGET),bin)
|
|||||||
post_build = @\
|
post_build = @\
|
||||||
mkdir -p build; \
|
mkdir -p build; \
|
||||||
echo "Exporting bitstream file..."; \
|
echo "Exporting bitstream file..."; \
|
||||||
cp build-$(1)/e31x.bit build/usrp_`echo $(2) | tr A-Z a-z`_fpga.bit; \
|
cp $(BUILD_BASE_DIR)/build-$(1)/e31x.bit build/usrp_`echo $(2) | tr A-Z a-z`_fpga.bit; \
|
||||||
echo "Exporting build report..."; \
|
echo "Exporting build report..."; \
|
||||||
cp build-$(1)/build.rpt build/usrp_`echo $(2) | tr A-Z a-z`_fpga.rpt; \
|
cp $(BUILD_BASE_DIR)/build-$(1)/build.rpt build/usrp_`echo $(2) | tr A-Z a-z`_fpga.rpt; \
|
||||||
echo "Build DONE ... $(1)";
|
echo "Build DONE ... $(1)";
|
||||||
else
|
else
|
||||||
post_build = @echo "Skipping bitfile export."
|
post_build = @echo "Skipping bitfile export."
|
||||||
|
|||||||
+5
-2
@@ -14,6 +14,9 @@
|
|||||||
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
||||||
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
||||||
|
|
||||||
|
# Base output directory for all builds
|
||||||
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
# Initialize a build seed. This can be changed to randomly affect build results.
|
# Initialize a build seed. This can be changed to randomly affect build results.
|
||||||
BUILD_SEED ?= 0
|
BUILD_SEED ?= 0
|
||||||
|
|
||||||
@@ -45,9 +48,9 @@ ifeq ($(TARGET),bin)
|
|||||||
post_build = @\
|
post_build = @\
|
||||||
mkdir -p build; \
|
mkdir -p build; \
|
||||||
echo "Exporting bitstream file..."; \
|
echo "Exporting bitstream file..."; \
|
||||||
cp build-$(1)_$(2)/e320.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/e320.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||||
echo "Exporting build report..."; \
|
echo "Exporting build report..."; \
|
||||||
cp build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||||
echo "Build DONE ... $(1)_$(2)";
|
echo "Build DONE ... $(1)_$(2)";
|
||||||
else
|
else
|
||||||
post_build = @echo "Skipping bitfile export."
|
post_build = @echo "Skipping bitfile export."
|
||||||
|
|||||||
+5
-2
@@ -23,6 +23,9 @@
|
|||||||
# Uncomment this line to add four example Aurora loopback lanes on the QSFP NPIO bus.
|
# Uncomment this line to add four example Aurora loopback lanes on the QSFP NPIO bus.
|
||||||
# OPTIONS += QSFP_LANES=4
|
# OPTIONS += QSFP_LANES=4
|
||||||
|
|
||||||
|
# Base output directory for all builds
|
||||||
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
# Initialize a build seed. This can be changed to randomly affect build results.
|
# Initialize a build seed. This can be changed to randomly affect build results.
|
||||||
BUILD_SEED ?= 0
|
BUILD_SEED ?= 0
|
||||||
|
|
||||||
@@ -68,9 +71,9 @@ ifeq ($(TARGET),bin)
|
|||||||
post_build = @\
|
post_build = @\
|
||||||
mkdir -p build; \
|
mkdir -p build; \
|
||||||
echo "Exporting bitstream file..."; \
|
echo "Exporting bitstream file..."; \
|
||||||
cp build-$(1)_$(2)/n3xx.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/n3xx.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||||
echo "Exporting build report..."; \
|
echo "Exporting build report..."; \
|
||||||
cp build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||||
echo "Build DONE ... $(1)_$(2)";
|
echo "Build DONE ... $(1)_$(2)";
|
||||||
else
|
else
|
||||||
post_build = @echo "Skipping bitfile export."
|
post_build = @echo "Skipping bitfile export."
|
||||||
|
|||||||
+7
-4
@@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
CREATE_LVBITX=python ../../lib/io_port2/create-lvbitx.py
|
CREATE_LVBITX=python ../../lib/io_port2/create-lvbitx.py
|
||||||
|
|
||||||
|
# Base output directory for all builds
|
||||||
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
# Initialize a build seed. This can be changed to randomly affect build results.
|
# Initialize a build seed. This can be changed to randomly affect build results.
|
||||||
BUILD_SEED ?= 0
|
BUILD_SEED ?= 0
|
||||||
|
|
||||||
@@ -56,13 +59,13 @@ ifeq ($(TARGET),bin)
|
|||||||
post_build = @\
|
post_build = @\
|
||||||
mkdir -p build; \
|
mkdir -p build; \
|
||||||
echo "Exporting bitstream files..."; \
|
echo "Exporting bitstream files..."; \
|
||||||
cp build-$(1)_$(2)/x300.bin build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bin; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/x300.bin build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bin; \
|
||||||
cp build-$(1)_$(2)/x300.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/x300.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||||
echo "Generating LVBITX..."; \
|
echo "Generating LVBITX..."; \
|
||||||
$(CREATE_LVBITX) --input-bin=build-$(1)_$(2)/x300.bin --output-lvbitx=build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).lvbitx --device="USRP $(1)" x3x0_base.lvbitx; \
|
$(CREATE_LVBITX) --input-bin=$(BUILD_BASE_DIR)/build-$(1)_$(2)/x300.bin --output-lvbitx=build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).lvbitx --device="USRP $(1)" x3x0_base.lvbitx; \
|
||||||
cp -f x3x0_base.lvbitx build/`echo $(1) | tr A-Z a-z`.lvbitx_base; \
|
cp -f x3x0_base.lvbitx build/`echo $(1) | tr A-Z a-z`.lvbitx_base; \
|
||||||
echo "Exporting build report..."; \
|
echo "Exporting build report..."; \
|
||||||
cp build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||||
echo "Build DONE ... $(1)_$(2)";
|
echo "Build DONE ... $(1)_$(2)";
|
||||||
else
|
else
|
||||||
post_build = @echo "Skipping bitfile export."
|
post_build = @echo "Skipping bitfile export."
|
||||||
|
|||||||
+4
-3
@@ -16,7 +16,8 @@
|
|||||||
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
## build/usrp_<product>_fpga_<image_type>.dts: Device tree source file
|
||||||
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
## build/usrp_<product>_fpga_<image_type>.rpt: Build report (includes utilization and timing summary)
|
||||||
|
|
||||||
|
# Base output directory for all builds
|
||||||
|
BUILD_BASE_DIR ?= .
|
||||||
|
|
||||||
# Definitions
|
# Definitions
|
||||||
# MGT Types from x4xx_mgt_type.vh
|
# MGT Types from x4xx_mgt_type.vh
|
||||||
@@ -97,9 +98,9 @@ ifeq ($(TARGET),bin)
|
|||||||
post_build = @\
|
post_build = @\
|
||||||
mkdir -p build; \
|
mkdir -p build; \
|
||||||
echo "Exporting bitstream file..."; \
|
echo "Exporting bitstream file..."; \
|
||||||
cp build-$(1)_$(2)/x4xx.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/x4xx.bit build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).bit; \
|
||||||
echo "Exporting build report..."; \
|
echo "Exporting build report..."; \
|
||||||
cp build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
cp $(BUILD_BASE_DIR)/build-$(1)_$(2)/build.rpt build/usrp_`echo $(1) | tr A-Z a-z`_fpga_$(2).rpt; \
|
||||||
echo "Build DONE ... $(1)_$(2)";
|
echo "Build DONE ... $(1)_$(2)";
|
||||||
else
|
else
|
||||||
post_build = @echo "Skipping bitfile export."
|
post_build = @echo "Skipping bitfile export."
|
||||||
|
|||||||
Reference in New Issue
Block a user