diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..57b0cd3d --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/debug +/release +*.tdb +*.tdb-journal +*.out +*.txt +/build-simulation +/release-simulation +/dram/src/common/third_party/DRAMPower/* +*.*~ +dram/build-*/ diff --git a/dram/.gitignore b/dram/.gitignore deleted file mode 100644 index 58658cf3..00000000 --- a/dram/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/debug -/release -*.tdb -*.tdb-journal -*.out -*.txt diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro index 6fed9296..128dd852 100644 --- a/dram/dramSys/dramSys.pro +++ b/dram/dramSys/dramSys.pro @@ -64,7 +64,8 @@ SOURCES += \ ../src/simulation/SimulationManager.cpp \ ../src/simulation/Simulation.cpp \ ../src/simulation/MemoryManager.cpp \ - ../src/simulation/main.cpp + ../src/simulation/main.cpp \ + ../src/common/libDRAMPower.cpp HEADERS += \ ../src/common/third_party/tinyxml2.h \ @@ -118,6 +119,7 @@ HEADERS += \ ../src/simulation/MemoryManager.h \ ../src/simulation/ISimulation.h \ ../src/simulation/Dram.h \ - ../src/simulation/Arbiter.h + ../src/simulation/Arbiter.h \ + ../src/common/libDRAMPower.h diff --git a/dram/resources/scripts/metrics.py b/dram/resources/scripts/metrics.py index 8f198bfc..7f780cca 100644 --- a/dram/resources/scripts/metrics.py +++ b/dram/resources/scripts/metrics.py @@ -38,6 +38,18 @@ def getClock(connection): result = cursor.fetchone() return result[0] +@metric +def latency_histogram(connection): + 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" + @metric def average_response_latency_in_ns(connection): cursor = connection.cursor() @@ -258,6 +270,9 @@ def calculateMetrics(pathToTrace): #print(calculatedMetrics[-1]) #print(calculatedMetrics[-2]) + #refreshMissDecision(connection, calculatedMetrics) + print(calculatedMetrics[-1]) + print(calculatedMetrics[-2]) connection.close() return calculatedMetrics diff --git a/dram/src/common/libDRAMPower.cpp b/dram/src/common/libDRAMPower.cpp new file mode 100644 index 00000000..8a6ae82b --- /dev/null +++ b/dram/src/common/libDRAMPower.cpp @@ -0,0 +1,5 @@ +#include "libdrampower.h" + +libDRAMPower::libDRAMPower() +{ +} diff --git a/dram/src/common/libDRAMPower.h b/dram/src/common/libDRAMPower.h new file mode 100644 index 00000000..9b1ca0b5 --- /dev/null +++ b/dram/src/common/libDRAMPower.h @@ -0,0 +1,10 @@ +#ifndef LIBDRAMPOWER_H +#define LIBDRAMPOWER_H + +class libDRAMPower +{ +public: + libDRAMPower(); +}; + +#endif // LIBDRAMPOWER_H diff --git a/install_prerequisites.sh b/install_prerequisites.sh new file mode 100755 index 00000000..7fb677b3 --- /dev/null +++ b/install_prerequisites.sh @@ -0,0 +1,8 @@ +#!/bin/bash +mkdir -p dram/src/common/third_party/DRAMPower +cd dram/src/common/third_party/DRAMPower +wget "http://www.es.ele.tue.nl/drampower/DRAMPower3.1.zip" +unzip DRAMPower3.1.zip +mv DRAMPower3.1/* . +rm -r DRAMPower3.1 +rm -r DRAMPower3.1.zip