From f85008e5ed503e777d96a59f83a1cb5617e0e08a Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 13 Dec 2018 02:43:22 +0000 Subject: [PATCH] fhdl.ir: make sure clocks and resets of used CDs appear as inputs. --- nmigen/fhdl/ir.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.30.2