aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/n3xx_bist
diff options
context:
space:
mode:
authorTrung N Tran <trung.tran@ettus.com>2017-08-28 15:49:48 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:01 -0800
commite4e5788a19105d0bf3a3a220611fd4469da6dac1 (patch)
treeb1757614642a14108ba1e706a73e07b73117e9cb /mpm/python/n3xx_bist
parent93e443697e56c6908a13147b7890496e0a2e7fb8 (diff)
downloaduhd-e4e5788a19105d0bf3a3a220611fd4469da6dac1.tar.gz
uhd-e4e5788a19105d0bf3a3a220611fd4469da6dac1.tar.bz2
uhd-e4e5788a19105d0bf3a3a220611fd4469da6dac1.zip
n3xx: BIST add GPS option and fix minor gps timing conversion bug
Diffstat (limited to 'mpm/python/n3xx_bist')
-rwxr-xr-xmpm/python/n3xx_bist18
1 files changed, 16 insertions, 2 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist
index 0d8a5ccd8..514abf0e0 100755
--- a/mpm/python/n3xx_bist
+++ b/mpm/python/n3xx_bist
@@ -216,6 +216,12 @@ def poll_with_timeout(state_check, timeout_ms, interval_ms):
time.sleep(interval_s)
return False
+def expand_options(option_list):
+ """
+ Turn a list ['foo=bar', 'spam=eggs'] into a dictionary {'foo': 'bar',
+ 'spam': 'eggs'}.
+ """
+ return dict(x.split('=') for x in option_list)
##############################################################################
# Bist class
##############################################################################
@@ -251,6 +257,10 @@ class N310BIST(object):
help="For debugging this tool.",
)
parser.add_argument(
+ '--option', '-o', action='append', default=[],
+ help="Option for individual test.",
+ )
+ parser.add_argument(
'--lv-compat', action='store_true',
help="Provides compatibility with the LV JSON parser. Don't run "
"this mode unless you know what you're doing. The JSON "
@@ -266,6 +276,7 @@ class N310BIST(object):
def __init__(self):
self.args = N310BIST.make_arg_parser().parse_args()
+ self.args.option = expand_options(self.args.option)
self.tests_to_run = set()
for test in self.args.tests:
if test in self.collections:
@@ -437,19 +448,22 @@ class N310BIST(object):
gpio_tca6424 = n310.TCA6424()
gpio_tca6424.set("PWREN-GPS")
time.sleep(5)
+ gps_warmup_timeout = float(self.args.option.get('gps_warmup_timeout', GPS_WARMUP_TIMEOUT))
+ gps_lockok_timeout = float(self.args.option.get('gps_lockok_timeout', GPS_LOCKOK_TIMEOUT))
# Wait for WARMUP to go low
sys.stderr.write("Waiting for WARMUP to go low...\n")
if not poll_with_timeout(
lambda: not gpio_tca6424.get('GPS-WARMUP'),
- GPS_WARMUP_TIMEOUT, 1000
+ gps_warmup_timeout*1000, 1000
):
raise RuntimeError("GPS-WARMUP did not go low within one minute!")
sys.stderr.write("Chip is warmed up.\n")
# Wait for LOCKOK. Data sheet says wait up to 15 minutes for GPS lock.
sys.stderr.write("Waiting for LOCKOK to go high...\n")
+ print(gps_lockok_timeout)
if not poll_with_timeout(
lambda: gpio_tca6424.get('GPS-LOCKOK'),
- GPS_LOCKOK_TIMEOUT,
+ gps_lockok_timeout*1000,
1000
):
sys.stderr.write("No GPS-LOCKOK!\n")