Skip to content

Commit

Permalink
phy/usp_gth/gty_1000basex: Add refclk_from_fabric parameter to allow …
Browse files Browse the repository at this point in the history
…selecting GTGREFCLK or GTREFCLK0.
  • Loading branch information
enjoy-digital committed Nov 25, 2024
1 parent 17f80af commit 99d4073
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions liteeth/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ def __init__(self, platform, core_config):
# Clocking.
refclk_or_clk_pads = ethphy_pads.refclk,
refclk_freq = core_config.get("refclk_freq", 200e6),
refclk_from_fabric = core_config.get("refclk_from_fabric", True),
# TX.
tx_polarity = core_config.get("phy_tx_polarity", 0),
# RX.
Expand Down
6 changes: 3 additions & 3 deletions liteeth/phy/usp_gth_1000basex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class USP_GTH_1000BASEX(LiteXModule):
linerate = 1.25e9
rx_clk_freq = 125e6
tx_clk_freq = 125e6
def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e6, with_csr=True, rx_polarity=0, tx_polarity=0):
def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e6, with_csr=True, rx_polarity=0, tx_polarity=0, refclk_from_fabric=False):
from liteiclink.serdes.gth4_ultrascale import GTHChannelPLL
assert refclk_freq in [200e6, 156.25e6]
self.pcs = pcs = PCS(lsb_first=True)
Expand Down Expand Up @@ -579,12 +579,12 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e
i_DRPWE = 0b0,
i_EYESCANRESET = 0b0,
i_EYESCANTRIGGER = 0b0,
i_GTGREFCLK = refclk,
i_GTGREFCLK = refclk if refclk_from_fabric else 0b0,
i_GTHRXN = data_pads.rxn,
i_GTHRXP = data_pads.rxp,
i_GTNORTHREFCLK0 = 0b0,
i_GTNORTHREFCLK1 = 0b0,
i_GTREFCLK0 = 0b0,
i_GTREFCLK0 = refclk if not refclk_from_fabric else 0b0,
i_GTREFCLK1 = 0b0,
i_GTRSVD = 0b0000000000000000,
i_GTRXRESET = rx_reset,
Expand Down
6 changes: 3 additions & 3 deletions liteeth/phy/usp_gty_1000basex.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class USP_GTY_1000BASEX(LiteXModule):
linerate = 1.25e9
rx_clk_freq = 125e6
tx_clk_freq = 125e6
def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e6, with_csr=True, rx_polarity=0, tx_polarity=0):
def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e6, with_csr=True, rx_polarity=0, tx_polarity=0, refclk_from_fabric=False):
from liteiclink.serdes.gty_ultrascale import GTYChannelPLL
assert refclk_freq in [200e6, 156.25e6]
self.pcs = pcs = PCS(lsb_first=True)
Expand Down Expand Up @@ -599,10 +599,10 @@ def __init__(self, refclk_or_clk_pads, data_pads, sys_clk_freq, refclk_freq=200e
i_EYESCANRESET = 0b0,
i_EYESCANTRIGGER = 0b0,
i_FREQOS = 0b0,
i_GTGREFCLK = refclk,
i_GTGREFCLK = refclk if refclk_from_fabric else 0b0,
i_GTNORTHREFCLK0 = 0b0,
i_GTNORTHREFCLK1 = 0b0,
i_GTREFCLK0 = 0b0,
i_GTREFCLK0 = refclk if not refclk_from_fabric else 0b0,
i_GTREFCLK1 = 0b0,
i_GTRSVD = 0b0,
i_GTRXRESET = rx_reset,
Expand Down

0 comments on commit 99d4073

Please sign in to comment.