aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/n3xx_bist
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-03-01 18:06:08 -0800
committerMartin Braun <martin.braun@ettus.com>2018-03-01 18:34:28 -0800
commitc3cc98cc7623bd7f11dde513011435a919bda6fe (patch)
tree8e1a2a6fc07df6138a0834d749d5616b27aee2ce /mpm/python/n3xx_bist
parent8ff61759600b77dac4e5213ef54f6f938443624c (diff)
downloaduhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.tar.gz
uhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.tar.bz2
uhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.zip
mpm: n3xx: Fix usage of UIO in Aurora tests
Diffstat (limited to 'mpm/python/n3xx_bist')
-rwxr-xr-xmpm/python/n3xx_bist35
1 files changed, 23 insertions, 12 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist
index 14f9370d0..ae243d95e 100755
--- a/mpm/python/n3xx_bist
+++ b/mpm/python/n3xx_bist
@@ -2,7 +2,7 @@
#
# Copyright 2017 Ettus Research, National Instruments Company
#
-# SPDX-License-Identifier: GPL-3.0
+# SPDX-License-Identifier: GPL-3.0-or-later
#
"""
N310 Built-In Self Test (BIST)
@@ -48,17 +48,28 @@ def run_aurora_bist(master, slave=None):
"""
from usrp_mpm import aurora_control
from usrp_mpm.sys_utils.uio import UIO
- master_au_ctrl = aurora_control.AuroraControl(
- UIO(label=master, read_only=False),
- )
- slave_au_ctrl = None if slave is None else aurora_control.AuroraControl(
- UIO(label=slave, read_only=False),
- )
- return master_au_ctrl.run_ber_loopback_bist(
- duration=10,
- requested_rate=1300 * 8e6,
- slave=slave_au_ctrl,
- )
+ try:
+ master_au_uio = UIO(label=master, read_only=False)
+ master_au_uio.open()
+ master_au_ctrl = aurora_control.AuroraControl(master_au_uio)
+ if slave is not None:
+ slave_au_uio = UIO(label=slave, read_only=False)
+ slave_au_uio.open()
+ slave_au_ctrl = None if slave is None else aurora_control.AuroraControl(
+ slave_au_uio
+ )
+ return master_au_ctrl.run_ber_loopback_bist(
+ duration=10,
+ requested_rate=1300 * 8e6,
+ slave=slave_au_ctrl,
+ )
+ except Exception as ex:
+ print("Unexpected exception: {}".format(str(ex)))
+ exit(1)
+ finally:
+ master_au_uio.close()
+ if slave is not None:
+ slave_au_uio.close()
def aurora_results_to_status(bist_results):
"""