From c30abbdd607a37c26f316fdac3e257e3dc577d2f Mon Sep 17 00:00:00 2001 From: David Sawatzke Date: Tue, 17 Aug 2021 19:17:51 +0200 Subject: [PATCH] =?UTF-8?q?mac/last=5Fbe:=20Adjust=20for=20dw=E2=89=A08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In that case, last_be needs to be passed through last_be also is now longer than 1 --- liteeth/mac/last_be.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/liteeth/mac/last_be.py b/liteeth/mac/last_be.py index bf49956..329f4f8 100644 --- a/liteeth/mac/last_be.py +++ b/liteeth/mac/last_be.py @@ -19,11 +19,11 @@ class LiteEthMACTXLastBE(Module): self.submodules.fsm = fsm = FSM(reset_state="COPY") fsm.act("COPY", - sink.connect(source, omit={"last", "last_be"}), - source.last.eq(sink.last_be), + sink.connect(source), + source.last.eq(sink.last_be != 0), If(sink.valid & sink.ready, # If last Byte but not last packet token. - If(sink.last_be & ~sink.last, + If(source.last & ~sink.last, NextState("WAIT-LAST") ) ) @@ -47,5 +47,10 @@ class LiteEthMACRXLastBE(Module): self.comb += [ sink.connect(source), - source.last_be.eq(sink.last) + If(dw == 8, + # 8bit PHYs will only drive last, thus `last_be` must be + # controlled accordingly. PHYs > 8bit must drive `last_be` + # themselves. + source.last_be.eq(sink.last) + ) ]