From f74386a38ee622c61dbec96999a0e78640f0a02d Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Tue, 29 Jul 2014 15:18:12 +0200 Subject: [PATCH 1/4] Cleaned code --- dram/src/simulation/Dram.h | 1 - 1 file changed, 1 deletion(-) diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index 69c882ba..825764b7 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -41,7 +41,6 @@ struct Dram: sc_module tSocket.register_nb_transport_fw(this, &Dram::nb_transport_fw); MemorySpecification memSpec(MemSpecParser::getMemSpecFromXML(Configuration::getInstance().memspecUri)); - //MemorySpecification::getMemSpecFromXML(Configuration::getInstance().memspecUri)); DRAMPower = new libDRAMPower( memSpec, 1,1,1,0,0 ); } From d402933502c27d2e9721286163eacc4f6b558a18 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Tue, 29 Jul 2014 16:21:07 +0200 Subject: [PATCH 2/4] New metric "memory utilization" defined --- dram/resources/scripts/metrics.py | 33 ++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/dram/resources/scripts/metrics.py b/dram/resources/scripts/metrics.py index 7f780cca..8f448db1 100644 --- a/dram/resources/scripts/metrics.py +++ b/dram/resources/scripts/metrics.py @@ -38,17 +38,17 @@ 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 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): @@ -59,6 +59,17 @@ def average_response_latency_in_ns(connection): result = cursor.fetchone() return round(result[0],1) +@metric +def memory_utilisation(connection): + cursor = connection.cursor() + cursor.execute(""" SELECT sum(DataStrobeEnd - DataStrobeBegin) FROM transactions """) + active = cursor.fetchone() + cursor = connection.cursor() + cursor.execute(""" SELECT max(DataStrobeEnd) FROM Transactions """) + total = cursor.fetchone() + return str(active[0]/total[0]*100)+"%" + + def refreshMissDecision(connection,calculatedMetrics): cursor = connection.cursor() cursor.execute("""SELECT phases.ID,PhaseBegin,PhaseEnd,TBank FROM Phases INNER JOIN transactions on transactions.id = phases.transact WHERE PhaseName='AUTO_REFRESH' """) From 62e7c8e65ec9faa68b47db5c794427b631f32477 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Tue, 29 Jul 2014 16:21:59 +0200 Subject: [PATCH 3/4] Changed to the lates DRAMPower --- dram/src/simulation/Dram.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dram/src/simulation/Dram.h b/dram/src/simulation/Dram.h index 825764b7..f4995534 100644 --- a/dram/src/simulation/Dram.h +++ b/dram/src/simulation/Dram.h @@ -41,7 +41,7 @@ struct Dram: sc_module tSocket.register_nb_transport_fw(this, &Dram::nb_transport_fw); MemorySpecification memSpec(MemSpecParser::getMemSpecFromXML(Configuration::getInstance().memspecUri)); - DRAMPower = new libDRAMPower( memSpec, 1,1,1,0,0 ); + DRAMPower = new libDRAMPower( memSpec, 0 ); } ~Dram() From 74456e530d344971ba88acd54754bc92b89a7fbc Mon Sep 17 00:00:00 2001 From: schlemmi Date: Wed, 30 Jul 2014 03:04:57 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4eabcd46..59e654e9 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,9 @@ de.uni-kl.ems.dram.vp.system Generic DRAM controller -#Setup with Eclipse +#Setup with QTCreator -1. Start Eclipse ($eclipse) -2. -> Import - -> Git - -> Projects from Git - -> Existing Local Repository - -> Add Path to $dram.vp.system - -> Import Existing Projects - -> Finish - -3. Configure Eclipse: - -> Run Configurations - -> Environment - -> Variable: LD_LIBRARY_PATH = /opt/systemc/lib-linux64/:/opt/gcc/lib64 +needs update!