New metric script that plots a histogram, prerequisites install script added
This commit is contained in:
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal 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
6
dram/.gitignore
vendored
@@ -1,6 +0,0 @@
|
||||
/debug
|
||||
/release
|
||||
*.tdb
|
||||
*.tdb-journal
|
||||
*.out
|
||||
*.txt
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parameter id="openPagePolicy" type="bool" value="1" />
|
||||
<parameter id="adaptiveOpenPagePolicy" type="bool" value="0" />
|
||||
<parameter id="refreshAwareScheduling" type="bool" value="0" />
|
||||
<parameter id="maxNrOfTransactionsInDram" type="uint" value="2000" />
|
||||
<parameter id="maxNrOfTransactionsInDram" type="uint" value="50" />
|
||||
<parameter id="scheduler" type="string" value="FIFO" />
|
||||
<parameter id="capsize" type="uint" value="5" />
|
||||
<parameter id="powerDownMode" type="string" value="TimeoutPDN" />
|
||||
|
||||
@@ -32,6 +32,18 @@ def getTraceLength(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()
|
||||
@@ -271,7 +283,7 @@ def calculateMetrics(pathToTrace):
|
||||
#calculatedMetrics.extend(passRatio(connection))
|
||||
#calculatedMetrics.extend(timeInPowerStates(connection))
|
||||
|
||||
refreshMissDecision(connection, calculatedMetrics)
|
||||
#refreshMissDecision(connection, calculatedMetrics)
|
||||
print(calculatedMetrics[-1])
|
||||
print(calculatedMetrics[-2])
|
||||
connection.close()
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
|
||||
<memconfigs>
|
||||
<memconfig>fifo.xml</memconfig>
|
||||
<memconfig>fr_fcfs.xml</memconfig>
|
||||
</memconfigs>
|
||||
<trace-setups>
|
||||
|
||||
<trace-setup id="simple">
|
||||
<device >test2.stl</device>
|
||||
<device >trace3.stl</device>
|
||||
</trace-setup>
|
||||
|
||||
|
||||
|
||||
5
dram/src/common/libDRAMPower.cpp
Normal file
5
dram/src/common/libDRAMPower.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "libdrampower.h"
|
||||
|
||||
libDRAMPower::libDRAMPower()
|
||||
{
|
||||
}
|
||||
10
dram/src/common/libDRAMPower.h
Normal file
10
dram/src/common/libDRAMPower.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef LIBDRAMPOWER_H
|
||||
#define LIBDRAMPOWER_H
|
||||
|
||||
class libDRAMPower
|
||||
{
|
||||
public:
|
||||
libDRAMPower();
|
||||
};
|
||||
|
||||
#endif // LIBDRAMPOWER_H
|
||||
8
install_prerequisites.sh
Executable file
8
install_prerequisites.sh
Executable 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
|
||||
Reference in New Issue
Block a user