From f59f3c24905c3773e605dbcfdf69cbe00788c6cc Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Tue, 14 Dec 2021 17:58:43 +0100 Subject: tools: Add check for SEP with ctrl enabled to rfnoc_image_builder When creating RFNoC images at least one SEP needs to have ctrl enabled otherwise one will end up with a non-functional image. This commit adds a method to the image builder to do plausibility checks on the configuration. The only check done for now is to verify that there is at least one SEP with ctrl enabled. --- host/python/uhd/imgbuilder/image_builder.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'host') diff --git a/host/python/uhd/imgbuilder/image_builder.py b/host/python/uhd/imgbuilder/image_builder.py index 159c075a7..81156600e 100755 --- a/host/python/uhd/imgbuilder/image_builder.py +++ b/host/python/uhd/imgbuilder/image_builder.py @@ -177,6 +177,7 @@ class ImageBuilderConfig: self.__dict__.update(**config) self.blocks = blocks self.device = device + self._check_configuration() self._update_sep_defaults() self._set_indices() self._collect_noc_ports() @@ -185,6 +186,18 @@ class ImageBuilderConfig: self.pick_connections() self.pick_clk_domains() + def _check_configuration(self): + """ + Do plausibility checks on the current configuration + """ + logging.info("Plausibility checks on the current configuration") + failure = None + if not any([bool(sep["ctrl"]) for sep in self.stream_endpoints.values()]): + failure = "At least one streaming endpoint needs to have ctrl enabled" + if failure: + logging.error(failure) + raise ValueError(failure) + def _update_sep_defaults(self): """ Update any missing stream endpoint attributes with default values -- cgit v1.2.3