diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-03-01 18:06:08 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-03-01 18:34:28 -0800 |
commit | c3cc98cc7623bd7f11dde513011435a919bda6fe (patch) | |
tree | 8e1a2a6fc07df6138a0834d749d5616b27aee2ce /mpm/python/aurora_bist_test.py | |
parent | 8ff61759600b77dac4e5213ef54f6f938443624c (diff) | |
download | uhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.tar.gz uhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.tar.bz2 uhd-c3cc98cc7623bd7f11dde513011435a919bda6fe.zip |
mpm: n3xx: Fix usage of UIO in Aurora tests
Diffstat (limited to 'mpm/python/aurora_bist_test.py')
-rw-r--r-- | mpm/python/aurora_bist_test.py | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/mpm/python/aurora_bist_test.py b/mpm/python/aurora_bist_test.py index 9fe6f10b4..da0cdc17e 100644 --- a/mpm/python/aurora_bist_test.py +++ b/mpm/python/aurora_bist_test.py @@ -11,7 +11,7 @@ Aurora BIST command line utility from __future__ import print_function import argparse import usrp_mpm as mpm -from usrp_mpm.uio import UIO +from usrp_mpm.sys_utils.uio import UIO from usrp_mpm.aurora_control import AuroraControl ######################################################################## @@ -23,7 +23,7 @@ def parse_args(): description='Controller for Ettus Aurora BIST Engine' ) parser.add_argument( - '--uio-dev', default='misc-enet-regs0', + '--uio-dev', default='misc-auro-regs0', help='UIO device for master device peeks and pokes' ) parser.add_argument( @@ -62,33 +62,43 @@ def main(): args = parse_args() # Initialize logger for downstream components mpm.get_main_logger().getChild('main') - master_core = AuroraControl( - UIO(label=args.uio_dev, read_only=False), - args.base_addr, - ) - slave_core = None if args.slave_uio_dev is None else AuroraControl( - UIO(label=args.slave_uio_dev, read_only=False), - args.slave_base_addr, - ) - if args.loopback: - master_core.reset_core() - master_core.set_loopback(enable=True) - return True - # Run BIST - if args.test == 'ber': - print("Performing BER BIST test.") - master_core.run_ber_loopback_bist( - args.duration, - args.rate * 8e6, - slave_core, - ) - else: - print("Performing Latency BIST test.") - master_core.run_latency_loopback_bist( - args.duration, - args.rate * 8e6, - slave_core, + master_core_uio = UIO(label=args.uio_dev, read_only=False) + master_core_uio.open() + if args.slave_uio_dev: + slave_core_uio = UIO(label=args.uio_dev, read_only=False) + slave_core_uio.open() + try: + master_core = AuroraControl(master_core_uio, args.base_addr) + slave_core = None if args.slave_uio_dev is None else AuroraControl( + slave_core_uio, + args.slave_base_addr, ) + if args.loopback: + master_core.reset_core() + master_core.set_loopback(enable=True) + return True + # Run BIST + if args.test == 'ber': + print("Performing BER BIST test.") + master_core.run_ber_loopback_bist( + args.duration, + args.rate * 8e6, + slave_core, + ) + else: + print("Performing Latency BIST test.") + master_core.run_latency_loopback_bist( + args.duration, + args.rate * 8e6, + slave_core, + ) + except Exception as ex: + print("Unexpected exception: {}".format(str(ex))) + return False + finally: + master_core_uio.close() + if args.slave_uio_dev: + slave_core_uio.close() if __name__ == '__main__': exit(not main()) |