diff --git a/python/pysmurf/client/base/smurf_config.py b/python/pysmurf/client/base/smurf_config.py index f2e977b3..65a73bb3 100644 --- a/python/pysmurf/client/base/smurf_config.py +++ b/python/pysmurf/client/base/smurf_config.py @@ -449,12 +449,12 @@ def validate_config(loaded_config): ## TODO remove lmsDelay # lmsDelay is deprected use bandDelayUs instead - # Matches system latency for LMS feedback (9.6 MHz - # ticks, use multiples of 52). For dspv3 to adjust to - # match refPhaseDelay*4 (ignore refPhaseDelayFine for - # this). If not provided and lmsDelay=None, sets to - # lmsDelay = 4 x refPhaseDelay. - Optional('lmsDelay', default=None) : And(int, lambda n: 0 <= n < 2**5), + # Matches system latency for LMS feedback (2.4 MHz + # ticks). For production SMuRF firmware, should set + # equal to refPhaseDelay. (ignore refPhaseDelayFine + # for this). If not provided and lmsDelay=None, sets + # to lmsDelay = refPhaseDelay. + Optional('lmsDelay', default=None) : And(int, lambda n: 0 <= n < 2**6), # Adjust trigRstDly such that the ramp resets at the flux ramp # glitch. 2.4 MHz ticks. diff --git a/python/pysmurf/client/base/smurf_control.py b/python/pysmurf/client/base/smurf_control.py index 0978fb6a..a1f41d32 100644 --- a/python/pysmurf/client/base/smurf_control.py +++ b/python/pysmurf/client/base/smurf_control.py @@ -542,13 +542,30 @@ def setup(self, write_log=True, payload_size=2048, force_configure=False, **kwar self._ref_phase_delay_fine[band], write_log=write_log, **kwargs) - # in DSPv3, lmsDelay should be 4*refPhaseDelay (says - # Mitch). If none provided in cfg, enforce that - # constraint. If provided in cfg, override with provided - # value. + # The lmsDelay register matches the system latency + # for LMS feedback. The readout has both actuator + # and sensor delay, so this delay is needed to + # compensate the feedback. + # + # actuator being the delay from DSP -> synthesis + # filter bank -> JESD -> DAC -> RF tracked freq + # out + # + # sensor delay being RF in resonator -> ADC input + # -> JESD -> filter bank -> demod (edited) + # + # The delay is needed because we are playing out a + # FM waveform on the RF DACs and it takes ~us to + # get the results. + # + # In production SMuRF firmware, lmsDelay should be + # set equal to refPhaseDelay, and both are + # integers that count 2.4 MHz ticks. If none + # provided in cfg, enforce that constraint. If + # provided in cfg, override with provided value. if self._lms_delay[band] is None: self.set_lms_delay( - band, int(4*self._ref_phase_delay[band]), + band, int(self._ref_phase_delay[band]), write_log=write_log, **kwargs) else: self.set_lms_delay(