diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-11-01 11:58:21 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:33 -0800 |
commit | d997c235b84148f90ecfd16febc25190b1a7bc25 (patch) | |
tree | 01699bab31519b4ad4cfe4b80c561c8a446e9d8b /host/utils/rfnoc | |
parent | 4693f9d1f093b28181996b02fda97e3346571de9 (diff) | |
download | uhd-d997c235b84148f90ecfd16febc25190b1a7bc25.tar.gz uhd-d997c235b84148f90ecfd16febc25190b1a7bc25.tar.bz2 uhd-d997c235b84148f90ecfd16febc25190b1a7bc25.zip |
image builder: Add ability to pick up extra Makefile.srcs from YAMLS
The blocks that are neither OOT, nor core blocks (like the DDC/DUC,
etc.) require additional info to find their appropriate Makefile.srcs
files. We don't include them in every build, to avoid building IP for
the FFT, FIR, and other blocks when they're not needed. However, those
blocks are in-tree, and don't follow the same directory structure as
out-of-tree modules, either.
We therefore allow the YAML files for those blocks (which are shipped
with UHD) to contain a path hint to their appropriate Makefile.srcs. The
image builder uses those paths to amend the `make` command
appropriately.
Diffstat (limited to 'host/utils/rfnoc')
-rwxr-xr-x | host/utils/rfnoc/image_builder.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/host/utils/rfnoc/image_builder.py b/host/utils/rfnoc/image_builder.py index e6c1ff7e4..4f5f416d6 100755 --- a/host/utils/rfnoc/image_builder.py +++ b/host/utils/rfnoc/image_builder.py @@ -25,6 +25,8 @@ from ruamel import yaml # Directory under the FPGA repo where the device directories are USRP3_TOP_DIR = os.path.join('usrp3', 'top') +USRP3_LIB_RFNOC_DIR = os.path.join('usrp3', 'lib', 'rfnoc') + # Subdirectory for the core YAML files RFNOC_CORE_DIR = os.path.join('rfnoc', 'core') @@ -680,6 +682,9 @@ def build(fpga_path, device, image_core_path, edge_file, **args): GUI: passed to Makefile source: The source of the build (YAML or GRC file path) include_paths: List of paths to OOT modules + extra_makefile_srcs: An additional list of paths to modules + that don't follow the OOT module layout. These paths must + point directly to a Makefile.srcs file. :return: exit value of build process """ ret_val = 0 @@ -693,7 +698,7 @@ def build(fpga_path, device, image_core_path, edge_file, **args): os.path.abspath(os.path.normpath(x)), os.path.join('fpga', 'Makefile.srcs')) for x in args.get("include_paths", []) - ] + ] + args.get("extra_makefile_srcs", []) logging.debug("Temporarily changing working directory to %s", build_dir) os.chdir(build_dir) make_cmd = ". ./setupenv.sh " @@ -827,4 +832,16 @@ def build_image(config, fpga_path, config_path, device, **args): logging.info("Skip build (generate only option given)") return 0 + # Check if the YAML files require additional Makefile.srcs + extra_makefile_srcs = set() + for block_info in builder_conf.noc_blocks.values(): + block_desc = blocks[block_info['block_desc']] + if hasattr(block_desc, 'makefile_srcs'): + extra_path = mako.template.Template(block_desc.makefile_srcs).render(**{ + "fpga_lib_dir": os.path.join(fpga_path, USRP3_LIB_RFNOC_DIR), + }) + if extra_path not in extra_makefile_srcs: + logging.debug("Adding additional Makefile.srcs path: %s", extra_path) + extra_makefile_srcs.add(extra_path) + args['extra_makefile_srcs'] = list(extra_makefile_srcs) return build(fpga_path, device, image_core_path, edge_file, **args) |