+import sys
import networkx as nx
from migen.fhdl import verilog
a2 = make_composable(g, Add(BV(16)))
a3 = make_composable(g, Add(BV(16)))
c3 = (a1 + a2)*a3
-print(c3)
c = CompositeActor(g)
frag = c.get_control_fragment() + c.get_process_fragment()
print(verilog.convert(frag))
+
+if len(sys.argv) > 1 and sys.argv[1] == "draw":
+ import matplotlib.pyplot as plt
+ nx.draw(g)
+ plt.show()
raise NotImplementedError("Actor classes must overload get_process_fragment")
def __repr__(self):
- return "<Actor " + repr(self.scheduling_model) + " " + repr(self.sinks()) + " " + repr(self.sources()) + ">"
+ return "<" + self.__class__.__name__ + " " + repr(self.scheduling_model) + " " + repr(self.sinks()) + " " + repr(self.sources()) + ">"
def get_conn_control_fragment(source, sink):
assert isinstance(source, Source)