aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/n3xx_bist
diff options
context:
space:
mode:
authorTrung N Tran <trung.tran@ettus.com>2017-07-27 16:05:33 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:00 -0800
commita745877cc9e3962dedb3f6b7c5db3382568fadee (patch)
tree8dee0cd3c894459ed32a58ec6b5ba7e1c069ee81 /mpm/python/n3xx_bist
parent1db37316ebe81786671739e6e297b2d47c9f4807 (diff)
downloaduhd-a745877cc9e3962dedb3f6b7c5db3382568fadee.tar.gz
uhd-a745877cc9e3962dedb3f6b7c5db3382568fadee.tar.bz2
uhd-a745877cc9e3962dedb3f6b7c5db3382568fadee.zip
n310: gpio bist
Diffstat (limited to 'mpm/python/n3xx_bist')
-rwxr-xr-xmpm/python/n3xx_bist33
1 files changed, 28 insertions, 5 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist
index a05a08b3c..f529cb70b 100755
--- a/mpm/python/n3xx_bist
+++ b/mpm/python/n3xx_bist
@@ -469,14 +469,37 @@ class N310BIST(object):
- read_patterns: A list of patterns that were read back
"""
assert 'gpio' in self.tests_to_run
+ patterns = range(64)
if self.args.dry_run:
return True, {
- 'write_patterns': [0, 1, 2, 4],
- 'read_patterns': [0, 1, 2, 4],
+ 'write_patterns': patterns,
+ 'read_patterns': patterns,
}
- # FIXME implement
- sys.stderr.write("Test not implemented.\n")
- return True, {}
+ from usrp_mpm.periph_manager import n310
+ gpioTCA6424 = n310.TCA6424()
+ ddr1 = 0x03f
+ ddr2 = 0xfc0
+ half_GPIO_SIZE = 6
+ def _runGPIO(ddr, patterns):
+ gpioTCA6424.set("FPGA-GPIO-EN")
+ time.sleep(.5)
+ myGPIO = n310.FP_GPIO(ddr)
+ for pattern in patterns:
+ myGPIO.set_all(pattern)
+ time.sleep(0.1)
+ rb = myGPIO.get_all()
+ if pattern != rb:
+ return False, {'write_patterns': [pattern],
+ 'read_patterns': [rb]}
+ return True, {'write_patterns': list(patterns),
+ 'read_patterns': list(patterns)}
+ gpioTCA6424.reset("FPGA-GPIO-EN")
+ time.sleep(.5)
+ status, data = _runGPIO(ddr1, patterns)
+ if not status:
+ return status, data
+ status, data = _runGPIO(ddr2, patterns)
+ return status, data
def bist_temp(self):
"""