Included RefreshManagerIF and RefreshManagerDummy to disable refresh.

This commit is contained in:
Lukas Steiner (2)
2019-08-09 13:39:02 +02:00
parent 1bd322e576
commit 2e40894097
10 changed files with 215 additions and 26 deletions

View File

@@ -157,7 +157,8 @@ SOURCES += \
src/controller/cmdmux/CmdMuxOldest.cpp \
src/controller/ControllerRecordable.cpp \
src/controller/checker/CheckerDDR3.cpp \
src/controller/RefreshManager.cpp
src/controller/refresh/RefreshManager.cpp \
src/controller/refresh/RefreshManagerDummy.cpp
HEADERS += \
src/common/third_party/tinyxml2/tinyxml2.h \
@@ -251,7 +252,9 @@ HEADERS += \
src/controller/ControllerRecordable.h \
src/controller/checker/CheckerIF.h \
src/controller/checker/CheckerDDR3.h \
src/controller/RefreshManager.h
src/controller/refresh/RefreshManagerIF.h \
src/controller/refresh/RefreshManager.h \
src/controller/refresh/RefreshManagerDummy.h
#src/common/third_party/json/include/nlohmann/json.hpp \
thermalsim = $$(THERMALSIM)

View File

@@ -43,7 +43,8 @@
#include "../common/protocol.h"
#include "core/scheduling/ScheduledCommand.h"
#include "checker/CheckerDDR3.h"
#include "RefreshManager.h"
#include "refresh/RefreshManager.h"
#include "refresh/RefreshManagerDummy.h"
ControllerNew::ControllerNew(sc_module_name name) :
GenericController(name)
@@ -52,13 +53,30 @@ ControllerNew::ControllerNew(sc_module_name name) :
sensitive << triggerEvent << triggerEventQueue;
dont_initialize();
Configuration config = Configuration::getInstance();
checker = new CheckerDDR3();
refreshManager = new RefreshManager();
triggerEventQueue.notify(refreshManager->getInitialDelay());
scheduler = new SchedulerFifo();
if (config.ControllerCoreRefDisable)
refreshManager = new RefreshManagerDummy();
else
{
refreshManager = new RefreshManager();
triggerEventQueue.notify(refreshManager->getInitialDelay());
}
if (config.Scheduler == "FifoStrict")
{
scheduler = new SchedulerFifo();
commandMux = new CmdMuxStrict();
}
else if (config.Scheduler == "FrFcfs")
{
scheduler = new SchedulerFrFcfs();
commandMux = new CmdMuxOldest();
}
else
SC_REPORT_FATAL("ControllerNew", "Selected scheduler not supported");
for (unsigned bankID = 0; bankID < Configuration::getInstance().memSpec->NumberOfBanks; bankID++)
bankMachines[Bank(bankID)] = new BankMachine(scheduler, checker, Bank(bankID));
commandMux = new CmdMuxStrict();
startBandwidthIdleCollector();
}

View File

@@ -50,7 +50,7 @@
#include "scheduler/SchedulerIF.h"
#include "../common/DebugManager.h"
#include "checker/CheckerIF.h"
#include "RefreshManager.h"
#include "refresh/RefreshManagerIF.h"
using namespace tlm;
@@ -84,7 +84,7 @@ private:
CmdMuxIF *commandMux;
SchedulerIF *scheduler;
CheckerIF *checker;
RefreshManager *refreshManager;
RefreshManagerIF *refreshManager;
void releasePayload();
void acquirePayload();

View File

@@ -34,6 +34,25 @@
#include "CheckerDDR3.h"
CheckerDDR3::CheckerDDR3()
{
Configuration config = Configuration::getInstance();
memSpec = dynamic_cast<MemSpecDDR3 *>(config.memSpec);
if (memSpec == nullptr)
SC_REPORT_FATAL("CheckerDDR3", "Wrong MemSpec chosen");
if (config.ControllerCoreRefDisable)
{
timeForNextREFA = sc_max_time();
timeForNextPREA = sc_max_time();
}
else
{
timeForNextREFA = memSpec->tREFI;
timeForNextPREA = timeForNextREFA - memSpec->tRP;
}
}
sc_time CheckerDDR3::delayToSatisfyConstraints(Command command, Bank bank)
{
ScheduledCommand lastCommand;

View File

@@ -43,16 +43,7 @@
class CheckerDDR3 final : public CheckerIF
{
public:
CheckerDDR3()
{
memSpec = dynamic_cast<MemSpecDDR3 *>(Configuration::getInstance().memSpec);
if (memSpec == nullptr)
SC_REPORT_FATAL("CheckerDDR3", "Wrong MemSpec chosen");
timeForNextREFA = memSpec->tREFI;
timeForNextPREA = timeForNextREFA - memSpec->tRP;
}
CheckerDDR3();
sc_time delayToSatisfyConstraints(Command, Bank);
void insert(const ScheduledCommand &);

View File

@@ -33,8 +33,8 @@
*/
#include "RefreshManager.h"
#include "../common/dramExtensions.h"
#include "core/configuration/Configuration.h"
#include "../../common/dramExtensions.h"
#include "../core/configuration/Configuration.h"
RefreshManager::RefreshManager()
{
@@ -79,5 +79,3 @@ sc_time RefreshManager::getInitialDelay()
{
return timeForNextPREA;
}

View File

@@ -38,8 +38,9 @@
#include <systemc.h>
#include <tlm.h>
#include <utility>
#include "Command.h"
#include "core/configuration/MemSpec.h"
#include "RefreshManagerIF.h"
#include "../Command.h"
#include "../core/configuration/MemSpec.h"
using namespace tlm;
@@ -49,7 +50,7 @@ enum class RmState
REFRESHING
};
class RefreshManager
class RefreshManager final : public RefreshManagerIF
{
public:
RefreshManager();

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Lukas Steiner
*/
#include "RefreshManagerDummy.h"
std::pair<Command, tlm_generic_payload *> RefreshManagerDummy::getNextCommand()
{
return std::pair<Command, tlm_generic_payload *>(Command::NOP, nullptr);
}
sc_time RefreshManagerDummy::updateState()
{
return SC_ZERO_TIME;
}
sc_time RefreshManagerDummy::getInitialDelay()
{
return SC_ZERO_TIME;
}

View File

@@ -0,0 +1,54 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Lukas Steiner
*/
#ifndef REFRESHMANAGERDUMMY_H
#define REFRESHMANAGERDUMMY_H
#include <systemc.h>
#include <tlm.h>
#include <utility>
#include "RefreshManagerIF.h"
#include "../Command.h"
using namespace tlm;
class RefreshManagerDummy final : public RefreshManagerIF
{
public:
std::pair<Command, tlm_generic_payload *> getNextCommand();
sc_time updateState();
sc_time getInitialDelay();
};
#endif // REFRESHMANAGERDUMMY_H

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 2019, University of Kaiserslautern
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Lukas Steiner
*/
#ifndef REFRESHMANAGERIF_H
#define REFRESHMANAGERIF_H
#include <systemc.h>
#include <tlm.h>
#include <utility>
#include "../Command.h"
using namespace tlm;
class RefreshManagerIF
{
public:
virtual ~RefreshManagerIF() {}
virtual std::pair<Command, tlm_generic_payload *> getNextCommand() = 0;
virtual sc_time updateState() = 0;
virtual sc_time getInitialDelay() = 0;
};
#endif // REFRESHMANAGERIF_H