From: whitequark Date: Thu, 13 Dec 2018 02:43:22 +0000 (+0000) Subject: fhdl.ir: make sure clocks and resets of used CDs appear as inputs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f85008e5ed503e777d96a59f83a1cb5617e0e08a;p=nmigen.git fhdl.ir: make sure clocks and resets of used CDs appear as inputs. --- diff --git a/nmigen/fhdl/ir.py b/nmigen/fhdl/ir.py index 2af5a52..8de3388 100644 --- a/nmigen/fhdl/ir.py +++ b/nmigen/fhdl/ir.py @@ -58,6 +58,11 @@ class Fragment: self_driven = union(s._lhs_signals() for s in self.statements) self_used = union(s._rhs_signals() for s in self.statements) + for cd_name, _ in self.iter_sync(): + cd = clock_domains[cd_name] + self_used.add(cd.clk) + if cd.reset is not None: + self_used.add(cd.reset) ins = self_used - self_driven outs = ports & self_driven