56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
/*
|
|
* controller_state.h
|
|
*
|
|
* Created on: Mar 5, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#ifndef CONTROLLER_STATE_H_
|
|
#define CONTROLLER_STATE_H_
|
|
|
|
#include <systemc.h>
|
|
#include "BankStates.h"
|
|
#include "utils/RingBuffer.h"
|
|
#include "scheduling/ScheduledCommand.h"
|
|
#include "Slots.h"
|
|
#include "configuration/Configuration.h"
|
|
#include <map>
|
|
#include <set>
|
|
#include <list>
|
|
|
|
namespace core {
|
|
|
|
class ControllerState
|
|
{
|
|
public:
|
|
ControllerState(Configuration* config) :
|
|
bankStates(), bus(config->Timings.clk), config(config)
|
|
{
|
|
}
|
|
virtual ~ControllerState()
|
|
{
|
|
}
|
|
|
|
const ScheduledCommand getLastCommand(Command command, Bank bank);
|
|
const ScheduledCommand getLastCommand(Command command);
|
|
const ScheduledCommand getLastScheduledCommand(Bank bank);
|
|
|
|
void change(const ScheduledCommand& scheduledCommand);
|
|
void cleanUp(sc_time time);
|
|
|
|
BankStates bankStates;
|
|
|
|
//used by the various checkers
|
|
std::map<Command, std::map<Bank, ScheduledCommand> > lastCommandsOnBus;
|
|
Slots bus;
|
|
std::list<ScheduledCommand> lastDataStrobeCommands;
|
|
std::map<sc_time, Bank> lastActivates;
|
|
|
|
private:
|
|
Configuration* config;
|
|
};
|
|
|
|
} /* namespace controller */
|
|
|
|
#endif /* CONTROLLER_STATE_H_ */
|