예제 #1
0
    def iter_options(self):
        """Returns all the possible combination of:
            - projects,
            - toolchains,
            - boards.

        Example:
        - path structure:    src/<project>/constr/<board>.<constraint>
        - valid combination: src/oneblink/constr/arty.pcf
        """

        combinations = set()

        vendors = get_vendors()
        for project in get_projects():
            project_dict = get_project(project)

            for vendor in project_dict["vendors"]:
                project_boards = project_dict["vendors"][vendor]

                toolchains = vendors[vendor]["toolchains"]
                vendor_boards = vendors[vendor]["boards"]

                boards = [
                    board for board in project_boards if board in vendor_boards
                ]

                for toolchain, board in list(product(toolchains, boards)):
                    combinations.add((project, toolchain, board))

        return combinations
예제 #2
0
    def iter_options(self):
        """Returns all the possible combination of:
            - projects,
            - toolchains,
            - families,
            - devices,
            - packages
            - boards.

        Example:
        - path structure:    src/<project>/<toolchain>/<family>_<device>_<package>_<board>.<constraint>
        - valid combination: src/oneblink/vpr/xc7_a35t_csg324-1_arty.pcf
        """

        projects = get_projects()
        toolchains = get_toolchains()

        combinations = set()
        for project, toolchain in list(product(projects, toolchains)):
            project_dict = get_project(project)

            if 'toolchains' in project_dict:
                toolchains_dict = project_dict['toolchains']
            else:
                continue

            if toolchain not in toolchains_dict:
                continue

            for board in toolchains_dict[toolchain]:
                combinations.add((project, toolchain, board))

        return combinations
예제 #3
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)
예제 #4
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)
예제 #5
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)
예제 #6
0
    def get_tasks(self,
                  args,
                  seeds=[0],
                  build_number=[0],
                  options=[None],
                  only_required=False):
        """Returns all the tasks filtering out the ones that do not correspond
        to the selected criteria"""

        tasks = []

        for task in self.tasks:
            take_task = True
            for arg in args.values():
                if arg is None:
                    continue

                if not any(value in arg for value in task):
                    take_task = False
                    break

            prj_file, prj_name, toolchain, board = task

            runner_task = (prj_file, toolchain, board)

            if take_task:
                if only_required:
                    required_toolchains = get_project(
                        prj_file)["required_toolchains"]
                    if toolchain in required_toolchains:
                        tasks.append(runner_task)
                else:
                    tasks.append(runner_task)

        tasks = self.add_extra_entry(seeds, tasks, create_new_tasks=True)
        tasks = self.add_extra_entry(options, tasks)
        tasks = self.add_extra_entry(build_number,
                                     tasks,
                                     create_new_tasks=True)
        return tasks
예제 #7
0
    def iter_options(self, all_combinations=False):
        """Returns all the possible combination of:
            - projects,
            - toolchains,
            - boards.

        Example:
        - path structure:    src/<project>/constr/<board>.<constraint>
        - valid combination: src/oneblink/constr/arty.pcf
        """

        combinations = set()

        vendors = get_vendors()
        for project_file in get_projects():
            project_dict = get_project(project_file)
            project_name = project_dict["name"]

            for vendor in project_dict["vendors"]:
                project_boards = project_dict["vendors"][vendor]

                toolchains = vendors[vendor]["toolchains"]
                vendor_boards = vendors[vendor]["boards"]
                skip_toolchains = project_dict.get("skip_toolchains", list())

                boards = [
                    board for board in project_boards if board in vendor_boards
                ]

                if all_combinations:
                    boards = vendor_boards

                for toolchain, board in list(product(toolchains, boards)):
                    if toolchain not in skip_toolchains or all_combinations:
                        combinations.add(
                            (project_file, project_name, toolchain, board))

        return combinations