gensdrphy: fix dm generation
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 19 May 2014 15:45:13 +0000 (17:45 +0200)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Wed, 21 May 2014 19:16:06 +0000 (21:16 +0200)
misoclib/sdramphy/gensdrphy.py

index 450e456e7ec85c3233da80aba7a0f9ee168fcab0..800dc0d56f636d9683bc603001c7335d0c176990 100644 (file)
@@ -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)