frontend/ecc/LiteDRAMNativePortECCW: Only set source.we when sink has at least one valid byte to write.

Write access with sink.we bits all set to 0 can happen when converters are used
in the user logic.
This commit is contained in:
Florent Kermarrec 2021-06-04 18:31:09 +02:00
parent 3f88eb9a43
commit 8b606cd05a
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class LiteDRAMNativePortECCW(Module):
encoder.i.eq(sink.data[i*data_width_from//8:(i+1)*data_width_from//8]),
source.data[i*data_width_to//8:(i+1)*data_width_to//8].eq(encoder.o)
]
self.comb += source.we.eq(2**len(source.we)-1)
self.comb += If(sink.we != 0, source.we.eq(2**len(source.we)-1))
# LiteDRAMNativePortECCR ---------------------------------------------------------------------------