From: whitequark Date: Thu, 13 Dec 2018 10:18:57 +0000 (+0000) Subject: fhdl.ir: remove iter_domains(). X-Git-Tag: working~300 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fde2471963da8cc4916cda29879fa331274d605c;p=nmigen.git fhdl.ir: remove iter_domains(). --- 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)