Exemple #1
0
    def worker(self, arglist):
        """Single worker function that is run in the Pool of workers.

        This takes, as argument list, the various tasks to perform.
        """
        def eprint(*args, **kwargs):
            print(*args, file=sys.stderr, **kwargs)

        project, toolchain, board, seed, option, build_number = arglist

        build = self.build_format.format(build_number)

        with redirect_stdout(open(os.devnull, 'w')):
            run(
                board,
                toolchain,
                project,
                None,  #params_file
                option,  #params_string
                None,  #out_dir
                self.out_prefix,
                self.overwrite,
                self.verbose,
                None,  #strategy
                seed,
                None,  #carry
                build,
                self.build_type,
            )
Exemple #2
0
 def test_toolchains(self):
     '''Try each toolchain'''
     for toolchain in fpgaperf.toolchains.keys():
         device, package = def_devpack(toolchain)
         fpgaperf.run(family='ice40',
                      device=device,
                      package=package,
                      toolchain=toolchain,
                      project=fpgaperf.get_project('oneblink'),
                      verbose=self.verbose)
Exemple #3
0
 def test_seed(self):
     '''Try seeding, where possible'''
     random.seed(1234)
     for toolchain in fpgaperf.get_seedable():
         seed = random.randint(1, 0x7FFFFFFF)
         device, package = def_devpack(toolchain)
         fpgaperf.run(family='ice40',
                      device=device,
                      package=package,
                      toolchain=toolchain,
                      project=fpgaperf.get_project('oneblink'),
                      seed=seed,
                      verbose=self.verbose)
Exemple #4
0
 def test_pcf(self):
     '''Try each toolchain with a pcf'''
     for toolchain in fpgaperf.toolchains.keys():
         device, package = def_devpack(toolchain)
         if 'radiant' in toolchain:
             pcf = fpgaperf.root_dir + '/project/FIXME.pcf'
         else:
             pcf = fpgaperf.root_dir + '/project/oneblink_lp8k-cm81.pcf'
         fpgaperf.run(family='ice40',
                      device=device,
                      package=package,
                      toolchain=toolchain,
                      project=fpgaperf.get_project('oneblink'),
                      pcf=pcf,
                      verbose=self.verbose)
Exemple #5
0
    def worker(self, arglist):
        """Single worker function that is run in the Pool of workers.

        This takes, as argument list, the various tasks to perform.
        """
        def eprint(*args, **kwargs):
            print(*args, file=sys.stderr, **kwargs)

        project, toolchain, board, seed, option, build_number = arglist

        build = self.build_format.format(build_number)

        # We don't want output of all subprocesses here
        # Log files for each build will be placed in build directory
        with redirect_stdout(open(os.devnull, 'w')):
            try:
                run(
                    board,
                    toolchain,
                    project,
                    None,  #params_file
                    option,  #params_string
                    None,  #out_dir
                    self.out_prefix,
                    self.overwrite,
                    self.verbose,
                    None,  #strategy
                    seed,
                    None,  #carry
                    build,
                    self.build_type,
                )
            except Exception as e:
                eprint("\n---------------------")
                eprint(
                    "ERROR: {} {} {} test has failed (build type {}, build nr. {})\n"
                    .format(project, toolchain, board, self.build_type, build)
                )
                # Limit output to max 300 characters for exhaust.py to make sure log files are not too large.
                exception_str = str(e)
                eprint(
                    "ERROR MESSAGE: ",
                    ("[...]\n{}".format(exception_str[-1000:]))
                    if len(str(exception_str)) > 1000 else exception_str
                )
                eprint("---------------------\n")
Exemple #6
0
    def worker(self, arglist):
        """Single worker function that is run in the Pool of workers.

        This takes, as argument list, the various tasks to perform.
        """
        def eprint(*args, **kwargs):
            print(*args, file=sys.stderr, **kwargs)

        project, toolchain, board, option, build = arglist

        build = self.build_format.format(self.build or build)

        # We don't want output of all subprocesses here
        # Log files for each build will be placed in build directory
        with redirect_stdout(open(os.devnull, 'w')):
            try:
                run(
                    board,
                    toolchain,
                    project,
                    None,  #options_file
                    option,
                    None,  #out_dir
                    self.out_prefix,
                    self.verbose,
                    None,  #strategy
                    None,  #seed
                    None,  #carry
                    build,
                    self.build_type,
                )
            except Exception as e:
                eprint("\n---------------------")
                eprint(
                    "ERROR: {} {} {}{}{} {} test has failed (build type {}, build nr. {})\n"
                    .format(project, toolchain, board, self.build_type, build))
                eprint("ERROR MESSAGE: ", e)
                eprint("---------------------\n")