Skip to content

Commit

Permalink
liteeth_gen: Fixes on Artix7 integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Jan 22, 2024
1 parent 650433d commit 3b10143
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions liteeth/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,17 @@ def __init__(self, platform, core_config):
ethphy_pads = platform.request("sgmii")
# Artix7.
if phy in [liteeth_phys.A7_1000BASEX]:
assert core_config.get("refclk_freq", 0) in [125e6, 156.25e6]
refclk_freq = core_config.get("refclk_freq", 0)
assert refclk_freq in [125e6, 156.25e6]
from liteeth.phy.a7_gtp import QPLLSettings, QPLL
qpll_settings = QPLLSettings(
refclksel = 0b001,
fbdiv = 4,
fbdiv_45 = {125e6:5, 156.25e6:4},
fbdiv_45 = {125e6:5, 156.25e6:4}[refclk_freq],
refclk_div = 1
)
qpll = QPLL(ethphy_pads.refclk, qpll_settings)
self.submodules += qpll
ethphy = phy(
qpll_channel = qpll.channels[0],
data_pads = ethphy_pads,
Expand Down

0 comments on commit 3b10143

Please sign in to comment.