From 7062e3379fdd80ac0523390ca46c87906b8c68ff Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Wed, 20 Dec 2023 20:33:15 +0100 Subject: [PATCH] build/efinix/ifacewriter: bypass clks out frequency check for Trion when a feedback clock is used --- litex/build/efinix/ifacewriter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/litex/build/efinix/ifacewriter.py b/litex/build/efinix/ifacewriter.py index dbeedc088..5ec2a3b88 100644 --- a/litex/build/efinix/ifacewriter.py +++ b/litex/build/efinix/ifacewriter.py @@ -370,11 +370,13 @@ design.create("{2}", "{3}", "./../gateware", overwrite=True) cmd += 'prop_map = design.get_property("{}", clock_source_prop, block_type="PLL")\n'.format(name) cmd += 'pprint.pprint(prop_map)\n' - for i, clock in enumerate(block["clk_out"]): - cmd += '\nfreq = float(prop_map["CLKOUT{}_FREQ"])\n'.format(i) - cmd += 'if freq != {}:\n'.format(clock[1]/1e6) - cmd += ' print("ERROR: CLKOUT{} configured for {}MHz is {{}}MHz".format(freq))\n'.format(i, clock[1]/1e6) - cmd += ' exit("PLL ERROR")\n' + # Efinix python API is buggy for Trion devices when a feedback is defined... + if block["version"] == "V3" or (block["version"] == "V1_V2" and block["feedback"] == -1): + for i, clock in enumerate(block["clk_out"]): + cmd += '\nfreq = float(prop_map["CLKOUT{}_FREQ"])\n'.format(i) + cmd += 'if freq != {}:\n'.format(clock[1]/1e6) + cmd += ' print("ERROR: CLKOUT{} configured for {}MHz is {{}}MHz".format(freq))\n'.format(i, clock[1]/1e6) + cmd += ' exit("PLL ERROR")\n' cmd += "\n#---------- END PLL {} ---------\n\n".format(name) return cmd