Initial setup for SMS implementation

# Explain what has been changed

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources
This commit is contained in:
Thanh C. Tran
2017-02-23 16:22:44 +01:00
parent 1d6ebb6223
commit 4ed7ff420b
9 changed files with 71 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
<mcconfig>
<BankwiseLogic value="0"/>
<OpenPagePolicy value="1" />
<MaxNrOfTransactions value="8" />
<Scheduler value="SMS" />
<SJFProbability value="100" />
<Capsize value="5" />
<PowerDownMode value="NoPowerDown" /> <!-- 4 Modes: NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF -->
<PowerDownTimeout value="100" />
<!-- Error Modelling -->
<ErrorChipSeed value="42" />
<ErrorCSVFile value="../../DRAMSys/simulator/src/error/error.csv" />
<!-- Modes: NoStorage, Store (store data without errormodel), ErrorModel (store data with errormodel) -->
<StoreMode value="NoStorage" />
</mcconfig>

View File

@@ -2,7 +2,7 @@
<!-- General Simulator Configuration (used for all simulation setups) -->
<simconfig>
<Debug value="0" />
<DatabaseRecording value="0" />
<DatabaseRecording value="1" />
<PowerAnalysis value="0" />
<EnableWindowing value = "0" />
<WindowSize value="1000" />
@@ -39,11 +39,11 @@
</addressmappings>
<mcconfigs>
<mcconfig src="../../DRAMSys/simulator/resources/configs/mcconfigs/fifoStrict.xml"/>
<mcconfig src="../../DRAMSys/simulator/resources/configs/mcconfigs/sms.xml"/>
</mcconfigs>
<tracesetups>
<tracesetup id="fifo">
<tracesetup id="sms">
<device clkMhz="200">chstone-adpcm_32.stl</device>
</tracesetup>
</tracesetups>

View File

@@ -107,7 +107,8 @@ SOURCES += \
src/controller/Controller.cpp \
src/simulation/TracePlayer.cpp \
src/simulation/StlPlayer.cpp \
src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp
src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp \
src/controller/scheduler/SMS.cpp
HEADERS += \
src/common/third_party/tinyxml2/tinyxml2.h \
@@ -169,7 +170,8 @@ HEADERS += \
src/controller/core/configuration/ConfigurationLoader.h \
src/error/errormodel.h \
src/simulation/ExampleInitiator.h \
src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h
src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h \
src/controller/scheduler/SMS.h
thermalsim = $$(THERMALSIM)
isEmpty(thermalsim) {

View File

@@ -53,6 +53,10 @@ void Controller::buildScheduler()
{
scheduler = new FR_FCFS(*controllerCore);
}
else if (selectedScheduler == "SMS")
{
scheduler = new SMS(*controllerCore, Configuration::getInstance().SJFProbability);
}
//else if (selectedScheduler == "PAR_BS")
//{
// scheduler = new PAR_BS(*controllerCore,Configuration::getInstance().RefreshAwareScheduling,

View File

@@ -67,6 +67,7 @@
#include "scheduler/Fifo.h"
#include "scheduler/FifoStrict.h"
#include "scheduler/Fr_Fcfs.h"
#include "scheduler/SMS.h"
#include "scheduler/IScheduler.h"
using namespace std;

View File

@@ -121,6 +121,12 @@ void Configuration::setParameter(std::string name, std::string value)
MaxNrOfTransactions = string2int(value);
else if(name == "Scheduler")
Scheduler = value;
else if(name == "SJFProbability")
if (string2int(value) > 100 || string2int(value) < 0) {
SC_REPORT_FATAL("Configuration", ("Invalid value for parameter " + name + ". This parameter must be between 0 and 100.").c_str());
} else {
SJFProbability = string2int(value);
}
else if(name == "Capsize")
Capsize = string2int(value);
else if(name == "PowerDownTimeout")

View File

@@ -66,6 +66,7 @@ struct Configuration
bool OpenPagePolicy = true;
unsigned int MaxNrOfTransactions = 8;
std::string Scheduler;
unsigned int SJFProbability;
unsigned int Capsize = 5;
sc_time getPowerDownTimeout(){return powerDownTimeoutInClk*memSpec.clk;}
EPowerDownMode PowerDownMode = EPowerDownMode::Staggered;

View File

@@ -0,0 +1,13 @@
#include "SMS.h"
using namespace std;
void SMS::schedule (gp *payload)
{
buffer[DramExtension::getExtension(payload).getThread()].emplace_back(payload);
}
std::pair<Command, gp*> SMS::getNextRequest(Bank bank)
{
return pair<Command, tlm::tlm_generic_payload*>(Command::NOP, NULL);
}

View File

@@ -0,0 +1,24 @@
#ifndef SMS_H
#define SMS_H
#include "IScheduler.h"
#include "../core/ControllerCore.h"
#include "../core/configuration/Configuration.h"
#include "../../common/dramExtension.h"
using namespace std;
class SMS: public sc_module, public IScheduler
{
public:
SMS(ControllerCore &controllerCore, unsigned int SJFprobability) : IScheduler(controllerCore), SJFprobability(SJFprobability){}
virtual ~SMS(){}
virtual void schedule(gp *payload) override;
virtual std::pair<Command, gp*> getNextRequest(Bank bank) override;
private:
std::map<Thread, std::deque<gp*>> buffer;
unsigned int SJFprobability;
};
#endif // SMS_H