flow/network: require ActorNode be passed to add_connection
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 16 Jun 2012 20:40:26 +0000 (22:40 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 16 Jun 2012 20:40:26 +0000 (22:40 +0200)
migen/flow/network.py

index 25d55d1b0589e5d699ea25cf85926ecb787ad57a..e33f04e9399e2499abda2b234461f075432d7c72 100644 (file)
@@ -53,10 +53,8 @@ class DataFlowGraph(MultiDiGraph):
        def add_connection(self, source_node, sink_node,
          source_ep=None, sink_ep=None,         # default: assume nodes have 1 source/sink and use that one
          source_subr=None, sink_subr=None):    # default: use whole record
-               if not isinstance(source_node, ActorNode):
-                       source_node = ActorNode(source_node)
-               if not isinstance(sink_node, ActorNode):
-                       sink_node = ActorNode(sink_node)
+               assert(isinstance(source_node, ActorNode))
+               assert(isinstance(sink_node, ActorNode))
                self.add_edge(source_node, sink_node,
                        source=source_ep, sink=sink_ep,
                        source_subr=source_subr, sink_subr=sink_subr)