From 3bee70945d6055c80d2f581d62a6f1f1e9e7a3a3 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Sat, 27 Feb 2016 12:29:25 +0100 Subject: [PATCH] changed from a constant window size to a constant step size --- DRAMSys/analyzer/scripts/plots.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/DRAMSys/analyzer/scripts/plots.py b/DRAMSys/analyzer/scripts/plots.py index 3b2d16fd..0092b012 100644 --- a/DRAMSys/analyzer/scripts/plots.py +++ b/DRAMSys/analyzer/scripts/plots.py @@ -20,11 +20,11 @@ def memory_utilisation_window(connection): # Besides, extracting the data from the memory specs, it is possible to calculate the maximum data rate of the memory and then determine the bandwidth in Gbit/s. # The bandwidth data are then plotted in two graphics. - windowSize = 1000000 + steps = 1000 cursor = connection.cursor() cursor.execute(""" SELECT max(DataStrobeEnd) FROM Transactions """) total = cursor.fetchone() - steps = ceil(float(total[0])/float(windowSize)) + windowSize = ceil(float(total[0])/float(steps)) # print(steps) # 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 @@ -38,7 +38,7 @@ def memory_utilisation_window(connection): bandwidthPercentage = [0] * steps bandwidth = [0] * steps for i in range(steps): - # print(i) + #print(i) bandwidthPercentage[i] = 0 cursor.execute(queryPart, (i*windowSize, (i+1)*windowSize)) result = cursor.fetchone() @@ -90,18 +90,18 @@ def memory_utilisation_window(connection): window.savefig() window.close() -@plot -def latency_histogram(connection): - # This function plots an histogram with access latencys - cursor = connection.cursor() - cursor.execute("SELECT ((p2.PhaseEnd - p1.PhaseEnd)/1000) FROM Transactions t, Phases p1, Phases p2 WHERE t.id = p1.Transact and t.id = p2.Transact and p1.PhaseName = \"REQ\" and p2.PhaseName = \"RESP\" ") - result = cursor.fetchall() - #result.sort() - #print(max(result)[0]) - import matplotlib.pyplot as plt - plt.hist(result, bins=max(result)[0], histtype='barstacked') - plt.savefig('hist.png') - return "Saved as hist.png" +#@plot +#def latency_histogram(connection): +# # This function plots an histogram with access latencys +# cursor = connection.cursor() +# cursor.execute("SELECT ((p2.PhaseEnd - p1.PhaseEnd)/1000) FROM Transactions t, Phases p1, Phases p2 WHERE t.id = p1.Transact and t.id = p2.Transact and p1.PhaseName = \"REQ\" and p2.PhaseName = \"RESP\" ") +# result = cursor.fetchall() +# #result.sort() +# #print(max(result)[0]) +# import matplotlib.pyplot as plt +# plt.hist(result, bins=max(result)[0], histtype='barstacked') +# plt.savefig('hist.png') +# return "Saved as hist.png" def generatePlots(pathToTrace):