phy/pcs_1000basex: Cleanup PCSRX buffer and fix PCS TX ready on Start-of-packet.

This commit is contained in:
Florent Kermarrec 2024-10-18 18:27:54 +02:00
parent a58e25c2f0
commit 1bbb735f9f
1 changed files with 3 additions and 2 deletions

View File

@ -107,6 +107,7 @@ class PCSTX(LiteXModule):
# Wait for valid Data. # Wait for valid Data.
).Else( ).Else(
If(sink.valid, If(sink.valid,
sink.ready.eq(timer.done),
self.encoder.d[0].eq(K(27, 7)), # Start-of-packet /S/. self.encoder.d[0].eq(K(27, 7)), # Start-of-packet /S/.
NextState("DATA") NextState("DATA")
).Else( ).Else(
@ -186,9 +187,9 @@ class PCSRX(LiteXModule):
# Buffer. # Buffer.
# ------- # -------
self.buffer = buffer = stream.Buffer([("data", 8)]) self.buffer = buffer = stream.Buffer([("data", 8)], pipe_valid=True, pipe_ready=False)
self.comb += If(timer.done, self.comb += If(timer.done,
buffer.source.connect(source), buffer.source.connect(source, omit={"last"}),
source.last.eq(buffer.source.valid & ~buffer.sink.valid), # Last when next is not valid. source.last.eq(buffer.source.valid & ~buffer.sink.valid), # Last when next is not valid.
) )