Merge pull request #1329 from Icenowy/altpll-fix

Misc fixes to Altera PLL support
This commit is contained in:
enjoy-digital 2022-06-15 10:52:24 +02:00 committed by GitHub
commit a4de315772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -88,6 +88,9 @@ def _build_sdc(clocks, false_paths, vns, named_sc, build_name, additional_sdc_co
tpl = "create_clock -name {clk} -period {period} [get_nets {{{clk}}}]"
sdc.append(tpl.format(clk=vns.get_name(clk), period=str(period)))
# Enable automatical constraint generation for PLLs
sdc.append("derive_pll_clocks")
# False path constraints
for from_, to in sorted(false_paths, key=lambda x: (x[0].duid, x[1].duid)):
tpl = "set_false_path -from [get_clocks {{{from_}}}] -to [get_clocks {{{to}}}]"

View File

@ -79,7 +79,7 @@ class IntelClocking(Module, AutoCSR):
diff = abs(clk_freq - f)
if diff <= f*_m and diff < best_diff:
config[f"clk{_n}_freq"] = clk_freq
config[f"clk{_n}_divide"] = c
config[f"clk{_n}_divide"] = c * n
config[f"clk{_n}_phase"] = p
clk_valid[_n] = True
diff_ratios[_n] = diff / f