diff --git a/DRAMSys/library/src/controller/Controller.cpp b/DRAMSys/library/src/controller/Controller.cpp index b9092b81..c9c93f05 100644 --- a/DRAMSys/library/src/controller/Controller.cpp +++ b/DRAMSys/library/src/controller/Controller.cpp @@ -261,21 +261,20 @@ void Controller::controllerMethod() commandTuple = powerDownManagers[rankID]->getNextCommand(); if (std::get(commandTuple) != Command::NOP) readyCommands.emplace_back(commandTuple); - - // (4.2) Check for refresh commands (PREA/PRE or REFA/REFB) - commandTuple = refreshManagers[rankID]->getNextCommand(); - if (std::get(commandTuple) != Command::NOP) + else { - readyCommands.emplace_back(commandTuple); - powerDownManagers[rankID]->triggerInterruption(); - } - - // (4.3) Check for bank commands (PRE, ACT, RD/RDA or WR/WRA) - for (auto it : bankMachinesOnRank[rankID]) - { - commandTuple = it->getNextCommand(); + // (4.2) Check for refresh commands (PREA/PRE or REFA/REFB) + commandTuple = refreshManagers[rankID]->getNextCommand(); if (std::get(commandTuple) != Command::NOP) readyCommands.emplace_back(commandTuple); + + // (4.3) Check for bank commands (PRE, ACT, RD/RDA or WR/WRA) + for (auto it : bankMachinesOnRank[rankID]) + { + commandTuple = it->getNextCommand(); + if (std::get(commandTuple) != Command::NOP) + readyCommands.emplace_back(commandTuple); + } } } diff --git a/DRAMSys/library/src/controller/refresh/RefreshManagerAllBank.cpp b/DRAMSys/library/src/controller/refresh/RefreshManagerAllBank.cpp index d9c86544..44c97ea1 100644 --- a/DRAMSys/library/src/controller/refresh/RefreshManagerAllBank.cpp +++ b/DRAMSys/library/src/controller/refresh/RefreshManagerAllBank.cpp @@ -66,9 +66,9 @@ sc_time RefreshManagerAllBank::start() if (sc_time_stamp() >= timeForNextTrigger) { -// powerDownManager->triggerInterruption(); -// if (sleeping) -// return timeToSchedule; + powerDownManager->triggerInterruption(); + if (sleeping) + return timeToSchedule; if (sc_time_stamp() >= timeForNextTrigger + memSpec->getRefreshIntervalAB()) { @@ -108,8 +108,7 @@ sc_time RefreshManagerAllBank::start() else nextCommand = Command::REFA; - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, BankGroup(0), Bank(0)); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, BankGroup(0), Bank(0)); return timeToSchedule; } else // if (state == RmState::Pulledin) @@ -133,9 +132,7 @@ sc_time RefreshManagerAllBank::start() else { nextCommand = Command::REFA; - - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, BankGroup(0), Bank(0)); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, BankGroup(0), Bank(0)); return timeToSchedule; } } diff --git a/DRAMSys/library/src/controller/refresh/RefreshManagerPerBank.cpp b/DRAMSys/library/src/controller/refresh/RefreshManagerPerBank.cpp index fc264031..1b2fe232 100644 --- a/DRAMSys/library/src/controller/refresh/RefreshManagerPerBank.cpp +++ b/DRAMSys/library/src/controller/refresh/RefreshManagerPerBank.cpp @@ -76,9 +76,9 @@ sc_time RefreshManagerPerBank::start() if (sc_time_stamp() >= timeForNextTrigger) { -// powerDownManager->triggerInterruption(); -// if (sleeping) -// return timeToSchedule; + powerDownManager->triggerInterruption(); + if (sleeping) + return timeToSchedule; if (sc_time_stamp() >= timeForNextTrigger + memSpec->getRefreshIntervalPB()) { @@ -129,9 +129,8 @@ sc_time RefreshManagerPerBank::start() } } - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, - currentBankMachine->getBankGroup(), currentBankMachine->getBank()); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, + currentBankMachine->getBankGroup(), currentBankMachine->getBank()); return timeToSchedule; } } @@ -163,9 +162,8 @@ sc_time RefreshManagerPerBank::start() else nextCommand = Command::REFB; - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, - currentBankMachine->getBankGroup(), currentBankMachine->getBank()); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, + currentBankMachine->getBankGroup(), currentBankMachine->getBank()); return timeToSchedule; } } diff --git a/DRAMSys/library/src/controller/refresh/RefreshManagerSameBank.cpp b/DRAMSys/library/src/controller/refresh/RefreshManagerSameBank.cpp index e0b3388b..484d652b 100644 --- a/DRAMSys/library/src/controller/refresh/RefreshManagerSameBank.cpp +++ b/DRAMSys/library/src/controller/refresh/RefreshManagerSameBank.cpp @@ -85,9 +85,9 @@ sc_time RefreshManagerSameBank::start() if (sc_time_stamp() >= timeForNextTrigger) { -// powerDownManager->triggerInterruption(); -// if (sleeping) -// return timeToSchedule; + powerDownManager->triggerInterruption(); + if (sleeping) + return timeToSchedule; if (sc_time_stamp() >= timeForNextTrigger + memSpec->getRefreshIntervalSB()) { @@ -148,9 +148,8 @@ sc_time RefreshManagerSameBank::start() skipSelection = true; } - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, - currentIterator->front()->getBankGroup(), currentIterator->front()->getBank()); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, + currentIterator->front()->getBankGroup(), currentIterator->front()->getBank()); return timeToSchedule; } } @@ -196,9 +195,8 @@ sc_time RefreshManagerSameBank::start() } } - if (!sleeping) - timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, - currentIterator->front()->getBankGroup(), currentIterator->front()->getBank()); + timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, + currentIterator->front()->getBankGroup(), currentIterator->front()->getBank()); return timeToSchedule; } }