diff options
| author | Martin Braun <martin.braun@ettus.com> | 2019-05-08 13:13:32 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2019-08-22 10:35:13 -0700 | 
| commit | 227fe34217e5430f78c6b679ba215b68a6a5c1a0 (patch) | |
| tree | 073d4d233b025ddaf1cf00b775919eb871ac1760 /mpm/python/usrp_mpm/dboard_manager | |
| parent | 78f453f8b59b2c4995e2aab584f3022715a2caaf (diff) | |
| download | uhd-227fe34217e5430f78c6b679ba215b68a6a5c1a0.tar.gz uhd-227fe34217e5430f78c6b679ba215b68a6a5c1a0.tar.bz2 uhd-227fe34217e5430f78c6b679ba215b68a6a5c1a0.zip | |
n3xx: mg: Make set_freq() call asynchronous
This does not change the MPM/UHD API, but it makes the set_freq() call
asynchronous on the MPM side. The upside is that it will release the GIL
if the set_freq() call takes too long, e.g., because of MPM
calibrations.
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager')
| -rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/magnesium.py | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index 13e621414..c4e2f4131 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -18,6 +18,7 @@ from usrp_mpm.cores import nijesdcore  from usrp_mpm.mpmlog import get_logger  from usrp_mpm.sys_utils.uio import open_uio  from usrp_mpm.user_eeprom import BfrfsEEPROM +from usrp_mpm.mpmutils import async_exec  ###############################################################################  # SPI Helpers @@ -328,6 +329,19 @@ class Magnesium(BfrfsEEPROM, DboardManagerBase):              # The reference clock is handled elsewhere since it is a motherboard-              # level clock. +    def set_freq(self, which, freq, wait_for_lock): +        """ +        Perform asynchronous tuning. This will, under the hood, call set_freq() +        on the AD937X object, but will spin it out into an asynchronous +        execution. We do this because under some circumstances, the set_freq() +        call can take a long time to execute, and we want to release the GIL +        during that time. + +        Note: This overrides the set_freq() call provided from self.mykonos. +        """ +        self.log.trace("Tuning {} {} {}".format(which, freq, wait_for_lock)) +        async_exec(self.mykonos, "set_freq", which, freq, wait_for_lock) +        return self.mykonos.get_freq(which)      def _reinit(self, master_clock_rate):          """ | 
