Skip to content
Snippets Groups Projects
Commit 8d623e09 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Rework IO times example

parent 0b8e4dd4
No related branches found
No related tags found
1 merge request!477Rework IO times example
Pipeline #157052 failed
......@@ -11,7 +11,8 @@ from b_asic.schedule import Schedule
from b_asic.scheduler import ASAPScheduler
from b_asic.sfg_generators import radix_2_dif_fft
sfg = radix_2_dif_fft(points=8)
points = 8
sfg = radix_2_dif_fft(points=points)
# %%
# The SFG is
......@@ -19,8 +20,8 @@ sfg
# %%
# Set latencies and execution times.
sfg.set_latency_of_type(Butterfly.type_name(), 3)
sfg.set_latency_of_type(ConstantMultiplication.type_name(), 2)
sfg.set_latency_of_type(Butterfly.type_name(), 1)
sfg.set_latency_of_type(ConstantMultiplication.type_name(), 3)
sfg.set_execution_time_of_type(Butterfly.type_name(), 1)
sfg.set_execution_time_of_type(ConstantMultiplication.type_name(), 1)
......@@ -32,26 +33,8 @@ schedule.show()
# %%
# Generate a non-cyclic Schedule from HybridScheduler with custom IO times.
resources = {Butterfly.type_name(): 1, ConstantMultiplication.type_name(): 1}
input_times = {
"in0": 0,
"in1": 1,
"in2": 2,
"in3": 3,
"in4": 4,
"in5": 5,
"in6": 6,
"in7": 7,
}
output_delta_times = {
"out0": -2,
"out1": -1,
"out2": 0,
"out3": 1,
"out4": 2,
"out5": 3,
"out6": 4,
"out7": 5,
}
input_times = {f"in{i}": i for i in range(points)}
output_delta_times = {f"out{i}": i - 2 for i in range(points)}
schedule = Schedule(
sfg,
scheduler=HybridScheduler(
......@@ -64,16 +47,7 @@ schedule.show()
# %%
# Generate a new Schedule with cyclic scheduling enabled
output_delta_times = {
"out0": 0,
"out1": 1,
"out2": 2,
"out3": 3,
"out4": 4,
"out5": 5,
"out6": 6,
"out7": 7,
}
output_delta_times = {f"out{i}": i for i in range(points)}
schedule = Schedule(
sfg,
scheduler=HybridScheduler(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment