def __call__(self, machine_graph, machine, plan_n_timesteps, placements):
        progress_bar = ProgressBar(7, "Routing")

        vertices_resources, nets, net_names = \
            convert_to_rig_graph_pure_mc(machine_graph, plan_n_timesteps)
        progress_bar.update()

        rig_machine = convert_to_rig_machine(machine)
        progress_bar.update()

        rig_constraints = create_rig_machine_constraints(machine)
        progress_bar.update()

        rig_constraints.extend(create_rig_graph_constraints(
            machine_graph, machine))
        progress_bar.update()

        rig_placements, rig_allocations = convert_to_rig_placements(
            placements, machine)
        progress_bar.update()

        rig_routes = route(
            vertices_resources, nets, rig_machine, rig_constraints,
            rig_placements, rig_allocations, "cores")
        rig_routes = {
            name: rig_routes[net] for net, name in iteritems(net_names)}
        progress_bar.update()

        routes = convert_from_rig_routes(rig_routes)
        progress_bar.update()
        progress_bar.end()

        return routes
Beispiel #2
0
    def __call__(self, partitioned_graph, machine):
        progress_bar = ProgressBar(9, "Placing and Routing")

        vertices_resources, nets, net_names = \
            rig_converters.convert_to_rig_partitioned_graph(
                partitioned_graph)
        progress_bar.update()

        rig_machine = rig_converters.convert_to_rig_machine(machine)
        progress_bar.update()

        rig_constraints = rig_converters.create_rig_machine_constraints(
            machine)
        progress_bar.update()

        rig_constraints.extend(
            rig_converters.create_rig_partitioned_graph_constraints(
                partitioned_graph, rig_machine))
        progress_bar.update()

        rig_placements = place(vertices_resources, nets, rig_machine,
                               rig_constraints)
        progress_bar.update()

        rig_allocations = allocate(vertices_resources, nets, rig_machine,
                                   rig_constraints, rig_placements)
        progress_bar.update()

        rig_routes = route(vertices_resources, nets, rig_machine,
                           rig_constraints, rig_placements, rig_allocations,
                           "cores")
        rig_routes = {
            name: rig_routes[net]
            for net, name in net_names.iteritems()
        }
        progress_bar.update()

        placements = rig_converters.convert_from_rig_placements(
            rig_placements, rig_allocations, partitioned_graph)
        progress_bar.update()
        routes = rig_converters.convert_from_rig_routes(
            rig_routes, partitioned_graph)
        progress_bar.update()
        progress_bar.end()

        return {"placements": placements, "routing_paths": routes}
Beispiel #3
0
    def __call__(self, machine_graph, machine, placements):
        progress_bar = ProgressBar(7, "Routing")

        vertices_resources, nets, net_names = \
            rig_converters.convert_to_rig_graph_pure_mc(machine_graph)
        progress_bar.update()

        rig_machine = rig_converters.convert_to_rig_machine(machine)
        progress_bar.update()

        rig_constraints = rig_converters.create_rig_machine_constraints(
            machine)
        progress_bar.update()

        rig_constraints.extend(
            rig_converters.create_rig_graph_constraints(
                machine_graph, machine))
        progress_bar.update()

        rig_placements, rig_allocations = \
            rig_converters.convert_to_rig_placements(placements, machine)
        progress_bar.update()

        rig_routes = route(vertices_resources, nets, rig_machine,
                           rig_constraints, rig_placements, rig_allocations,
                           "cores")
        rig_routes = {
            name: rig_routes[net]
            for net, name in iteritems(net_names)
        }
        progress_bar.update()

        routes = rig_converters.convert_from_rig_routes(rig_routes)
        progress_bar.update()
        progress_bar.end()

        return routes