aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/n3xx_bist
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/n3xx_bist')
-rwxr-xr-xmpm/python/n3xx_bist28
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):
"""