From 829c170d7b498eab9f56f9b062449e1425773342 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 19 Feb 2019 14:20:24 -0800 Subject: mpm: n3xx: BIST: Improve DDR3 BIST to check for DmaFIFO The capability to run the DDR3 BIST is built into the DmaFIFO RFNoC block, which is not always available. This change performs a quick check before for its existence before retrieving the throughput values, and thus can provide a better error message in that case. --- mpm/python/usrp_mpm/bist.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mpm/python/usrp_mpm/bist.py b/mpm/python/usrp_mpm/bist.py index b16fefa35..dc57f2a0c 100644 --- a/mpm/python/usrp_mpm/bist.py +++ b/mpm/python/usrp_mpm/bist.py @@ -273,7 +273,6 @@ def test_ddr3_with_usrp_probe(): reporting a good throughput. This is a bit of a roundabout way of testing the DDR3, but it uses existing software and also tests the RFNoC pathways. """ - result = {} ddr3_bist_executor = 'uhd_usrp_probe --args addr=127.0.0.1' try: output = subprocess.check_output( @@ -285,14 +284,19 @@ def test_ddr3_with_usrp_probe(): # Don't throw errors from uhd_usrp_probe output = ex.output output = output.decode("utf-8") + if re.search(r"DmaFIFO", output) is None: + return { + 'error_msg': "DmaFIFO block not enabled. Cannot execute DDR3 BIST!", + 'throughput': 0, + } mobj = re.search(r"Throughput: (?P[0-9.]+)\s?MB", output) if mobj is not None: - result['throughput'] = float(mobj.group('thrup')) * 1000 + return {'throughput': float(mobj.group('thrup')) * 1000} else: - result['throughput'] = 0 - result['error_msg'] = result.get('error_msg', '') + \ - "\n\nFailed match throughput regex!" - return result + return { + 'throughput': 0, + 'error_msg': "Failed match throughput regex!", + } def get_gpsd_tpv_result(): -- cgit v1.2.3