aboutsummaryrefslogtreecommitdiffstats
path: root/host/python
diff options
context:
space:
mode:
authorWade Fife <wade.fife@ettus.com>2020-08-05 17:37:06 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-08-10 15:18:46 -0500
commitde8b6fcd7137834defbb52242bc4cdec8adb167e (patch)
tree18a97f32ba3892d3d00cf5e14a6c6377225636ba /host/python
parent2da3cdcb3bd5e00040c7815ec756759be7149414 (diff)
downloaduhd-de8b6fcd7137834defbb52242bc4cdec8adb167e.tar.gz
uhd-de8b6fcd7137834defbb52242bc4cdec8adb167e.tar.bz2
uhd-de8b6fcd7137834defbb52242bc4cdec8adb167e.zip
python: Change default name for rfnoc_image_core
This changes the default name of the image core file to <DEVICE>_rfnoc_image_core.v instead of naming it after the YAML file. This ensures that when you use a custom YAML file, the resulting FPGA build will use the generated rfnoc_image_core and static_router files, rather than just the generated static_router file.
Diffstat (limited to 'host/python')
-rwxr-xr-xhost/python/uhd/imgbuilder/image_builder.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/host/python/uhd/imgbuilder/image_builder.py b/host/python/uhd/imgbuilder/image_builder.py
index 9c26f2726..2521ee31c 100755
--- a/host/python/uhd/imgbuilder/image_builder.py
+++ b/host/python/uhd/imgbuilder/image_builder.py
@@ -795,21 +795,26 @@ def get_core_config_path(config_path):
"""
return os.path.join(config_path, RFNOC_CORE_DIR)
-def generate_image_core_path(output_path, source):
+def generate_image_core_path(output_path, device, source):
"""
Creates the path where the image core file gets to be stored.
output_path: If not None, this is returned
- source: Otherwise, this path is returned with a .v argument
+ device: Device type string, used to generate default file name
+ source: Otherwise, this path is returned, combined with a default file name
"""
if output_path is not None:
return output_path
- source = os.path.splitext(os.path.abspath(os.path.normpath(source)))[0]
- return source + '.v'
+ source = os.path.split(os.path.abspath(os.path.normpath(source)))[0]
+ return os.path.join(source, "{}_rfnoc_image_core.v".format(device))
def generate_edge_file_path(output_path, device, source):
"""
Creates a valid path for the edge file to get stored.
+
+ output_path: If not None, this is returned
+ device: Device type string, used to generate default file name
+ source: Otherwise, this path is returned, combined with a default file name
"""
if output_path is not None:
return output_path
@@ -836,7 +841,8 @@ def build_image(config, fpga_path, config_path, device, **args):
"""
logging.info("Selected device %s", device)
image_core_path = \
- generate_image_core_path(args.get('output_path'), args.get('source'))
+ generate_image_core_path(
+ args.get('output_path'), device, args.get('source'))
edge_file = \
generate_edge_file_path(
args.get('router_hex_path'), device, args.get('source'))