Automatic scheduling with custom IO timesΒΆ

It is possible to specify the IO times and provide those to the scheduling.

from b_asic.core_operations import ConstantMultiplication
from b_asic.fft_operations import R2Butterfly
from b_asic.list_schedulers import HybridScheduler
from b_asic.schedule import Schedule
from b_asic.scheduler import ALAPScheduler, ASAPScheduler
from b_asic.sfg_generators import radix_2_dif_fft

points = 8
sfg = radix_2_dif_fft(points=points)

The SFG is:

sfg
auto scheduling with custom io times

Set latencies and execution times.

sfg.set_latency_of_type(R2Butterfly, 1)
sfg.set_latency_of_type(ConstantMultiplication, 3)
sfg.set_execution_time_of_type(R2Butterfly, 1)
sfg.set_execution_time_of_type(ConstantMultiplication, 1)

Generate an ASAP schedule for reference with custom IO times.

input_times = {f"in{i}": i for i in range(points)}
output_delta_times = {f"out{i}": i for i in range(points)}
schedule1 = Schedule(sfg, scheduler=ASAPScheduler(input_times, output_delta_times))
schedule1
auto scheduling with custom io times

Generate an ALAP schedule for reference with custom IO times..

schedule_t = Schedule(sfg, scheduler=ALAPScheduler(input_times, output_delta_times))
schedule_t
auto scheduling with custom io times

Generate a non-cyclic Schedule from HybridScheduler with custom IO times, one input and output per time unit and one butterfly/multiplication per time unit.

auto scheduling with custom io times

Generate a new Schedule with cyclic scheduling enabled.

schedule3 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=14,
    cyclic=True,
)
schedule3
auto scheduling with custom io times

Generate a new Schedule with even less scheduling time.

schedule4 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=13,
    cyclic=True,
)
schedule4
auto scheduling with custom io times

Try scheduling for 12 cycles, which gives full butterfly usage.

schedule5 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=12,
    cyclic=True,
)
schedule5
auto scheduling with custom io times

Total running time of the script: (0 minutes 1.872 seconds)

Gallery generated by Sphinx-Gallery