From 3b10143da22db8db0ce50d028d31059151bd1563 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 22 Jan 2024 19:49:30 +0100 Subject: [PATCH] liteeth_gen: Fixes on Artix7 integration. --- liteeth/gen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/liteeth/gen.py b/liteeth/gen.py index b63117e..7450de0 100755 --- a/liteeth/gen.py +++ b/liteeth/gen.py @@ -286,15 +286,17 @@ class PHYCore(SoCMini): 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,