def do_debug(self, args): """Quick read of SBit Clusters. USAGE: debug <OH_NUM>""" arglist = args.split() if len(arglist) == 1: for reg in getNodesContaining('OH' + str(args) + '.DEBUG_LAST'): try: cluster = parseInt(readReg(reg)) except: cluster = 0 if cluster == 2047: if 'r' in str(reg.permission): print hex( reg.real_address), reg.permission, '\t', tabPad( reg.name, 4), readReg(reg), '(None)' else: if 'r' in str(reg.permission): print hex( reg.real_address), reg.permission, '\t', tabPad( reg.name, 4), readReg(reg), '(VFAT:', cluster_to_vfat( cluster), 'SBit:', cluster_to_vfat2_sbit( cluster), 'Size:', cluster_to_size( cluster), ')' else: print "Incorrect number of arguments!"
def do_trigger(self, args=''): """Read all registers in TRIGGER module. USAGE: trigger <optional OH_NUM>""" arglist = args.split() if len(arglist) == 1: if not arglist[0].isdigit(): print 'Incorrect usage.' return elif int(arglist[0]) < 0 or int(arglist[0]) > MAX_OH_NUM: print 'Invalid OH number:', arglist[0] else: if getNodesContaining('GEM_AMC.TRIGGER.OH' + str(arglist[0]) + '.') is not None: for reg in getNodesContaining('GEM_AMC.TRIGGER.OH' + str(arglist[0]) + '.'): address = reg.real_address if 'r' in str(reg.permission): print hex(address).rstrip( 'L'), reg.permission, '\t', tabPad( reg.name, 7), readReg(reg) else: print 'Regs not found!' elif args == '': if getNodesContaining('GEM_AMC.TRIGGER') is not None: for reg in getNodesContaining('GEM_AMC.TRIGGER'): address = reg.real_address if 'r' in str(reg.permission): print hex(address).rstrip( 'L'), reg.permission, '\t', tabPad(reg.name, 7), readReg(reg) else: print 'Regs not found!' else: print 'Incorrect usage.'
def do_ttc(self, args=None): """Read all registers in TTC module. USAGE: ttc""" if getNodesContaining('GEM_AMC.TTC') is not None: for reg in getNodesContaining('GEM_AMC.TTC'): address = reg.real_address if 'r' in str(reg.permission): print hex(address).rstrip( 'L'), reg.permission, '\t', tabPad(reg.name, 7), readReg(reg) else: print 'Regs not found!'
def do_gemsystem(self, args=None): """Read all registers in GEM_SYSTEM module. USAGE: gemsystem""" if args == '': if getNodesContaining('GEM_AMC.GEM_SYSTEM') is not None: for reg in getNodesContaining('GEM_AMC.GEM_SYSTEM'): address = reg.real_address if 'r' in str(reg.permission): print hex(address).rstrip( 'L'), reg.permission, '\t', tabPad(reg.name, 7), readReg(reg) else: print 'Regs not found!'
def do_oh(self, args): """ Begin command by selecting OH, followed by command. USAGE oh <number> <command> """ arglist = args.split() if len(arglist) < 1: print 'Too few arguments.' elif len(arglist) == 1: if not arglist[0].isdigit(): print 'Invalid OH number:', arglist[0] return elif int(arglist[0]) < 0 or int(arglist[0]) > MAX_OH_NUM: print 'Invalid OH number:', arglist[0] else: if getNodesContaining('GEM_AMC.OH.OH' + str(arglist[0]) + '.') is not None: for reg in getNodesContaining('GEM_AMC.OH.OH' + str(arglist[0]) + '.'): address = reg.real_address if 'r' in str(reg.permission): print hex(address).rstrip( 'L'), reg.permission, '\t', tabPad( reg.name, 7), readReg(reg) else: print 'Regs not found!'
def do_fw(self, args=None): """Quick read of all FW-related registers""" for reg in getNodesContaining('RELEASE'): if 'r' in str(reg.permission): print hex(reg.real_address), reg.permission, '\t', tabPad( reg.name, 4), readReg(reg)