diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-07-19 08:06:25 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-07-19 10:31:40 -0700 |
commit | c2d22b75d5a00452161959cd407a72ff79e9298e (patch) | |
tree | 032390ae8695d8d382a1ab00e059bced52793e41 /mpm | |
parent | fc95b292803ebf1a47aafec655dfeb4cb0563abf (diff) | |
download | uhd-c2d22b75d5a00452161959cd407a72ff79e9298e.tar.gz uhd-c2d22b75d5a00452161959cd407a72ff79e9298e.tar.bz2 uhd-c2d22b75d5a00452161959cd407a72ff79e9298e.zip |
mpm: n3xx: bist: Only conditionally reload FPGA image
The tests for white rabbit and SFP loopback require a specific FPGA
image. We now check if that image is already available before running
uhd_image_loader.
Diffstat (limited to 'mpm')
-rwxr-xr-x | mpm/python/n3xx_bist | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist index 1a00a0005..a6676f940 100755 --- a/mpm/python/n3xx_bist +++ b/mpm/python/n3xx_bist @@ -44,6 +44,18 @@ def get_sfp_bist_defaults(): 'bits': 12012486656, } +def assert_aurora_image(master, slave): + """ + Make sure we have an FPGA image with which we can run the requested tests. + + Will load an AA image if not, which always satisfies all conditions for + running Aurora tests. + """ + from usrp_mpm.sys_utils import uio + if not uio.find_uio_device(master)[0] or \ + (slave is not None and not uio.find_uio_device(slave)[0]): + load_fpga_image('AA') + def run_aurora_bist(master, slave=None): """ Spawn a BER test @@ -51,7 +63,7 @@ def run_aurora_bist(master, slave=None): from usrp_mpm import aurora_control from usrp_mpm.sys_utils.uio import UIO try: - load_fpga_image('AA') + assert_aurora_image(master, slave) master_au_uio = UIO(label=master, read_only=False) master_au_uio.open() master_au_ctrl = aurora_control.AuroraControl(master_au_uio) @@ -791,11 +803,15 @@ class N3XXBIST(object): assert 'whiterabbit' in self.tests_to_run if self.args.dry_run: return True, {'lock': True} - load_fpga_image('WX') - self.reload_fpga_image = True from usrp_mpm.cores import WhiteRabbitRegsControl from usrp_mpm.periph_manager.n3xx import n3xx from usrp_mpm.periph_manager import n3xx_periphs + from usrp_mpm.sys_utils import uio + if not uio.find_uio_device(n3xx.wr_regs_label, logger=self.log)[0]: + self.log.info("Need to load WX image before proceeding...") + load_fpga_image('WX') + self.log.info("Image loading complete.") + self.reload_fpga_image = True mb_regs = n3xx_periphs.MboardRegsControl( n3xx.mboard_regs_label, self.log) mb_regs.set_time_source('sfp0', 25e6) |