Metrics bank overlap ratio: coherence check and support to RGR
This commit is contained in:
@@ -254,7 +254,7 @@ def bank_overlap_ratio(connection):
|
||||
cursor.execute("""
|
||||
select p1.PhaseBegin, p1.PhaseName from Phases p1
|
||||
where
|
||||
(p1.PhaseName = "ACT" or p1.PhaseName = "PRE_ALL" or p1.PhaseName = "PRE" or p1.PhaseName = "RDA" or p1.PhaseName = "WRA")
|
||||
(p1.PhaseName = "ACT" or p1.PhaseName = "PRE_ALL" or p1.PhaseName = "PRE" or p1.PhaseName = "RDA" or p1.PhaseName = "WRA" or p1.PhaseName = "PREB" or p1.PhaseName = "ACTB")
|
||||
order by PhaseBegin
|
||||
""")
|
||||
prevPhase = "PRE_ALL"
|
||||
@@ -273,7 +273,10 @@ def bank_overlap_ratio(connection):
|
||||
bankTime.append(0)
|
||||
|
||||
currentTime = 0
|
||||
validBankRange = range(0, getNumberOfBanks(connection) + 1)
|
||||
|
||||
# RGR uses ACTB and PREB for refresh
|
||||
actbCnt = 0
|
||||
for t in trace:
|
||||
|
||||
interval = t[0] - currentTime
|
||||
@@ -282,14 +285,38 @@ def bank_overlap_ratio(connection):
|
||||
|
||||
if(t[1] == "ACT"):
|
||||
bankCounter += 1
|
||||
if not (bankCounter in validBankRange):
|
||||
print("Unexpected ACT. bankCounter was {0} valid range is python range {1}".format(bankCounter, validBankRange))
|
||||
elif t[1] == "ACTB":
|
||||
actbCnt += 1
|
||||
elif(t[1] == "PRE_ALL"):
|
||||
bankCounter = 0
|
||||
elif(t[1] == "PRE"):
|
||||
bankCounter -= 1
|
||||
if (bankCounter > 0):
|
||||
bankCounter -= 1
|
||||
else:
|
||||
print("Unexpected PRE. bankCounter was {0} valid range is python range {1}".format(bankCounter, validBankRange))
|
||||
elif(t[1] == "PREB"):
|
||||
# RGR first PREB closes the row ACT follows, then PREB again.
|
||||
if actbCnt > 0:
|
||||
# Ignore the second PREB
|
||||
actbCnt -= 1
|
||||
else:
|
||||
# Treat the first PREB which closes the row
|
||||
if bankCounter > 0:
|
||||
bankCounter -= 1
|
||||
else:
|
||||
print("Unexpected PREB. bankCounter was {0} valid range is python range {1}".format(bankCounter, validBankRange))
|
||||
elif(t[1] == "WRA"):
|
||||
bankCounter -= 1
|
||||
if (bankCounter > 0):
|
||||
bankCounter -= 1
|
||||
else:
|
||||
print("Unexpected WRA. bankCounter was {0} valid range is python range {1}".format(bankCounter, validBankRange))
|
||||
elif(t[1] == "RDA"):
|
||||
bankCounter -= 1
|
||||
if (bankCounter > 0):
|
||||
bankCounter -= 1
|
||||
else:
|
||||
print("Unexpected RDA. bankCounter was {0} valid range is python range {1}".format(bankCounter, validBankRange))
|
||||
else:
|
||||
print("ERROR")
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user