diff --git a/dram/dramSys/dramSys.pro b/dram/dramSys/dramSys.pro
index 78ebe06a..1b3163b3 100644
--- a/dram/dramSys/dramSys.pro
+++ b/dram/dramSys/dramSys.pro
@@ -15,7 +15,7 @@ LIBS += -L../src/common/third_party/DRAMPower/src/ -ldrampower
INCLUDEPATH += /opt/systemc/include
INCLUDEPATH += /opt/boost/include
INCLUDEPATH += /opt/sqlite3/include
-INCLUDEPATH += /opt/xerces-c-3.1.1/include
+INCLUDEPATH += /opt/xerces/include
INCLUDEPATH += ../src/common/third_party/DRAMPower/src
INCLUDEPATH += ../src/common/third_party/DRAMPower/src/libdrampower
@@ -79,7 +79,6 @@ HEADERS += \
../src/common/protocol.h \
../src/common/dramExtension.h \
../src/common/DebugManager.h \
- ../src/controller/core/configuration/TimingConfiguration.h \
../src/controller/core/configuration/MemSpecLoader.h \
../src/controller/core/configuration/Configuration.h \
../src/controller/core/powerdown/PowerDownManagerTimeout.h \
@@ -123,5 +122,6 @@ HEADERS += \
../src/common/libDRAMPower.h \
../src/controller/core/RowBufferStates.h \
../src/controller/scheduler/readwritegrouper.h \
- ../src/simulation/ReorderBuffer.h
+ ../src/simulation/ReorderBuffer.h \
+ ../src/controller/core/configuration/MemSpec.h
diff --git a/dram/resources/simulations/sim-batch.xml b/dram/resources/simulations/sim-batch.xml
index 516578e6..3e19862c 100644
--- a/dram/resources/simulations/sim-batch.xml
+++ b/dram/resources/simulations/sim-batch.xml
@@ -5,7 +5,7 @@
grouper.xml
+ --> fr_fcfs.xml
diff --git a/dram/src/common/TlmRecorder.cpp b/dram/src/common/TlmRecorder.cpp
index 7e2d3821..d1ebd6ba 100644
--- a/dram/src/common/TlmRecorder.cpp
+++ b/dram/src/common/TlmRecorder.cpp
@@ -240,8 +240,8 @@ void TlmRecorder::insertGeneralInfo()
sqlite3_bind_int64(insertGeneralInfoStatement, 1, totalNumTransactions - 1);
sqlite3_bind_int64(insertGeneralInfoStatement, 2, simulationTimeCoveredByRecording.value());
sqlite3_bind_int(insertGeneralInfoStatement, 3,
- core::Configuration::getInstance().NumberOfBanks);
- sqlite3_bind_int(insertGeneralInfoStatement, 4, core::Configuration::getInstance().Timings.clk.value());
+ core::Configuration::getInstance().memSpec.NumberOfBanks);
+ sqlite3_bind_int(insertGeneralInfoStatement, 4, core::Configuration::getInstance().memSpec.clk.value());
sqlite3_bind_text(insertGeneralInfoStatement, 5, "PS", 2, NULL);
sqlite3_bind_text(insertGeneralInfoStatement, 6, memconfig.c_str(), memconfig.length(), NULL);
sqlite3_bind_text(insertGeneralInfoStatement, 7, memspec.c_str(), memspec.length(), NULL);
diff --git a/dram/src/common/dramExtension.cpp b/dram/src/common/dramExtension.cpp
index 0d465db5..ca2dce48 100644
--- a/dram/src/common/dramExtension.cpp
+++ b/dram/src/common/dramExtension.cpp
@@ -184,7 +184,7 @@ bool operator !=(const Row& lhs, const Row& rhs)
const Row Row::operator ++()
{
- id = (id + 1) % core::Configuration::getInstance().NumberOfRows;
+ id = (id + 1) % core::Configuration::getInstance().memSpec.NumberOfRows;
return *this;
}
diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h
index e40f8ade..b08a835d 100644
--- a/dram/src/controller/Controller.h
+++ b/dram/src/controller/Controller.h
@@ -23,7 +23,7 @@
#include "../common/TlmRecorder.h"
#include "../common/Utils.h"
#include "core/configuration/Configuration.h"
-#include "core/configuration/TimingConfiguration.h"
+#include "core/configuration/MemSpec.h"
#include "core/Command.h"
#include "core/ControllerCore.h"
#include "core/ControllerState.h"
@@ -310,12 +310,12 @@ tlm_sync_enum Controller::nb_transport_fw(tlm_generic_payload &payload
{
TlmRecorder::getInstance().recordPhase(payload, phase, fwDelay + sc_time_stamp());
frontendPEQ.notify(payload, phase,
- clkAlign(sc_time_stamp() + fwDelay) - (sc_time_stamp() + fwDelay) + Configuration::getInstance().Timings.clk);
+ clkAlign(sc_time_stamp() + fwDelay) - (sc_time_stamp() + fwDelay) + Configuration::getInstance().memSpec.clk);
}
else if (phase == END_RESP)
{
TlmRecorder::getInstance().recordPhase(payload, phase,
- fwDelay + sc_time_stamp() + Configuration::getInstance().Timings.clk);
+ fwDelay + sc_time_stamp() + Configuration::getInstance().memSpec.clk);
frontendPEQ.notify(payload, phase, clkAlign(sc_time_stamp() + fwDelay) - (sc_time_stamp() + fwDelay));
}
return TLM_ACCEPTED;
diff --git a/dram/src/controller/core/ControllerCore.cpp b/dram/src/controller/core/ControllerCore.cpp
index 7d41ed0a..6e73f2f3 100644
--- a/dram/src/controller/core/ControllerCore.cpp
+++ b/dram/src/controller/core/ControllerCore.cpp
@@ -166,7 +166,7 @@ const std::vector& ControllerCore::getBanks()
if (banks.size() == 0)
{
- for (unsigned int i = 0; i < config.NumberOfBanks; i++)
+ for (unsigned int i = 0; i < config.memSpec.NumberOfBanks; i++)
{
banks.push_back(Bank(i));
}
diff --git a/dram/src/controller/core/ControllerState.cpp b/dram/src/controller/core/ControllerState.cpp
index 45562eb6..95816fd5 100644
--- a/dram/src/controller/core/ControllerState.cpp
+++ b/dram/src/controller/core/ControllerState.cpp
@@ -20,7 +20,7 @@ const ScheduledCommand ControllerState::getLastCommand(Command command)
{
ScheduledCommand max;
- for (unsigned int i = 0; i < config->NumberOfBanks; ++i)
+ for (unsigned int i = 0; i < config->memSpec.NumberOfBanks; ++i)
{
ScheduledCommand current = getLastCommand(command, Bank(i));
if (current.getStart() > max.getStart())
@@ -36,7 +36,7 @@ const ScheduledCommand ControllerState::getLastScheduledCommand()
for(Command cmd : getAllCommands())
{
- for(Bank bank : Configuration::getInstance().getBanks())
+ for(Bank bank : Configuration::getInstance().memSpec.getBanks())
{
ScheduledCommand& current = lastScheduledByCommandAndBank[cmd][bank];
if (current.getStart() > lastCommand.getStart())
@@ -109,12 +109,12 @@ void ControllerState::cleanUp(sc_time time)
vector tmp;
for(ScheduledCommand& command: lastDataStrobeCommands)
{
- if(command.getEnd() >= time || getDistance(command.getEnd(), time) <= config->Timings.tDataStrobeHistory())
+ if(command.getEnd() >= time || getDistance(command.getEnd(), time) <= config->memSpec.tDataStrobeHistory())
tmp.push_back(command);
}
lastDataStrobeCommands = tmp;
- if(time >= config->Timings.tActHistory())
- lastActivates.erase(lastActivates.begin(), lastActivates.lower_bound(time - config->Timings.tActHistory()));
+ if(time >= config->memSpec.tActHistory())
+ lastActivates.erase(lastActivates.begin(), lastActivates.lower_bound(time - config->memSpec.tActHistory()));
}
} /* namespace controller */
diff --git a/dram/src/controller/core/ControllerState.h b/dram/src/controller/core/ControllerState.h
index e683aa9d..83702d50 100644
--- a/dram/src/controller/core/ControllerState.h
+++ b/dram/src/controller/core/ControllerState.h
@@ -23,7 +23,7 @@ class ControllerState
{
public:
ControllerState(Configuration* config) :
- rowBufferStates(), bus(config->Timings.clk), config(config)
+ rowBufferStates(), bus(config->memSpec.clk), config(config)
{
}
virtual ~ControllerState()
diff --git a/dram/src/controller/core/RowBufferStates.cpp b/dram/src/controller/core/RowBufferStates.cpp
index 7202288c..d77186db 100644
--- a/dram/src/controller/core/RowBufferStates.cpp
+++ b/dram/src/controller/core/RowBufferStates.cpp
@@ -48,7 +48,7 @@ void RowBufferState::closeRowBuffer(Bank bank)
bool RowBufferState::allRowBuffersAreClosed() const
{
- for(unsigned int i=0; i& Configuration::getBanks() const
-{
- static std::vector banks;
- if (banks.size() == 0)
- {
- for (unsigned int i = 0; i < NumberOfBanks; i++)
- {
- banks.push_back(Bank(i));
- }
- }
-
- return banks;
-}
-
} /* namespace core */
diff --git a/dram/src/controller/core/configuration/Configuration.h b/dram/src/controller/core/configuration/Configuration.h
index 25709dca..feefaf3b 100644
--- a/dram/src/controller/core/configuration/Configuration.h
+++ b/dram/src/controller/core/configuration/Configuration.h
@@ -10,7 +10,7 @@
#include
#include
-#include "TimingConfiguration.h"
+#include "MemSpec.h"
namespace core{
@@ -30,35 +30,21 @@ struct Configuration
}
//MemConfiguration
- bool BankwiseLogic;
- bool OpenPagePolicy;
- bool AdaptiveOpenPagePolicy;
- bool RefreshAwareScheduling;
- unsigned int MaxNrOfTransactions;
+ bool BankwiseLogic = false;
+ bool OpenPagePolicy = true;
+ bool AdaptiveOpenPagePolicy = false;
+ bool RefreshAwareScheduling = false;
+ unsigned int MaxNrOfTransactions = 50;
std::string Scheduler;
- unsigned int Capsize;
-
- bool databaseRecordingEnabled;
- //MemSpecification
- std::string MemoryId;
- std::string MemoryType;
-
- unsigned int NumberOfBanks;
- unsigned int NumberOfBankGroups;
- unsigned int BurstLength;
- unsigned int nActivate;
- unsigned int DataRate;
- unsigned int NumberOfRows;
- bool recordingIsEnabled;
-
- // Powerdown Mode
- sc_time powerDownTimeout;
+ unsigned int Capsize = 5;
+ sc_time powerDownTimeout = 3*memSpec.clk;
PowerDownMode powerDownMode;
- //MemTimings
- TimingConfiguration Timings;
+ //Memory Specification (from DRAM Power XML)
+ MemSpec memSpec;
- const std::vector& getBanks() const;
+ //Simulation Configuration
+ bool databaseRecordingEnabled = true;
private:
Configuration();
diff --git a/dram/src/controller/core/configuration/TimingConfiguration.h b/dram/src/controller/core/configuration/MemSpec.h
similarity index 73%
rename from dram/src/controller/core/configuration/TimingConfiguration.h
rename to dram/src/controller/core/configuration/MemSpec.h
index cb080c94..9a47ce35 100644
--- a/dram/src/controller/core/configuration/TimingConfiguration.h
+++ b/dram/src/controller/core/configuration/MemSpec.h
@@ -1,12 +1,12 @@
/*
- * TimingConfiguration.h
+ * MemSpec.h
*
* Created on: Mar 6, 2014
* Author: jonny
*/
-#ifndef TIMINGS_H_
-#define TIMINGS_H_
+#ifndef MemSpec_H_
+#define MemSpec_H_
#include
#include