From c0f83bb1dcd22eae2d80f714722bedaa54a89598 Mon Sep 17 00:00:00 2001 From: Felipe Salerno Prado Date: Thu, 28 Apr 2016 17:22:40 +0200 Subject: [PATCH] Charts Correction --- DRAMSys/analyzer/scripts/plots.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/DRAMSys/analyzer/scripts/plots.py b/DRAMSys/analyzer/scripts/plots.py index 282cd4bf..4706b98d 100644 --- a/DRAMSys/analyzer/scripts/plots.py +++ b/DRAMSys/analyzer/scripts/plots.py @@ -25,23 +25,19 @@ def memory_utilisation_window(connection, tracePath): cursor.execute(""" SELECT max(time) FROM Power """) maxTime = cursor.fetchone() cursor.execute(""" SELECT min(time) FROM Power where time > 0 """) - windowSize = cursor.fetchone() - steps = ceil(float(maxTime[0])/float(windowSize[0])) + windowSize = cursor.fetchone()[0] + steps = ceil(float(maxTime[0])/float(windowSize)) # 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 queryEnd = """ SELECT sum(DataStrobeEnd - ?) FROM transactions Where DataStrobeBegin < ? and DataStrobeEnd > ? and DataStrobeEnd <=?""" # Only the end of the data transfer is inside the time window queryBegin = """ SELECT sum(? - DataStrobeBegin) FROM transactions Where DataStrobeBegin >= ? and DataStrobeBegin < ? and DataStrobeEnd > ?""" # Only the beginning of the data transfer is inside the time window queryPart = """ SELECT DataStrobeBegin FROM transactions Where DataStrobeBegin <= ? and DataStrobeEnd >= ?""" # The data transfer occupies all the time window maxDataRate = maximum_data_rate(connection) - # print(width) - # print(clk) - # print(rate) bandwidthPercentage = [0] * (steps+1) bandwidth = [0] * (steps+1) bandwidthPercentage[0] = 0 bandwidth[0] = 0 for i in range(steps): - # print(i) bandwidthPercentage[i+1] = 0 cursor.execute(queryPart, (i*windowSize, (i+1)*windowSize)) result = cursor.fetchone() @@ -71,8 +67,6 @@ def memory_utilisation_window(connection, tracePath): name = ntpath.basename(tracePath) basename, extension = os.path.splitext(name) - - OUTPUT_FILE = 'memory_utilization_' + basename + '.pdf' print("Output file is {0}".format(OUTPUT_FILE)) @@ -111,8 +105,8 @@ def power_window(connection, tracePath): cursor.execute(""" SELECT max(time) FROM Power """) maxTime = cursor.fetchone() cursor.execute(""" SELECT min(time) FROM Power where time > 0 """) - windowSize = cursor.fetchone() - steps = ceil(float(maxTime[0])/float(windowSize[0])) + windowSize = cursor.fetchone()[0] + steps = ceil(float(maxTime[0])/float(windowSize)) cursor.execute(""" SELECT * FROM Power """) time = [0] * (steps+1) power = [0] * (steps+1)