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 1fb55b56525af08902a9db2c613e66234f72875c..f4c46d946a399c8f53cb4f21ae460c33999c0e2f 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 @@ -62,6 +62,7 @@ import pi_eth import pi_bsn_monitor import pi_diag_block_gen import pi_diag_data_buffer +import pi_debug_wave from tools import * from common import * @@ -438,6 +439,26 @@ def test_flash(tc,io,cmd): tc.append_log(3, '') +def led(tc,dw,led,text): + tc.append_log(3, text) + dw.set_led(led) + tc.sleep(1.0) + +def test_leds(tc,io,cmd): + tc.set_section_id('LED test - ') + tc.append_log(3, '>>>') + tc.append_log(1, '>>> %s' % help_text(tc,io,cmd)) + tc.append_log(3, '>>>') + dw = pi_debug_wave.PiDebugWave(tc, io) + led(tc,dw,'off', '') + led(tc,dw,'red', 'RED on') + led(tc,dw,'off', 'RED off') + led(tc,dw,'green','GREEN on') + led(tc,dw,'off', 'GREEN off') + led(tc,dw,'both', 'ORANGE (RED+GREEN) on') + led(tc,dw,'off', 'ORANGE (RED+GREEN) off') + tc.append_log(3, '') + def sleep(tc,io,cmd): tc.set_section_id('%s - ' % cmd) @@ -458,6 +479,7 @@ Cmd['REGMAP'] = (read_regmap, 'using pi_system_info to read register info (acc Cmd['INFO'] = (test_info, 'using pi_system_info to read system info (access PIO_SYSTEM_INFO)','(-s for expected design_name)') Cmd['FLASH'] = (test_flash, 'using pi_epcs to program/verify flash','(-s for .rbf file)') Cmd['SENSORS'] = (test_sensors, 'using pi_unb_sens to readout sensors (access REG_UNB_SENS)','') +Cmd['LED'] = (test_leds, 'using pi_debug_wave to set LEDs (access PIO_DEBUG_WAVE)','') Cmd['PPSH'] = (test_ppsh, 'using pi_ppsh to read PPSH capture count (access PIO_PPS)','') Cmd['ETH'] = (test_eth, 'using pi_eth to read eth status','') Cmd['REMU'] = (test_remu, 'using pi_remu to load user image (access REG_REMU)','')