Exemplo n.º 1
0
    def run(self, gbs_path, bdf, bd_id=0, guid=''):
        if gbs_path:
            bc.load_gbs(gbs_path, bdf)
        ret = 0
        for func, param in self.executables.items():
            if bd_id in dma_list:
                for i, c in dma_list[bd_id].items():
                    name, size = c
                    if self.dev_id != int(param, 16):
                        continue
                    cmd = "{} {} -B {} -D {} -S {}".format(
                        func, param, hex(bdf['bus']), i, size)
                    if guid:
                        cmd += ' -G {}'.format(guid)
                    print "Running {} test on {}...\n".format(func, name)
                    ret += self.run_cmd(cmd)
            else:
                print "Running {} test...\n".format(func)
                cmd = [func, '-B', hex(bdf['bus'])]
                cmd.extend(param.split())
                try:
                    subprocess.check_call(cmd)
                except subprocess.CalledProcessError as e:
                    print "Failed Test: {}".format(func)
                    print e
                    ret += 1

        print "Finished Executing DMA Tests\n"
        return ret
Exemplo n.º 2
0
 def run(self, gbs_path, bus_num):
     bc.load_gbs(gbs_path, bus_num)
     for func, param in self.executables.items():
         print "Running {} test...\n".format(func)
         cmd = "{} {}".format(func, param)
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(func)
             print e
     print "Finished Executing DMA Tests\n"
Exemplo n.º 3
0
 def run(self, gbs_path, bus_num):
     bc.load_gbs(gbs_path, bus_num)
     for test, param in self.executables.items():
         print "Running fpgadiag {} test...\n".format(test)
         cmd = ['fpgadiag', '-B', '0x{}'.format(bus_num), param]
         try:
             subprocess.check_call(cmd)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(test)
             print e
     print "Finished Executing NLB (FPGA DIAG)Tests\n"
Exemplo n.º 4
0
 def run(self, gbs_path, bus_num):
     bc.load_gbs(gbs_path, bus_num)
     for test, param in self.executables.items():
         print "Running fpgadiag {} test...\n".format(test)
         cmd = "fpgadiag {}".format(param)
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(test)
             print e
     print "Finished Executing NLB (FPGA DIAG)Tests\n"
Exemplo n.º 5
0
 def run(self, gbs_path, bus_num):
     bc.load_gbs(gbs_path, bus_num)
     for func, param in self.executables.items():
         print "Running {} test...\n".format(func)
         cmd = [func, param]
         try:
             subprocess.check_call(cmd)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(func)
             print e
     print "Finished Executing BIST application\n"
Exemplo n.º 6
0
 def run(self, gbs_path, bus_num):
     bc.load_gbs(bc.INSTALL_PATH, gbs_path, bus_num)
     for func, param in self.executables.items():
         print "Running {} test...\n".format(func)
         run = os.path.join(bc.INSTALL_PATH, func)
         cmd = "{} {}".format(run, param)
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(func)
             print e
     print "Finished Executing NLB (FPGA DIAG)Tests\n"
Exemplo n.º 7
0
 def run(self, gbs_path, bdf):
     if gbs_path:
         bc.load_gbs(gbs_path, bdf)
     ret = 0
     for func, param in self.executables.items():
         print "Running {} test...\n".format(func)
         cmd = "{} {}".format(func, param)
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(func)
             print e
             ret += 1
     print "Finished Executing BIST application\n"
     return ret
Exemplo n.º 8
0
 def run(self, gbs_path, bus_num):
     if gbs_path:
         bc.load_gbs(gbs_path, bus_num)
     ret = 0
     for test, param in self.executables.items():
         print "Running fpgadiag {} test...\n".format(test)
         cmd = "fpgadiag -B 0x{} {}".format(bus_num, param)
         try:
             subprocess.check_call(cmd, shell=True)
         except subprocess.CalledProcessError as e:
             print "Failed Test: {}".format(test)
             print e
             ret += 1
     print "Finished Executing NLB (FPGA DIAG)Tests\n"
     return ret
