Skip to content
Snippets Groups Projects
Commit eb4a5de8 authored by Simon Bjurek's avatar Simon Bjurek
Browse files

linting fixes

parent 97342c36
No related branches found
No related tags found
2 merge requests!461Finalize earliest deadline scheduler,!459Qt6 fixes and scheduler class started
Pipeline #154514 failed
......@@ -7,7 +7,7 @@ Contains the schedule class for scheduling operations in an SFG.
import io
import sys
from collections import defaultdict
from typing import Dict, List, Literal, Optional, Sequence, Tuple, cast
from typing import Dict, List, Optional, Sequence, Tuple, cast
import matplotlib.pyplot as plt
import numpy as np
......@@ -33,10 +33,10 @@ from b_asic.operation import Operation
from b_asic.port import InputPort, OutputPort
from b_asic.process import MemoryVariable, OperatorProcess
from b_asic.resources import ProcessCollection
from b_asic.scheduling_algorithm import SchedAlg
from b_asic.signal_flow_graph import SFG
from b_asic.special_operations import Delay, Input, Output
from b_asic.types import TypeName
from b_asic.scheduling_algorithm import SchedAlg
# Need RGB from 0 to 1
_EXECUTION_TIME_COLOR: Tuple[float, ...] = tuple(
......@@ -1229,10 +1229,10 @@ class Schedule:
_repr_html_ = _repr_svg_
class Scheduler():
class Scheduler:
def __init__(self, schedule: Schedule) -> None:
self.schedule = schedule
def schedule_asap(self) -> None:
"""Schedule the operations using as-soon-as-possible scheduling."""
sched = self.schedule
......@@ -1303,7 +1303,7 @@ class Scheduler():
op_start_time = max(op_start_time, op_start_time_from_in)
sched._start_times[operation.graph_id] = op_start_time
# handle output and remove delays
for output in sched._sfg.find_by_type_name(Output.type_name()):
output = cast(Output, output)
......@@ -1337,7 +1337,7 @@ class Scheduler():
for output in sched.sfg.find_by_type_name(Output.type_name()):
output = cast(Output, output)
sched.move_operation_alap(output.graph_id)
# move all operations ALAP
for step in reversed(sched.sfg.get_precedence_list()):
for outport in step:
......@@ -1366,10 +1366,10 @@ class Scheduler():
# operation = outport.operation
# if operation.graph_id not in sched._start_times:
# sched._start_times[operation.graph_id] = 0
# # handle the remaining sets
# for outports in prec_list[2:]:
# for outport in outports:
# operation = outport.operation
# if operation.graph_id not in sched._start_times:
# pass
\ No newline at end of file
# pass
from enum import Enum
class SchedAlg(Enum):
ASAP = "ASAP"
ALAP = "ALAP"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment