mirror of
https://github.com/fpganinja/taxi.git
synced 2026-02-28 05:55:09 -08:00
ptp: Tame the control loop a bit, avoid higher gain when locked
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -420,7 +420,7 @@ always_comb begin
|
||||
endcase
|
||||
|
||||
// time integral of error
|
||||
case (dst_gain_sel_reg)
|
||||
case (dst_gain_sel_reg && !dst_sync_locked_reg)
|
||||
1'd0: {dst_ovf, dst_err_int_next} = $signed({1'b0, dst_err_int_reg}) + (PHASE_ACC_W+2)'($signed(sample_acc_sync_reg));
|
||||
1'd1: {dst_ovf, dst_err_int_next} = $signed({1'b0, dst_err_int_reg}) + (PHASE_ACC_W+2)'($signed(sample_acc_sync_reg) * 2**7);
|
||||
endcase
|
||||
@@ -435,7 +435,7 @@ always_comb begin
|
||||
end
|
||||
|
||||
// compute output
|
||||
case (dst_gain_sel_reg)
|
||||
case (dst_gain_sel_reg && !dst_sync_locked_reg)
|
||||
1'd0: {dst_ovf, dst_phase_inc_next} = $signed({1'b0, dst_err_int_reg}) + ($signed(sample_acc_sync_reg) * 2**4);
|
||||
1'd1: {dst_ovf, dst_phase_inc_next} = $signed({1'b0, dst_err_int_reg}) + ($signed(sample_acc_sync_reg) * 2**11);
|
||||
endcase
|
||||
|
||||
Reference in New Issue
Block a user