Exemplo n.º 9
0
 def run(self, gbs_path, bdf):
     if gbs_path:
         bc.load_gbs(gbs_path, bdf)
     ret = 0
     for func, param in self.executables.items():
         print("Running Built-in Self test...\n")
         cmd = [func, '-B', hex(bdf['bus']),
                '-D', hex(bdf['device']),
                '-F', hex(bdf['function'])]
         cmd.extend(param.split())
         try:
             subprocess.check_call(cmd)
         except subprocess.CalledProcessError as e:
             print("Failed Test: {}".format(func))
             print(e)
             ret += 1
     print("Finished Executing BIST\n")
     return ret
Exemplo n.º 10
0
    def run(self, gbs_path, bdf, bd_id=0, guid=''):
        if gbs_path:
            bc.load_gbs(gbs_path, bdf)

        # Does a set of tests exist for the requested bd_id?
        if bd_id not in self.executables:
            print("No DMA tests for bd_id {}".format(bd_id))
            return 1

        ret = 0
        self.dev_id = bd_id
        # Pick the set of tests to run based on bd_id
        for func, param in self.executables[bd_id].items():
            if bd_id in dma_list:
                for i, c in dma_list[bd_id].items():
                    name, size = c
                    if self.dev_id != int(param, 16):
                        continue
                    cmd = "{} {} -B {} -D {} -S {}".format(
                        func, param, bdf['bus'], i, size)
                    if guid:
                        cmd += ' -G {}'.format(guid)
                    print("Running {} test on {}...\n".format(func, name))
                    ret += self.run_cmd(cmd)
            else:
                print("Running {} test...\n".format(func))
                cmd = [
                    func, '-B',
                    hex(bdf['bus']), '-D',
                    hex(bdf['device']), '-F',
                    hex(bdf['function'])
                ]
                cmd.extend(param.split())
                print("  " + ' '.join(cmd) + '\n')
                try:
                    subprocess.check_call(cmd)
                except subprocess.CalledProcessError as e:
                    print("Failed Test: {}".format(func))
                    print(e)
                    ret += 1

        print("Finished Executing DMA Tests\n")
        return ret
Exemplo n.º 11
0
 def run(self, gbs_path, bdf):
     if gbs_path:
         bc.load_gbs(gbs_path, bdf)
     ret = 0
     for test, param in self.executables.items():
         print("Running fpgadiag {} test...\n".format(test))
         cmd = [
             'fpgadiag', '-B',
             hex(bdf['bus']), '-D',
             hex(bdf['device']), '-F',
             hex(bdf['function'])
         ]
         cmd.extend(param.split())
         try:
             subprocess.check_call(cmd)
         except subprocess.CalledProcessError as e:
             print("Failed Test: {}".format(test))
             print(e)
             ret += 1
     print("Finished Executing NLB (FPGA DIAG)Tests\n")
     return ret
Exemplo n.º 12
0
    def run(self, gbs_path, bus_num, bd_id=0, guid=''):
        if gbs_path:
            bc.load_gbs(gbs_path, bus_num)
        ret = 0
        for func, param in self.executables.items():
            if bd_id in dma_list:
                for i, c in dma_list[bd_id].items():
                    name, size = c
                    if self.dev_id != int(param, 16):
                        continue
                    cmd = "{} {} -B 0x{} -D {} -S {}".format(
                        func, param, bus_num, i, size)
                    if guid:
                        cmd += ' -G {}'.format(guid)
                    print "Running {} test on {}...\n".format(func, name)
                    ret += self.run_cmd(cmd)
            else:
                print "Running {} test...\n".format(func)
                cmd = "{} {} {}".format(func, param, bus_num)
                ret += self.run_cmd(cmd)

        print "Finished Executing DMA Tests\n"
        return ret