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