Example #1
0
                        indx = l.find('"', 1)  # skip opening
                        if indx > 0:
                            cmdLine.append(l[:indx + 1])  # including ""
                            l = l[indx + 1:].strip()
                            continue
                    indx = l.find(' ')
                    if indx < 0:
                        indx = len(
                            l)  # use all the remaining l as next argument
                    cmdLine.append(l[:indx])  # including ""
                    l = l[indx:].strip()

#                strarg=line[len(lineList[0]):].strip()
                rslt = execTask(cmdLine)
                if showResult:
                    print('    Result: ' + hx(rslt))
                if soc_conn:
                    soc_conn.send(str(rslt) + '\n')
                    soc_conn.close()
#                    soc_conn=None
                continue
            if soc_conn:
                soc_conn.send('0\n')
                soc_conn.close()


#                soc_conn=None

#http://stackoverflow.com/questions/11781265/python-using-getattr-to-call-function-with-variable-parameters
#*getattr(foo,bar)(*params)
    return 0
Example #2
0
    def read_all_status(self):
        """
        Read and print contents of all defined status registers
        """
#        print (self.__dict__)
#        for name in self.__dict__:
#            print (name+": "+str(name=='MCONTR_PHY_STATUS_REG_ADDR'))
#        print (self.__dict__['MCONTR_PHY_STATUS_REG_ADDR'])
        print ("MCONTR_PHY_STATUS_REG_ADDR:          %s"%(hx(self.read_status(vrlg.MCONTR_PHY_STATUS_REG_ADDR),8)))
        print ("MCONTR_TOP_STATUS_REG_ADDR:          %s"%(hx(self.read_status(vrlg.MCONTR_TOP_STATUS_REG_ADDR),8)))
        print ("MCNTRL_PS_STATUS_REG_ADDR:           %s"%(hx(self.read_status(vrlg.MCNTRL_PS_STATUS_REG_ADDR) ,8)))
        print ("MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR:%s"%(hx(self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR),8)))
        print ("MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR:%s"%(hx(self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR),8)))
        print ("MCNTRL_TILED_STATUS_REG_CHN2_ADDR:   %s"%(hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN2_ADDR),8)))
        print ("MCNTRL_TILED_STATUS_REG_CHN4_ADDR:   %s"%(hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN4_ADDR),8)))
#        print ("MCNTRL_TEST01_STATUS_REG_CHN1_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN1_ADDR),8)))
        print ("MCNTRL_TEST01_STATUS_REG_CHN2_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN2_ADDR),8)))
        print ("MCNTRL_TEST01_STATUS_REG_CHN3_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN3_ADDR),8)))
        print ("MCNTRL_TEST01_STATUS_REG_CHN4_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN4_ADDR),8)))
        print ("MEMBRIDGE_STATUS_REG:                %s"%(hx(self.read_status(vrlg.MEMBRIDGE_STATUS_REG),8)))
        items_per_line = 8
        for i in range (256):
            if not i % items_per_line:
                print ("\n0x%02x: "%(i), end = "") 
            d=hx(self.read_status(i),8)
            print ("%s "%(d), end = "")
        print ()
Example #3
0
                    if l[0] == '"':
                        indx=l.find('"',1) # skip opening
                        if  indx > 0:
                            cmdLine.append(l[:indx+1]) # including ""
                            l=l[indx+1:].strip()
                            continue
                    indx=l.find(' ')
                    if indx<0:
                        indx=len(l) # use all the remaining l as next argument
                    cmdLine.append(l[:indx]) # including ""
                    l=l[indx:].strip()
                        
#                strarg=line[len(lineList[0]):].strip()
                rslt= execTask(cmdLine)
                if showResult:
                    print ('    Result: '+hx(rslt))
                if soc_conn:
                    soc_conn.send(str(rslt)+'\n')
                    soc_conn.close()
#                    soc_conn=None
                continue    
            if soc_conn:
                soc_conn.send('0\n')
                soc_conn.close()
#                soc_conn=None
       
#http://stackoverflow.com/questions/11781265/python-using-getattr-to-call-function-with-variable-parameters
#*getattr(foo,bar)(*params)   
    return 0

if __name__ == "__main__":
Example #4
0
 def read_all_status(self):
     """
     Read and print contents of all defined status registers
     """
     #        print (self.__dict__)
     #        for name in self.__dict__:
     #            print (name+": "+str(name=='MCONTR_PHY_STATUS_REG_ADDR'))
     #        print (self.__dict__['MCONTR_PHY_STATUS_REG_ADDR'])
     print("MCONTR_PHY_STATUS_REG_ADDR:          %s" %
           (hx(self.read_status(vrlg.MCONTR_PHY_STATUS_REG_ADDR), 8)))
     print("MCONTR_TOP_STATUS_REG_ADDR:          %s" %
           (hx(self.read_status(vrlg.MCONTR_TOP_STATUS_REG_ADDR), 8)))
     print("MCNTRL_PS_STATUS_REG_ADDR:           %s" %
           (hx(self.read_status(vrlg.MCNTRL_PS_STATUS_REG_ADDR), 8)))
     print("MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR:%s" % (hx(
         self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR), 8)))
     print("MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR:%s" % (hx(
         self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR), 8)))
     print(
         "MCNTRL_TILED_STATUS_REG_CHN2_ADDR:   %s" %
         (hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN2_ADDR), 8)))
     print(
         "MCNTRL_TILED_STATUS_REG_CHN4_ADDR:   %s" %
         (hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN4_ADDR), 8)))
     #        print ("MCNTRL_TEST01_STATUS_REG_CHN1_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN1_ADDR),8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN2_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN2_ADDR), 8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN3_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN3_ADDR), 8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN4_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN4_ADDR), 8)))
     print("MEMBRIDGE_STATUS_REG:                %s" %
           (hx(self.read_status(vrlg.MEMBRIDGE_STATUS_REG), 8)))
     items_per_line = 8
     for i in range(256):
         if not i % items_per_line:
             print("\n0x%02x: " % (i), end="")
         d = hx(self.read_status(i), 8)
         print("%s " % (d), end="")
     print()
