diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro
index 128dd852..b99145ed 100644
--- a/dram/dramSys/dramSys.pro
+++ b/dram/dramSys/dramSys.pro
@@ -14,18 +14,9 @@ INCLUDEPATH += /opt/boost/include
DEFINES += TIXML_USE_STL
DEFINES += SC_INCLUDE_DYNAMIC_PROCESSES
-CONFIG(release){
-DEFINES += NDEBUG
-QMAKE_CXXFLAGS_RELEASE -= -O
-QMAKE_CXXFLAGS_RELEASE -= -O1
-QMAKE_CXXFLAGS_RELEASE -= -O2
-QMAKE_CXXFLAGS_RELEASE *= -O3
-}
-
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS += -isystem /opt/systemc/include
QMAKE_CXXFLAGS += -isystem /opt/boost/include
-#QMAKE_CXXFLAGS = -Wno-unused-variable
SOURCES += \
../src/common/third_party/tinyxml2.cpp \
@@ -60,12 +51,12 @@ SOURCES += \
../src/controller/core/ControllerState.cpp \
../src/controller/core/ControllerCore.cpp \
../src/controller/core/Command.cpp \
- ../src/controller/core/BankStates.cpp \
../src/simulation/SimulationManager.cpp \
../src/simulation/Simulation.cpp \
../src/simulation/MemoryManager.cpp \
../src/simulation/main.cpp \
- ../src/common/libDRAMPower.cpp
+ ../src/common/libDRAMPower.cpp \
+ ../src/controller/core/RowBufferStates.cpp
HEADERS += \
../src/common/third_party/tinyxml2.h \
@@ -112,7 +103,6 @@ HEADERS += \
../src/controller/core/ControllerState.h \
../src/controller/core/ControllerCore.h \
../src/controller/core/Command.h \
- ../src/controller/core/BankStates.h \
../src/simulation/TracePlayer.h \
../src/simulation/SimulationManager.h \
../src/simulation/Simulation.h \
@@ -120,6 +110,7 @@ HEADERS += \
../src/simulation/ISimulation.h \
../src/simulation/Dram.h \
../src/simulation/Arbiter.h \
- ../src/common/libDRAMPower.h
+ ../src/common/libDRAMPower.h \
+ ../src/controller/core/RowBufferStates.h
diff --git a/dram/resources/configs/memconfigs/fifo.xml b/dram/resources/configs/memconfigs/fifo.xml
index 37d82f94..2e23e330 100644
--- a/dram/resources/configs/memconfigs/fifo.xml
+++ b/dram/resources/configs/memconfigs/fifo.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/fr_fcfs.xml b/dram/resources/configs/memconfigs/fr_fcfs.xml
index 073db719..b126adb1 100644
--- a/dram/resources/configs/memconfigs/fr_fcfs.xml
+++ b/dram/resources/configs/memconfigs/fr_fcfs.xml
@@ -1,6 +1,6 @@
-
+
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml b/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml
index 19993035..1c2d4e9d 100644
--- a/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml
+++ b/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml b/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml
index 30faa1ff..167af96e 100644
--- a/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml
+++ b/dram/resources/configs/memconfigs/fr_fcfs_unaware.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/memconfig.xml b/dram/resources/configs/memconfigs/memconfig.xml
index 19993035..1c2d4e9d 100644
--- a/dram/resources/configs/memconfigs/memconfig.xml
+++ b/dram/resources/configs/memconfigs/memconfig.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/par_bs.xml b/dram/resources/configs/memconfigs/par_bs.xml
index f2b95b02..cae1eb9a 100644
--- a/dram/resources/configs/memconfigs/par_bs.xml
+++ b/dram/resources/configs/memconfigs/par_bs.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/configs/memconfigs/par_bs_unaware.xml b/dram/resources/configs/memconfigs/par_bs_unaware.xml
index c4c2e70e..aed501d7 100644
--- a/dram/resources/configs/memconfigs/par_bs_unaware.xml
+++ b/dram/resources/configs/memconfigs/par_bs_unaware.xml
@@ -9,5 +9,7 @@
+
+
diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml
index e2b1f304..7dff121d 100644
--- a/dram/resources/simulations/sim-batch.xml
+++ b/dram/resources/simulations/sim-batch.xml
@@ -8,9 +8,10 @@
am_wideio.xml
- fifo.xml
+ par_bs.xml
+
@@ -18,14 +19,14 @@
chstone-aes_32.stl
-
- mediabench-h263decode_32.stl
+
+ chstone-motion.stl
-
- chstone-aes_32.stl
- mediabench-h263decode_32.stl
-
+
+ mediabench-fractal_32.stl
+ mediabench-epic_32.stl
+
diff --git a/dram/src/common/DebugManager.cpp b/dram/src/common/DebugManager.cpp
index a79c245d..9d65abc9 100644
--- a/dram/src/common/DebugManager.cpp
+++ b/dram/src/common/DebugManager.cpp
@@ -11,41 +11,34 @@ using namespace std;
void DebugManager::printDebugMessage(string sender, string message)
{
#ifndef NDEBUG
- if (whiteList.count(sender))
- {
- if (writeToConsole)
- cout << " at " << sc_time_stamp() << "\t in " << sender << "\t: " << message << endl;
+ if (whiteList.count(sender))
+ {
+ if (writeToConsole)
+ cout << " at " << sc_time_stamp() << "\t in " << sender << "\t: " << message << endl;
- if (writeToFile && debugFile)
- debugFile << " at " << sc_time_stamp() << " in " << sender << "\t: " << message << "\n";
- }
+ if (writeToFile && debugFile)
+ debugFile << " at " << sc_time_stamp() << " in " << sender << "\t: " << message << "\n";
+ }
#endif
}
void DebugManager::addToWhiteList(string sender)
{
- whiteList.insert(sender);
+ whiteList.insert(sender);
}
void DebugManager::addToWhiteList(vector senders)
{
- for (string sender : senders)
- addToWhiteList(sender);
+ for (string sender : senders)
+ addToWhiteList(sender);
}
DebugManager::DebugManager() :
- writeToConsole(true), writeToFile(true)
+ writeToConsole(true), writeToFile(true)
{
}
-void DebugManager::setDebugFile(std::string filename)
-{
- if(debugFile)
- debugFile.close();
- debugFile.open(filename);
-}
-
DebugManager::~DebugManager()
{
- debugFile.close();
+ debugFile.close();
}
diff --git a/dram/src/common/DebugManager.h b/dram/src/common/DebugManager.h
index e1d6f9cd..86c10258 100644
--- a/dram/src/common/DebugManager.h
+++ b/dram/src/common/DebugManager.h
@@ -15,32 +15,32 @@
class DebugManager
{
public:
- ~DebugManager();
- static inline DebugManager& getInstance()
- {
- static DebugManager manager;
- return manager;
- }
+ ~DebugManager();
+ static inline DebugManager& getInstance()
+ {
+ static DebugManager manager;
+ return manager;
+ }
- bool writeToConsole;
- bool writeToFile;
+ bool writeToConsole;
+ bool writeToFile;
- void printDebugMessage(std::string message, std::string sender);
-
- void addToWhiteList(std::string sender);
- void addToWhiteList(std::vector senders);
-
- void setDebugFile(std::string filename);
+ void printDebugMessage(std::string message, std::string sender);
+ void openDebugFile(std::string filename)
+ {
+ if(debugFile)
+ debugFile.close();
+ debugFile.open(filename);
+ }
+ void addToWhiteList(std::string sender);
+ void addToWhiteList(std::vector senders);
private:
+ DebugManager();
+ DebugManager(const DebugManager&){}
- ofstream debugFile;
-
- DebugManager();
- DebugManager(const DebugManager&){};
-
- std::set whiteList;
-
+ ofstream debugFile;
+ std::set whiteList;
};
#endif /* DEBUGMANAGER_H_ */
diff --git a/dram/src/common/TlmRecorder.cpp b/dram/src/common/TlmRecorder.cpp
index ba7f6614..56c2cee6 100644
--- a/dram/src/common/TlmRecorder.cpp
+++ b/dram/src/common/TlmRecorder.cpp
@@ -12,27 +12,30 @@ using namespace std;
string TlmRecorder::dbName = "";
string TlmRecorder::sqlScriptURI = "";
string TlmRecorder::senderName = "TlmRecorder";
-
+bool TlmRecorder::recordingEnabled = true;
// ------------- public -----------------------
TlmRecorder::TlmRecorder() :
transactionIDCounter(1), recordingEndTime(SC_ZERO_TIME)
{
- recordedData.reserve(transactionCommitRate);
- setUpTransactionTerminatingPhases();
- openDB(TlmRecorder::dbName.c_str());
- char * sErrMsg;
- sqlite3_exec(db, "PRAGMA main.page_size = 4096", NULL, NULL, &sErrMsg);
- sqlite3_exec(db, "PRAGMA main.cache_size=10000", NULL, NULL, &sErrMsg);
- sqlite3_exec(db, "PRAGMA main.locking_mode=EXCLUSIVE", NULL, NULL, &sErrMsg);
- sqlite3_exec(db, "PRAGMA main.synchronous=OFF", NULL, NULL, &sErrMsg);
- sqlite3_exec(db, "PRAGMA journal_mode = OFF", NULL, NULL, &sErrMsg);
+ if(recordingEnabled)
+ {
+ recordedData.reserve(transactionCommitRate);
+ setUpTransactionTerminatingPhases();
+ openDB(TlmRecorder::dbName.c_str());
+ char * sErrMsg;
+ sqlite3_exec(db, "PRAGMA main.page_size = 4096", NULL, NULL, &sErrMsg);
+ sqlite3_exec(db, "PRAGMA main.cache_size=10000", NULL, NULL, &sErrMsg);
+ sqlite3_exec(db, "PRAGMA main.locking_mode=EXCLUSIVE", NULL, NULL, &sErrMsg);
+ sqlite3_exec(db, "PRAGMA main.synchronous=OFF", NULL, NULL, &sErrMsg);
+ sqlite3_exec(db, "PRAGMA journal_mode = OFF", NULL, NULL, &sErrMsg);
- createTables(TlmRecorder::sqlScriptURI);
- prepareSqlStatements();
+ createTables(TlmRecorder::sqlScriptURI);
+ prepareSqlStatements();
- printDebugMessage("Starting new database transaction");
+ printDebugMessage("Starting new database transaction");
+ }
}
TlmRecorder::~TlmRecorder()
@@ -41,74 +44,61 @@ TlmRecorder::~TlmRecorder()
closeConnection();
}
-void TlmRecorder::recordDummy(tlm::tlm_generic_payload& trans)
-{
- // static unsigned int id = 0;
- // RecordingData data(id);
-
- // insertTransactionInDB(data,trans);
- // insertRangeInDB(id,SC_ZERO_TIME,SC_ZERO_TIME);
- // for(int i=0;i<5;i++)
- // {
- // string phaseName("Phase " + to_string(id));
- // sqlite3_bind_text(insertPhaseStatement, 1, phaseName.c_str(), phaseName.length(), 0);
- // sqlite3_bind_int64(insertPhaseStatement, 2, 0);
- // sqlite3_bind_int64(insertPhaseStatement, 3, 2);
- // sqlite3_bind_int(insertPhaseStatement, 4, id);
- // executeSqlStatement(insertPhaseStatement);
- // }
-
- // id++;
-}
-
void TlmRecorder::recordPhase(tlm::tlm_generic_payload& trans, tlm::tlm_phase phase, sc_time time)
{
- if (currentTransactionsInSystem.count(&trans) == 0)
- introduceNewTransactionToSystem(trans);
-
- string phaseName = phaseNameToString(phase);
- string phaseBeginPrefix = "BEGIN_";
- string phaseEndPrefix = "END_";
-
- if (phaseName.find(phaseBeginPrefix) != string::npos)
+ if(TlmRecorder::recordingEnabled)
{
- phaseName.erase(0, phaseBeginPrefix.length());
- assert(currentTransactionsInSystem.count(&trans) != 0);
- currentTransactionsInSystem[&trans].insertPhase(phaseName,time);
- }
- else
- {
- phaseName.erase(0, phaseEndPrefix.length());
- assert(currentTransactionsInSystem.count(&trans) != 0);
- currentTransactionsInSystem[&trans].setPhaseEnd(phaseName,time);
- }
+ if (currentTransactionsInSystem.count(&trans) == 0)
+ introduceTransactionSystem(trans);
- bool phaseTerminatesTransaction = count(transactionTerminatingPhases.begin(),
- transactionTerminatingPhases.end(), phase) == 1;
- if (phaseTerminatesTransaction)
- removeTransactionFromDBAndInsertInDB(trans);
+ string phaseName = phaseNameToString(phase);
+ string phaseBeginPrefix = "BEGIN_";
+ string phaseEndPrefix = "END_";
- recordingEndTime = time;
+ if (phaseName.find(phaseBeginPrefix) != string::npos)
+ {
+ phaseName.erase(0, phaseBeginPrefix.length());
+ assert(currentTransactionsInSystem.count(&trans) != 0);
+ currentTransactionsInSystem[&trans].insertPhase(phaseName,time);
+ }
+ else
+ {
+ phaseName.erase(0, phaseEndPrefix.length());
+ assert(currentTransactionsInSystem.count(&trans) != 0);
+ currentTransactionsInSystem[&trans].setPhaseEnd(phaseName,time);
+ }
+
+ bool phaseTerminatesTransaction = count(transactionTerminatingPhases.begin(),
+ transactionTerminatingPhases.end(), phase) == 1;
+ if (phaseTerminatesTransaction)
+ removeTransactionFromSystem(trans);
+
+ recordingEndTime = time;
+ }
}
void TlmRecorder::updateDataStrobe(const sc_time& begin,const sc_time& end, tlm::tlm_generic_payload& trans)
{
- assert(currentTransactionsInSystem.count(&trans) != 0);
- currentTransactionsInSystem[&trans].timeOnDataStrobe.start = begin;
- currentTransactionsInSystem[&trans].timeOnDataStrobe.end = end;
+ if(TlmRecorder::recordingEnabled)
+ {
+ assert(currentTransactionsInSystem.count(&trans) != 0);
+ currentTransactionsInSystem[&trans].timeOnDataStrobe.start = begin;
+ currentTransactionsInSystem[&trans].timeOnDataStrobe.end = end;
+ }
}
void TlmRecorder::recordDebugMessage(std::string message, sc_time time)
{
- insertDebugMessageInDB(message, time);
+ if(TlmRecorder::recordingEnabled)
+ insertDebugMessageInDB(message, time);
}
// ------------- internal -----------------------
-void TlmRecorder::introduceNewTransactionToSystem(tlm::tlm_generic_payload& trans)
+void TlmRecorder::introduceTransactionSystem(tlm::tlm_generic_payload& trans)
{
unsigned int id = transactionIDCounter++;
currentTransactionsInSystem[&trans].id = id;
@@ -130,7 +120,7 @@ void TlmRecorder::introduceNewTransactionToSystem(tlm::tlm_generic_payload& tran
}
}
-void TlmRecorder::removeTransactionFromDBAndInsertInDB(tlm::tlm_generic_payload& trans)
+void TlmRecorder::removeTransactionFromSystem(tlm::tlm_generic_payload& trans)
{
assert(currentTransactionsInSystem.count(&trans) != 0);
@@ -324,12 +314,15 @@ void TlmRecorder::printDebugMessage(std::string message)
void TlmRecorder::closeConnection()
{
- commitRecordedDataToDB();
- insertGeneralInfo();
- printDebugMessage(
- "Number of transactions written to DB: " + std::to_string(transactionIDCounter - 1));
- printDebugMessage("tlmPhaseRecorder:\tEnd Recording");
- sqlite3_close(db);
- db = NULL;
+ if(TlmRecorder::recordingEnabled)
+ {
+ commitRecordedDataToDB();
+ insertGeneralInfo();
+ printDebugMessage(
+ "Number of transactions written to DB: " + std::to_string(transactionIDCounter - 1));
+ printDebugMessage("tlmPhaseRecorder:\tEnd Recording");
+ sqlite3_close(db);
+ db = NULL;
+ }
}
diff --git a/dram/src/common/TlmRecorder.h b/dram/src/common/TlmRecorder.h
index 70dad21b..3a4e83bf 100755
--- a/dram/src/common/TlmRecorder.h
+++ b/dram/src/common/TlmRecorder.h
@@ -24,6 +24,7 @@ public:
static std::string sqlScriptURI;
static std::string dbName;
static std::string senderName;
+ static bool recordingEnabled;
static inline TlmRecorder& getInstance()
{
@@ -31,14 +32,14 @@ public:
return decoder;
}
- void recordDummy(tlm::tlm_generic_payload& trans);
+ void recordMemconfig(string memconfig){this->memconfig = memconfig;}
+ void recordMemspec(string memspec){this->memspec = memspec;}
+ void recordTracenames(string traces){this->traces = traces;}
+
void recordPhase(tlm::tlm_generic_payload &trans, tlm::tlm_phase phase, sc_time time);
void recordDebugMessage(std::string message, sc_time time);
void updateDataStrobe(const sc_time& begin, const sc_time& end, tlm::tlm_generic_payload& trans);
void closeConnection();
- void recordMemconfig(string memconfig){this->memconfig = memconfig;}
- void recordMemspec(string memspec){this->memspec = memspec;}
- void recordTracenames(string traces){this->traces = traces;}
private:
@@ -64,7 +65,6 @@ private:
void insertPhase(string name,sc_time begin);
void setPhaseEnd(string name,sc_time end);
-
};
std::string memconfig,memspec,traces;
@@ -80,8 +80,8 @@ private:
void createTables(std::string pathToURI);
void setUpTransactionTerminatingPhases();
- void introduceNewTransactionToSystem(tlm::tlm_generic_payload& trans);
- void removeTransactionFromDBAndInsertInDB(tlm::tlm_generic_payload& trans);
+ void introduceTransactionSystem(tlm::tlm_generic_payload& trans);
+ void removeTransactionFromSystem(tlm::tlm_generic_payload& trans);
void commitRecordedDataToDB();
void insertGeneralInfo();
diff --git a/dram/src/common/dramExtension.h b/dram/src/common/dramExtension.h
index ef308e2b..526d659f 100644
--- a/dram/src/common/dramExtension.h
+++ b/dram/src/common/dramExtension.h
@@ -61,7 +61,7 @@ private:
class Bank
{
public:
- explicit Bank(unsigned int id) :
+ Bank(unsigned int id) :
id(id)
{
}
diff --git a/dram/src/common/libDRAMPower.cpp b/dram/src/common/libDRAMPower.cpp
index 8a6ae82b..951855d4 100644
--- a/dram/src/common/libDRAMPower.cpp
+++ b/dram/src/common/libDRAMPower.cpp
@@ -1,5 +1,5 @@
-#include "libdrampower.h"
+//#include "libdrampower.h"
-libDRAMPower::libDRAMPower()
-{
-}
+//libDRAMPower::libDRAMPower()
+//{
+//}
diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h
index 20e347b5..90f7f5fc 100644
--- a/dram/src/controller/Controller.h
+++ b/dram/src/controller/Controller.h
@@ -8,16 +8,10 @@
#ifndef CONTROLLERWRAPPER_H_
#define CONTROLLERWRAPPER_H_
-//#include
-//#include
-//#include
-//#include
-//#include
#include