diff --git a/examples/dataflow.py b/examples/dataflow.py index 7707b3a2d..8e43f8c5d 100644 --- a/examples/dataflow.py +++ b/examples/dataflow.py @@ -1,3 +1,4 @@ +import sys import networkx as nx from migen.fhdl import verilog @@ -10,9 +11,13 @@ a1 = make_composable(g, Add(BV(16))) 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() diff --git a/migen/flow/actor.py b/migen/flow/actor.py index a1f57e4fa..25279bd84 100644 --- a/migen/flow/actor.py +++ b/migen/flow/actor.py @@ -152,7 +152,7 @@ class Actor: raise NotImplementedError("Actor classes must overload get_process_fragment") def __repr__(self): - return "" + 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)