Merge pull request #247 from andrewb1999/master

Fix UpConverter reversed write mask
This commit is contained in:
enjoy-digital 2021-04-27 18:19:32 +02:00 committed by GitHub
commit c139f9d3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -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)
wdata_sel_parts = [ if reverse:
Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits) wdata_sel_parts = [
for i in range(ratio) Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits)
] for i in reverse(range(ratio))
]
else:
wdata_sel_parts = [
Replicate(cmd_buffer.source.sel[i], port_to.wdata.we.nbits // sel.nbits)
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))