diff options
author | Wade Fife <wade.fife@ettus.com> | 2022-03-29 18:00:11 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-03-31 13:51:23 -0700 |
commit | 246b72519584de7e0d42a83329e7c699899c50d0 (patch) | |
tree | 61a549db6d6d4dfbbdc8e9e858f5b2817eb3dcd6 | |
parent | 5007d9832875bbdacc55bb4986b406c832ff94fc (diff) | |
download | uhd-246b72519584de7e0d42a83329e7c699899c50d0.tar.gz uhd-246b72519584de7e0d42a83329e7c699899c50d0.tar.bz2 uhd-246b72519584de7e0d42a83329e7c699899c50d0.zip |
rfnoc: Update image builder to check for deprecated port names
-rw-r--r-- | host/python/uhd/imgbuilder/image_builder.py | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/host/python/uhd/imgbuilder/image_builder.py b/host/python/uhd/imgbuilder/image_builder.py index 9475ed84a..54a06a02c 100644 --- a/host/python/uhd/imgbuilder/image_builder.py +++ b/host/python/uhd/imgbuilder/image_builder.py @@ -178,6 +178,7 @@ class ImageBuilderConfig: self.blocks = blocks self.device = device self._check_configuration() + self._check_deprecated_signatures() self._update_sep_defaults() self._set_indices() self._collect_noc_ports() @@ -186,6 +187,54 @@ class ImageBuilderConfig: self.pick_connections() self.pick_clk_domains() + def _check_deprecated_signatures(self): + """ + Check if the configuration uses deprecated IO signatures or block + descriptions. + """ + # List of blocks that have been replaced (old name : new name) + block_yml_map = { + "radio_1x64.yml" : "radio.yml", + "radio_2x64.yml" : "radio.yml", + "axi_ram_fifo_2x64.yml" : "axi_ram_fifo.yml", + "axi_ram_fifo_4x64.yml" : "axi_ram_fifo.yml", + } + # List of port names that have been replaced (old name : new name) + port_name_map = { + "x300_radio" : "radio", + "radio_iface" : "radio", + "x300_radio0" : "radio0", + "x300_radio1" : "radio1", + "radio_ch0" : "radio0", + "radio_ch1" : "radio1", + "ctrl_port" : "ctrlport", + "ctrlport_radio" : "ctrlport", + "timekeeper" : "time", + "time_keeper" : "time", + } + # Go through blocks and look for any deprecated descriptions + for name, block in self.noc_blocks.items(): + desc = block['block_desc'] + if desc in block_yml_map: + logging.warning( + "The block description '" + desc + + "' has been deprecated. Please update your image to use '" + + block_yml_map[desc] + "'." + ) + # Override the block with the new version + block['block_desc'] = block_yml_map[desc] + # Go through port connections and look for deprecated names + for con in self.connections: + for port in ('srcport', 'dstport'): + if con[port] in port_name_map: + logging.warning( + "The port name '" + con[port] + "' has been deprecated. " + "Please update your image to use '" + + port_name_map[con[port]] + "'." + ) + # Override the name with the new version + con[port] = port_name_map[con[port]] + def _check_configuration(self): """ Do plausibility checks on the current configuration @@ -606,7 +655,7 @@ def collect_module_paths(config_path, include_paths): def read_block_descriptions(signatures, *paths): """ - Recursive search all pathes for block definitions. + Recursive search all paths for block definitions. :param signatures: signature passed to IOConfig initialization :param paths: paths to be searched :return: dictionary of noc blocks. Key is filename of the block, value |