Add earliest time of issuance to command tuple and adapt cmd muxes.
This commit is contained in:
@@ -44,12 +44,9 @@ BankMachine::BankMachine(SchedulerIF *scheduler, CheckerIF *checker, Bank bank)
|
||||
bankgroup = BankGroup(bank.ID() / memSpec->banksPerGroup);
|
||||
}
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> BankMachine::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> BankMachine::getNextCommand()
|
||||
{
|
||||
if (sc_time_stamp() == timeToSchedule)
|
||||
return std::tuple<Command, tlm_generic_payload *>(nextCommand, currentPayload);
|
||||
else
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(nextCommand, currentPayload, timeToSchedule);
|
||||
}
|
||||
|
||||
void BankMachine::updateState(Command command)
|
||||
@@ -124,6 +121,7 @@ BankMachineOpen::BankMachineOpen(SchedulerIF *scheduler, CheckerIF *checker, Ban
|
||||
sc_time BankMachineOpen::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sleeping)
|
||||
return timeToSchedule;
|
||||
@@ -134,30 +132,26 @@ sc_time BankMachineOpen::start()
|
||||
|
||||
if (currentState == BmState::Precharged && !blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::ACT, rank, bankgroup, bank);
|
||||
nextCommand = Command::ACT;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (currentState == BmState::Activated)
|
||||
{
|
||||
if (DramExtension::getRow(currentPayload) == currentRow) // row hit
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RD, rank, bankgroup, bank);
|
||||
nextCommand = Command::RD;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WR, rank, bankgroup, bank);
|
||||
nextCommand = Command::WR;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (!blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::PRE, rank, bankgroup, bank);
|
||||
nextCommand = Command::PRE;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
}
|
||||
return timeToSchedule;
|
||||
@@ -169,6 +163,7 @@ BankMachineClosed::BankMachineClosed(SchedulerIF *scheduler, CheckerIF *checker,
|
||||
sc_time BankMachineClosed::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sleeping)
|
||||
return timeToSchedule;
|
||||
@@ -179,23 +174,19 @@ sc_time BankMachineClosed::start()
|
||||
|
||||
if (currentState == BmState::Precharged && !blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::ACT, rank, bankgroup, bank);
|
||||
nextCommand = Command::ACT;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (currentState == BmState::Activated)
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RDA, rank, bankgroup, bank);
|
||||
nextCommand = Command::RDA;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WRA, rank, bankgroup, bank);
|
||||
nextCommand = Command::WRA;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
return timeToSchedule;
|
||||
}
|
||||
@@ -206,6 +197,7 @@ BankMachineOpenAdaptive::BankMachineOpenAdaptive(SchedulerIF *scheduler, Checker
|
||||
sc_time BankMachineOpenAdaptive::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sleeping)
|
||||
return timeToSchedule;
|
||||
@@ -216,8 +208,8 @@ sc_time BankMachineOpenAdaptive::start()
|
||||
|
||||
if (currentState == BmState::Precharged && !blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::ACT, rank, bankgroup, bank);
|
||||
nextCommand = Command::ACT;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (currentState == BmState::Activated)
|
||||
{
|
||||
@@ -226,38 +218,27 @@ sc_time BankMachineOpenAdaptive::start()
|
||||
if (scheduler->hasFurtherRequest(bank) && !scheduler->hasFurtherRowHit(bank, currentRow))
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RDA, rank, bankgroup, bank);
|
||||
nextCommand = Command::RDA;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WRA, rank, bankgroup, bank);
|
||||
nextCommand = Command::WRA;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RD, rank, bankgroup, bank);
|
||||
nextCommand = Command::RD;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WR, rank, bankgroup, bank);
|
||||
nextCommand = Command::WR;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
}
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (!blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::PRE, rank, bankgroup, bank);
|
||||
nextCommand = Command::PRE;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
}
|
||||
return timeToSchedule;
|
||||
@@ -269,6 +250,7 @@ BankMachineClosedAdaptive::BankMachineClosedAdaptive(SchedulerIF *scheduler, Che
|
||||
sc_time BankMachineClosedAdaptive::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sleeping)
|
||||
return timeToSchedule;
|
||||
@@ -279,8 +261,8 @@ sc_time BankMachineClosedAdaptive::start()
|
||||
|
||||
if (currentState == BmState::Precharged && !blocked) // row miss
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::ACT, rank, bankgroup, bank);
|
||||
nextCommand = Command::ACT;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (currentState == BmState::Activated)
|
||||
{
|
||||
@@ -289,38 +271,27 @@ sc_time BankMachineClosedAdaptive::start()
|
||||
if (scheduler->hasFurtherRowHit(bank, currentRow))
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RD, rank, bankgroup, bank);
|
||||
nextCommand = Command::RD;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WR, rank, bankgroup, bank);
|
||||
nextCommand = Command::WR;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentPayload->get_command() == TLM_READ_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::RDA, rank, bankgroup, bank);
|
||||
nextCommand = Command::RDA;
|
||||
}
|
||||
else if (currentPayload->get_command() == TLM_WRITE_COMMAND)
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::WRA, rank, bankgroup, bank);
|
||||
nextCommand = Command::WRA;
|
||||
}
|
||||
else
|
||||
SC_REPORT_FATAL("BankMachine", "Wrong TLM command");
|
||||
}
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
}
|
||||
else if (!blocked) // row miss TODO: remove this, can never happen
|
||||
{
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(Command::PRE, rank, bankgroup, bank);
|
||||
nextCommand = Command::PRE;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, bankgroup, bank);
|
||||
SC_REPORT_FATAL("BankMachine", "Should never be reached for this policy");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class BankMachine
|
||||
public:
|
||||
virtual ~BankMachine() {}
|
||||
virtual sc_time start() = 0;
|
||||
std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand();
|
||||
std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand();
|
||||
void updateState(Command);
|
||||
void block();
|
||||
|
||||
@@ -74,7 +74,7 @@ protected:
|
||||
tlm::tlm_generic_payload *currentPayload = nullptr;
|
||||
SchedulerIF *scheduler;
|
||||
CheckerIF *checker;
|
||||
Command nextCommand;
|
||||
Command nextCommand = Command::NOP;
|
||||
BmState currentState = BmState::Precharged;
|
||||
Row currentRow;
|
||||
sc_time timeToSchedule = sc_max_time();
|
||||
|
||||
@@ -239,38 +239,34 @@ void Controller::controllerMethod()
|
||||
it->start();
|
||||
|
||||
// (5) Choose one request and send it to DRAM
|
||||
std::tuple<Command, tlm_generic_payload *> commandTuple;
|
||||
std::vector<std::tuple<Command, tlm_generic_payload *>> readyCommands;
|
||||
// (5.1) Check for power-down commands (PDEA/PDEP/SREFEN or PDXA/PDXP/SREFEX)
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> commandTuple;
|
||||
std::list<std::tuple<Command, tlm_generic_payload *, sc_time>> readyCommands;
|
||||
for (unsigned rankID = 0; rankID < memSpec->numberOfRanks; rankID++)
|
||||
{
|
||||
// (5.1) Check for power-down commands (PDEA/PDEP/SREFEN or PDXA/PDXP/SREFEX)
|
||||
commandTuple = powerDownManagers[rankID]->getNextCommand();
|
||||
if (std::get<1>(commandTuple) != nullptr)
|
||||
if (std::get<0>(commandTuple) != Command::NOP)
|
||||
readyCommands.push_back(commandTuple);
|
||||
else
|
||||
{
|
||||
|
||||
// (5.2) Check for refresh commands (PREA/PRE or REFA/REFB)
|
||||
commandTuple = refreshManagers[rankID]->getNextCommand();
|
||||
if (std::get<1>(commandTuple) != nullptr)
|
||||
if (std::get<0>(commandTuple) != Command::NOP)
|
||||
readyCommands.push_back(commandTuple);
|
||||
else
|
||||
{
|
||||
|
||||
// (5.3) Check for bank commands (PRE, ACT, RD/RDA or WR/WRA)
|
||||
for (auto it : bankMachinesOnRank[rankID])
|
||||
{
|
||||
commandTuple = it->getNextCommand();
|
||||
if (std::get<1>(commandTuple) != nullptr)
|
||||
if (std::get<0>(commandTuple) != Command::NOP)
|
||||
readyCommands.push_back(commandTuple);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool readyCmdBlocked = false;
|
||||
if (!readyCommands.empty())
|
||||
{
|
||||
commandTuple = cmdMux->selectCommand(readyCommands);
|
||||
if (std::get<1>(commandTuple) != nullptr) // can happen with FIFO strict
|
||||
if (std::get<0>(commandTuple) != Command::NOP) // can happen with FIFO strict
|
||||
{
|
||||
Rank rank = DramExtension::getRank(std::get<1>(commandTuple));
|
||||
BankGroup bankgroup = DramExtension::getBankGroup(std::get<1>(commandTuple));
|
||||
@@ -305,8 +301,11 @@ void Controller::controllerMethod()
|
||||
sendToDram(std::get<0>(commandTuple), std::get<1>(commandTuple));
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cout << "Ready command blocked at " << sc_time_stamp() << std::endl;
|
||||
readyCmdBlocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// (6) Accept request from arbiter if scheduler is not full, otherwise backpressure (start END_REQ)
|
||||
if (payloadToAcquire != nullptr && timeToAcquire == sc_max_time())
|
||||
|
||||
@@ -35,17 +35,18 @@
|
||||
#ifndef CMDMUXIF_H
|
||||
#define CMDMUXIF_H
|
||||
|
||||
#include <systemc.h>
|
||||
#include <tlm.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include "../Command.h"
|
||||
|
||||
class CmdMuxIF
|
||||
{
|
||||
public:
|
||||
virtual ~CmdMuxIF() {}
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *>
|
||||
selectCommand(std::vector<std::tuple<Command, tlm::tlm_generic_payload *>> &) = 0;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time>
|
||||
selectCommand(std::list<std::tuple<Command, tlm::tlm_generic_payload *, sc_time>> &) = 0;
|
||||
};
|
||||
|
||||
#endif // CMDMUXIF_H
|
||||
|
||||
@@ -38,9 +38,13 @@
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *>
|
||||
CmdMuxOldest::selectCommand(std::vector<std::tuple<Command, tlm_generic_payload *>> &readyCommands)
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time>
|
||||
CmdMuxOldest::selectCommand(std::list<std::tuple<Command, tlm_generic_payload *, sc_time>> &readyCommands)
|
||||
{
|
||||
readyCommands.remove_if([](std::tuple<Command, tlm_generic_payload *, sc_time> element){return std::get<2>(element) != sc_time_stamp();});
|
||||
|
||||
if (!readyCommands.empty())
|
||||
{
|
||||
auto it = readyCommands.begin();
|
||||
auto result = it;
|
||||
uint64_t lastPayloadID = DramExtension::getPayloadID(std::get<1>(*it));
|
||||
@@ -57,4 +61,7 @@ CmdMuxOldest::selectCommand(std::vector<std::tuple<Command, tlm_generic_payload
|
||||
it++;
|
||||
}
|
||||
return *result;
|
||||
}
|
||||
else
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(Command::NOP, nullptr, sc_max_time());
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
class CmdMuxOldest : public CmdMuxIF
|
||||
{
|
||||
public:
|
||||
std::tuple<Command, tlm::tlm_generic_payload *>
|
||||
selectCommand(std::vector<std::tuple<Command, tlm::tlm_generic_payload *>> &);
|
||||
std::tuple<Command, tlm::tlm_generic_payload *, sc_time>
|
||||
selectCommand(std::list<std::tuple<Command, tlm::tlm_generic_payload *, sc_time>> &);
|
||||
};
|
||||
|
||||
#endif // CMDMUXOLDEST_H
|
||||
|
||||
@@ -38,9 +38,13 @@
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *>
|
||||
CmdMuxStrict::selectCommand(std::vector<std::tuple<Command, tlm_generic_payload *>> &readyCommands)
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time>
|
||||
CmdMuxStrict::selectCommand(std::list<std::tuple<Command, tlm_generic_payload *, sc_time>> &readyCommands)
|
||||
{
|
||||
readyCommands.remove_if([](std::tuple<Command, tlm_generic_payload *, sc_time> element){return std::get<2>(element) != sc_time_stamp();});
|
||||
|
||||
if (!readyCommands.empty())
|
||||
{
|
||||
for (auto it : readyCommands)
|
||||
{
|
||||
if (isCasCommand(std::get<0>(it)))
|
||||
@@ -57,5 +61,6 @@ CmdMuxStrict::selectCommand(std::vector<std::tuple<Command, tlm_generic_payload
|
||||
if (isRasCommand(std::get<0>(it)))
|
||||
return it;
|
||||
}
|
||||
return std::pair<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
}
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(Command::NOP, nullptr, sc_max_time());
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
class CmdMuxStrict : public CmdMuxIF
|
||||
{
|
||||
public:
|
||||
std::tuple<Command, tlm::tlm_generic_payload *>
|
||||
selectCommand(std::vector<std::tuple<Command, tlm::tlm_generic_payload *>> &);
|
||||
std::tuple<Command, tlm::tlm_generic_payload *, sc_time>
|
||||
selectCommand(std::list<std::tuple<Command, tlm::tlm_generic_payload *, sc_time>> &);
|
||||
|
||||
private:
|
||||
uint64_t nextPayloadID = 0;
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> PowerDownManagerDummy::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> PowerDownManagerDummy::getNextCommand()
|
||||
{
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(Command::NOP, nullptr, sc_max_time());
|
||||
}
|
||||
|
||||
sc_time PowerDownManagerDummy::start()
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
virtual void triggerExit() override {}
|
||||
virtual void triggerInterruption() override {}
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() override;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() override;
|
||||
virtual void updateState(Command) override {}
|
||||
virtual sc_time start() override;
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
virtual void triggerExit() = 0;
|
||||
virtual void triggerInterruption() = 0;
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() = 0;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() = 0;
|
||||
virtual void updateState(Command) = 0;
|
||||
virtual sc_time start() = 0;
|
||||
};
|
||||
|
||||
@@ -69,17 +69,15 @@ void PowerDownManagerStaggered::triggerInterruption()
|
||||
exitTriggered = true;
|
||||
}
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> PowerDownManagerStaggered::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> PowerDownManagerStaggered::getNextCommand()
|
||||
{
|
||||
if (sc_time_stamp() == timeToSchedule)
|
||||
return std::tuple<Command, tlm_generic_payload *>(nextCommand, &powerDownPayload);
|
||||
else
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(nextCommand, &powerDownPayload, timeToSchedule);
|
||||
}
|
||||
|
||||
sc_time PowerDownManagerStaggered::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (exitTriggered)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
virtual void triggerExit() override;
|
||||
virtual void triggerInterruption() override;
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() override;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() override;
|
||||
virtual void updateState(Command) override;
|
||||
virtual sc_time start() override;
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
CheckerIF *checker;
|
||||
|
||||
sc_time timeToSchedule = sc_max_time();
|
||||
Command nextCommand;
|
||||
Command nextCommand = Command::NOP;
|
||||
|
||||
bool controllerIdle = true;
|
||||
bool entryTriggered = true;
|
||||
|
||||
@@ -54,23 +54,22 @@ RefreshManagerBankwise::RefreshManagerBankwise(std::vector<BankMachine *> &bankM
|
||||
allBankMachines.push_back(bankMachines[bankID]);
|
||||
}
|
||||
remainingBankMachines = allBankMachines;
|
||||
currentBankMachine = *remainingBankMachines.begin();
|
||||
|
||||
maxPostponed = config.refreshMaxPostponed * memSpec->banksPerRank;
|
||||
maxPulledin = -(config.refreshMaxPulledin * memSpec->banksPerRank);
|
||||
}
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> RefreshManagerBankwise::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> RefreshManagerBankwise::getNextCommand()
|
||||
{
|
||||
if (sc_time_stamp() == timeToSchedule)
|
||||
return std::tuple<Command, tlm_generic_payload *>
|
||||
(nextCommand, &refreshPayloads[currentBankMachine->getBank().ID() % memSpec->banksPerRank]);
|
||||
else
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>
|
||||
(nextCommand, &refreshPayloads[currentBankMachine->getBank().ID() % memSpec->banksPerRank], timeToSchedule);
|
||||
}
|
||||
|
||||
sc_time RefreshManagerBankwise::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sc_time_stamp() >= timeForNextTrigger)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ class RefreshManagerBankwise final : public RefreshManagerIF
|
||||
public:
|
||||
RefreshManagerBankwise(std::vector<BankMachine *> &, PowerDownManagerIF *, Rank, CheckerIF *);
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() override;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() override;
|
||||
virtual sc_time start() override;
|
||||
virtual void updateState(Command) override;
|
||||
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
sc_time timeToSchedule = sc_max_time();
|
||||
Rank rank;
|
||||
CheckerIF *checker;
|
||||
Command nextCommand;
|
||||
Command nextCommand = Command::NOP;
|
||||
|
||||
std::list<BankMachine *> remainingBankMachines;
|
||||
std::list<BankMachine *> allBankMachines;
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> RefreshManagerDummy::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> RefreshManagerDummy::getNextCommand()
|
||||
{
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(Command::NOP, nullptr, sc_max_time());
|
||||
}
|
||||
|
||||
sc_time RefreshManagerDummy::start()
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
class RefreshManagerDummy final : public RefreshManagerIF
|
||||
{
|
||||
public:
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() override;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() override;
|
||||
virtual sc_time start() override;
|
||||
virtual void updateState(Command) override {}
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ class RefreshManagerIF
|
||||
public:
|
||||
virtual ~RefreshManagerIF() {}
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() = 0;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() = 0;
|
||||
virtual sc_time start() = 0;
|
||||
virtual void updateState(Command) = 0;
|
||||
};
|
||||
|
||||
@@ -52,17 +52,15 @@ RefreshManagerRankwise::RefreshManagerRankwise(std::vector<BankMachine *> &bankM
|
||||
maxPulledin = -config.refreshMaxPulledin;
|
||||
}
|
||||
|
||||
std::tuple<Command, tlm_generic_payload *> RefreshManagerRankwise::getNextCommand()
|
||||
std::tuple<Command, tlm_generic_payload *, sc_time> RefreshManagerRankwise::getNextCommand()
|
||||
{
|
||||
if (sc_time_stamp() == timeToSchedule)
|
||||
return std::tuple<Command, tlm_generic_payload *>(nextCommand, &refreshPayload);
|
||||
else
|
||||
return std::tuple<Command, tlm_generic_payload *>(Command::NOP, nullptr);
|
||||
return std::tuple<Command, tlm_generic_payload *, sc_time>(nextCommand, &refreshPayload, timeToSchedule);
|
||||
}
|
||||
|
||||
sc_time RefreshManagerRankwise::start()
|
||||
{
|
||||
timeToSchedule = sc_max_time();
|
||||
nextCommand = Command::NOP;
|
||||
|
||||
if (sc_time_stamp() >= timeForNextTrigger)
|
||||
{
|
||||
@@ -130,7 +128,7 @@ sc_time RefreshManagerRankwise::start()
|
||||
}
|
||||
else
|
||||
{
|
||||
// nextCommand stays Command::REFA
|
||||
nextCommand = Command::REFA;
|
||||
timeToSchedule = checker->timeToSatisfyConstraints(nextCommand, rank, BankGroup(0), Bank(0));
|
||||
return timeToSchedule;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class RefreshManagerRankwise final : public RefreshManagerIF
|
||||
public:
|
||||
RefreshManagerRankwise(std::vector<BankMachine *> &, PowerDownManagerIF *, Rank, CheckerIF *);
|
||||
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *> getNextCommand() override;
|
||||
virtual std::tuple<Command, tlm::tlm_generic_payload *, sc_time> getNextCommand() override;
|
||||
virtual sc_time start() override;
|
||||
virtual void updateState(Command) override;
|
||||
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
sc_time timeToSchedule = sc_max_time();
|
||||
Rank rank;
|
||||
CheckerIF *checker;
|
||||
Command nextCommand;
|
||||
Command nextCommand = Command::NOP;
|
||||
|
||||
unsigned activatedBanks = 0;
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ The content of [ddr3.json](DRAMSys/library/resources/configs/simulator/ddr3.json
|
||||
}
|
||||
```
|
||||
|
||||
- *SimulationName* (boolean)
|
||||
- *SimulationName* (string)
|
||||
- Give the name of the simulation for distinguishing from other simulations.
|
||||
- *Debug* (boolean)
|
||||
- true: enables debug output on console (only supported by a debug build)
|
||||
|
||||
Reference in New Issue
Block a user