From f4c064828935d9b23b87547a043b10c525721445 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 19 May 2014 17:45:13 +0200 Subject: [PATCH] gensdrphy: fix dm generation --- misoclib/sdramphy/gensdrphy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misoclib/sdramphy/gensdrphy.py b/misoclib/sdramphy/gensdrphy.py index 450e456e..800dc0d5 100644 --- a/misoclib/sdramphy/gensdrphy.py +++ b/misoclib/sdramphy/gensdrphy.py @@ -72,7 +72,11 @@ class GENSDRPHY(Module): drive_dq = Signal() self.sync += sd_dq_out.eq(self.dfi.p0.wrdata), self.specials += Tristate(pads.dq, sd_dq_out, drive_dq) - self.sync += pads.dm.eq(~self.dfi.p0.wrdata_mask) + self.sync += If(self.dfi.p0.wrdata_en, + pads.dm.eq(self.dfi.p0.wrdata_mask) + ).Else( + pads.dm.eq(0) + ) sd_dq_in_ps = Signal(d) self.sync.sys_ps += sd_dq_in_ps.eq(pads.dq) self.sync += self.dfi.p0.rddata.eq(sd_dq_in_ps) -- 2.30.2