dl0_per=[phaseData[p][0]forpinperiods]# only delay for line 0, but with same branch requirement this should be the same for all lines
ifhighDelayorlowDelayornotlist_branchesorreturn_error:# in list_branches mode - filter by low/high only if requested, for delays use low if not highDelay
print ('Data for filter_dqso is not available (self.adjustment_state["wlev_dqs_bspe"]')
filter_dqso=0
if filter_dqsi:
try:
dqsi_phase=self.adjustment_state['dqsi_phase']
except:
print ('Data for filter_dqsi is not available (self.adjustment_state["dqsi_phase"]')
filter_dqsi=0
if filter_cmda:
try:
addr_odelay= self.adjustment_state['addr_odelay']
except:
addr_odelay=None
#keep cmda_bspe even if addr_odelay is available?
try:
cmda_bspe=self.adjustment_state['cmda_bspe']
except:
if addr_odelay is None:
print ('Data for filter_cmda is not available (self.adjustment_state["cmda_bspe"]')
filter_cmda=0
if isinstance(filter_cmda,float):
if filter_cmda >=0.5:
print ("Invalid 'safe range' for filter_cmda. It is measured in clock cycles and should be < 0.5.Using strict cmda filter")
filter_cmda=2
num_cmda=0
for phase in range(numPhaseSteps):
delays_phase.append({})
if filter_cmda:
# for special case (float filter_cmda) use initial 'cmda_bspe', not 'addr_odelay'
if (not addr_odelay is None) and (not isinstance(filter_cmda,float)): #TODO: add zerr to addr_odelay (error as a fraction of clock period if delay is set to 0)
#special case to test address setup time - will never execute now
if isinstance(filter_cmda,float) and (not addr_odelay['err'][phase] is None) and (addr_odelay['err'][phase] < 0.5-filter_cmda):
delays_phase[phase][CMDA_KEY]=0
else:
if (addr_odelay['dlys'][phase] is None) and (not keep_all):
delays_phase[phase]=None
continue # next phase
else:
if not addr_odelay['dlys'][phase] is None:
delays_phase[phase][CMDA_KEY]=addr_odelay['dlys'][phase] # list, not single value!
num_cmda=len(addr_odelay['dlys'][phase])
else:
#special case to test address setup time
if isinstance(filter_cmda,float) and (not cmda_bspe[phase]['zerr'] is None) and (cmda_bspe[phase]['zerr']< 0.5-filter_cmda):
delays_phase[phase][CMDA_KEY]=0 # set to minimal delay (==0)
else:
if (cmda_bspe[phase]['ldly'] is None) and (not keep_all):