diff options
author | Lars Amsel <lars.amsel@ni.com> | 2021-12-14 17:58:43 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-12-16 09:26:46 -0600 |
commit | f59f3c24905c3773e605dbcfdf69cbe00788c6cc (patch) | |
tree | 0e54890b89f1ab9ed654fee34d4c8afabb6c6151 /host/python | |
parent | 5f5bb7921bf1e1e0cb6ecc55837694605f1ad093 (diff) | |
download | uhd-f59f3c24905c3773e605dbcfdf69cbe00788c6cc.tar.gz uhd-f59f3c24905c3773e605dbcfdf69cbe00788c6cc.tar.bz2 uhd-f59f3c24905c3773e605dbcfdf69cbe00788c6cc.zip |
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.
Diffstat (limited to 'host/python')
-rwxr-xr-x | host/python/uhd/imgbuilder/image_builder.py | 13 |
1 files changed, 13 insertions, 0 deletions
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 |