phy/gensdrphy: add assertions on length of pads.dq/pads.dq
Allow detecting platform file issues similar to #88, #89 earlier.
This commit is contained in:
parent
6c53996a70
commit
8573c22cc1
|
@ -28,6 +28,7 @@ class GENSDRPHY(Module):
|
||||||
bankbits = len(pads.ba)
|
bankbits = len(pads.ba)
|
||||||
nranks = 1 if not hasattr(pads, "cs_n") else len(pads.cs_n)
|
nranks = 1 if not hasattr(pads, "cs_n") else len(pads.cs_n)
|
||||||
databits = len(pads.dq)
|
databits = len(pads.dq)
|
||||||
|
assert databits%8 == 0
|
||||||
|
|
||||||
self.settings = PhySettings(
|
self.settings = PhySettings(
|
||||||
memtype="SDR",
|
memtype="SDR",
|
||||||
|
@ -68,6 +69,7 @@ class GENSDRPHY(Module):
|
||||||
self.sync += dq_o.eq(dfi.p0.wrdata)
|
self.sync += dq_o.eq(dfi.p0.wrdata)
|
||||||
self.specials += Tristate(pads.dq, dq_o, dq_oe, dq_i)
|
self.specials += Tristate(pads.dq, dq_o, dq_oe, dq_i)
|
||||||
if hasattr(pads, "dm"):
|
if hasattr(pads, "dm"):
|
||||||
|
assert len(pads.dm)*8 == databits
|
||||||
self.sync += \
|
self.sync += \
|
||||||
If(dfi.p0.wrdata_en,
|
If(dfi.p0.wrdata_en,
|
||||||
pads.dm.eq(dfi.p0.wrdata_mask)
|
pads.dm.eq(dfi.p0.wrdata_mask)
|
||||||
|
|
Loading…
Reference in New Issue