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)
|
||||
nranks = 1 if not hasattr(pads, "cs_n") else len(pads.cs_n)
|
||||
databits = len(pads.dq)
|
||||
assert databits%8 == 0
|
||||
|
||||
self.settings = PhySettings(
|
||||
memtype="SDR",
|
||||
|
@ -68,6 +69,7 @@ class GENSDRPHY(Module):
|
|||
self.sync += dq_o.eq(dfi.p0.wrdata)
|
||||
self.specials += Tristate(pads.dq, dq_o, dq_oe, dq_i)
|
||||
if hasattr(pads, "dm"):
|
||||
assert len(pads.dm)*8 == databits
|
||||
self.sync += \
|
||||
If(dfi.p0.wrdata_en,
|
||||
pads.dm.eq(dfi.p0.wrdata_mask)
|
||||
|
|
Loading…
Reference in New Issue