Changing the Windowing and Updating Authors
This commit is contained in:
@@ -49,11 +49,10 @@ struct GeneralInfo
|
||||
QString description;
|
||||
QString unitOfTime;
|
||||
unsigned int clkPeriod;
|
||||
unsigned long long timeWindowSize;
|
||||
|
||||
public:
|
||||
GeneralInfo(unsigned int numberOfTransactions,unsigned int numberOfPhases,Timespan span,unsigned int numberOfBanks,const QString& description, QString unitOfTime,unsigned int clkPeriod, unsigned long long timeWindowSize) :
|
||||
numberOfTransactions(numberOfTransactions) , numberOfPhases(numberOfPhases),span(span), numberOfBanks(numberOfBanks), description(description), unitOfTime(unitOfTime), clkPeriod(clkPeriod), timeWindowSize(timeWindowSize)
|
||||
GeneralInfo(unsigned int numberOfTransactions,unsigned int numberOfPhases,Timespan span,unsigned int numberOfBanks,const QString& description, QString unitOfTime,unsigned int clkPeriod) :
|
||||
numberOfTransactions(numberOfTransactions) , numberOfPhases(numberOfPhases),span(span), numberOfBanks(numberOfBanks), description(description), unitOfTime(unitOfTime), clkPeriod(clkPeriod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "pythoncaller.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef PYTHONCALLER_H
|
||||
|
||||
@@ -199,7 +199,7 @@ ID TraceDB::getTransactionIDFromPhaseID(ID phaseID)
|
||||
GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
{
|
||||
QSqlQuery query(database);
|
||||
query.prepare("SELECT NumberOfTransactions,TraceEnd,NumberOfBanks,Clk,UnitOfTime,Traces,Memspec,Memconfig,TimeWindowSize FROM GeneralInfo");
|
||||
query.prepare("SELECT NumberOfTransactions,TraceEnd,NumberOfBanks,Clk,UnitOfTime,Traces,Memspec,Memconfig FROM GeneralInfo");
|
||||
executeQuery(query);
|
||||
|
||||
if(query.next())
|
||||
@@ -214,7 +214,6 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
QString traces = "Traces: " + query.value(5).toString();
|
||||
QString memspec = "Memspec: " + query.value(6).toString();
|
||||
QString memconfig = "Memconfig: " + query.value(7).toString();
|
||||
unsigned long long timeWindowSize = query.value(8).toLongLong();
|
||||
|
||||
QString description = (traces + "\n");
|
||||
description += memconfig + "\n";
|
||||
@@ -222,9 +221,8 @@ GeneralInfo TraceDB::getGeneralInfoFromDB()
|
||||
description += "Number of Transactions: " + QString::number(numberOfTransactions) + "\n";
|
||||
description += "Clock period: " + QString::number(clkPeriod) + " " + unitOfTime + "\n";
|
||||
description += "Length of trace: " + prettyFormatTime(traceEnd) + "\n";
|
||||
description += "Time windows size: " + prettyFormatTime(timeWindowSize);
|
||||
|
||||
return GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0,traceEnd),numberOfBanks,description,unitOfTime,clkPeriod,timeWindowSize);
|
||||
return GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0,traceEnd),numberOfBanks,description,unitOfTime,clkPeriod);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef EVALUATIONTOOL_H
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "tracemetrictreewidget.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef TRACEMETRICTREEWIDGET_H
|
||||
|
||||
@@ -235,7 +235,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")
|
||||
(p1.PhaseName = "ACT" or p1.PhaseName = "PRE_ALL" or p1.PhaseName = "PRE" or p1.PhaseName = "RDA" or p1.PhaseName = "WRA")
|
||||
order by PhaseBegin
|
||||
""")
|
||||
prevPhase = "PRE_ALL"
|
||||
@@ -267,6 +267,10 @@ def bank_overlap_ratio(connection):
|
||||
bankCounter = 0
|
||||
elif(t[1] == "PRE"):
|
||||
bankCounter -= 1
|
||||
elif(t[1] == "WRA"):
|
||||
bankCounter -= 1
|
||||
elif(t[1] == "RDA"):
|
||||
bankCounter -= 1
|
||||
else:
|
||||
print ("ERROR")
|
||||
return 0
|
||||
|
||||
@@ -23,82 +23,85 @@ def memory_utilisation_window(connection, tracePath):
|
||||
# The bandwidth data are then plotted in two graphics.
|
||||
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT TimeWindowSize FROM generalInfo")
|
||||
windowSize = cursor.fetchone()[0]
|
||||
cursor.execute("SELECT TraceEnd FROM generalInfo")
|
||||
traceEnd = cursor.fetchone()[0]
|
||||
steps = ceil(float(traceEnd)/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)
|
||||
maximumPercentage = 0
|
||||
bandwidthPercentage = [0] * (steps+1)
|
||||
bandwidth = [0] * (steps+1)
|
||||
bandwidthPercentage[0] = 0
|
||||
bandwidth[0] = 0
|
||||
for i in range(steps):
|
||||
bandwidthPercentage[i+1] = 0
|
||||
cursor.execute(queryPart, (i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result is None):
|
||||
cursor.execute(queryFull, (i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
cursor.execute(queryEnd, (i*windowSize, i*windowSize, i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
cursor.execute(queryBegin, ((i+1)*windowSize, i*windowSize, (i+1)*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
else:
|
||||
bandwidthPercentage[i+1] = windowSize
|
||||
bandwidthPercentage[i+1] = float(bandwidthPercentage[i+1]/windowSize)
|
||||
bandwidth[i+1] = float(bandwidthPercentage[i+1])*float(maxDataRate)/1024
|
||||
bandwidthPercentage[i+1] *= 100
|
||||
if(maximumPercentage < 100 and maximumPercentage < bandwidthPercentage[i+1]):
|
||||
maximumPercentage = bandwidthPercentage[i+1]
|
||||
|
||||
name = ntpath.basename(tracePath)
|
||||
basename, extension = os.path.splitext(name)
|
||||
|
||||
cursor.execute(""" SELECT time FROM Power """)
|
||||
outputFile = ""
|
||||
OUTPUT_FILE = 'memory_utilization_' + basename + '.pdf'
|
||||
outputFile = "Output file is {0}".format(OUTPUT_FILE)
|
||||
if(cursor.fetchone() is not None):
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT max(time) FROM Power")
|
||||
maxTime = pow(10,12)*cursor.fetchone()[0]
|
||||
cursor.execute("SELECT min(time) FROM Power WHERE time > 0")
|
||||
windowSize = pow(10,12)*cursor.fetchone()[0]
|
||||
steps = ceil(float(maxTime)/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)
|
||||
maximumPercentage = 0
|
||||
bandwidthPercentage = [0] * (steps+1)
|
||||
bandwidth = [0] * (steps+1)
|
||||
bandwidthPercentage[0] = 0
|
||||
bandwidth[0] = 0
|
||||
for i in range(steps):
|
||||
bandwidthPercentage[i+1] = 0
|
||||
cursor.execute(queryPart, (i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result is None):
|
||||
cursor.execute(queryFull, (i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
cursor.execute(queryEnd, (i*windowSize, i*windowSize, i*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
cursor.execute(queryBegin, ((i+1)*windowSize, i*windowSize, (i+1)*windowSize, (i+1)*windowSize))
|
||||
result = cursor.fetchone()
|
||||
if(result[0] is not None):
|
||||
bandwidthPercentage[i+1] += int(result[0])
|
||||
else:
|
||||
bandwidthPercentage[i+1] = windowSize
|
||||
bandwidthPercentage[i+1] = float(bandwidthPercentage[i+1]/windowSize)
|
||||
bandwidth[i+1] = float(bandwidthPercentage[i+1])*float(maxDataRate)/1024
|
||||
bandwidthPercentage[i+1] *= 100
|
||||
if(maximumPercentage < 100 and maximumPercentage < bandwidthPercentage[i+1]):
|
||||
maximumPercentage = bandwidthPercentage[i+1]
|
||||
|
||||
name = ntpath.basename(tracePath)
|
||||
basename, extension = os.path.splitext(name)
|
||||
|
||||
OUTPUT_FILE = 'memory_utilization_' + basename + '.pdf'
|
||||
outputFile = "Output file is {0}".format(OUTPUT_FILE)
|
||||
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.backends.backend_pdf import PdfPages
|
||||
'''import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.backends.backend_pdf import PdfPages
|
||||
|
||||
time = np.arange(0, (steps+1)*windowSize, windowSize)
|
||||
time = np.arange(0, (steps+1)*windowSize, windowSize)
|
||||
|
||||
plt.figure()
|
||||
plt.figure()
|
||||
|
||||
subplotIndex = 211
|
||||
plt.subplot(subplotIndex)
|
||||
plt.plot(time/1000, bandwidthPercentage)
|
||||
plt.xlabel('Time (ns)')
|
||||
plt.ylabel('Bandwidth (%)')
|
||||
plt.ylim(0, maximumPercentage + (10 - maximumPercentage%10))
|
||||
plt.grid(True)
|
||||
subplotIndex = 211
|
||||
plt.subplot(subplotIndex)
|
||||
plt.plot(time/1000, bandwidthPercentage)
|
||||
plt.xlabel('Time (ns)')
|
||||
plt.ylabel('Bandwidth (%)')
|
||||
plt.ylim(0, maximumPercentage + (10 - maximumPercentage%10))
|
||||
plt.grid(True)
|
||||
|
||||
subplotIndex += 1
|
||||
plt.subplot(subplotIndex)
|
||||
plt.plot(time/1000, bandwidth)
|
||||
plt.xlabel('Time (ns)')
|
||||
plt.ylabel('Bandwidth (Gibit/s)')
|
||||
plt.grid(True)
|
||||
subplotIndex += 1
|
||||
plt.subplot(subplotIndex)
|
||||
plt.plot(time, bandwidth)
|
||||
plt.xlabel('Time (ns)')
|
||||
plt.ylabel('Bandwidth (Gibit/s)')
|
||||
plt.grid(True)
|
||||
|
||||
pdf = PdfPages(OUTPUT_FILE)
|
||||
pdf.savefig()
|
||||
pdf.close()
|
||||
plt.close()
|
||||
pdf = PdfPages(OUTPUT_FILE)
|
||||
pdf.savefig()
|
||||
pdf.close()
|
||||
plt.close()'''
|
||||
return outputFile
|
||||
|
||||
|
||||
@@ -109,11 +112,12 @@ def power_window(connection, tracePath):
|
||||
|
||||
outputFile = ""
|
||||
if(cursor.fetchone() is not None):
|
||||
cursor.execute("SELECT TimeWindowSize FROM generalInfo")
|
||||
windowSize = cursor.fetchone()[0]
|
||||
cursor.execute("SELECT TraceEnd FROM generalInfo")
|
||||
traceEnd = cursor.fetchone()[0]
|
||||
steps = ceil(float(traceEnd)/float(windowSize))
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT max(time) FROM Power")
|
||||
maxTime = pow(10,9)*cursor.fetchone()[0]
|
||||
cursor.execute("SELECT min(time) FROM Power WHERE time > 0")
|
||||
windowSize = pow(10,9)*cursor.fetchone()[0]
|
||||
steps = ceil(float(maxTime)/float(windowSize))
|
||||
cursor.execute(""" SELECT * FROM Power """)
|
||||
time = [0] * (steps+1)
|
||||
power = [0] * (steps+1)
|
||||
@@ -121,7 +125,7 @@ def power_window(connection, tracePath):
|
||||
power[0] = 0
|
||||
for i in range((steps)):
|
||||
result = cursor.fetchone()
|
||||
time[i+1] = float(result[0])*1000000000
|
||||
time[i+1] = float(result[0])*pow(10,9)
|
||||
power[i+1] = float(result[1])
|
||||
|
||||
name = ntpath.basename(tracePath)
|
||||
@@ -131,7 +135,7 @@ def power_window(connection, tracePath):
|
||||
OUTPUT_FILE = 'power_' + basename + '.pdf'
|
||||
outputFile = "\n" + "Output file is {0}".format(OUTPUT_FILE)
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
'''import matplotlib.pyplot as plt
|
||||
from matplotlib.backends.backend_pdf import PdfPages
|
||||
|
||||
plt.plot(time, power)
|
||||
@@ -141,7 +145,7 @@ def power_window(connection, tracePath):
|
||||
pdf = PdfPages(OUTPUT_FILE)
|
||||
pdf.savefig()
|
||||
pdf.close()
|
||||
plt.close()
|
||||
plt.close()'''
|
||||
return outputFile
|
||||
|
||||
# @plot
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2015, University of Kaiserslautern
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Authors:
|
||||
* Felipe S. Prado
|
||||
* Matthias Jung
|
||||
*/
|
||||
|
||||
#include "selectmetrics.h"
|
||||
#include "ui_selectmetrics.h"
|
||||
#include<QMessageBox>
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2015, University of Kaiserslautern
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Authors:
|
||||
* Felipe S. Prado
|
||||
* Matthias Jung
|
||||
*/
|
||||
|
||||
#ifndef SELECTMETRICS_H
|
||||
#define SELECTMETRICS_H
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ CREATE TABLE GeneralInfo(
|
||||
UnitOfTime TEXT,
|
||||
Memconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
TimeWindowSize INTEGER
|
||||
Traces TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<Debug value="0" />
|
||||
<DatabaseRecording value="1" />
|
||||
<PowerAnalysis value="1" />
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "1" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="1"/>
|
||||
<NumberOfMemChannels value="1"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<Debug value="0" />
|
||||
<DatabaseRecording value="0" />
|
||||
<PowerAnalysis value="0" />
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "0" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="1"/>
|
||||
<NumberOfMemChannels value="4"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
|
||||
@@ -270,8 +270,8 @@ void TlmRecorder::prepareSqlStatements()
|
||||
updatePhaseString =
|
||||
"UPDATE Phases SET PhaseEnd = :end WHERE Transact = :trans AND PhaseName = :name";
|
||||
insertGeneralInfoString =
|
||||
"INSERT INTO GeneralInfo (NumberOfTransactions,TraceEnd,NumberOfBanks,clk,UnitOfTime,Memconfig,Memspec,Traces,TimeWindowSize) VALUES"
|
||||
"(:numberOfTransactions,:end,:numberOfBanks,:clk,:unitOfTime,:memconfig,:memspec,:traces,:timeWindowSize)";
|
||||
"INSERT INTO GeneralInfo (NumberOfTransactions,TraceEnd,NumberOfBanks,clk,UnitOfTime,Memconfig,Memspec,Traces) VALUES"
|
||||
"(:numberOfTransactions,:end,:numberOfBanks,:clk,:unitOfTime,:memconfig,:memspec,:traces)";
|
||||
insertDebugMessageString = "INSERT INTO DebugMessages (Time,Message) Values (:time,:message)";
|
||||
insertPowerString = "INSERT INTO Power VALUES (:time,:averagePower)";
|
||||
|
||||
@@ -304,8 +304,6 @@ void TlmRecorder::insertGeneralInfo()
|
||||
sqlite3_bind_text(insertGeneralInfoStatement, 6, memconfig.c_str(), memconfig.length(), NULL);
|
||||
sqlite3_bind_text(insertGeneralInfoStatement, 7, memspec.c_str(), memspec.length(), NULL);
|
||||
sqlite3_bind_text(insertGeneralInfoStatement, 8, traces.c_str(), traces.length(), NULL);
|
||||
sqlite3_bind_int64(insertGeneralInfoStatement, 9,
|
||||
Configuration::getInstance().TraceLength.value()/Configuration::getInstance().NumberOfTimeWindows);
|
||||
|
||||
executeSqlStatement(insertGeneralInfoStatement);
|
||||
}
|
||||
|
||||
@@ -482,9 +482,16 @@ bool Controller::containsPhase(tlm_phase phase, std::vector<tlm_phase> phases)
|
||||
|
||||
void Controller::terminateSimulation()
|
||||
{
|
||||
for (Bank bank : controllerCore->getBanks())
|
||||
if(Configuration::getInstance().BankwiseLogic)
|
||||
{
|
||||
controllerCore->powerDownManager->wakeUp(bank, clkAlign(sc_time_stamp()));
|
||||
for (Bank bank : controllerCore->getBanks())
|
||||
{
|
||||
controllerCore->powerDownManager->wakeUp(bank, clkAlign(sc_time_stamp()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
controllerCore->powerDownManager->wakeUp(0, clkAlign(sc_time_stamp()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
* Authors:
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "ControllerState.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "Configuration.h"
|
||||
@@ -136,13 +137,15 @@ void Configuration::setParameter(std::string name, std::string value)
|
||||
DatabaseRecording = string2bool(value);
|
||||
else if(name == "PowerAnalysis")
|
||||
PowerAnalysis = string2bool(value);
|
||||
else if (name == "NumberOfTimeWindows") {
|
||||
else if (name == "EnableWindowing")
|
||||
EnableWindowing = string2bool(value);
|
||||
else if(name == "WindowSize")
|
||||
if(string2int(value) < 1) {
|
||||
SC_REPORT_FATAL("Configuration", ("Invalid value for parameter " + name + ". This parameter must be at least one.").c_str());
|
||||
throw;
|
||||
}
|
||||
NumberOfTimeWindows = string2int(value);
|
||||
}
|
||||
else
|
||||
WindowSize = string2int(value);
|
||||
else if(name == "Debug")
|
||||
Debug = string2bool(value);
|
||||
else if (name == "NumberOfTracePlayers")
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef CONFIGURATION_H_
|
||||
@@ -76,13 +77,14 @@ struct Configuration
|
||||
bool DatabaseRecording = true;
|
||||
bool PowerAnalysis = false;
|
||||
sc_time TraceLength;
|
||||
unsigned int NumberOfTimeWindows;
|
||||
bool EnableWindowing = false;
|
||||
unsigned int WindowSize = 1000;
|
||||
bool Debug = false;
|
||||
unsigned int NumberOfTracePlayers = 1;
|
||||
unsigned int NumberOfMemChannels = 1;
|
||||
bool ControllerCoreDisableRefresh = false;
|
||||
bool ThermalSimulation = false;
|
||||
bool SimulationProgressBar;
|
||||
bool SimulationProgressBar = false;
|
||||
unsigned int NumberOfDevicesOnDIMM = 1;
|
||||
|
||||
//MemSpec(from DRAM-Power XML)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
* Authors:
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "PowerDownChecker.h"
|
||||
@@ -55,8 +56,8 @@ sc_time PowerDownChecker::getTimeConstraintToEnterPowerDown(Command lastCmd, Com
|
||||
constraint = config.memSpec.tXP;
|
||||
} else if (lastCmd == Command::SREFX) {
|
||||
constraint = config.memSpec.tXSR;
|
||||
} else if(lastCmd == Command::Precharge || lastCmd == Command::PrechargeAll) {
|
||||
constraint = config.memSpec.tRP;
|
||||
} else if(lastCmd == Command::Precharge || lastCmd == Command::PrechargeAll) {
|
||||
constraint = config.memSpec.tRP;
|
||||
} else {
|
||||
reportFatal("Powerdown checker", commandToString(pdnCmd) + " can not follow " + commandToString(lastCmd));
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
* Authors:
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "PrechargeAllChecker.h"
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
* Authors:
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "RefreshChecker.h"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* Matthias Jung
|
||||
* Peter Ehses
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef DRAM_H_
|
||||
@@ -73,7 +74,7 @@ struct Dram : sc_module
|
||||
|
||||
// Power Model related
|
||||
bool powerAnalysis = Configuration::getInstance().PowerAnalysis;
|
||||
sc_time powerWindowSize = Configuration::getInstance().TraceLength/Configuration::getInstance().NumberOfTimeWindows;
|
||||
sc_time powerWindowSize = Configuration::getInstance().memSpec.clk*Configuration::getInstance().WindowSize;
|
||||
libDRAMPower *DRAMPower;
|
||||
double sumOfEnergyWindows = 0.0;
|
||||
|
||||
@@ -185,7 +186,8 @@ struct Dram : sc_module
|
||||
|
||||
// Create a thread that is triggered every $powerWindowSize
|
||||
// to generate a Power over Time plot in the Trace analyzer:
|
||||
SC_THREAD(powerWindow);
|
||||
if(Configuration::getInstance().EnableWindowing)
|
||||
SC_THREAD(powerWindow);
|
||||
}
|
||||
|
||||
// Bandwidth Calculation:
|
||||
@@ -220,9 +222,9 @@ struct Dram : sc_module
|
||||
|
||||
double totalEnergy = sumOfEnergyWindows + DRAMPower->getEnergy().total_energy * Configuration::getInstance().NumberOfDevicesOnDIMM;
|
||||
// The energy is given in [pJ] and divided by [s] resulting in [pW] then converted to [mW]
|
||||
double averagePower = (totalEnergy / sc_time_stamp().to_seconds()) / 1e9;
|
||||
|
||||
tlmRecorder->recordPower(sc_time_stamp().to_seconds(), DRAMPower->getPower().average_power * Configuration::getInstance().NumberOfDevicesOnDIMM);
|
||||
double averagePower = (totalEnergy/ sc_time_stamp().to_seconds()) / 1e9;
|
||||
if(Configuration::getInstance().EnableWindowing)
|
||||
tlmRecorder->recordPower(sc_time_stamp().to_seconds(), DRAMPower->getPower().average_power * Configuration::getInstance().NumberOfDevicesOnDIMM);
|
||||
|
||||
// Print the final total energy and the average power for the simulation
|
||||
cout << name() << string("\tTotal Energy: \t") << fixed <<std::setprecision( 2 )<< totalEnergy << string(" pJ") << endl;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -141,8 +142,11 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
playerClk = FrequencyToClk(devices[i].clkMhz);
|
||||
|
||||
player = new StlPlayer(playerStr.c_str(), pathToResources + string("traces/") + devices[i].trace, playerClk, this);
|
||||
player->getTraceLength(pathToResources + string("traces/") + devices[i].trace, playerClk);
|
||||
totalTransactions += player->getNumberOfLines(pathToResources + string("traces/") + devices[i].trace);
|
||||
if(Configuration::getInstance().SimulationProgressBar)
|
||||
{
|
||||
player->getTraceLength(pathToResources + string("traces/") + devices[i].trace, playerClk);
|
||||
totalTransactions += player->getNumberOfLines(pathToResources + string("traces/") + devices[i].trace);
|
||||
}
|
||||
players.push_back(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef SIMULATION_H_
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "StlPlayer.h"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef STLPLAYER_H
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include "TracePlayer.h"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef TRACEPLAYER_H_
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
<Debug value="0" />
|
||||
<DatabaseRecording value="0" />
|
||||
<PowerAnalysis value="1" />
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "0" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="1"/>
|
||||
<NumberOfMemChannels value="4"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
<Debug value="0" />
|
||||
<DatabaseRecording value="1" />
|
||||
<PowerAnalysis value="1" />
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "0" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="1"/>
|
||||
<NumberOfMemChannels value="4"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
|
||||
17
README.md
17
README.md
@@ -398,12 +398,14 @@ The DRAMSys' main configuration file is presented below.
|
||||
<Debug value="1" />
|
||||
<DatabaseRecording value="1" />
|
||||
<PowerAnalysis value="1" />
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "1" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="1"/>
|
||||
<NumberOfMemChannels value="4"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
<ThermalSimulation value="1"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
@@ -499,12 +501,14 @@ The XML code below shows a typic configuration:
|
||||
<Debug value="1"/>
|
||||
<DatabaseRecording value="1"/>
|
||||
<PowerAnalysis value="1"/>
|
||||
<NumberOfTimeWindows value="1000" />
|
||||
<EnableWindowing value = "1" />
|
||||
<WindowSize value="1000" />
|
||||
<NumberOfTracePlayers value="5"/>
|
||||
<NumberOfMemChannels value="1"/>
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
@@ -612,8 +616,11 @@ Below are listed the configuration sections and configuration fields.
|
||||
- *PowerAnalysis* (boolean)
|
||||
- "1": enables live power analysis with the DRAMPower tool
|
||||
- "0": disables power analysis
|
||||
- *NumberOfTimeWindows* (int)
|
||||
- number of time windows used to evaluate average bandwidth and average power consumption
|
||||
- *EnableWindowing* (boolean)
|
||||
- "1": enables temporal windowing
|
||||
- "0": disables temporal windowing
|
||||
- *WindowSize* (unisgned int)
|
||||
- Size of the window in clock cycles used to evaluate average bandwidth and average power consumption
|
||||
- *NumberOfTracePlayers* (unsigned int)
|
||||
- Number of trace players
|
||||
- *NumberOfMemChannels* (unsigned int)
|
||||
@@ -627,6 +634,8 @@ Below are listed the configuration sections and configuration fields.
|
||||
- *SimulationProgressBar* (boolean)
|
||||
- "1": enables the simulation progress bar
|
||||
- "0": disables the simulation progress bar
|
||||
- *NumberOfDevicesOnDIMM* (unsigned int)
|
||||
- Number of devices on dual inline memory module
|
||||
|
||||
- **Temperature Simulator Configuration**
|
||||
- *TemperatureScale* (string)
|
||||
|
||||
Reference in New Issue
Block a user