Skip to content
Snippets Groups Projects

Better schedule, including plotting

Merged Oscar Gustafsson requested to merge plotschedule into master
2 files
+ 73
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 17
1
@@ -14,7 +14,6 @@ import io
from b_asic.signal_flow_graph import SFG
from b_asic.graph_component import GraphID
from b_asic.operation import Operation
from b_asic.special_operations import Delay, Output
@@ -108,6 +107,22 @@ class Schema:
def schedule_time(self) -> int:
return self._schedule_time
def increase_time_resolution(self, factor: int) -> None:
raise NotImplementedError
def decrease_time_resolution(self, factor: int) -> None:
raise NotImplementedError
def move_operation(self, op_id: GraphID, time: int) -> None:
assert op_id in self._start_times, "No operation with the specified op_id in this schema."
if time < 0:
if -time > self.backward_slack(op_id):
raise ValueError
else:
if time > self.forward_slack(op_id):
raise ValueError
self._start_times[op_id] += time
def _remove_delays(self) -> None:
delay_list = self._sfg.find_by_type_name(Delay.type_name())
while delay_list:
@@ -270,6 +285,7 @@ class Schema:
plt.show()
def _repr_svg_(self):
plt.figure()
self._plot_schedule()
f = io.StringIO()
plt.savefig(f, format='svg')
Loading