Fix UpConverter reversed write mask
Signed-off-by: Andrew Butt <andrewb1999@gmail.com>
This commit is contained in:
parent
886f60d32c
commit
b4a2b7f9b0
|
@ -309,10 +309,17 @@ class LiteDRAMNativePortUpConverter(Module):
|
||||||
|
|
||||||
# Replicate `sel` bits to match the width of port_to.wdata.we.
|
# Replicate `sel` bits to match the width of port_to.wdata.we.
|
||||||
wdata_sel = Signal.like(port_to.wdata.we)
|
wdata_sel = Signal.like(port_to.wdata.we)
|
||||||
|
if reverse:
|
||||||
|
wdata_sel_parts = [
|
||||||
|
Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits)
|
||||||
|
for i in reverse(range(ratio))
|
||||||
|
]
|
||||||
|
else:
|
||||||
wdata_sel_parts = [
|
wdata_sel_parts = [
|
||||||
Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits)
|
Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits)
|
||||||
for i in range(ratio)
|
for i in range(ratio)
|
||||||
]
|
]
|
||||||
|
|
||||||
self.sync += \
|
self.sync += \
|
||||||
If(cmd_buffer.source.valid & cmd_buffer.source.we & wdata_chunk[ratio - 1],
|
If(cmd_buffer.source.valid & cmd_buffer.source.we & wdata_chunk[ratio - 1],
|
||||||
wdata_sel.eq(Cat(wdata_sel_parts))
|
wdata_sel.eq(Cat(wdata_sel_parts))
|
||||||
|
|
Loading…
Reference in New Issue