Commit 6a112729 authored by Jean-Claude BAU's avatar Jean-Claude BAU Committed by Adam Wujek

HA: Use scaledDelayCoefficient instead of fiber_fix_alpha

For the calculation of the delay MS, we use now
asymmetryCorrectionPortDS.scaledDelayCoefficient (fpa:2^62) instead of
fiber_fix_alpha.
parent b8861c89
......@@ -125,7 +125,6 @@ static inline L1SyncOptParamsPortDS_t *L1E_DSPOR_OP(struct pp_instance *ppi)
struct l1e_servo_state {
/* These fields are used by servo code, after setting at init time */
int64_t fiber_fix_alpha;
int32_t clock_period_ps;
/* Following fields are for monitoring/diagnostics (use w/ shmem) */
......
......@@ -51,18 +51,15 @@ int l1e_update_correction_values(struct pp_instance *ppi)
/* read the interesting values from HW (i.e. HAL)*/
if ( WRH_OPER()->read_corr_data(ppi,
&s->fiber_fix_alpha,
NULL,
&s->clock_period_ps,
NULL) != WRH_HW_CALIB_OK){
pp_diag(ppi, ext, 2, "hook: %s -- cannot read calib values\n",
__func__);
return -1;
}
pp_diag(ppi, ext, 2, "ML- Updated correction values:"
" fiber_fix_alpha=%"PRId64" , Clock period=%d [ps]",
s->fiber_fix_alpha,
s->clock_period_ps
);
pp_diag(ppi, ext, 2, "ML- Updated correction values: Clock period=%d [ps]",
s->clock_period_ps);
return 0;
}
......
......@@ -220,7 +220,7 @@ static int l1e_p2p_delay(struct pp_instance *ppi, struct l1e_servo_state *s)
s->delayMM_ps = pp_time_to_picos(&s->delayMM);
/* delayMS[ps] = (fix_alpha*delayMM[ps])/2e40 +delayMM[ps]/2 */
s->delayMS_ps =
((s->delayMM_ps * s->fiber_fix_alpha) >> FIX_ALPHA_FRACBITS)
((s->delayMM_ps * ppi->asymmetryCorrectionPortDS.scaledDelayCoefficient) >> REL_DIFF_FRACBITS)
+ (s->delayMM_ps >> 1);
return 1;
......@@ -307,7 +307,7 @@ static int l1e_e2e_offset(struct pp_instance *ppi,
}
/* delayMS = (delayMM * fix_alpha) + delayMM/2*/
s->delayMS_ps = ((s->delayMM_ps * s->fiber_fix_alpha) >> FIX_ALPHA_FRACBITS) + (s->delayMM_ps >> 1);
s->delayMS_ps = ((s->delayMM_ps * ppi->asymmetryCorrectionPortDS.scaledDelayCoefficient) >> REL_DIFF_FRACBITS) + (s->delayMM_ps >> 1);
{ /* offsetMS = t1-t2 + delayMS */
struct pp_time tmp1;
......@@ -359,8 +359,8 @@ int l1e_servo_update(struct pp_instance *ppi)
l1e_update_offsetFromMaster(ppi,&offsetMS); /* Update currentDS.offsetFromMaster */
s->offsetMS_ps=pp_time_to_picos(&offsetMS);
pp_diag(ppi, servo, 2,
"ML: fiber_fix_alpha = %lld, delayMS = %lld, offsetMS = %lld [ps]\n",
(long long )s->fiber_fix_alpha,
"ML: scaledDelayCoeff = %lld, delayMS = %lld, offsetMS = %lld [ps]\n",
(long long )ppi->asymmetryCorrectionPortDS.scaledDelayCoefficient,
(long long )s->delayMS_ps,
(long long )s->offsetMS_ps);
l1e_dump_timestamp(ppi,"ML: offsetMS",offsetMS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment