From: whitequark Date: Wed, 9 Oct 2019 21:16:14 +0000 (+0000) Subject: build.plat: elaborate result of create_missing_domain() against platform. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6241ab655cc351c8665760a76f64b45aa52407d;p=nmigen.git build.plat: elaborate result of create_missing_domain() against platform. Before this commit, the result was elaborated without platform, which caused generic implementation of e.g. ResetSynchronizer to be used. --- diff --git a/nmigen/build/plat.py b/nmigen/build/plat.py index be73772..2b01cab 100644 --- a/nmigen/build/plat.py +++ b/nmigen/build/plat.py @@ -111,7 +111,7 @@ class Platform(ResourceManager, metaclass=ABCMeta): self._prepared = True fragment = Fragment.get(elaboratable, self) - fragment.create_missing_domains(self.create_missing_domain) + fragment.create_missing_domains(self.create_missing_domain, platform=self) def add_pin_fragment(pin, pin_fragment): pin_fragment = Fragment.get(pin_fragment, self) diff --git a/nmigen/hdl/ir.py b/nmigen/hdl/ir.py index 1ad8f82..7ff40d0 100644 --- a/nmigen/hdl/ir.py +++ b/nmigen/hdl/ir.py @@ -355,7 +355,7 @@ class Fragment: subfrag._propagate_domains_down() - def create_missing_domains(self, missing_domain): + def create_missing_domains(self, missing_domain, *, platform=None): from .xfrm import DomainCollector collector = DomainCollector() @@ -374,7 +374,7 @@ class Fragment: # and there was no chance to add any logic driving it. new_domains.append(value) else: - new_fragment = Fragment.get(value, platform=None) + new_fragment = Fragment.get(value, platform=platform) if domain_name not in new_fragment.domains: defined = new_fragment.domains.keys() raise DomainError(