refresh manger and bankwise refresh manager

This commit is contained in:
robert
2014-03-29 11:48:18 +01:00
parent 04e38d6663
commit e13f2b0868
19 changed files with 344 additions and 256 deletions

View File

@@ -11,6 +11,8 @@
#include "scheduling/checker/PrechargeChecker.h"
#include "scheduling/checker/ReadChecker.h"
#include "scheduling/checker/WriteChecker.h"
#include "refresh/RefreshManagerBankwise.h"
#include "refresh/RefreshManager.h"
namespace core {
@@ -18,14 +20,18 @@ Controller::Controller(IWrapperConnector& wrapperConnector, TlmRecorder& recorde
config(), state(config.numberOfBanks, config.nActivate), busChecker(config, state), wrapper(
wrapperConnector), commandChecker(), recorder(recorder), savedState(
config.numberOfBanks, config.nActivate), commandSequenceGenerator(state), commandSequenceScheduler(
*this), refreshManager(*this)
*this)
{
commandChecker[Command::Activate] = new ActivateChecker(config, state);
commandChecker[Command::Precharge] = new PrechargeChecker(config, state);
commandChecker[Command::Read] = new ReadChecker(config, state);
commandChecker[Command::Write] = new WriteChecker(config, state);
if(config.RefreshBankwise)
refreshManager = new RefreshManagerBankwise(*this);
else
refreshManager = new RefreshManager(*this);
}
Controller::~Controller()
@@ -34,6 +40,7 @@ Controller::~Controller()
delete commandChecker[Command::Precharge];
delete commandChecker[Command::Read];
delete commandChecker[Command::Write];
delete refreshManager;
}
void Controller::saveState()
@@ -49,7 +56,7 @@ void Controller::resetState()
void Controller::scheduleRefresh(tlm::tlm_generic_payload& payload, sc_time time)
{
cleanUpBus(time);
refreshManager.scheduleRefresh(payload, time);
refreshManager->scheduleRefresh(payload, time);
}
bool Controller::schedule(sc_time start, tlm::tlm_generic_payload& payload)
@@ -64,14 +71,13 @@ bool Controller::schedule(sc_time start, tlm::tlm_generic_payload& payload)
CommandSequence sequence = commandSequenceGenerator.generateCommandSequence(payload);
CommandSchedule schedule = commandSequenceScheduler.schedule(sequence, start, payload);
if (refreshManager.hasCollision(schedule))
if (refreshManager->hasCollision(schedule))
{
resetState();
return false;
}
else
{
schedule.record(recorder);
send(schedule);
return true;
}
@@ -105,9 +111,9 @@ void Controller::send(const CommandSchedule& schedule) const
{
wrapper.send(cmd);
}
}
void Controller::cleanUpBus(sc_time currentTime)
{
state.pendingBusCommands.erase(state.pendingBusCommands.begin(),