diff --git a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py index 932c6071ab698b3e1211ec2c09c9b10b150e2fe7..d97d701d590554d41421c70c701dc7d29d8414bf 100644 --- a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py +++ b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py @@ -57,13 +57,45 @@ import pi_wdi import pi_epcs import pi_remu import pi_eth +import pi_bsn_monitor from tools import * from common import * +from pi_common import * +def test_tr_xaui(tc, io): + tc.set_section_id('Read tr xaui status - ') + tc.append_log(3, '>>>') + tc.append_log(1, '>>> Access the REG_TR_XAUI peripheral (pi_tr_xaui.py)') + tc.append_log(3, '>>>') + + tc.append_log(3, '') + from pi_tr_xaui import * + on_execute(class_definition=PiTrXaui,regmap=REGMAP) + +def test_tr_10GbE(tc, io): + tc.set_section_id('Read tr 10GbE status - ') + tc.append_log(3, '>>>') + tc.append_log(1, '>>> Access the REG_TR_10GBE peripheral (pi_tr_10GbE.py)') + tc.append_log(3, '>>>') + + tc.append_log(3, '') + from pi_tr_10GbE import * + on_execute(class_definition=PiTr10GbE,regmap=REGMAP) + +def test_bsn_mon(tc, io): + tc.set_section_id('Read BSN monitor status - ') + tc.append_log(3, '>>>') + tc.append_log(1, '>>> Access the REG_BSN_MONITOR peripheral (pi_bsn_monitor.py)') + tc.append_log(3, '>>>') + + Bsn = pi_bsn_monitor.PiBsnMonitor(tc,io) + Bsn.read_bsn_monitor() + tc.append_log(3, '') + def test_info(tc, io): tc.set_section_id('Read System Info - ') @@ -133,12 +165,19 @@ def test_remu(tc,io): tc.append_log(3, '>>>') tc.append_log(1, '>>> REMU (pi_remu.py)') tc.append_log(3, '>>>') + + dummy_tc = test_case.Testcase('Dummy TB - ', '') + dummy_tc.set_result('PASSED') - Remu = pi_remu.PiRemu(tc, io) + Remu = pi_remu.PiRemu(dummy_tc, io) try: Remu.write_user_reconfigure() except: pass # ignoring FAILED + + if dummy_tc.get_result() == 'FAILED': + tc.append_log(1, 'Result=%s but ignoring this' % dummy_tc.get_result()) + tc.append_log(3, '') @@ -176,6 +215,7 @@ def test_flash(tc,io): def sleep(tc,io): + tc.set_section_id('SLEEP - ') tc.append_log(3, 'sleeping 1 second') tc.sleep(1.0) @@ -194,17 +234,25 @@ Cmd = { 5 : ('FLASH' , test_flash, 'using pi_epcs to program/verify flash'), 6 : ('REMU' , test_remu, 'using pi_remu to load user image'), 7 : ('ETH' , test_eth, 'using pi_eth to read eth status'), + 8 : ('XAUI' , test_tr_xaui, 'using pi_tr_xaui to read xaui status'), + 9 : ('10GBE' , test_tr_10GbE,'using pi_tr_10GbE to read 10GbE status'), + 10 : ('BSN' , test_bsn_mon, 'using pi_bsn_monitor to read BSN monitor'), 100 : ('HELP' , show_help, 'show help on commands') } + + def help_text(tc,io): tc.append_log(0, '>>> Usage [--cmd <command number or series of numbers>]:') for cmd in sorted(Cmd): tc.append_log(0, ' . %d : %s: %s' % (cmd,Cmd[cmd][0],Cmd[cmd][2])) tc.append_log(0, '') - tc.append_log(0, '[full test] sequence: --cmd 1,4,0,0,0,0,1,5,6,0,0,0,1,2,3 -s file.rbf') - tc.append_log(0, '[image start and test] sequence: --cmd 1,4,0,0,0,0,1,6,0,0,0,1,2,3') - tc.append_log(0, '[read info,sensors] sequence: --cmd 1,2,3 --rep 10') + tc.append_log(0, '[full test] sequence: --cmd 1,4,0,0,0,0,1,0,5,6,0,0,0,0,1,2,3 -s file.rbf') + tc.append_log(0, '[image start and test] sequence: --cmd 1,4,0,0,0,0,1,6,0,0,0,0,1,2,3') + tc.append_log(0, '[re-read info,sensors] sequence: --cmd 1,2,3 --rep 10') + tc.append_log(0, '[reset to factory] sequence: --cmd 1,4,0,0,0,0,1') + tc.append_log(0, '[program user image] sequence: --cmd 5 -s file.rbf') + tc.append_log(0, '[load user image] sequence: --cmd 6,0,0,0,0,1')