Beispiel #1
0
    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!"
Beispiel #2
0
    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.'
Beispiel #3
0
 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!'
Beispiel #4
0
 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!'
Beispiel #5
0
 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!'
Beispiel #6
0
 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)