68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
/*
|
|
* BankwiseRefreshManager.h
|
|
*
|
|
* Created on: Mar 9, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#ifndef BANKWISEREFRESHMANAGER_H_
|
|
#define BANKWISEREFRESHMANAGER_H_
|
|
|
|
#include "../scheduling/CommandSchedule.h"
|
|
#include "../../common/dramExtension.h"
|
|
#include "../configuration/TimingConfiguration.h"
|
|
#include "IRefreshManager.h"
|
|
|
|
namespace core {
|
|
|
|
class ControllerCore;
|
|
|
|
class RefreshManagerBankwise : public IRefreshManager
|
|
{
|
|
public:
|
|
RefreshManagerBankwise(ControllerCore& controller);
|
|
virtual ~RefreshManagerBankwise();
|
|
|
|
virtual bool hasCollision(const CommandSchedule& schedule) override;
|
|
virtual void scheduleRefresh(tlm::tlm_generic_payload& payload, sc_time time) override;
|
|
|
|
void reInitialize(tlm::tlm_generic_payload& payload, sc_time time) override;
|
|
|
|
bool isInvalidated(tlm::tlm_generic_payload& payload,sc_time time) override;
|
|
|
|
private:
|
|
|
|
class RefreshManagerForBank
|
|
{
|
|
public:
|
|
RefreshManagerForBank(ControllerCore& controller, Bank bank);
|
|
~RefreshManagerForBank();
|
|
|
|
bool hasCollision(const CommandSchedule& schedule);
|
|
void scheduleRefresh(sc_time time);
|
|
|
|
void reInitialize(tlm::tlm_generic_payload& payload, sc_time time);
|
|
|
|
bool isInvalidated(sc_time);
|
|
private:
|
|
ControllerCore& controller;
|
|
RefreshTiming& timing;
|
|
Bank bank;
|
|
|
|
tlm::tlm_generic_payload refreshPayload;
|
|
sc_time nextPlannedRefresh;
|
|
|
|
void planNextRefresh();
|
|
void setupTransaction();
|
|
};
|
|
|
|
ControllerCore& controller;
|
|
std::vector<RefreshManagerForBank*> refreshManagerForBanks;
|
|
|
|
|
|
};
|
|
|
|
} /* namespace controller */
|
|
|
|
#endif /* BANKWISEREFRESHMANAGER_H_ */
|