Skip to content
Snippets Groups Projects

Better schedule, including plotting

Merged Oscar Gustafsson requested to merge plotschedule into master
1 file
+ 13
2
Compare changes
  • Side-by-side
  • Inline
+ 13
2
@@ -10,6 +10,7 @@ from matplotlib.ticker import MaxNLocator
import numpy as np
from scipy import interpolate
import sys
import io
from b_asic.signal_flow_graph import SFG
from b_asic.graph_component import GraphID
@@ -180,7 +181,7 @@ class Schema:
self._start_times[output.graph_id] = self._start_times[source_port.operation.graph_id] + source_port.latency_offset
self._remove_delays()
def plot_schedule(self) -> None:
def _plot_schedule(self):
def _draw_arrow2(start, end):
if end[0] < start[0]: # Wrap around
plt.plot([start[0], self._schedule_time], [start[1], start[1]])
@@ -223,7 +224,6 @@ class Schema:
ypos = 0.5
ytickpositions = []
yticklabels = []
plt.figure()
plt.grid(zorder=0.5)
ypositions = dict()
for op_id, op_start_time in self._start_times.items():
@@ -263,4 +263,15 @@ class Schema:
plt.gca().xaxis.set_major_locator(MaxNLocator(integer=True))
plt.plot([0, 0], [0, ypos], linestyle='--', color='black')
plt.plot([self._schedule_time, self._schedule_time], [0, ypos], linestyle='--', color='black')
def plot_schedule(self) -> None:
plt.figure()
self._plot_schedule()
plt.show()
def _repr_svg_(self):
self._plot_schedule()
f = io.StringIO()
plt.savefig(f, format='svg')
return f.getvalue()
Loading