From 2827e9947fa4af3970e329ae7258509dab98d982 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sun, 31 Oct 2021 15:11:08 +0100 Subject: [PATCH] mac/sram: Fix length_lsb slicing (+1). --- 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 ea1e5c0..585129d 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[0:int(math.log2(dw//8))] + length_lsb = cmd_fifo.source.length[:int(math.log2(dw/8)) + 1] self.comb += If(source.last, Case(length_lsb, { 1 : source.last_be.eq(0b00000001),