From 6bb1e1250399e96d1f612320adc059aa61d22dd8 Mon Sep 17 00:00:00 2001 From: djepson1 Date: Mon, 9 Oct 2017 10:41:08 -0500 Subject: mg: Clean up radio_regs creation Signed-off-by: djepson1 --- mpm/python/usrp_mpm/dboard_manager/magnesium.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index df573219d..f5d17a3f4 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -132,10 +132,6 @@ class Magnesium(DboardManagerBase): self.mykonos = self._device.get_radio_ctrl() self.log.debug("Loaded C++ drivers.") - self.log.debug("Getting Mg A uio...") - self.radio_regs = UIO(label="dboard-regs-0", read_only=False) - self.log.info("Radio-register UIO object successfully generated!") - for mykfuncname in [x for x in dir(self.mykonos) if not x.startswith("_") and callable(getattr(self.mykonos, x))]: self.log.trace("adding {}".format(mykfuncname)) setattr(self, mykfuncname, self._get_mykonos_function(mykfuncname)) @@ -145,6 +141,13 @@ class Magnesium(DboardManagerBase): Execute necessary init dance to bring up dboard """ + def _init_dboard_regs(): + " Create a UIO object to talk to dboard regs " + self.log.trace("Getting uio...") + return UIO( + label="dboard-regs-{}".format(self.slot_idx), + read_only=False + ) def _init_spi_devices(): " Returns abstraction layers to all the SPI devices " self.log.trace("Loading SPI interfaces...") @@ -176,7 +179,8 @@ class Magnesium(DboardManagerBase): ",".join(['{}={}'.format(x, args[x]) for x in args]) )) - + self.radio_regs = _init_dboard_regs() + self.log.info("Radio-register UIO object successfully generated!") self._spi_ifaces = _init_spi_devices() self.log.info("Loaded SPI interfaces!") self.dboard_clk_control = _init_clock_control(self.radio_regs) -- cgit v1.2.3