b_asic.scheduler

Inheritance diagram of b_asic.scheduler

B-ASIC Scheduler Module.

Contains classes for automatic scheduling of SFGs.

class b_asic.scheduler.ALAPScheduler(input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, sort_y_location: bool = True)

Bases: Scheduler

Scheduler that implements the as-late-as-possible (ALAP) algorithm.

Parameters:
input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.

class b_asic.scheduler.ASAPScheduler(input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, sort_y_location: bool = True)

Bases: Scheduler

Scheduler that implements the as-soon-as-possible (ASAP) algorithm.

Parameters:
input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.

class b_asic.scheduler.ILPScheduler(solver: LpSolver | None = None, input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, max_time: int | None = None, sort_y_location: bool = True)

Bases: Scheduler

ILP-based scheduler that minimizes the amount of concurrent operations.

Parameters:
solverLpSolver, optional

Only used if strategy is an ILP method. To see which solvers are available:

import pulp

print(pulp.listSolvers(onlyAvailable=True))
input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

max_timeint, optional

The time horizon to schedule for in cyclic scheduling.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.

class b_asic.scheduler.ListScheduler(sort_order: tuple[tuple[int, bool], ...], max_resources: dict[TypeName, int] | None = None, max_concurrent_reads: int | None = None, max_concurrent_writes: int | None = None, input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, sort_y_location: bool = True)

Bases: Scheduler

List-based scheduler with optional constraints.

Important

Only works on non-recursive SFGs. For recursive SFGs use RecursiveListScheduler instead.

Parameters:
sort_ordertuple(tuple(int, bool))

Specifies which columns in the priority table to sort on and in which order, where True is ascending order. There are five columns:

0 - GraphID of the operation.
1 - Deadline, i.e., the clock cycle that the data is required in the ALAP schedule.
2 - Output slack, i.e., the start time of the operation in the ALAP schedule when sorted on.
3 - Fan-out, i.e., the number of operations reading from the output of the operation.
4 - Memory reads, i.e., the number of memory reads required if operation is scheduled in the
    current time slot.
max_resourcesdict[TypeName, int], optional

Max resources available to realize the schedule.

max_concurrent_readsint, optional

Max number of conccurent reads.

max_concurrent_writesint, optional

Max number of conccurent writes.

input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.

class b_asic.scheduler.RecursiveListScheduler(sort_order: tuple[tuple[int, bool], ...], max_resources: dict[TypeName, int] | None = None, input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, sort_y_location: bool = True)

Bases: ListScheduler

List-based scheduler for recursive algorithms with optional constraints.

Info

If the SFG does not have any recursive parts, use ListScheduler instead.

Parameters:
sort_ordertuple(tuple(int, bool))

Specifies which columns in the priority table to sort on and in which order, where True is ascending order. There are five columns:

0 - GraphID of the operation.
1 - Deadline, i.e., the clock cycle that the data is required in the ALAP schedule.
2 - Output slack, i.e., the start time of the operation in the ALAP schedule when sorted on.
3 - Fan-out, i.e., the number of operations reading from the output of the operation.
4 - Memory reads, i.e., the number of memory reads required if operation is scheduled in the
    current time slot.
max_resourcesdict[TypeName, int], optional

Max resources available to realize the schedule.

input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.

class b_asic.scheduler.Scheduler(input_times: dict[GraphID, int] | None = None, output_delta_times: dict[GraphID, int] | None = None, output_times: dict[GraphID, int] | None = None, sort_y_location: bool = True)

Bases: ABC

Scheduler base class.

Parameters:
input_timesdict(GraphID, int), optional

The times when inputs arrive.

output_delta_timesdict(GraphID, int), optional

The relative times when outputs should be produced.

output_timesdict(GraphID, int), optional

The times when outputs should be produced.

sort_y_locationbool, default: True

If the y-location should be sorted based on start time of operations.

abstractmethod apply_scheduling(schedule: Schedule) None

Apply the scheduling algorithm on the given Schedule.

Parameters:
scheduleSchedule

Schedule to apply the scheduling algorithm on.