From c98b8f7c07ad517503261c470c69799e33d5aca3 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 3 Jul 2019 13:24:00 +0000 Subject: [PATCH] compat.fhdl.specials: fix Memory.get_port() after 94e8f479. This also makes sure the native ports are instantiated for correct clock domain. --- nmigen/compat/fhdl/specials.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nmigen/compat/fhdl/specials.py b/nmigen/compat/fhdl/specials.py index 1aef667..c18c14e 100644 --- a/nmigen/compat/fhdl/specials.py +++ b/nmigen/compat/fhdl/specials.py @@ -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 -- 2.30.2