66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
/*
|
|
* ControllerCore.h
|
|
*
|
|
* Created on: Mar 5, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#ifndef CONTROLLER_H_
|
|
#define CONTROLLER_H_
|
|
|
|
#include <tlm.h>
|
|
#include <map>
|
|
#include "IWrapperConnector.h"
|
|
#include "configuration/Configuration.h"
|
|
#include "powerdown/PowerDownManager.h"
|
|
#include "refresh/IRefreshManager.h"
|
|
#include "scheduling/CommandSequenceGenerator.h"
|
|
#include "scheduling/checker/ICommandChecker.h"
|
|
#include "scheduling/CommandSequenceScheduler.h"
|
|
#include "../common/TlmRecorder.h"
|
|
|
|
namespace core {
|
|
|
|
class ControllerCore
|
|
{
|
|
public:
|
|
ControllerCore(IWrapperConnector& wrapper, std::map<Bank, int>& numberOfPayloads);
|
|
virtual ~ControllerCore() ;
|
|
|
|
bool isBusy(sc_time currentTime, Bank bank);
|
|
bool scheduleRequest(sc_time currentTime, tlm::tlm_generic_payload& payload);
|
|
void triggerRefresh(tlm::tlm_generic_payload& payload, sc_time time);
|
|
void triggerWakeUp(tlm::tlm_generic_payload& payload, sc_time time);
|
|
|
|
const BankStates& getBankStates(){return state.bankStates;}
|
|
|
|
void saveState();
|
|
void resetState();
|
|
|
|
|
|
const std::vector<Bank>& getBanks() const;//TODO put in config?
|
|
|
|
void send(const CommandSchedule& schedule, tlm::tlm_generic_payload& payload) const;
|
|
ICommandChecker& getCommandChecker(Command command);
|
|
|
|
Configuration config;
|
|
ControllerState state;
|
|
IWrapperConnector& wrapper;
|
|
|
|
IPowerDownManager* powerDownManager;
|
|
IRefreshManager* refreshManager;
|
|
std::map<Bank,int>& numberOfPayloads;
|
|
static std::string senderName;
|
|
static void printDebugMessage(string message);
|
|
|
|
private:
|
|
std::map<Command, ICommandChecker*> commandChecker;
|
|
ControllerState savedState;
|
|
CommandSequenceGenerator commandSequenceGenerator;
|
|
CommandSequenceScheduler commandSequenceScheduler;
|
|
};
|
|
|
|
} /* namespace controller */
|
|
|
|
#endif /* CONTROLLER_H_ */
|