diff options
author | Trung N Tran <trung.tran@ettus.com> | 2017-08-03 17:22:07 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:04:00 -0800 |
commit | d4047be7f2886bc060b6c7458ee17fec8ede0379 (patch) | |
tree | 30048c592e6316baf69990dd450663b7f1a74779 /mpm/python | |
parent | c701ea815df3d6bb76eba2374b6c6158fa8dc963 (diff) | |
download | uhd-d4047be7f2886bc060b6c7458ee17fec8ede0379.tar.gz uhd-d4047be7f2886bc060b6c7458ee17fec8ede0379.tar.bz2 uhd-d4047be7f2886bc060b6c7458ee17fec8ede0379.zip |
n310_bist: add ddr3 bist
Diffstat (limited to 'mpm/python')
-rwxr-xr-x | mpm/python/n3xx_bist | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist index b734dd967..577c0e35d 100755 --- a/mpm/python/n3xx_bist +++ b/mpm/python/n3xx_bist @@ -22,6 +22,8 @@ N310 Built-In Self Test (BIST) from __future__ import print_function import os import sys +import subprocess +import re import socket import select import time @@ -377,10 +379,28 @@ class N310BIST(object): assert 'ddr3' in self.tests_to_run if self.args.dry_run: return True, {'throughput': 1250e6} - # FIXME implement - sys.stderr.write("Test not implemented.\n") - result = {'throughput': 1250e6} - return result.get('throughput', 0) > 1000e6, result + result = {} + ddr3_bist_executor = 'uhd_usrp_probe' + try: + output = subprocess.check_output( + ddr3_bist_executor, + stderr=subprocess.STDOUT, + shell=True, + ).decode("utf-8") + except subprocess.CalledProcessError as ex: + sys.stderr.write("Calling `{}' failed with return code {}.\n".format( + ddr3_bist_executor, ex.returncode + )) + result['error_msg'] = ex.output + output = ex.output + mobj = re.search(r"Throughput: (?P<thrup>[0-9.]+)MB", output) + if mobj is not None: + result['throughput'] = float(mobj.group('thrup')) * 1000 + else: + result['throughput'] = 0 + result['error_msg'] = result.get('error_msg', '') + \ + "\n\nFailed match throughput regex!" + return result.get('throughput', 0) > 1000e3, result def bist_gpsdo(self): """ |