Skip to content

Commit

Permalink
build/efinix/ifacewriter: bypass clks out frequency check for Trion w…
Browse files Browse the repository at this point in the history
…hen a feedback clock is used
  • Loading branch information
trabucayre committed Dec 20, 2023
1 parent 54c58ef commit 7062e33
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions litex/build/efinix/ifacewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,13 @@ def generate_pll(self, block, partnumber, verbose=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
Expand Down

0 comments on commit 7062e33

Please sign in to comment.