Merge pull request #101 from sprado/master
Changing the windowing and updating authors
This commit is contained in:
@@ -49,11 +49,11 @@ struct GeneralInfo
|
||||
QString description;
|
||||
QString unitOfTime;
|
||||
unsigned int clkPeriod;
|
||||
unsigned long long timeWindowSize;
|
||||
unsigned int windowSize;
|
||||
|
||||
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, unsigned int windowSize) :
|
||||
numberOfTransactions(numberOfTransactions) , numberOfPhases(numberOfPhases),span(span), numberOfBanks(numberOfBanks), description(description), unitOfTime(unitOfTime), clkPeriod(clkPeriod), windowSize(windowSize)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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, WindowSize FROM GeneralInfo");
|
||||
executeQuery(query);
|
||||
|
||||
if(query.next())
|
||||
@@ -214,7 +214,7 @@ 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();
|
||||
unsigned int windowSize = query.value(8).toInt();
|
||||
|
||||
QString description = (traces + "\n");
|
||||
description += memconfig + "\n";
|
||||
@@ -222,9 +222,9 @@ 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);
|
||||
description += "Window size:" + QString::number(windowSize) + "\n";
|
||||
|
||||
return GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0,traceEnd),numberOfBanks,description,unitOfTime,clkPeriod,timeWindowSize);
|
||||
return GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0,traceEnd),numberOfBanks,description,unitOfTime,clkPeriod, windowSize);
|
||||
}
|
||||
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
|
||||
|
||||
@@ -14,7 +14,7 @@ def plot(function):
|
||||
|
||||
|
||||
@plot
|
||||
def memory_utilisation_window(connection, tracePath):
|
||||
def memory_utilisation_window(connection, tracePath, steps):
|
||||
# This function determines the average memory bandwidth over time in percentage and in Gbit/s.
|
||||
# The average bandwidth over time is done dividing the time into windows of the same length and getting the average bandwidth in each window.
|
||||
# Through data from the database, DataStrobeEnd and DataStrobeBegin, it is possible to assess when a data transfer begins or ends.
|
||||
@@ -23,11 +23,8 @@ 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))
|
||||
cursor.execute(" SELECT WindowSize FROM GeneralInfo ")
|
||||
windowSize = 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
|
||||
queryEnd = """ SELECT sum(DataStrobeEnd - ?) FROM transactions Where DataStrobeBegin < ? and DataStrobeEnd > ? and DataStrobeEnd <=?""" # Only the end of the data transfer is inside the time window
|
||||
@@ -67,7 +64,6 @@ def memory_utilisation_window(connection, tracePath):
|
||||
name = ntpath.basename(tracePath)
|
||||
basename, extension = os.path.splitext(name)
|
||||
|
||||
outputFile = ""
|
||||
OUTPUT_FILE = 'memory_utilization_' + basename + '.pdf'
|
||||
outputFile = "Output file is {0}".format(OUTPUT_FILE)
|
||||
|
||||
@@ -76,23 +72,25 @@ def memory_utilisation_window(connection, tracePath):
|
||||
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(0, maximumPercentage + (10 - maximumPercentage%10))
|
||||
plt.ylim(-1, maximumPercentage + (10 - maximumPercentage%10))
|
||||
plt.grid(True)
|
||||
|
||||
subplotIndex += 1
|
||||
plt.subplot(subplotIndex)
|
||||
plt.plot(time/1000, bandwidth)
|
||||
plt.plot(time, bandwidth)
|
||||
plt.xlabel('Time (ns)')
|
||||
plt.ylabel('Bandwidth (Gibit/s)')
|
||||
plt.ylim((-0.01)*float(maxDataRate)/1024, ((maximumPercentage + (10 - maximumPercentage%10))/100)*float(maxDataRate)/1024)
|
||||
plt.grid(True)
|
||||
|
||||
pdf = PdfPages(OUTPUT_FILE)
|
||||
@@ -103,26 +101,24 @@ def memory_utilisation_window(connection, tracePath):
|
||||
|
||||
|
||||
@plot
|
||||
def power_window(connection, tracePath):
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(""" SELECT time FROM Power """)
|
||||
def power_window(connection, tracePath, steps):
|
||||
|
||||
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.execute(""" SELECT * FROM Power """)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(" SELECT * FROM Power")
|
||||
result = cursor.fetchone()
|
||||
if(result is not None):
|
||||
time = [0] * (steps+1)
|
||||
power = [0] * (steps+1)
|
||||
time[0] = 0
|
||||
power[0] = 0
|
||||
for i in range((steps)):
|
||||
result = cursor.fetchone()
|
||||
time[i+1] = float(result[0])*1000000000
|
||||
power[i+1] = float(result[1])
|
||||
#pow(10,9): seconds to nanoseconds conversion
|
||||
time[1] = float(result[0])*pow(10,9)
|
||||
power[1] = float(result[1])
|
||||
for i in range((steps-1)):
|
||||
result = cursor.fetchone()
|
||||
time[i+2] = float(result[0])*pow(10,9)
|
||||
power[i+2] = float(result[1])
|
||||
|
||||
name = ntpath.basename(tracePath)
|
||||
basename, extension = os.path.splitext(name)
|
||||
@@ -165,8 +161,17 @@ def generatePlots(pathToTrace):
|
||||
#print("Generating plots for {0}".format(pathToTrace))
|
||||
|
||||
outputFiles = ""
|
||||
for p in plots:
|
||||
outputFiles += p(connection, pathToTrace)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(" SELECT WindowSize FROM GeneralInfo")
|
||||
windowSize = float(cursor.fetchone()[0])
|
||||
if(windowSize == 0):
|
||||
outputFiles = "No output file created"
|
||||
else:
|
||||
cursor.execute(" SELECT TraceEnd FROM GeneralInfo ")
|
||||
traceEnd = float(cursor.fetchone()[0])
|
||||
steps = ceil(traceEnd/windowSize)
|
||||
for p in plots:
|
||||
outputFiles += p(connection, pathToTrace, steps)
|
||||
|
||||
connection.close()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ CREATE TABLE GeneralInfo(
|
||||
Memconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
TimeWindowSize INTEGER
|
||||
WindowSize INTEGER
|
||||
);
|
||||
|
||||
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, WindowSize) VALUES"
|
||||
"(:numberOfTransactions,:end,:numberOfBanks,:clk,:unitOfTime,:memconfig,:memspec,:traces,:windowSize)";
|
||||
insertDebugMessageString = "INSERT INTO DebugMessages (Time,Message) Values (:time,:message)";
|
||||
insertPowerString = "INSERT INTO Power VALUES (:time,:averagePower)";
|
||||
|
||||
@@ -304,8 +304,10 @@ 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);
|
||||
if(!Configuration::getInstance().EnableWindowing)
|
||||
sqlite3_bind_int64(insertGeneralInfoStatement, 9, 0);
|
||||
else
|
||||
sqlite3_bind_int64(insertGeneralInfoStatement, 9, (Configuration::getInstance().memSpec.clk*Configuration::getInstance().WindowSize).value());
|
||||
|
||||
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_
|
||||
@@ -75,14 +76,14 @@ struct Configuration
|
||||
//SimConfig
|
||||
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,7 +222,7 @@ 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;
|
||||
double averagePower = (totalEnergy/ sc_time_stamp().to_seconds()) / 1e9;
|
||||
|
||||
tlmRecorder->recordPower(sc_time_stamp().to_seconds(), DRAMPower->getPower().average_power * Configuration::getInstance().NumberOfDevicesOnDIMM);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -141,8 +142,10 @@ 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)
|
||||
{
|
||||
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"
|
||||
@@ -98,52 +99,6 @@ void TracePlayer::peqCallback(tlm_generic_payload &payload, const tlm_phase &pha
|
||||
}
|
||||
}
|
||||
|
||||
void TracePlayer::getTraceLength(string pathToTrace, sc_time clk)
|
||||
{
|
||||
ifstream newFile;
|
||||
newFile.open(pathToTrace);
|
||||
if(newFile.is_open()) {
|
||||
newFile.seekg(-1,ios_base::end);// go to one spot before the EOF
|
||||
char ch;
|
||||
newFile.get(ch);
|
||||
|
||||
if(ch == newFile.eof())
|
||||
SC_REPORT_FATAL(0, (string("Empty Trace ") + pathToTrace).c_str());
|
||||
|
||||
while(ch == '\n')
|
||||
{
|
||||
newFile.seekg(-2,ios_base::cur);
|
||||
newFile.get(ch);
|
||||
}
|
||||
|
||||
bool keepLooping = true;
|
||||
while(keepLooping) {
|
||||
|
||||
newFile.clear();
|
||||
if((int)newFile.tellg() <= 1) { // If the data was at or before the 0th byte
|
||||
newFile.seekg(0); // The first line is the last line
|
||||
keepLooping = false; // So stop there
|
||||
}
|
||||
else if(ch == '\n') { // If the data was a newline
|
||||
keepLooping = false; // Stop at the current position.
|
||||
}
|
||||
else { // If the data was neither a newline nor at the 0 byte
|
||||
newFile.seekg(-2,ios_base::cur); // Move to the front of that data, then to the front of the data before it
|
||||
newFile.get(ch);
|
||||
}
|
||||
}
|
||||
|
||||
string lastLine;
|
||||
getline(newFile,lastLine); // Read the current line
|
||||
std::istringstream iss(lastLine);
|
||||
string time;
|
||||
iss >> time;
|
||||
Configuration::getInstance().TraceLength = std::stoull(time.c_str())*clk;
|
||||
newFile.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
unsigned int TracePlayer::getNumberOfLines(string pathToTrace)
|
||||
{
|
||||
ifstream newFile;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Éder F. Zulian
|
||||
* Felipe S. Prado
|
||||
*/
|
||||
|
||||
#ifndef TRACEPLAYER_H_
|
||||
@@ -62,7 +63,6 @@ public:
|
||||
tlm_utils::simple_initiator_socket<TracePlayer> iSocket;
|
||||
TracePlayer(TracePlayerListener *listener);
|
||||
virtual void nextPayload() = 0;
|
||||
void getTraceLength(string pathToTrace, sc_time clk);
|
||||
unsigned int getNumberOfLines(string pathToTrace);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -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