Example #5
0
                    if l[0] == '"':
                        indx = l.find('"', 1)  # skip opening
                        if indx > 0:
                            cmdLine.append(l[: indx + 1])  # including ""
                            l = l[indx + 1 :].strip()
                            continue
                    indx = l.find(" ")
                    if indx < 0:
                        indx = len(l)  # use all the remaining l as next argument
                    cmdLine.append(l[:indx])  # including ""
                    l = l[indx:].strip()

                #                strarg=line[len(lineList[0]):].strip()
                rslt = execTask(cmdLine)
                if showResult:
                    print("    Result: " + hx(rslt))
    # http://stackoverflow.com/questions/11781265/python-using-getattr-to-call-function-with-variable-parameters
    # *getattr(foo,bar)(*params)
    return 0


if __name__ == "__main__":
    if DEBUG:
        #        sys.argv.append("-h")
        sys.argv.append("-v")
    if TESTRUN:
        import doctest

        doctest.testmod()
    if PROFILE:
        import cProfile
Example #6
0
 def read_all_status(self):
     """
     Read and print contents of all defined status registers
     """
     #        print (self.__dict__)
     #        for name in self.__dict__:
     #            print (name+": "+str(name=='MCONTR_PHY_STATUS_REG_ADDR'))
     #        print (self.__dict__['MCONTR_PHY_STATUS_REG_ADDR'])
     print("MCONTR_PHY_STATUS_REG_ADDR:          %s" %
           (hx(self.read_status(vrlg.MCONTR_PHY_STATUS_REG_ADDR), 8)))
     print("MCONTR_TOP_STATUS_REG_ADDR:          %s" %
           (hx(self.read_status(vrlg.MCONTR_TOP_STATUS_REG_ADDR), 8)))
     print("MCNTRL_PS_STATUS_REG_ADDR:           %s" %
           (hx(self.read_status(vrlg.MCNTRL_PS_STATUS_REG_ADDR), 8)))
     print("MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR:%s" % (hx(
         self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN1_ADDR), 8)))
     print("MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR:%s" % (hx(
         self.read_status(vrlg.MCNTRL_SCANLINE_STATUS_REG_CHN3_ADDR), 8)))
     print(
         "MCNTRL_TILED_STATUS_REG_CHN2_ADDR:   %s" %
         (hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN2_ADDR), 8)))
     print(
         "MCNTRL_TILED_STATUS_REG_CHN4_ADDR:   %s" %
         (hx(self.read_status(vrlg.MCNTRL_TILED_STATUS_REG_CHN4_ADDR), 8)))
     #        print ("MCNTRL_TEST01_STATUS_REG_CHN1_ADDR:  %s"%(hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN1_ADDR),8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN2_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN2_ADDR), 8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN3_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN3_ADDR), 8)))
     print(
         "MCNTRL_TEST01_STATUS_REG_CHN4_ADDR:  %s" %
         (hx(self.read_status(vrlg.MCNTRL_TEST01_STATUS_REG_CHN4_ADDR), 8)))
     print("MEMBRIDGE_STATUS_REG:                %s" %
           (hx(self.read_status(vrlg.MEMBRIDGE_STATUS_REG), 8)))
     items_per_line = 8
     r = range(256)
     if self.DRY_MODE:
         r = (0, 1, 2, 3, 4, 5, 6, 7, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
              0x3e, 0x3f, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff)
     for i in r:
         if not i % items_per_line:
             print("\n0x%02x: " % (i), end="")
         d = hx(self.read_status(i), 8)
         print("%s " % (d), end="")
     print()