mac/sram: Properly fix length_lsb for dw==8 case.

This commit is contained in:
Florent Kermarrec 2021-11-01 08:28:58 +01:00
parent 2827e9947f
commit 9b03fc14de
1 changed files with 1 additions and 1 deletions

View File

@ -213,7 +213,7 @@ class LiteEthMACSRAMReader(Module, AutoCSR):
self.comb += self._timestamp.status.eq(stat_fifo.source.timestamp) self.comb += self._timestamp.status.eq(stat_fifo.source.timestamp)
# Encode Length to last_be. # Encode Length to last_be.
length_lsb = cmd_fifo.source.length[:int(math.log2(dw/8)) + 1] length_lsb = cmd_fifo.source.length[:int(math.log2(dw/8))] if (dw != 8) else 0
self.comb += If(source.last, self.comb += If(source.last,
Case(length_lsb, { Case(length_lsb, {
1 : source.last_be.eq(0b00000001), 1 : source.last_be.eq(0b00000001),