build.plat: elaborate result of create_missing_domain() against platform.
authorwhitequark <cz@m-labs.hk>
Wed, 9 Oct 2019 21:16:14 +0000 (21:16 +0000)
committerwhitequark <cz@m-labs.hk>
Wed, 9 Oct 2019 21:16:20 +0000 (21:16 +0000)
Before this commit, the result was elaborated without platform, which
caused generic implementation of e.g. ResetSynchronizer to be used.

nmigen/build/plat.py
nmigen/hdl/ir.py

index be7377269fa37db4423219c4c9ca2ffa62bdfd0d..2b01cabe561bd45b3552bfcaec788331edcffabc 100644 (file)
@@ -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)
index 1ad8f82958b049bcab1c22c62527eec8681e30d6..7ff40d04aaaa2f2568fb46f7acafd723a68adede 100644 (file)
@@ -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(