From cc3f13670a7ccbd7af491b3ffe764dc175e7acfc Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Wed, 28 Aug 2024 20:13:03 +0200 Subject: [PATCH] Merge pull request #2050 from Dolu1990/efinix_pll_ext_fix efinix: Fix PLL with external clock input ifacewriter --- litex/build/efinix/ifacewriter.py | 2 ++ litex/soc/cores/clock/efinix.py | 1 + 2 files changed, 3 insertions(+) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index 95cd66c8a..b2ca619fd 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -295,6 +295,8 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) else: cmd += 'design.gen_pll_ref_clock("{}", pll_res="{}", refclk_src="{}", refclk_name="{}", ext_refclk_no="{}")\n\n' \ .format(name, block["resource"], block["input_clock"], block["input_clock_name"], block["clock_no"]) + for p, val in block["input_properties"]: + cmd += 'design.set_property("{}","{}","{}")\n'.format(block["input_clock_name"], p, val) else: cmd += 'design.gen_pll_ref_clock("{}", pll_res="{}", refclk_name="{}", refclk_src="CORE")\n'.format(name, block["resource"], block["input_signal"]) cmd += 'design.set_property("{}", "CORE_CLK_PIN", "{}", block_type="PLL")\n\n'.format(name, block["input_signal"]) diff --git a/litex/soc/cores/clock/efinix.py b/litex/soc/cores/clock/efinix.py index ba2a9e70d..0ca5ebf6e 100644 --- a/litex/soc/cores/clock/efinix.py +++ b/litex/soc/cores/clock/efinix.py @@ -85,6 +85,7 @@ class EFINIXPLL(LiteXModule): block["input_refclk_name"] = refclk_name block["resource"] = pll_res block["clock_no"] = clock_no + block["input_properties"] = self.platform.get_pin_properties(clkin) self.logger.info("Clock source: {}, using EXT_CLK{}".format(block["input_clock"], clock_no)) self.platform.get_pll_resource(pll_res) else: