fhdl.ir: make sure clocks and resets of used CDs appear as inputs.
authorwhitequark <whitequark@whitequark.org>
Thu, 13 Dec 2018 02:43:22 +0000 (02:43 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 13 Dec 2018 02:43:22 +0000 (02:43 +0000)
nmigen/fhdl/ir.py

index 2af5a525b0f21dbe4b7d390245b8f9546764dcdc..8de3388869ee0e04cd1a09373b5bc5ea4ba97c59 100644 (file)
@@ -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