From: Sebastien Bourdeauducq Date: Fri, 3 Aug 2012 16:48:35 +0000 (+0200) Subject: flow/hooks/DFGHook: add iterator on hooks X-Git-Tag: 24jan2021_ls180~2099^2~856 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adacdadd58b1cad4fb6df8994f925343c1114794;p=litex.git flow/hooks/DFGHook: add iterator on hooks --- diff --git a/migen/flow/hooks.py b/migen/flow/hooks.py index 9165e641..9272d9be 100644 --- a/migen/flow/hooks.py +++ b/migen/flow/hooks.py @@ -37,9 +37,10 @@ class DFGHook: ep = data["source"] ep_to_hook[ep] = create(u, ep, v) - def get_fragment(self): - frag = Fragment() + def hooks_iter(self): for v1 in self.nodepair_to_ep.values(): for v2 in v1.values(): - frag += v2.get_fragment() - return frag + yield v2 + + def get_fragment(self): + return sum([h.get_fragment() for h in self.hooks_iter()], Fragment())