From: Nina Engelhardt Date: Sun, 11 Aug 2013 21:11:30 +0000 (+0200) Subject: add += operator to fragment X-Git-Tag: 24jan2021_ls180~2099^2~475 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e12187aa807a724f5ba60ff5bf4ad4b32170cc15;p=litex.git add += operator to fragment --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 2be1a640..9ef2cb32 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -275,3 +275,16 @@ class _Fragment: self.specials | other.specials, self.clock_domains + other.clock_domains, self.sim + other.sim) + + def __iadd__(self, other): + newsync = defaultdict(list) + for k, v in self.sync.items(): + newsync[k] = v[:] + for k, v in other.sync.items(): + newsync[k].extend(v) + self.comb += other.comb + self.sync = newsync + self.specials |= other.specials + self.clock_domains += other.clock_domains + self.sim += other.sim + return self