compat.fhdl.specials: fix Memory.get_port() after 94e8f479.
authorwhitequark <whitequark@whitequark.org>
Wed, 3 Jul 2019 13:24:00 +0000 (13:24 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 3 Jul 2019 13:24:00 +0000 (13:24 +0000)
This also makes sure the native ports are instantiated for correct
clock domain.

nmigen/compat/fhdl/specials.py

index 1aef667bfd2884deac6fee3219486c6ff980b734..c18c14ec3cbe152fe2313d7fd0f01083a83b3ba5 100644 (file)
@@ -98,12 +98,13 @@ class CompatMemory(NativeMemory):
                           DeprecationWarning, stacklevel=1)
             we_granularity = None
         assert mode != NO_CHANGE
-        rdport = self.read_port(synchronous=not async_read, transparent=mode == WRITE_FIRST)
+        rdport = self.read_port(domain="comb" if async_read else clock_domain,
+                                transparent=mode == WRITE_FIRST)
         rdport.addr.name = "{}_addr".format(self.name)
         adr = rdport.addr
         dat_r = rdport.data
         if write_capable:
-            wrport = self.write_port(granularity=we_granularity)
+            wrport = self.write_port(domain=clock_domain, granularity=we_granularity)
             wrport.addr = rdport.addr
             we = wrport.en
             dat_w = wrport.data