This commit is contained in:
robert
2014-06-16 17:43:22 +02:00
7 changed files with 53 additions and 8 deletions

11
.gitignore vendored Normal file
View File

@@ -0,0 +1,11 @@
/debug
/release
*.tdb
*.tdb-journal
*.out
*.txt
/build-simulation
/release-simulation
/dram/src/common/third_party/DRAMPower/*
*.*~
dram/build-*/

6
dram/.gitignore vendored
View File

@@ -1,6 +0,0 @@
/debug
/release
*.tdb
*.tdb-journal
*.out
*.txt

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
#include "libdrampower.h"
libDRAMPower::libDRAMPower()
{
}

View File

@@ -0,0 +1,10 @@
#ifndef LIBDRAMPOWER_H
#define LIBDRAMPOWER_H
class libDRAMPower
{
public:
libDRAMPower();
};
#endif // LIBDRAMPOWER_H

8
install_prerequisites.sh Executable file
View File

@@ -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