From 4b50df65689315d78b795cbaa99d00e40e790b0d Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 13 Dec 2018 10:18:57 +0000 Subject: [PATCH] fhdl.ir: remove iter_domains(). --- nmigen/back/rtlil.py | 2 +- nmigen/fhdl/ir.py | 3 --- nmigen/fhdl/xfrm.py | 9 ++++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/nmigen/back/rtlil.py b/nmigen/back/rtlil.py index 7de5d00..c670e73 100644 --- a/nmigen/back/rtlil.py +++ b/nmigen/back/rtlil.py @@ -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",)) diff --git a/nmigen/fhdl/ir.py b/nmigen/fhdl/ir.py index 41a2c52..8b838c9 100644 --- a/nmigen/fhdl/ir.py +++ b/nmigen/fhdl/ir.py @@ -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: diff --git a/nmigen/fhdl/xfrm.py b/nmigen/fhdl/xfrm.py index e2fe1e2..07c454d 100644 --- a/nmigen/fhdl/xfrm.py +++ b/nmigen/fhdl/xfrm.py @@ -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) -- 2.30.2