diff --git a/b_asic/scheduler.py b/b_asic/scheduler.py index b17b48424cba2a10368e3db5b9cf3d17077b7423..cc4086d981e5f11b9a4f9d883b5b0a000806d4af 100644 --- a/b_asic/scheduler.py +++ b/b_asic/scheduler.py @@ -1,3 +1,4 @@ +import sys from abc import ABC, abstractmethod from collections import defaultdict from typing import TYPE_CHECKING, Optional, cast @@ -181,8 +182,6 @@ class EarliestDeadlineScheduler(Scheduler): Schedule to apply the scheduling algorithm on. """ - # TODO: Solve bug where operation (ADD) is scheduled before proceeding (MUL) -> pipelining - ALAPScheduler().apply_scheduling(schedule) # move all inputs ASAP to ensure correct operation @@ -211,7 +210,6 @@ class EarliestDeadlineScheduler(Scheduler): # update available operators for operation, ready_time in used_resources_ready_times.items(): - print(ready_time, current_time) if ready_time == current_time: remaining_resources[operation.type_name()] += 1 # remaining_resources = self._max_resources.copy() @@ -255,6 +253,9 @@ class EarliestDeadlineScheduler(Scheduler): source_end_times[op_id], schedule.start_times[source_op.graph_id] + source_op.latency, ) + # ensure that the source is already scheduled + if source_op.graph_id in remaining_ops: + source_end_times[op_id] = sys.maxsize # check resource constraints if operation.type_name() in remaining_resources: