Skip to content

Commit

Permalink
Merge pull request f4pga#1679 from antmicro/fix_pllfb
Browse files Browse the repository at this point in the history
Fix missing CLKFBOUT_PHASE update
  • Loading branch information
litghost committed Sep 25, 2020
2 parents f309ffd + f1b55b9 commit ff5f9ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
14 changes: 1 addition & 13 deletions xc/xc7/tests/soc/ibex/ibex.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,9 @@ index c26ca45..be19828 100644
logic clk_sys, rst_sys_n;

diff --git a/shared/rtl/fpga/xilinx/clkgen_xil7series.sv b/shared/rtl/fpga/xilinx/clkgen_xil7series.sv
index e41b4b0..e080de7 100644
index e41b4b0..f253c07 100644
--- a/shared/rtl/fpga/xilinx/clkgen_xil7series.sv
+++ b/shared/rtl/fpga/xilinx/clkgen_xil7series.sv
@@ -27,9 +27,9 @@ module clkgen_xil7series (
.STARTUP_WAIT ("FALSE"),
.DIVCLK_DIVIDE (1),
.CLKFBOUT_MULT (12),
- .CLKFBOUT_PHASE (0.000),
+ .CLKFBOUT_PHASE (0),
.CLKOUT0_DIVIDE (24),
- .CLKOUT0_PHASE (0.000),
+ .CLKOUT0_PHASE (0),
.CLKOUT0_DUTY_CYCLE (0.500)
) pll (
.CLKFBOUT (clk_fb_unbuf),
@@ -40,7 +40,7 @@ module clkgen_xil7series (
.CLKOUT4 (),
.CLKOUT5 (),
Expand Down
15 changes: 8 additions & 7 deletions xc/xc7/yosys/utils.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
proc multiply_param { cell param_name multiplier } {
set param_value [getparam $param_name $cell]
if {$param_value ne ""} {
set new_param_value [expr int(round($param_value * $multiplier))]
setparam -set $param_name $new_param_value $cell
puts "Updated parameter $param_name of cell $cell from $param_value to $new_param_value"
set new_param_value [expr int(round($param_value * $multiplier))]
setparam -set $param_name $new_param_value $cell
puts "Updated parameter $param_name of cell $cell from $param_value to $new_param_value"
}
}

proc update_pll_params {} {
foreach cell [selection_to_tcl_list "t:PLLE2_ADV"] {
for {set output 0} {$output < 6} {incr output} {
multiply_param $cell "CLKOUT${output}_PHASE" 1000
multiply_param $cell "CLKOUT${output}_DUTY_CYCLE" 100000
}
multiply_param $cell "CLKFBOUT_PHASE" 1000
for {set output 0} {$output < 6} {incr output} {
multiply_param $cell "CLKOUT${output}_PHASE" 1000
multiply_param $cell "CLKOUT${output}_DUTY_CYCLE" 100000
}
}
}

0 comments on commit ff5f9ad

Please sign in to comment.