Merge commit '7722471b5ae36275fd3617980a172c38239e26ef' into Bandwidth_Edit

This commit is contained in:
Frederik Lauer
2016-05-31 13:56:59 +02:00
3 changed files with 75 additions and 0 deletions

View File

@@ -219,6 +219,65 @@ def number_of_accesses(connection):
return result[0]
@metric
def bank_overlap_ratio(connection):
# Calculates how many banks are open in parallel
cursor = connection.cursor()
cursor.execute("SELECT clk FROM GeneralInfo ")
clk = cursor.fetchone()
cursor.execute("select TraceEnd from GeneralInfo")
traceEndTMP = cursor.fetchone()
traceEnd = int(traceEndTMP[0]/clk[0])
trace = []
cursor.execute("""
select p1.PhaseBegin, p1.PhaseName from Phases p1
where
(p1.PhaseName = "ACT" or p1.PhaseName = "PRE_ALL" or p1.PhaseName = "PRE")
order by PhaseBegin
""")
prevPhase = "PRE_ALL"
prevTime = 0
for c in cursor:
trace.append([(int(c[0]/clk[0])),c[1]])
#Insert a pseudo precharge all to mark the end of the trace
trace.append([traceEnd,"PRE_ALL"])
bankCounter = 0
bankTime = []
for i in range(0, getNumberOfBanks(connection)+1):
bankTime.append(0)
currentTime = 0
for t in trace:
interval = t[0] - currentTime
bankTime[bankCounter] += interval
currentTime = t[0]
if(t[1] == "ACT"):
bankCounter += 1
elif(t[1] == "PRE_ALL"):
bankCounter = 0
elif(t[1] == "PRE"):
bankCounter -= 1
else:
print ("ERROR")
return 0
for i in range(0, getNumberOfBanks(connection)+1):
bankTime[i] = round(bankTime[i]/traceEnd * 100,2)
return ",".join(format(x, "6.2f") for x in bankTime)
# @metric
# def number_of_precharges(connection):
# cursor = connection.cursor()

View File

@@ -0,0 +1,8 @@
<addressmapping>
<channel from="128" to="128" /> <!-- only one channel -->
<bank from="26" to="28" />
<row from="13" to="25" />
<column from="3" to="12" />
<bytes from="0" to="2" />
</addressmapping>

View File

@@ -0,0 +1,8 @@
<addressmapping>
<channel from="128" to="128" /> <!-- only one channel -->
<row from="16" to="28" />
<bank from="13" to="15" />
<column from="3" to="12" />
<bytes from="0" to="2" />
</addressmapping>