From 9b03fc14de8aa2454d967c16bcf7c97cf894b9ee Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 1 Nov 2021 08:28:58 +0100 Subject: [PATCH] mac/sram: Properly fix length_lsb for dw==8 case. --- liteeth/mac/sram.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liteeth/mac/sram.py b/liteeth/mac/sram.py index 585129d..06f0bcf 100644 --- a/liteeth/mac/sram.py +++ b/liteeth/mac/sram.py @@ -213,7 +213,7 @@ class LiteEthMACSRAMReader(Module, AutoCSR): self.comb += self._timestamp.status.eq(stat_fifo.source.timestamp) # 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, Case(length_lsb, { 1 : source.last_be.eq(0b00000001),