diff --git a/DRAMSys/library/library.pro b/DRAMSys/library/library.pro index 917ee599..36c5861b 100644 --- a/DRAMSys/library/library.pro +++ b/DRAMSys/library/library.pro @@ -151,7 +151,7 @@ SOURCES += \ src/simulation/dram/DramGDDR5.cpp \ src/simulation/dram/DramGDDR5X.cpp \ src/simulation/dram/DramGDDR6.cpp \ - src/controller/powerdown/PowerDownManager.cpp \ + src/controller/powerdown/PowerDownManagerStaggered.cpp \ src/controller/powerdown/PowerDownManagerDummy.cpp HEADERS += \ @@ -236,7 +236,7 @@ HEADERS += \ src/simulation/dram/DramGDDR5.h \ src/simulation/dram/DramGDDR5X.h \ src/simulation/dram/DramGDDR6.h \ - src/controller/powerdown/PowerDownManager.h \ + src/controller/powerdown/PowerDownManagerStaggered.h \ src/controller/powerdown/PowerDownManagerIF.h \ src/controller/powerdown/PowerDownManagerDummy.h #src/common/third_party/json/include/nlohmann/json.hpp \ diff --git a/DRAMSys/library/src/controller/Controller.cpp b/DRAMSys/library/src/controller/Controller.cpp index 0a63fa41..b097d268 100644 --- a/DRAMSys/library/src/controller/Controller.cpp +++ b/DRAMSys/library/src/controller/Controller.cpp @@ -53,7 +53,7 @@ #include "refresh/RefreshManager.h" #include "refresh/RefreshManagerDummy.h" #include "refresh/RefreshManagerBankwise.h" -#include "powerdown/PowerDownManager.h" +#include "powerdown/PowerDownManagerStaggered.h" #include "powerdown/PowerDownManagerDummy.h" Controller::Controller(sc_module_name name) : @@ -151,7 +151,7 @@ Controller::Controller(sc_module_name name) : { for (unsigned rankID = 0; rankID < memSpec->NumberOfRanks; rankID++) { - PowerDownManagerIF *manager = new PowerDownManager(Rank(rankID), checker); + PowerDownManagerIF *manager = new PowerDownManagerStaggered(Rank(rankID), checker); powerDownManagers.push_back(manager); manager->triggerEntry(TriggerSource::Controller); controllerEvent.notify(manager->start()); diff --git a/DRAMSys/library/src/controller/Controller.h b/DRAMSys/library/src/controller/Controller.h index ed04c5e9..02a93b92 100644 --- a/DRAMSys/library/src/controller/Controller.h +++ b/DRAMSys/library/src/controller/Controller.h @@ -56,7 +56,7 @@ using namespace tlm; class BankMachine; class SchedulerIF; -class PowerDownManager; +class PowerDownManagerStaggered; class Controller : public GenericController { diff --git a/DRAMSys/library/src/controller/core/powerdown/IPowerDownManager.h b/DRAMSys/library/src/controller/core/powerdown/IPowerDownManager.h deleted file mode 100644 index 047cb407..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/IPowerDownManager.h +++ /dev/null @@ -1,129 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Matthias Jung -// */ - -//#ifndef IPOWERDOWNMANAGER_H -//#define IPOWERDOWNMANAGER_H - -//#include -//#include "../../../common/dramExtensions.h" -//#include "../../Command.h" - - -//enum class PowerDownState { -// Awake, AwakeForRefresh, PDNActive, PDNPrecharge, PDNSelfRefresh -//}; - -//class IPowerDownManager -//{ -//public: -// virtual ~IPowerDownManager() {} - -// virtual void sleep(Bank bank, sc_time time) = 0; -// virtual void triggerSleep(Bank bank, sc_time time) = 0; - -// virtual void wakeUp(Bank bank, sc_time time) = 0; -// virtual void wakeUpForRefresh(Bank bank, sc_time time) = 0; - -// virtual bool isInSelfRefresh(Bank bank) = 0; - -//protected: -// Command getSleepCommand(PowerDownState state); -// Command getWakeUpCommand(PowerDownState state); - -//}; - -//inline Command IPowerDownManager::getSleepCommand(PowerDownState state) -//{ -// Command cmd(Command::NOP); -// switch (state) { -// case PowerDownState::PDNActive: -// cmd = Command::PDEA; -// break; -// case PowerDownState::PDNPrecharge: -// cmd = Command::PDEP; -// break; -// case PowerDownState::PDNSelfRefresh: -// cmd = Command::SREFEN; -// break; -// default: -// SC_REPORT_FATAL("In PowerDownManager sendPowerdownBegin", -// "invalid powerDownState"); -// break; -// } -// return cmd; -//} - -//inline Command IPowerDownManager::getWakeUpCommand(PowerDownState state) - -//{ -// Command cmd(Command::NOP); -// switch (state) { -// case PowerDownState::PDNActive: -// cmd = Command::PDXA; -// break; -// case PowerDownState::PDNPrecharge: -// cmd = Command::PDXP; -// break; -// case PowerDownState::PDNSelfRefresh: -// cmd = Command::SREFEX; -// break; -// default: -// SC_REPORT_FATAL("In PowerDownManager sendPowerdownEnd", -// "invalid powerDownState"); -// } -// return cmd; -//} - -//inline std::string powerDownStateToString(PowerDownState powerDownState) -//{ -// switch (powerDownState) { -// case PowerDownState::Awake: -// return "Awake"; -// case PowerDownState::AwakeForRefresh: -// return "Awake for refresh"; -// case PowerDownState::PDNActive: -// return "PDN Active"; -// case PowerDownState::PDNPrecharge: -// return "PDN Precharged"; -// case PowerDownState::PDNSelfRefresh: -// return "PDN Self refresh"; -// default: -// return "unknown state"; -// } -//} - - -//#endif // IPOWERDOWNMANAGER_H diff --git a/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.cpp b/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.cpp deleted file mode 100644 index 97c8bd30..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// */ - -//#include "NoPowerDown.h" - -//void NoPowerDown::triggerSleep(Bank /*bank*/, sc_time /*time*/) -//{ -// return; -//} - -//void NoPowerDown::sleep(Bank /*bank*/, sc_time /*time*/) -//{ -// return; -//} - -//void NoPowerDown::wakeUp(Bank /*bank*/, sc_time /*time*/) -//{ -// return; -//} - -//void NoPowerDown::wakeUpForRefresh(Bank /*bank*/, sc_time /*time*/) -//{ -// return; -//} - -//bool NoPowerDown::isInSelfRefresh(Bank /*bank*/) -//{ -// return false; -//} diff --git a/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.h b/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.h deleted file mode 100644 index 4dd70adc..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/NoPowerDown.h +++ /dev/null @@ -1,65 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// */ - -//#ifndef NOPOWERDOWN_H -//#define NOPOWERDOWN_H - -//#include "PowerDownManager.h" -//#include -//#include "../../../common/dramExtensions.h" -//#include "../scheduling/ScheduledCommand.h" - - - -//class NoPowerDown : public IPowerDownManager -//{ -//public: -// NoPowerDown() {} -// virtual ~NoPowerDown() {} - -// virtual void triggerSleep(Bank bank, sc_time time) override; -// virtual void sleep(Bank bank, sc_time time) override; - -// virtual void wakeUp(Bank bank, sc_time time) override; -// virtual void wakeUpForRefresh(Bank bank, sc_time time) override; - -// virtual bool isInSelfRefresh(Bank bank) override; -//}; - - - -//#endif // NOPOWERDOWN_H diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.cpp b/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.cpp deleted file mode 100644 index 15ddf00a..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.cpp +++ /dev/null @@ -1,220 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Matthias Jung -// * Felipe S. Prado -// */ - -//#include -//#include -//#include "PowerDownManager.h" -//#include "../ControllerCore.h" -//#include "../timingCalculations.h" -//#include "../../../common/DebugManager.h" -//#include -//#include "../../../common/utils.h" - -//using namespace tlm; -//using namespace std; - - -//PowerDownManager::PowerDownManager(sc_module_name /*name*/, -// ControllerCore &controller) : -// controllerCore(controller) -//{ -// powerDownState = PowerDownState::Awake; -// for (Bank bank : controller.getBanks()) { -// setUpDummy(powerDownPayloads[bank], bank); -// } -// //controllerCore.controller.send(PDNTrigger, sc_time_stamp(), powerDownPayloads[Bank(0)]); -//} - -//PowerDownManager::~PowerDownManager() -//{ - -//} - -//void PowerDownManager::sleep(Bank /*bank*/, sc_time time) -//{ -// if (!canSleep() || isInPowerDown()) -// return; - -// PowerDownState state = powerDownState; - -// if (state == PowerDownState::Awake) { //coming from active -// state = controllerCore.state->rowBufferStates->allRowBuffersAreClosed() ? -// PowerDownState::PDNPrecharge : PowerDownState::PDNActive; -// } else if (state == -// PowerDownState::AwakeForRefresh) { //coming from refresh interrupting power down -// sc_assert(controllerCore.state->rowBufferStates->allRowBuffersAreClosed()); - -// if (controllerCore.state->getLastCommand(Command::PDEA).getStart() -// >= controllerCore.state->getLastCommand(Command::PDEP).getStart()) -// state = PowerDownState::PDNPrecharge; -// else { -// state = PowerDownState::PDNSelfRefresh; -// } -// } - -// Command cmd = IPowerDownManager::getSleepCommand(state); -// ScheduledCommand pdn(cmd, time, -// Configuration::getInstance().memSpec->getMinExecutionTimeForPowerDownCmd(cmd), -// DramExtension::getExtension(powerDownPayloads[Bank(0)])); - -// controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn); - -// if (state != PowerDownState::PDNSelfRefresh -// && controllerCore.refreshManager->hasCollision(pdn)) { -// return; -// } else { -// setPowerDownState(state); -// sendPowerDownPayload(pdn); -// } -//} - -//void PowerDownManager::wakeUp(Bank bank, sc_time time) -//{ -// printDebugMessage("Waking up at " + time.to_string() + -// " current power down state is " + powerDownStateToString(powerDownState)); - -// if (isAwakeForRefresh()) { //Request enters system during Refresh -// setPowerDownState(PowerDownState::Awake); -// } else if (isInPowerDown()) { //Request wakes up power down -// Command cmd = IPowerDownManager::getWakeUpCommand(powerDownState); -// ScheduledCommand pdn(cmd, time, Configuration::getInstance().memSpec->getExecutionTime(cmd, -// powerDownPayloads[Bank(0)]), -// DramExtension::getExtension(powerDownPayloads[Bank(0)])); -// controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn); - -// if (cmd == Command::SREFEX) { -// // Leaving Self Refresh. Plan the next refresh. -// controllerCore.refreshManager->reInitialize(bank, pdn.getEnd()); -// printDebugMessage("Waking up. Leaving Self Refresh at " + time.to_string() + -// " next refresh planned to " + pdn.getEnd().to_string()); -// } - -// setPowerDownState(PowerDownState::Awake); - -// printDebugMessage("Sending power down exit command " + commandToString( -// cmd) + " on all banks"); -// sendPowerDownPayload(pdn); -// } - -// printDebugMessage("Awaken at " + time.to_string() + -// " current power down state is " + powerDownStateToString(powerDownState)); -//} - -//void PowerDownManager::wakeUpForRefresh(Bank /*bank*/, sc_time time) -//{ -// printDebugMessage("Waking up for refresh at " + time.to_string() + -// " current power down state is " + powerDownStateToString(powerDownState)); - -// if (isInPowerDown()) { -// Command cmd = IPowerDownManager::getWakeUpCommand(powerDownState); -// ScheduledCommand pdn(cmd, time, Configuration::getInstance().memSpec->getExecutionTime(cmd, -// powerDownPayloads[Bank(0)]), -// DramExtension::getExtension(powerDownPayloads[Bank(0)])); - -// setPowerDownState(PowerDownState::AwakeForRefresh); - -// printDebugMessage("Sending power down exit command " + commandToString( -// cmd) + " on all banks"); -// sendPowerDownPayload(pdn); -// } - -// printDebugMessage("Awaken for refresh at " + time.to_string() + -// " current power down state is " + powerDownStateToString(powerDownState)); -//} - -//void PowerDownManager::sendPowerDownPayload(ScheduledCommand &pdnToSend) -//{ -// controllerCore.state->bus.moveCommandToNextFreeSlot(pdnToSend); -// for (size_t bank = 1; bank < controllerCore.getBanks().size(); bank++) { -// tlm_generic_payload &payloadToSend = powerDownPayloads[bank]; - -// ScheduledCommand pdn(pdnToSend.getCommand(), pdnToSend.getStart(), -// pdnToSend.getExecutionTime(), DramExtension::getExtension(payloadToSend)); -// controllerCore.state->change(pdn); - -// } -// controllerCore.state->change(pdnToSend); -// controllerCore.controller.send(pdnToSend, powerDownPayloads[Bank(0)]); -// printDebugMessage("Sending power down command " + commandToString( -// pdnToSend.getCommand()) + " on bank " + to_string(pdnToSend.getBank().ID()) + -// " start time " + pdnToSend.getStart().to_string() + " end time " + -// pdnToSend.getEnd().to_string()); -//} - -//void PowerDownManager::setPowerDownState(PowerDownState state) -//{ -// powerDownState = state; -// printDebugMessage("Is now in state " + powerDownStateToString( -// powerDownState) + " on all banks"); -//} - -//bool PowerDownManager::isInPowerDown() -//{ -// return (powerDownState == PowerDownState::PDNActive -// || powerDownState == PowerDownState::PDNPrecharge -// || powerDownState == PowerDownState::PDNSelfRefresh); -//} - -//bool PowerDownManager::canSleep() -//{ -// for (Bank bank : controllerCore.getBanks()) { -// if (!controllerCore.numberOfPayloads[bank] == 0) -// return false; -// } -// return true; -//} - -//bool PowerDownManager::isInSelfRefresh(Bank /*bank*/) -//{ -// return powerDownState == PowerDownState::PDNSelfRefresh; -//} - -//bool PowerDownManager::isAwakeForRefresh() -//{ -// return powerDownState == PowerDownState::AwakeForRefresh; -//} - -//void PowerDownManager::triggerSleep(Bank bank, sc_time time) -//{ -// sleep(bank, time); -//} - -//void PowerDownManager::printDebugMessage(std::string message) -//{ -// DebugManager::getInstance().printDebugMessage(this->name(), message); -//} - diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.h b/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.h deleted file mode 100644 index bd7ffd3d..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManager.h +++ /dev/null @@ -1,71 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Matthias Jung -// */ - -//#ifndef POWERDOWNMANAGER_H -//#define POWERDOWNMANAGER_H - -//#include "PowerDownManagerBankwise.h" - - -//class ControllerCore; - -//class PowerDownManager: public IPowerDownManager, public sc_module -//{ -//public: -// PowerDownManager(sc_module_name /*name*/, ControllerCore &controllerCore); -// virtual ~PowerDownManager(); - -// virtual void triggerSleep(Bank bank, sc_time time) override; -// virtual void sleep(Bank /*bank*/, sc_time time) override; -// virtual void wakeUp(Bank bank, sc_time time) override; -// virtual void wakeUpForRefresh(Bank bank, sc_time time) override; -// virtual bool isInSelfRefresh(Bank bank) override; - -//protected: -// void sendPowerDownPayload(ScheduledCommand &pdnToSend); -// bool isInPowerDown(); -// void setPowerDownState(PowerDownState state); -// bool canSleep(); -// bool isAwakeForRefresh(); - -// PowerDownState powerDownState; -// std::map powerDownPayloads; -// ControllerCore &controllerCore; -// void printDebugMessage(std::string message); -//}; - - -//#endif // POWERDOWNMANAGER_H diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.cpp b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.cpp deleted file mode 100644 index 4b9e125c..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.cpp +++ /dev/null @@ -1,216 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Matthias Jung -// */ - -//#include "PowerDownManager.h" -//#include "../ControllerCore.h" -//#include "../../../common/utils.h" -//#include "../../../common/DebugManager.h" -//#include "../timingCalculations.h" - -//using namespace tlm; - -//PowerDownManagerBankwise::PowerDownManagerBankwise(sc_module_name /*name*/, -// ControllerCore &controllerCore) : controllerCore(controllerCore) -//{ -// for (Bank bank : controllerCore.getBanks()) { -// setUpDummy(powerDownPayloads[bank], bank); -// powerDownStates[bank] = PowerDownState::Awake; -// //controllerCore.controller.send(PDNTrigger, sc_time_stamp(), powerDownPayloads[bank]); -// } -//} - -//void PowerDownManagerBankwise::sleep(Bank bank, sc_time time) -//{ -// if (!canSleep(bank) || isInPowerDown(bank)) -// return; - -// tlm_generic_payload &payload = powerDownPayloads[bank]; - -// PowerDownState state = powerDownStates[bank]; -// if (state == PowerDownState::Awake) { //coming from active -// state = controllerCore.state->rowBufferStates->rowBufferIsOpen( -// bank) ? PowerDownState::PDNActive : PowerDownState::PDNPrecharge; -// } else if (state == -// PowerDownState::AwakeForRefresh) { //coming from refresh interrupting power down -// sc_assert(!controllerCore.state->rowBufferStates->rowBufferIsOpen(bank)); - -// if (controllerCore.state->getLastCommand(Command::PDEA, bank).getStart() -// >= controllerCore.state->getLastCommand(Command::PDEP, bank).getStart()) -// state = PowerDownState::PDNPrecharge; -// else { -// state = PowerDownState::PDNSelfRefresh; -// } -// } - -// Command cmd = IPowerDownManager::getSleepCommand(state); -// ScheduledCommand pdn(cmd, time, -// Configuration::getInstance().memSpec->getMinExecutionTimeForPowerDownCmd(cmd), -// DramExtension::getExtension(payload)); -// controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn); - -// if (state != PowerDownState::PDNSelfRefresh -// && controllerCore.refreshManager->hasCollision(pdn)) { -// return; -// } else { -// setPowerDownState(state, bank); -// sendPowerDownPayload(pdn); -// } -//} - -//void PowerDownManagerBankwise::wakeUp(Bank bank, sc_time time) -//{ -// printDebugMessage("Waking up on bank " + to_string(bank.ID()) + " at " + -// time.to_string() + " current power down state is " + powerDownStateToString( -// powerDownStates[bank])); - -// if (isAwakeForRefresh(bank)) { -// printDebugMessage("It was already awake for refresh on bank " + to_string( -// bank.ID()) + " at " + time.to_string()); -// setPowerDownState(PowerDownState::Awake, bank); -// } else if (isInPowerDown(bank)) { -// // Request wake up from power down. A Power Down Exit request will be generated (PDNAX, PDNPX, SREFX). -// Command pdnExitCmd = IPowerDownManager::getWakeUpCommand(powerDownStates[bank]); -// // Mount the command to be scheduled -// ScheduledCommand pdnExit(pdnExitCmd, time, Configuration::getInstance().memSpec->getExecutionTime(pdnExitCmd, -// powerDownPayloads[bank]), DramExtension::getExtension(powerDownPayloads[bank])); -// // Ensure that time constraints are respected -// controllerCore.getCommandChecker(pdnExitCmd).delayToSatisfyConstraints(pdnExit); - -// if (pdnExitCmd == Command::SREFEX) { -// // Leaving Self Refresh. Plan the next refresh. -// controllerCore.refreshManager->reInitialize(bank, pdnExit.getEnd()); -// printDebugMessage("Waking up. Leaving Self Refresh on Bank " + to_string( -// bank.ID()) + " at " + time.to_string() + " next refresh planned to " + -// pdnExit.getEnd().to_string()); -// } - -// setPowerDownState(PowerDownState::Awake, bank); - -// printDebugMessage("Sending power down exit command " + commandToString( -// pdnExitCmd) + " on bank " + to_string(bank.ID()) + " at " + time.to_string() + -// " start time " + pdnExit.getStart().to_string() + " end time " + -// pdnExit.getEnd().to_string()); -// sendPowerDownPayload(pdnExit); -// } - -// printDebugMessage("Awaken on bank " + to_string(bank.ID()) + " at " + -// time.to_string() + " current power down state is " + powerDownStateToString( -// powerDownStates[bank])); -//} - -//void PowerDownManagerBankwise::wakeUpForRefresh(Bank bank, sc_time time) -//{ -// printDebugMessage("Waking up for refresh on bank " + to_string( -// bank.ID()) + " at " + time.to_string() + " current power down state is " + -// powerDownStateToString(powerDownStates[bank])); - -// if (isInPowerDown(bank)) { -// // A Power Down Exit request will be generated (PDNAX, PDNPX, SREFX). -// Command pdnExitCmd = IPowerDownManager::getWakeUpCommand(powerDownStates[bank]); -// // Get the execution time for this request -// sc_time executionTime = Configuration::getInstance().memSpec->getExecutionTime(pdnExitCmd, powerDownPayloads[bank]); -// // Mount the command to be scheduled -// ScheduledCommand pdnExit(pdnExitCmd, time, executionTime, -// DramExtension::getExtension(powerDownPayloads[bank])); - -// setPowerDownState(PowerDownState::AwakeForRefresh, bank); - -// printDebugMessage("Sending power down exit command " + commandToString( -// pdnExitCmd) + " on bank " + to_string(bank.ID()) + " at " + time.to_string() + -// " start time " + pdnExit.getStart().to_string() + " end time " + -// pdnExit.getEnd().to_string()); -// sendPowerDownPayload(pdnExit); -// } - -// printDebugMessage("Awaken for refresh on bank " + to_string( -// bank.ID()) + " at " + time.to_string() + " current power down state is " + -// powerDownStateToString(powerDownStates[bank])); -//} - -//bool PowerDownManagerBankwise::isInPowerDown(Bank bank) -//{ -// return isIn(powerDownStates[bank], { PowerDownState::PDNActive, PowerDownState::PDNPrecharge, PowerDownState::PDNSelfRefresh }); -//} - -//bool PowerDownManagerBankwise::isInSelfRefresh(Bank bank) -//{ -// return powerDownStates[bank] == PowerDownState::PDNSelfRefresh; -//} - -//bool PowerDownManagerBankwise::isAwakeForRefresh(Bank bank) -//{ -// return powerDownStates[bank] == PowerDownState::AwakeForRefresh; -//} - -//bool PowerDownManagerBankwise::isAwake(Bank bank) -//{ -// return powerDownStates[bank] == PowerDownState::Awake; -//} - -//void PowerDownManagerBankwise::setPowerDownState(PowerDownState state, -// Bank bank) -//{ -// PowerDownState &bankstate = powerDownStates[bank]; -// bankstate = state; -// printDebugMessage("Is now in state " + powerDownStateToString( -// state) + " on Bank " + to_string(bank.ID())); -//} - -//void PowerDownManagerBankwise::sendPowerDownPayload(ScheduledCommand &pdn) -//{ -// controllerCore.state->bus.moveCommandToNextFreeSlot(pdn); -// controllerCore.state->change(pdn); -// printDebugMessage("Sending power down command " + commandToString( -// pdn.getCommand()) + " on bank " + to_string(pdn.getBank().ID()) + " start time " -// + pdn.getStart().to_string() + " end time " + pdn.getEnd().to_string()); -// controllerCore.controller.send(pdn, powerDownPayloads[pdn.getBank()]); -//} - -//bool PowerDownManagerBankwise::canSleep(Bank bank) -//{ -// return controllerCore.numberOfPayloads[bank] == 0; -//} - -//void PowerDownManagerBankwise::triggerSleep(Bank bank, sc_time time) -//{ -// sleep(bank, time); -//} - -//void PowerDownManagerBankwise::printDebugMessage(std::string message) -//{ -// DebugManager::getInstance().printDebugMessage(this->name(), message); -//} - diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.h b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.h deleted file mode 100644 index 07d32ba1..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerBankwise.h +++ /dev/null @@ -1,86 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Matthias Jung -// */ - -//#ifndef POWERDOWNMANAGERBANKWISE_H -//#define POWERDOWNMANAGERBANKWISE_H - -//#include -//#include -//#include -//#include -//#include "../../Command.h" -//#include "../../../common/dramExtensions.h" -//#include "../scheduling/ScheduledCommand.h" -//#include "IPowerDownManager.h" - - -//class ControllerCore; - -//class PowerDownManagerBankwise : public sc_module, public IPowerDownManager -//{ -//public: -// PowerDownManagerBankwise(sc_module_name /*name*/, -// ControllerCore &controllerCore); -// virtual ~PowerDownManagerBankwise() {} -// virtual void triggerSleep(Bank bank, sc_time time) override; -// virtual void sleep(Bank bank, sc_time time) override; -// virtual void wakeUp(Bank bank, sc_time time) override; -// virtual void wakeUpForRefresh(Bank bank, sc_time time) override; -// virtual bool isInSelfRefresh(Bank bank) override; - -//protected: -// virtual bool isInPowerDown(Bank bank); -// virtual bool isAwake(Bank bank); -// virtual bool isAwakeForRefresh(Bank bank); - -// ControllerCore &controllerCore; -// std::map powerDownPayloads; -// std::map powerDownStates; - -// virtual bool canSleep(Bank bank); - -// void setPowerDownState(PowerDownState state, Bank bank); - -// Command getWakeUpCommand(PowerDownState state); -// Command getSleepCommand(PowerDownState state); - -// void sendPowerDownPayload(ScheduledCommand &pdn); - -// void printDebugMessage(std::string message); -//}; - -//#endif // POWERDOWNMANAGERBANKWISE_H - diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.cpp b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.cpp deleted file mode 100644 index 65a9a45d..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.cpp +++ /dev/null @@ -1,142 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// * Felipe S. Prado -// */ - -//#include "PowerDownManagerTimeout.h" -//#include "../ControllerCore.h" -//#include "../../../common/utils.h" -//#include "../../../common/DebugManager.h" -//#include "../timingCalculations.h" - -//using namespace tlm; - -//PowerDownManagerTimeout::PowerDownManagerTimeout(sc_module_name name, -// ControllerCore &controllerCore): -// PowerDownManager(name, controllerCore) -//{ -// //controllerCore.controller.send(PDNTrigger, Configuration::getInstance().getPowerDownTimeout(), powerDownPayloads[Bank(0)]); -//} - -//PowerDownManagerTimeout::~PowerDownManagerTimeout() -//{ -// // TODO Auto-generated destructor stub -//} - -//void PowerDownManagerTimeout::sleep(Bank /*bank*/, sc_time time) -//{ -// bool timeoutTest; -// if (!isAwakeForRefresh()) { -// sc_time lastReadScheduled; -// sc_time lastWriteScheduled; -// if (Configuration::getInstance().OpenPagePolicy) { -// lastReadScheduled = controllerCore.state->getLastCommand( -// Command::RD).getEnd(); -// lastWriteScheduled = controllerCore.state->getLastCommand( -// Command::WR).getEnd(); -// } else { -// lastReadScheduled = controllerCore.state->getLastCommand( -// Command::RDA).getEnd(); -// lastWriteScheduled = controllerCore.state->getLastCommand( -// Command::WRA).getEnd(); -// } -// sc_time lastScheduledCommand = max(lastReadScheduled, lastWriteScheduled); -// timeoutTest = (time - lastScheduledCommand) >= -// Configuration::getInstance().getPowerDownTimeout(); -// } else { -// timeoutTest = true; -// } - -// //test_awakeForRefresh = false; - -// if ( canSleep() && !isInPowerDown() && timeoutTest) { - -// PowerDownState newState; -// if (Configuration::getInstance().PowerDownMode == EPowerDownMode::TimeoutPDN) { -// newState = controllerCore.state->rowBufferStates->allRowBuffersAreClosed() ? -// PowerDownState::PDNPrecharge : PowerDownState::PDNActive; -// } else { // PowerDownMode == TimeoutSREF -// if (!controllerCore.state->rowBufferStates->allRowBuffersAreClosed()) { -// ScheduledCommand prechargeAllMaster(Command::PREA, time, -// Configuration::getInstance().memSpec->getExecutionTime( -// Command::PREA, powerDownPayloads[Bank(0)]), -// DramExtension::getExtension(powerDownPayloads[Bank(0)])); - -// controllerCore.getCommandChecker( -// Command::PREA).delayToSatisfyConstraints(prechargeAllMaster); - -// if (controllerCore.refreshManager->hasCollision(prechargeAllMaster)) { -// return; -// } else { -// for (size_t i = 1; i < controllerCore.getBanks().size(); i++) { -// ScheduledCommand prechargeAll(Command::PREA, -// prechargeAllMaster.getStart(), prechargeAllMaster.getExecutionTime(), -// powerDownPayloads[Bank(i)]); -// controllerCore.state->change(prechargeAll); -// } -// controllerCore.state->change(prechargeAllMaster); -// controllerCore.controller.send(prechargeAllMaster, powerDownPayloads[Bank(0)]); -// } - -// } - -// newState = PowerDownState::PDNSelfRefresh; -// } - -// Command cmd = IPowerDownManager::getSleepCommand(newState); -// ScheduledCommand pdn(cmd, time, -// Configuration::getInstance().memSpec->getMinExecutionTimeForPowerDownCmd(cmd), -// DramExtension::getExtension(powerDownPayloads[Bank(0)])); - -// controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn); - -// if (controllerCore.refreshManager->hasCollision(pdn)) { -// return; -// } else { -// setPowerDownState(newState); -// sendPowerDownPayload(pdn); -// } -// } -//} - -//void PowerDownManagerTimeout::triggerSleep(Bank /*bank*/, sc_time time) -//{ -// if (canSleep() && !isInPowerDown()) { -// controllerCore.controller.send(PDNTrigger, -// time + controllerCore.config.getPowerDownTimeout(), powerDownPayloads[Bank(0)]); -// } -//} - diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.h b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.h deleted file mode 100644 index 48b36b0b..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeout.h +++ /dev/null @@ -1,63 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// * Felipe S. Prado -// */ - -//#ifndef POWERDOWNMANAGERTIMEOUT_H -//#define POWERDOWNMANAGERTIMEOUT_H - -//#include "PowerDownManager.h" -//#include -//#include "../../../common/dramExtensions.h" -//#include "../scheduling/ScheduledCommand.h" -//#include - -//class ControllerCore; - -//class PowerDownManagerTimeout: public PowerDownManager -//{ -//public: -// PowerDownManagerTimeout(sc_module_name /*name*/, -// ControllerCore &controllerCore); -// virtual ~PowerDownManagerTimeout(); - -// virtual void triggerSleep(Bank /*bank*/, sc_time time); -// virtual void sleep(Bank /*bank*/, sc_time time); -//}; - - - -//#endif // POWERDOWNMANAGERTIMEOUT_H diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp deleted file mode 100644 index 83535fc6..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp +++ /dev/null @@ -1,135 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// * Felipe S. Prado -// */ - -//#include "PowerDownManagerTimeoutBankwise.h" -//#include "../ControllerCore.h" -//#include "../../../common/utils.h" -//#include "../../../common/DebugManager.h" -//#include "../timingCalculations.h" - -//using namespace tlm; - -//PowerDownManagerTimeoutBankwise::PowerDownManagerTimeoutBankwise( -// sc_module_name name, ControllerCore &controllerCore): -// PowerDownManagerBankwise(name, controllerCore) -//{ -// /*for (Bank bank : controllerCore.getBanks()) -// { -// controllerCore.controller.send(PDNTrigger, controllerCore.config.getPowerDownTimeout(), powerDownPayloads[bank]); -// }*/ -//} - -//PowerDownManagerTimeoutBankwise::~PowerDownManagerTimeoutBankwise() -//{ -// // TODO Auto-generated destructor stub -//} - -//void PowerDownManagerTimeoutBankwise::sleep(Bank bank, sc_time time) -//{ -// bool timeoutTest; -// if (!isAwakeForRefresh(bank)) { -// sc_time lastReadScheduled; -// sc_time lastWriteScheduled; -// if (Configuration::getInstance().OpenPagePolicy) { -// lastReadScheduled = controllerCore.state->getLastCommand(Command::RD, -// bank).getEnd(); -// lastWriteScheduled = controllerCore.state->getLastCommand(Command::WR, -// bank).getEnd(); -// } else { -// lastReadScheduled = controllerCore.state->getLastCommand(Command::RDA, -// bank).getEnd(); -// lastWriteScheduled = controllerCore.state->getLastCommand(Command::WRA, -// bank).getEnd(); -// } -// sc_time lastScheduledCommand = max(lastReadScheduled, lastWriteScheduled); -// timeoutTest = (time - lastScheduledCommand) >= -// Configuration::getInstance().getPowerDownTimeout(); -// } else { -// timeoutTest = true; -// } - -// if ( canSleep(bank) && !isInPowerDown(bank) && timeoutTest) { -// PowerDownState newState; -// if (Configuration::getInstance().PowerDownMode == EPowerDownMode::TimeoutPDN) { -// newState = controllerCore.state->rowBufferStates->rowBufferIsOpen( -// bank) ? PowerDownState::PDNActive : PowerDownState::PDNPrecharge; -// } else { // PowerDownMode == TimeoutSREF -// if (controllerCore.state->rowBufferStates->rowBufferIsOpen(bank)) { -// ScheduledCommand precharge(Command::PRE, time, -// Configuration::getInstance().memSpec->getExecutionTime(Command::PRE, powerDownPayloads[bank]), -// DramExtension::getExtension(powerDownPayloads[bank])); - -// controllerCore.getCommandChecker(Command::PRE).delayToSatisfyConstraints( -// precharge); - -// if (controllerCore.refreshManager->hasCollision(precharge)) { -// return; -// } else { -// controllerCore.state->change(precharge); -// controllerCore.controller.send(precharge, powerDownPayloads[bank]); -// } - -// } - -// newState = PowerDownState::PDNSelfRefresh; -// } - - -// Command cmd = IPowerDownManager::getSleepCommand(newState); -// ScheduledCommand pdn(cmd, time, -// Configuration::getInstance().memSpec->getMinExecutionTimeForPowerDownCmd(cmd), -// DramExtension::getExtension(powerDownPayloads[bank])); - -// controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn); - -// if (controllerCore.refreshManager->hasCollision(pdn)) { -// return; -// } else { -// setPowerDownState(newState, bank); -// sendPowerDownPayload(pdn); -// } -// } -//} - -//void PowerDownManagerTimeoutBankwise::triggerSleep(Bank bank, sc_time time) -//{ -// if (canSleep(bank) && !isInPowerDown(bank)) { -// controllerCore.controller.send(PDNTrigger, -// time + controllerCore.config.getPowerDownTimeout(), powerDownPayloads[bank]); -// } -//} diff --git a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h b/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h deleted file mode 100644 index 440a482d..00000000 --- a/DRAMSys/library/src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h +++ /dev/null @@ -1,63 +0,0 @@ -///* -// * Copyright (c) 2015, 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. -// * -// * Authors: -// * Janik Schlemminger -// * Robert Gernhardt -// * Matthias Jung -// * Felipe S. Prado -// */ - -//#ifndef POWERDOWNMANAGERTIMEOUTBANKWISE_H -//#define POWERDOWNMANAGERTIMEOUTBANKWISE_H - -//#include "PowerDownManager.h" -//#include -//#include "../../../common/dramExtensions.h" -//#include "../scheduling/ScheduledCommand.h" -//#include - -//class ControllerCore; - -//class PowerDownManagerTimeoutBankwise: public PowerDownManagerBankwise -//{ -//public: -// PowerDownManagerTimeoutBankwise(sc_module_name /*name*/, -// ControllerCore &controllerCore); -// virtual ~PowerDownManagerTimeoutBankwise(); - -// virtual void triggerSleep(Bank bank, sc_time time); -// virtual void sleep(Bank bank, sc_time time); -//}; - - - -//#endif // POWERDOWNMANAGERTIMEOUTBANKWISE_H diff --git a/DRAMSys/library/src/controller/powerdown/PowerDownManager.cpp b/DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.cpp similarity index 91% rename from DRAMSys/library/src/controller/powerdown/PowerDownManager.cpp rename to DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.cpp index c81efa30..cf3cc839 100644 --- a/DRAMSys/library/src/controller/powerdown/PowerDownManager.cpp +++ b/DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.cpp @@ -32,16 +32,16 @@ * Author: Lukas Steiner */ -#include "PowerDownManager.h" +#include "PowerDownManagerStaggered.h" #include "../../common/utils.h" -PowerDownManager::PowerDownManager(Rank rank, CheckerIF *checker) +PowerDownManagerStaggered::PowerDownManagerStaggered(Rank rank, CheckerIF *checker) : rank(rank), checker(checker) { setUpDummy(powerDownPayload, rank); } -void PowerDownManager::triggerEntry(TriggerSource source) +void PowerDownManagerStaggered::triggerEntry(TriggerSource source) { if (source == TriggerSource::Controller) controllerIdle = true; @@ -51,7 +51,7 @@ void PowerDownManager::triggerEntry(TriggerSource source) triggered = true; } -void PowerDownManager::triggerExit(TriggerSource source) +void PowerDownManagerStaggered::triggerExit(TriggerSource source) { if (source == TriggerSource::Controller) { @@ -77,7 +77,7 @@ void PowerDownManager::triggerExit(TriggerSource source) } } -std::pair PowerDownManager::getNextCommand() +std::pair PowerDownManagerStaggered::getNextCommand() { if (sc_time_stamp() == timeToSchedule) return std::pair(nextCommand, &powerDownPayload); @@ -85,7 +85,7 @@ std::pair PowerDownManager::getNextCommand() return std::pair(Command::NOP, nullptr); } -sc_time PowerDownManager::start() +sc_time PowerDownManagerStaggered::start() { timeToSchedule = sc_max_time(); sc_time delay = sc_max_time() - sc_time_stamp(); @@ -117,7 +117,7 @@ sc_time PowerDownManager::start() return delay; } -void PowerDownManager::updateState(Command command) +void PowerDownManagerStaggered::updateState(Command command) { if (command == Command::ACT) activatedBanks++; diff --git a/DRAMSys/library/src/controller/powerdown/PowerDownManager.h b/DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.h similarity index 91% rename from DRAMSys/library/src/controller/powerdown/PowerDownManager.h rename to DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.h index 1394e6ea..350e38b5 100644 --- a/DRAMSys/library/src/controller/powerdown/PowerDownManager.h +++ b/DRAMSys/library/src/controller/powerdown/PowerDownManagerStaggered.h @@ -32,8 +32,8 @@ * Author: Lukas Steiner */ -#ifndef POWERDOWNMANAGER_H -#define POWERDOWNMANAGER_H +#ifndef POWERDOWNMANAGERSTAGGERED_H +#define POWERDOWNMANAGERSTAGGERED_H #include "PowerDownManagerIF.h" #include "../BankMachine.h" @@ -41,10 +41,10 @@ using namespace tlm; -class PowerDownManager final : public PowerDownManagerIF +class PowerDownManagerStaggered final : public PowerDownManagerIF { public: - PowerDownManager(Rank, CheckerIF *); + PowerDownManagerStaggered(Rank, CheckerIF *); virtual void triggerEntry(TriggerSource) override; virtual void triggerExit(TriggerSource) override; @@ -68,4 +68,4 @@ private: unsigned activatedBanks = 0; }; -#endif // POWERDOWNMANAGER_H +#endif // POWERDOWNMANAGERSTAGGERED_H diff --git a/DRAMSys/library/src/controller/refresh/RefreshManager.h b/DRAMSys/library/src/controller/refresh/RefreshManager.h index 5c24c0a3..b718b243 100644 --- a/DRAMSys/library/src/controller/refresh/RefreshManager.h +++ b/DRAMSys/library/src/controller/refresh/RefreshManager.h @@ -38,7 +38,7 @@ #include "RefreshManagerIF.h" #include "../../configuration/memspec/MemSpec.h" #include "../BankMachine.h" -#include "../powerdown/PowerDownManager.h" +#include "../powerdown/PowerDownManagerIF.h" #include "../checker/CheckerIF.h" using namespace tlm;