Debugs improved
This commit is contained in:
@@ -87,6 +87,10 @@ std::string commandToString(Command command)
|
||||
return "SREFX";
|
||||
break;
|
||||
|
||||
case Command::NOP:
|
||||
return "NOP";
|
||||
break;
|
||||
|
||||
default:
|
||||
SC_REPORT_FATAL("command", "commandToString was called with unknown command");
|
||||
break;
|
||||
|
||||
@@ -460,7 +460,7 @@ void Controller<BUSWIDTH>::scheduleNextFromScheduler(Bank bank)
|
||||
{
|
||||
controllerCore->powerDownManager->wakeUp(DramExtension::getExtension(nextRequest.second).getBank(), sc_time_stamp());
|
||||
controllerCore->scheduleRequest(nextRequest.first, *nextRequest.second);
|
||||
printDebugMessage("\t-> Next payload was scheduled by core");
|
||||
printDebugMessage("\t-> Next payload was scheduled by core [" + commandToString(nextRequest.first) + "]");
|
||||
}
|
||||
|
||||
while (!blockedRequests.empty()) {
|
||||
@@ -471,7 +471,7 @@ void Controller<BUSWIDTH>::scheduleNextFromScheduler(Bank bank)
|
||||
if (nextRequest.second != NULL) {
|
||||
controllerCore->powerDownManager->wakeUp(DramExtension::getExtension(nextRequest.second).getBank(), sc_time_stamp());
|
||||
controllerCore->scheduleRequest(nextRequest.first, *nextRequest.second);
|
||||
printDebugMessage("\t-> Next payload was scheduled by core");
|
||||
printDebugMessage("\t-> Next payload was scheduled by core [" + commandToString(nextRequest.first) + "] (unblocked)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ const ScheduledCommand ControllerState::getLastScheduledCommand()
|
||||
}
|
||||
}
|
||||
|
||||
printDebugMessage("Last scheduled command was " + commandToString(lastCommand.getCommand()));
|
||||
|
||||
return lastCommand;
|
||||
}
|
||||
|
||||
@@ -87,6 +89,8 @@ const ScheduledCommand ControllerState::getLastScheduledCommand(Bank bank)
|
||||
lastCommand = current;
|
||||
}
|
||||
|
||||
printDebugMessage("Last scheduled command on bank " + to_string(bank.ID()) + " was " + commandToString(lastCommand.getCommand()));
|
||||
|
||||
return lastCommand;
|
||||
}
|
||||
|
||||
@@ -145,3 +149,9 @@ void ControllerState::cleanUp(sc_time time)
|
||||
if(time >= config->memSpec.tActHistory())
|
||||
lastActivates.erase(lastActivates.begin(), lastActivates.lower_bound(time - config->memSpec.tActHistory()));
|
||||
}
|
||||
|
||||
void ControllerState::printDebugMessage(std::string message)
|
||||
{
|
||||
DebugManager::getInstance().printDebugMessage(ownerName, message);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
class ControllerState
|
||||
{
|
||||
public:
|
||||
ControllerState(std::string ownerName, Configuration* config) : bus(config->memSpec.clk), config(config)
|
||||
ControllerState(std::string ownerName, Configuration* config) : bus(config->memSpec.clk), config(config), ownerName(ownerName)
|
||||
{
|
||||
rowBufferStates = new RowBufferState(ownerName);
|
||||
rowBufferStates = new RowBufferState(ownerName);
|
||||
}
|
||||
virtual ~ControllerState(){}
|
||||
|
||||
@@ -75,7 +75,9 @@ public:
|
||||
std::map<sc_time, ScheduledCommand> lastActivates;
|
||||
|
||||
private:
|
||||
std::string ownerName;
|
||||
Configuration* config;
|
||||
void printDebugMessage(std::string message);
|
||||
};
|
||||
|
||||
#endif /* CONTROLLER_STATE_H_ */
|
||||
|
||||
@@ -82,6 +82,7 @@ inline Command IPowerDownManager::getSleepCommand(PowerDownState state)
|
||||
break;
|
||||
default:
|
||||
SC_REPORT_FATAL("In PowerDownManager sendPowerdownBegin", "invalid powerDownState");
|
||||
break;
|
||||
}
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ void PowerDownManager::sleep(Bank bank, sc_time time)
|
||||
|
||||
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);
|
||||
@@ -116,16 +118,25 @@ void PowerDownManager::wakeUp(Bank bank, sc_time time)
|
||||
DramExtension::getExtension(powerDownPayloads[bank]));
|
||||
controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
|
||||
|
||||
if (cmd == Command::SREFX)
|
||||
if (cmd == Command::SREFX) {
|
||||
// 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");
|
||||
sendPowerDownPayloads(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);
|
||||
@@ -133,8 +144,12 @@ void PowerDownManager::wakeUpForRefresh(Bank bank, sc_time time)
|
||||
DramExtension::getExtension(powerDownPayloads[bank]));
|
||||
|
||||
setPowerDownState(PowerDownState::AwakeForRefresh);
|
||||
|
||||
printDebugMessage("Sending power down exit command " + commandToString(cmd) + " on all banks");
|
||||
sendPowerDownPayloads(pdn);
|
||||
}
|
||||
|
||||
printDebugMessage("Awaken for refresh at " + time.to_string() + " current power down state is " + powerDownStateToString(powerDownState));
|
||||
}
|
||||
|
||||
void PowerDownManager::sendPowerDownPayloads(ScheduledCommand& cmd)
|
||||
@@ -144,9 +159,9 @@ void PowerDownManager::sendPowerDownPayloads(ScheduledCommand& cmd)
|
||||
{
|
||||
tlm_generic_payload& payloadToSend = powerDownPayloads[bank];
|
||||
|
||||
ScheduledCommand pdnToSend(cmd.getCommand(), cmd.getStart(), cmd.getExecutionTime(),
|
||||
DramExtension::getExtension(payloadToSend));
|
||||
ScheduledCommand pdnToSend(cmd.getCommand(), cmd.getStart(), cmd.getExecutionTime(), DramExtension::getExtension(payloadToSend));
|
||||
controllerCore.state->change(pdnToSend);
|
||||
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());
|
||||
controllerCore.controller.send(pdnToSend, payloadToSend);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,6 @@ void PowerDownManagerBankwise::wakeUp(Bank bank, sc_time time)
|
||||
// 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());
|
||||
|
||||
}
|
||||
|
||||
setState(PowerDownState::Awake, bank);
|
||||
|
||||
@@ -46,6 +46,7 @@ using namespace tlm;
|
||||
|
||||
PowerDownManagerTimeout::PowerDownManagerTimeout(sc_module_name /*name*/, ControllerCore& controller): controllerCore(controller)
|
||||
{
|
||||
powerDownState = PowerDownState::Awake;
|
||||
for (Bank bank : controller.getBanks())
|
||||
{
|
||||
setUpDummy(powerDownPayloads[bank], bank);
|
||||
@@ -113,6 +114,8 @@ void PowerDownManagerTimeout::setPowerDownState(PowerDownState state)
|
||||
|
||||
void PowerDownManagerTimeout::wakeUp(Bank bank, sc_time time)
|
||||
{
|
||||
printDebugMessage("Waking up at " + time.to_string() + " current power down state is " + powerDownStateToString(powerDownState));
|
||||
|
||||
if (isInPowerDown()) //Request wakes up power down
|
||||
{
|
||||
Command cmd = IPowerDownManager::getWakeUpCommand(powerDownState);
|
||||
@@ -120,16 +123,25 @@ void PowerDownManagerTimeout::wakeUp(Bank bank, sc_time time)
|
||||
DramExtension::getExtension(powerDownPayloads[bank]));
|
||||
controllerCore.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
|
||||
|
||||
if (cmd == Command::SREFX)
|
||||
if (cmd == Command::SREFX) {
|
||||
// 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");
|
||||
sendPowerDownPayloads(pdn);
|
||||
}
|
||||
|
||||
printDebugMessage("Awaken at " + time.to_string() + " current power down state is " + powerDownStateToString(powerDownState));
|
||||
}
|
||||
|
||||
void PowerDownManagerTimeout::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);
|
||||
@@ -137,10 +149,14 @@ void PowerDownManagerTimeout::wakeUpForRefresh(Bank bank, sc_time time)
|
||||
DramExtension::getExtension(powerDownPayloads[bank]));
|
||||
|
||||
setPowerDownState(PowerDownState::AwakeForRefresh);
|
||||
|
||||
printDebugMessage("Sending power down exit command " + commandToString(cmd) + " on all banks");
|
||||
sendPowerDownPayloads(pdn);
|
||||
|
||||
// Schedule Next Powerdown after Refresh:
|
||||
}
|
||||
|
||||
printDebugMessage("Awaken for refresh at " + time.to_string() + " current power down state is " + powerDownStateToString(powerDownState));
|
||||
}
|
||||
|
||||
void PowerDownManagerTimeout::triggerSleep(Bank /*bank*/, sc_time time)
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
std::map<Bank, tlm::tlm_generic_payload> powerDownPayloads;
|
||||
void sendPowerDownPayloads(ScheduledCommand& cmd);
|
||||
|
||||
PowerDownState powerDownState = PowerDownState::Awake;
|
||||
PowerDownState powerDownState;
|
||||
void setPowerDownState(PowerDownState state);
|
||||
bool isInPowerDown();
|
||||
void printDebugMessage(std::string message);
|
||||
|
||||
Reference in New Issue
Block a user