flow/network/DataFlowGraph: add add_pipeline
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 30 Apr 2013 13:49:51 +0000 (15:49 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 30 Apr 2013 13:49:51 +0000 (15:49 +0200)
migen/flow/network.py

index 4082720aff8fc3357f1ad071943fe14b989adb62..1b61dccc1fca70187c6cf3c6a3b8117a54480223 100644 (file)
@@ -37,6 +37,10 @@ class DataFlowGraph(MultiDiGraph):
                self.add_edge(source_node, sink_node,
                        source=source_ep, sink=sink_ep,
                        source_subr=source_subr, sink_subr=sink_subr)
+
+       def add_pipeline(self, *nodes):
+               for n1, n2 in zip(nodes, nodes[1:]):
+                       self.add_connection(n1, n2)
        
        def del_connections(self, source_node, sink_node, data_requirements):
                edges_to_delete = []