0x0000/0xffff/0x0000/0xffff (same as fixed pattern) data and read it with known dqsi/dqi
0x0000/0xffff/0x0000/0xffff (same as fixed pattern) data and read it with known dqsi/dqi
values (maybe even set different phase for read?), discarding first and last 1.5 8-bursts
values (maybe even set different phase for read?), discarding first and last 1.5 8-bursts
Measure 4 different transitions for each data bit (rising DQS/rising DQ, falling DQS/falling DQ,
Measure 4 different transitions for each data bit (rising DQS/rising DQ, falling DQS/falling DQ,
rising DQS/falling DQ and falling DQS/rising DQ (that allows to measure duty cycles fro both
rising DQS/falling DQ and falling DQS/rising DQ (that allows to measure duty cycles for both
DQS and DQ lines
DQS and DQ lines
@param quiet reduce output
@param quiet reduce output
"""
"""
ifreinits:
self.x393_pio_sequences.restart_ddr3()
# self.load_hardcoded_data() # TODO: REMOVE LATER
# self.load_hardcoded_data() # TODO: REMOVE LATER
try:
try:
dqi_dqsi=self.adjustment_state['dqi_dqsi']
dqi_dqsi=self.adjustment_state['dqi_dqsi']
...
@@ -3223,11 +3333,12 @@ class X393McntrlAdjust(object):
...
@@ -3223,11 +3333,12 @@ class X393McntrlAdjust(object):
ra=0,
ra=0,
ba=0,
ba=0,
quiet=1,
quiet=1,
single=False):
single=False,
reinits=True):
# quiet=0):
# quiet=0):
"""
"""
Will raise exception if read non good or bad - that may happen if cmda_odelay is violated too much. Need to re-
Will raise exception if read non good or bad - that may happen if cmda_odelay is violated too much. Need to re-
init memory if that happems and possibly re-run with largersafe_phase or safe_phase==0/None to disable this feature
init memory if that happens and possibly re-run with larger safe_phase or safe_phase==0/None to disable this feature
Final measurement of output delay on address lines, performed when read/write timing is set
Final measurement of output delay on address lines, performed when read/write timing is set
Writes different data in the specified block and then different pattern to all blocks different
Writes different data in the specified block and then different pattern to all blocks different
by one row address or bank address bit.
by one row address or bank address bit.
...
@@ -3242,7 +3353,7 @@ class X393McntrlAdjust(object):
...
@@ -3242,7 +3353,7 @@ class X393McntrlAdjust(object):
dqm_patt=None,
dqm_patt=None,
quiet=quiet+2)
quiet=quiet+2)
except:
except:
print("Skipping DQS pattern (0x55/0xaa) control as it is not in gloabal data (dqs_patt=self.adjustment_state['dqs_pattern'])")
print("Skipping DQS pattern (0x55/0xaa) control as it is not in global data (dqs_patt=self.adjustment_state['dqs_pattern'])")
num_ba=3
num_ba=3
ifnotsingle:
ifnotsingle:
...
@@ -3251,13 +3362,15 @@ class X393McntrlAdjust(object):
...
@@ -3251,13 +3362,15 @@ class X393McntrlAdjust(object):
ra=ra,# 0,
ra=ra,# 0,
ba=ba,# 0,
ba=ba,# 0,
quiet=quiet,#+1, #1,
quiet=quiet,#+1, #1,
single=True)# single=False)
single=True,# single=False)
reinits=reinits)
pass2=self.measure_addr_odelay(safe_phase=safe_phase,#0.25, # 0 strictly follow cmda_odelay, >0 -program with this fraction of clk period from the margin
pass2=self.measure_addr_odelay(safe_phase=safe_phase,#0.25, # 0 strictly follow cmda_odelay, >0 -program with this fraction of clk period from the margin
dqsi_safe_phase=dqsi_safe_phase,
dqsi_safe_phase=dqsi_safe_phase,
ra=ra^((1<<vrlg.ADDRESS_NUMBER)-1),# 0,
ra=ra^((1<<vrlg.ADDRESS_NUMBER)-1),# 0,
ba=ba^((1<<num_ba)-1),# 0,
ba=ba^((1<<num_ba)-1),# 0,
quiet=quiet,#+1, #1,
quiet=quiet,#+1, #1,
single=True)# single=False)
single=True,# single=False)
reinits=reinits)
self.adjustment_state['addr_meas']=[pass1,pass2]
self.adjustment_state['addr_meas']=[pass1,pass2]
if(quiet<4):
if(quiet<4):
print('addr_meas=[')
print('addr_meas=[')
...
@@ -3268,7 +3381,7 @@ class X393McntrlAdjust(object):
...
@@ -3268,7 +3381,7 @@ class X393McntrlAdjust(object):
if(quiet<4):
if(quiet<4):
num_addr=vrlg.ADDRESS_NUMBER
num_addr=vrlg.ADDRESS_NUMBER
num_banks=3
num_banks=3
print("\n measured marginal addresses and bank adresses for each phase")
print("\n measured marginal addresses and bank addresses for each phase")
print("phase",end=" ")
print("phase",end=" ")
foredgein("\\_","_/"):
foredgein("\\_","_/"):
foriinrange(num_addr):
foriinrange(num_addr):
...
@@ -3308,7 +3421,7 @@ class X393McntrlAdjust(object):
...
@@ -3308,7 +3421,7 @@ class X393McntrlAdjust(object):
inv_ra=ra^((1<<vrlg.ADDRESS_NUMBER)-1)
inv_ra=ra^((1<<vrlg.ADDRESS_NUMBER)-1)
ca=ra&((1<<vrlg.COLADDR_NUMBER)-1)
ca=ra&((1<<vrlg.COLADDR_NUMBER)-1)
inv_ba=ba^((1<<num_ba)-1)
inv_ba=ba^((1<<num_ba)-1)
print("quiet=",quiet)
#print ("quiet=",quiet)
ifquiet<4:
ifquiet<4:
print("Writing good data to ra=0x%x, ba = 0x%x, ca = 0x%x, refresh will use: inv_ra = 0x%x, inv_ba=0x%x"%(ra,ba,ca,inv_ra,inv_ba))
print("Writing good data to ra=0x%x, ba = 0x%x, ca = 0x%x, refresh will use: inv_ra = 0x%x, inv_ba=0x%x"%(ra,ba,ca,inv_ra,inv_ba))
...
@@ -3343,28 +3456,54 @@ class X393McntrlAdjust(object):
...
@@ -3343,28 +3456,54 @@ class X393McntrlAdjust(object):
"""
"""
phase=0 seems to be bad (during wlev), ***temporarily*** just start from 90 degrees shift
phase=0 seems to be bad (during wlev), ***temporarily*** just start from 90 degrees shift