Skip to content

Commit

Permalink
phy/pcs_1000basex: Add specific breaklink timer and increase consiste…
Browse files Browse the repository at this point in the history
…ncy count to 8.
  • Loading branch information
enjoy-digital committed Oct 18, 2024
1 parent 20e9ea6 commit b783639
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions liteeth/phy/pcs_1000basex.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def __init__(self, lsb_first=False):
# PCS ----------------------------------------------------------------------------------------------

class PCS(LiteXModule):
def __init__(self, lsb_first=False, check_period=6e-3, more_ack_time=10e-3, sgmii_ack_time=1.6e-3):
def __init__(self, lsb_first=False, check_period=6e-3, breaklink_time=10e-3, more_ack_time=10e-3, sgmii_ack_time=1.6e-3):
self.tx = ClockDomainsRenamer("eth_tx")(PCSTX(lsb_first=lsb_first))
self.rx = ClockDomainsRenamer("eth_rx")(PCSRX(lsb_first=lsb_first))

Expand Down Expand Up @@ -301,6 +301,7 @@ def __init__(self, lsb_first=False, check_period=6e-3, more_ack_time=10e-3, sgmi

# Timers.
# -------
self.breaklink_timer = breaklink_timer = ClockDomainsRenamer("eth_tx")(WaitTimer(breaklink_time * 125e6))
self.more_ack_timer = more_ack_timer = ClockDomainsRenamer("eth_tx")(WaitTimer(more_ack_time * 125e6))
self.sgmii_ack_timer = sgmii_ack_timer = ClockDomainsRenamer("eth_tx")(WaitTimer(sgmii_ack_time * 125e6))

Expand Down Expand Up @@ -362,8 +363,8 @@ def __init__(self, lsb_first=False, check_period=6e-3, more_ack_time=10e-3, sgmi
fsm.act("AUTONEG-BREAKLINK",
self.tx.config_valid.eq(1),
config_empty.eq(1),
more_ack_timer.wait.eq(1),
If(more_ack_timer.done,
breaklink_timer.wait.eq(1),
If(breaklink_timer.done,
NextState("AUTONEG-WAIT-ABI")
)
)
Expand Down Expand Up @@ -424,7 +425,7 @@ def __init__(self, lsb_first=False, check_period=6e-3, more_ack_time=10e-3, sgmi
# Consistency Count/Check.
rx_config_reg_last.eq(self.rx.config_reg),
If(self.rx.config_reg != rx_config_reg_last,
rx_config_reg_count.eq(2 - 1)
rx_config_reg_count.eq(8 - 1)
).Else(
If(rx_config_reg_count != 0,
rx_config_reg_count.eq(rx_config_reg_count - 1),
Expand Down

0 comments on commit b783639

Please sign in to comment.