Skip to content

Commit c2d22b7

Browse files
committed
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.
1 parent fc95b29 commit c2d22b7

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

mpm/python/n3xx_bist

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,26 @@ def get_sfp_bist_defaults():
4444
'bits': 12012486656,
4545
}
4646

47+
def assert_aurora_image(master, slave):
48+
"""
49+
Make sure we have an FPGA image with which we can run the requested tests.
50+
51+
Will load an AA image if not, which always satisfies all conditions for
52+
running Aurora tests.
53+
"""
54+
from usrp_mpm.sys_utils import uio
55+
if not uio.find_uio_device(master)[0] or \
56+
(slave is not None and not uio.find_uio_device(slave)[0]):
57+
load_fpga_image('AA')
58+
4759
def run_aurora_bist(master, slave=None):
4860
"""
4961
Spawn a BER test
5062
"""
5163
from usrp_mpm import aurora_control
5264
from usrp_mpm.sys_utils.uio import UIO
5365
try:
54-
load_fpga_image('AA')
66+
assert_aurora_image(master, slave)
5567
master_au_uio = UIO(label=master, read_only=False)
5668
master_au_uio.open()
5769
master_au_ctrl = aurora_control.AuroraControl(master_au_uio)
@@ -791,11 +803,15 @@ class N3XXBIST(object):
791803
assert 'whiterabbit' in self.tests_to_run
792804
if self.args.dry_run:
793805
return True, {'lock': True}
794-
load_fpga_image('WX')
795-
self.reload_fpga_image = True
796806
from usrp_mpm.cores import WhiteRabbitRegsControl
797807
from usrp_mpm.periph_manager.n3xx import n3xx
798808
from usrp_mpm.periph_manager import n3xx_periphs
809+
from usrp_mpm.sys_utils import uio
810+
if not uio.find_uio_device(n3xx.wr_regs_label, logger=self.log)[0]:
811+
self.log.info("Need to load WX image before proceeding...")
812+
load_fpga_image('WX')
813+
self.log.info("Image loading complete.")
814+
self.reload_fpga_image = True
799815
mb_regs = n3xx_periphs.MboardRegsControl(
800816
n3xx.mboard_regs_label, self.log)
801817
mb_regs.set_time_source('sfp0', 25e6)

0 commit comments

Comments
 (0)