/* * controller.h * * Created on: Mar 5, 2014 * Author: jonny */ #ifndef CONTROLLER_H_ #define CONTROLLER_H_ #include #include #include "IWrapperConnector.h" #include "CommandBus.h" #include "Configuration.h" #include "powerdown/PowerDownManager.h" #include "refresh/RefreshManager.h" #include "scheduling/CommandSequenceGenerator.h" #include "scheduling/checker/ICommandChecker.h" #include "scheduling/CommandSequenceScheduler.h" namespace core { class DramController { public: DramController(IWrapperConnector& wrapper); virtual ~DramController() ; bool schedule(sc_time currentTime, tlm::tlm_generic_payload& payload); bool isBusy(sc_time currentTime, Bank bank); void scheduleRefresh(sc_time time); const ICommandChecker& getChecker(Command command) const; Configuration config; const BankStates& getBankStates(){return state.bankStates;} void saveState(); void resetState(); private: ControllerState state; ControllerState savedState; CommandSequenceGenerator commandSequenceGenerator; std::map commandChecker; CommandSequenceScheduler commandSequenceScheduler; CommandBus bus; RefreshManager refreshManager; //std::vector allCommandChecker; //PowerDownManager powerDownManager; void addCommandChecker(Command command, ICommandChecker* checker); }; } /* namespace controller */ #endif /* CONTROLLER_H_ */