fhdl.ir: remove iter_domains().
authorwhitequark <whitequark@whitequark.org>
Thu, 13 Dec 2018 10:18:57 +0000 (10:18 +0000)
committerwhitequark <whitequark@whitequark.org>
Thu, 13 Dec 2018 10:18:57 +0000 (10:18 +0000)
nmigen/back/rtlil.py
nmigen/fhdl/ir.py
nmigen/fhdl/xfrm.py

index 7de5d00fb5530b212c2a41fdfb20d0b48743c84b..c670e73cd84f29e37ccb53170553ca7788c72f7b 100644 (file)
@@ -480,7 +480,7 @@ def convert_fragment(builder, fragment, name, top, clock_domains):
             # however, differs between domains: for comb domains, it is `always`, for sync domains
             # with sync reset, it is `posedge clk`, for sync domains with async rest it is
             # `posedge clk or posedge rst`.
-            for domain, signals in fragment.iter_domains():
+            for domain, signals in fragment.drivers.items():
                 triggers = []
                 if domain is None:
                     triggers.append(("always",))
index 41a2c525de4eb5d4c7c821cd229a3856b23e4071..8b838c9d00c88aefd19c3ff86a3afc653310cd0f 100644 (file)
@@ -25,9 +25,6 @@ class Fragment:
             self.drivers[domain] = ValueSet()
         self.drivers[domain].add(signal)
 
-    def iter_domains(self):
-        yield from self.drivers.items()
-
     def iter_drivers(self):
         for domain, signals in self.drivers.items():
             for signal in signals:
index e2fe1e259bf9fabd2c3eccc54a707d25d6985ad4..07c454d435a2d9719da9a9eda11ad5d93b75e4c7 100644 (file)
@@ -102,9 +102,8 @@ class FragmentTransformer:
             new_fragment.add_statements(fragment.statements)
 
     def map_drivers(self, fragment, new_fragment):
-        for domain, signals in fragment.iter_domains():
-            for signal in signals:
-                new_fragment.drive(signal, domain)
+        for domain, signal in fragment.iter_drivers():
+            new_fragment.drive(signal, domain)
 
     def on_fragment(self, fragment):
         new_fragment = Fragment()
@@ -134,7 +133,7 @@ class DomainRenamer(FragmentTransformer, ValueTransformer, StatementTransformer)
         return value
 
     def map_drivers(self, fragment, new_fragment):
-        for domain, signals in fragment.iter_domains():
+        for domain, signals in fragment.drivers.items():
             if domain in self.domains:
                 domain = self.domains[domain]
             for signal in signals:
@@ -149,7 +148,7 @@ class _ControlInserter(FragmentTransformer):
 
     def on_fragment(self, fragment):
         new_fragment = super().on_fragment(fragment)
-        for domain, signals in fragment.iter_domains():
+        for domain, signals in fragment.drivers.items():
             if domain is None or domain not in self.controls:
                 continue
             self._insert_control(new_fragment, domain, signals)