aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/x4xx.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2022-03-30 09:39:30 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2022-03-30 05:29:00 -0700
commit9573640db723386d029a294620c5b48c4d4d13d6 (patch)
treee4ac9ee36e86bc28cb5d81a8aeac6ec7b05849a2 /mpm/python/usrp_mpm/periph_manager/x4xx.py
parent958eab7ea804337bd904c119427d363a05aa5cf6 (diff)
downloaduhd-9573640db723386d029a294620c5b48c4d4d13d6.tar.gz
uhd-9573640db723386d029a294620c5b48c4d4d13d6.tar.bz2
uhd-9573640db723386d029a294620c5b48c4d4d13d6.zip
mpm: x4xx: Fix clock/time source API
In f73e327, we modified PeriphManagerBase to explicitly list all required methods as per the MPM/UHD API. This had an unintended side effect: Because the clocking methods on x4xx are imported from X4xxClockMgr, and not defined on x4xx itself, the method used to import methods from X4xxClockMgr onto x4xx would refuse to re-define API calls such as set_clock_source(), get_clock_source(), and so on. The solution is to allow _add_public_methods() to overwrite existing methods, which means we can overwrite abstract methods from PeriphManagerBase in this fashion. Without this patch, UHD sessions could fail in the following manner: >>> import uhd >>> U = uhd.usrp.MultiUSRP("type=x4xx") >>> U.get_clock_source(0) Traceback (most recent call last): File "<input>", line 1, in <module> U.get_clock_source(0) RuntimeError: RuntimeError: Error during RPC call to `get_clock_source'. Error message: get_clock_source() not available on this device!
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/x4xx.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/x4xx.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/x4xx.py b/mpm/python/usrp_mpm/periph_manager/x4xx.py
index 7479874dc..e72b2e41e 100644
--- a/mpm/python/usrp_mpm/periph_manager/x4xx.py
+++ b/mpm/python/usrp_mpm/periph_manager/x4xx.py
@@ -484,7 +484,8 @@ class x4xx(ZynqComponents, PeriphManagerBase):
self._add_public_methods(
self._clk_mgr,
prefix="",
- filter_cb=lambda name, method: not hasattr(method, '_norpc')
+ filter_cb=lambda name, method: not hasattr(method, '_norpc'),
+ allow_overwrite=True
)
# Overlay must be applied after clocks have been configured