mac/last_be: Adjust for dw≠8

In that case, last_be needs to be passed through

last_be also is now longer than 1
This commit is contained in:
David Sawatzke 2021-08-17 19:17:51 +02:00
parent 9b38fd8df3
commit c30abbdd60
1 changed files with 9 additions and 4 deletions

View File

@ -19,11 +19,11 @@ class LiteEthMACTXLastBE(Module):
self.submodules.fsm = fsm = FSM(reset_state="COPY") self.submodules.fsm = fsm = FSM(reset_state="COPY")
fsm.act("COPY", fsm.act("COPY",
sink.connect(source, omit={"last", "last_be"}), sink.connect(source),
source.last.eq(sink.last_be), source.last.eq(sink.last_be != 0),
If(sink.valid & sink.ready, If(sink.valid & sink.ready,
# If last Byte but not last packet token. # If last Byte but not last packet token.
If(sink.last_be & ~sink.last, If(source.last & ~sink.last,
NextState("WAIT-LAST") NextState("WAIT-LAST")
) )
) )
@ -47,5 +47,10 @@ class LiteEthMACRXLastBE(Module):
self.comb += [ self.comb += [
sink.connect(source), 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)
)
] ]