OpenASIP
2.0
|
#include <RFAccessTracker.hh>
Public Types | |
typedef boost::tuple< std::string, std::size_t, std::size_t > | ConcurrentRFAccess |
type to be used as a key for storing concurrent access info More... | |
typedef std::map< ConcurrentRFAccess, ClockCycleCount > | ConcurrentRFAccessIndex |
concurrent accesses and their counts More... | |
Public Member Functions | |
RFAccessTracker (SimulatorFrontend &frontend, const InstructionMemory &instructions) | |
virtual | ~RFAccessTracker () |
virtual void | handleEvent (int event) |
ClockCycleCount | concurrentRegisterFileAccessCount (const std::string &rfName, std::size_t concurrentWrites, std::size_t concurrentReads) const |
const ConcurrentRFAccessIndex & | accessDataBase () const |
Public Member Functions inherited from Listener | |
Listener () | |
virtual | ~Listener () |
virtual void | handleEvent () |
Private Types | |
typedef hash_map< const char *, boost::tuple< std::size_t, std::size_t > > | RFAccessIndex |
Index for RF accesses in an instruction. More... | |
Private Attributes | |
SimulatorFrontend & | frontend_ |
the simulator frontend used to access simulation data More... | |
const InstructionMemory & | instructionExecutions_ |
used to access instruction execution data More... | |
ConcurrentRFAccessIndex | conditionalAccesses_ |
conditional register file accesses are counted in this container More... | |
ConcurrentRFAccessIndex | totalAccesses_ |
total (conditional + unconditional) register file accesses are counted in this container More... | |
RFAccessIndex | accessesInInstruction_ |
container used in collecting register accesses in an instruction More... | |
Tracks concurrent register file accesses.
Definition at line 52 of file RFAccessTracker.hh.
typedef boost::tuple< std::string, std::size_t, std::size_t> RFAccessTracker::ConcurrentRFAccess |
type to be used as a key for storing concurrent access info
Definition at line 58 of file RFAccessTracker.hh.
typedef std::map<ConcurrentRFAccess, ClockCycleCount> RFAccessTracker::ConcurrentRFAccessIndex |
concurrent accesses and their counts
Definition at line 61 of file RFAccessTracker.hh.
|
private |
Index for RF accesses in an instruction.
Definition at line 82 of file RFAccessTracker.hh.
RFAccessTracker::RFAccessTracker | ( | SimulatorFrontend & | frontend, |
const InstructionMemory & | instructions | ||
) |
Constructor.
frontend | The SimulationFrontend which is used to access simulation data. |
instructions | Used to fetch instruction execution counts. |
Definition at line 63 of file RFAccessTracker.cc.
References SimulatorFrontend::eventHandler(), Informer::registerListener(), SimulationEventHandler::SE_CYCLE_END, and SimulationEventHandler::SE_SIMULATION_STOPPED.
|
virtual |
Destructor.
Definition at line 76 of file RFAccessTracker.cc.
References SimulatorFrontend::eventHandler(), frontend_, Informer::registerListener(), SimulationEventHandler::SE_CYCLE_END, SimulationEventHandler::SE_SIMULATION_STOPPED, and Informer::unregisterListener().
const RFAccessTracker::ConcurrentRFAccessIndex & RFAccessTracker::accessDataBase | ( | ) | const |
Returns the access data base.
In case statistics are not up-to-date, finalizes the calculation before returning the index.
Definition at line 220 of file RFAccessTracker.cc.
References totalAccesses_.
Referenced by InfoProcCommand::execute(), and SimulatorFrontend::finishSimulation().
ClockCycleCount RFAccessTracker::concurrentRegisterFileAccessCount | ( | const std::string & | rfName, |
std::size_t | concurrentWrites, | ||
std::size_t | concurrentReads | ||
) | const |
Returns the count of clock cycles in which the given register file was written and read concurrently the given times.
rfName | Name of the register file. |
concurrentWrites | Count of concurrent writes. |
concurrentReads | Count of concurrent reads. |
Definition at line 198 of file RFAccessTracker.cc.
References totalAccesses_.
|
virtual |
Counts the concurrent register file accesses of current clock cycle.
Reimplemented from Listener.
Definition at line 87 of file RFAccessTracker.cc.
References abortWithError, accessesInInstruction_, TTAProgram::Instruction::address(), conditionalAccesses_, TTAProgram::Move::destination(), ExecutableInstruction::executionCount(), frontend_, TTAProgram::Instruction::hasConditionalRegisterAccesses(), TTAProgram::Instruction::hasRegisterAccesses(), TTAProgram::NullInstruction::instance(), TTAProgram::Program::instructionAt(), InstructionMemory::instructionAtConst(), instructionExecutions_, TTAProgram::Terminal::isGPR(), SimulatorFrontend::lastExecutedInstruction(), TTAProgram::Address::location(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), ExecutableInstruction::moveSquashed(), TTAMachine::Component::name(), program, SimulatorFrontend::program(), TTAProgram::Terminal::registerFile(), SimulationEventHandler::SE_CYCLE_END, SimulationEventHandler::SE_SIMULATION_STOPPED, TTAProgram::Move::source(), and totalAccesses_.
|
private |
container used in collecting register accesses in an instruction
Definition at line 93 of file RFAccessTracker.hh.
Referenced by handleEvent().
|
private |
conditional register file accesses are counted in this container
Definition at line 88 of file RFAccessTracker.hh.
Referenced by handleEvent().
|
private |
the simulator frontend used to access simulation data
Definition at line 84 of file RFAccessTracker.hh.
Referenced by handleEvent(), and ~RFAccessTracker().
|
private |
used to access instruction execution data
Definition at line 86 of file RFAccessTracker.hh.
Referenced by handleEvent().
|
private |
total (conditional + unconditional) register file accesses are counted in this container
Definition at line 91 of file RFAccessTracker.hh.
Referenced by accessDataBase(), concurrentRegisterFileAccessCount(), and handleEvent().