Small fixes

This commit is contained in:
Felipe S. Prado
2016-08-24 21:12:44 +02:00
parent ba3d93f3a6
commit 1409a8816a

View File

@@ -24,6 +24,7 @@ def memory_utilisation_window(connection, tracePath, steps):
cursor = connection.cursor()
cursor.execute(" SELECT time FROM Power WHERE averagePower = 0 ")
#pow(10,12): seconds to picoseconds conversion
windowSize = pow(10,12)*float(cursor.fetchone()[0])
# All possible cases of data transfers inside a time window
queryFull = """ SELECT sum(DataStrobeEnd - DataStrobeBegin) FROM transactions Where DataStrobeBegin > ? and DataStrobeEnd < ?""" # The data transfer begins and ends inside the time window
@@ -72,13 +73,14 @@ def memory_utilisation_window(connection, tracePath, steps):
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
time = np.arange(0, (steps+1)*windowSize, windowSize)
#windowSize/1000: picoseconds to nanoseconds conversion
time = np.arange(0, (steps+1)*windowSize/1000, windowSize/1000)
plt.figure()
subplotIndex = 211
plt.subplot(subplotIndex)
plt.plot(time/1000, bandwidthPercentage)
plt.plot(time, bandwidthPercentage)
plt.xlabel('Time (ns)')
plt.ylabel('Bandwidth (%)')
plt.ylim(-1, maximumPercentage + (10 - maximumPercentage%10))
@@ -117,6 +119,7 @@ def power_window(connection, tracePath, steps):
power[0] = 0
for i in range((steps)):
result = cursor.fetchone()
#pow(10,9): seconds to nanoseconds conversion
time[i+1] = float(result[0])*pow(10,9)
power[i+1] = float(result[1])
@@ -169,6 +172,7 @@ def generatePlots(pathToTrace):
cursor.execute(" SELECT TraceEnd FROM GeneralInfo ")
traceEnd = float(cursor.fetchone()[0])
cursor.execute(" SELECT min(time) FROM Power WHERE averagePower = 0")
#pow(10,12): seconds to picoseconds conversion
windowSize = pow(10,12)*float(cursor.fetchone()[0])
steps = ceil(traceEnd/windowSize)
for p in plots: