Skip to content

Commit

Permalink
phy/pcs_1000basex: Cleanup PCSRX buffer and fix PCS TX ready on Start…
Browse files Browse the repository at this point in the history
…-of-packet.
  • Loading branch information
enjoy-digital committed Oct 18, 2024
1 parent a58e25c commit 1bbb735
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions liteeth/phy/pcs_1000basex.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(self, lsb_first=False):
# Wait for valid Data.
).Else(
If(sink.valid,
sink.ready.eq(timer.done),
self.encoder.d[0].eq(K(27, 7)), # Start-of-packet /S/.
NextState("DATA")
).Else(
Expand Down Expand Up @@ -186,9 +187,9 @@ def __init__(self, lsb_first=False):

# 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,
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.
)

Expand Down

0 comments on commit 1bbb735

Please sign in to comment.