OpenASIP
2.0
|
#include <UtilizationStats.hh>
Public Types | |
typedef std::map< std::string, ClockCycleCount > | ComponentUtilizationIndex |
Index for connecting component names to utilization counts. More... | |
typedef std::map< int, std::pair< ClockCycleCount, ClockCycleCount > > | RegisterUtilizationIndex |
Index for connecting register indices to utilization counts. The first number in the pair is the count of reads, and the second is the count of writes. More... | |
typedef std::map< std::string, ComponentUtilizationIndex > | FUOperationUtilizationIndex |
Index for connecting function unit and operations implemented in them to utilization counts. More... | |
typedef std::map< std::string, RegisterUtilizationIndex > | RFRegisterUtilizationIndex |
Index for connecting register files and register utilization indices in them. More... | |
Public Member Functions | |
UtilizationStats () | |
virtual | ~UtilizationStats () |
virtual void | calculateForInstruction (const TTAProgram::Instruction &instructionData, const ExecutableInstruction &executionCounts) |
ClockCycleCount | busWrites (const std::string &busName) const |
ClockCycleCount | socketWrites (const std::string &socketName) const |
ClockCycleCount | triggerCount (const std::string &fuName) const |
ClockCycleCount | operationExecutions (const std::string &operationName) const |
ClockCycleCount | operationExecutions (const std::string &fuName, const std::string &operationName) const |
ClockCycleCount | registerReads (const std::string &rfName, int registerIndex) const |
ClockCycleCount | guardRegisterReads (const std::string &rfName, int registerIndex) const |
ClockCycleCount | registerWrites (const std::string &rfName, int registerIndex) const |
ClockCycleCount | FUGuardAccesses (const std::string &fuName, const std::string &fuPort) const |
FUOperationUtilizationIndex | FUGuardAccesses () const |
int | highestUsedRegisterIndex () const |
Public Member Functions inherited from SimulationStatisticsCalculator | |
SimulationStatisticsCalculator () | |
virtual | ~SimulationStatisticsCalculator () |
Private Attributes | |
ComponentUtilizationIndex | sockets_ |
Socket write counts. More... | |
ComponentUtilizationIndex | buses_ |
Bus write counts. More... | |
ComponentUtilizationIndex | fus_ |
Function unit utilizations, i.e., total operation triggerings. More... | |
ComponentUtilizationIndex | operations_ |
Operation utilizations (started operations). More... | |
FUOperationUtilizationIndex | fuOperations_ |
Index for operation utilizations for each function unit. More... | |
RFRegisterUtilizationIndex | rfAccesses_ |
Register read and write data for each register in each register file. More... | |
RFRegisterUtilizationIndex | guardRfAccesses_ |
Guard register accesses for each register in a RF. More... | |
FUOperationUtilizationIndex | guardFUAccesses_ |
Guard FU port accesses. More... | |
int | highestRegister_ |
The highest register index used. This is an uglish way to fetch register access info for sequential simulation. More... | |
Calculates processor utilization data from instructions and their execution counts.
Definition at line 50 of file UtilizationStats.hh.
typedef std::map<std::string, ClockCycleCount> UtilizationStats::ComponentUtilizationIndex |
Index for connecting component names to utilization counts.
Definition at line 53 of file UtilizationStats.hh.
typedef std::map<std::string, ComponentUtilizationIndex> UtilizationStats::FUOperationUtilizationIndex |
Index for connecting function unit and operations implemented in them to utilization counts.
Definition at line 62 of file UtilizationStats.hh.
typedef std::map<int, std::pair<ClockCycleCount, ClockCycleCount> > UtilizationStats::RegisterUtilizationIndex |
Index for connecting register indices to utilization counts. The first number in the pair is the count of reads, and the second is the count of writes.
Definition at line 58 of file UtilizationStats.hh.
typedef std::map<std::string, RegisterUtilizationIndex> UtilizationStats::RFRegisterUtilizationIndex |
Index for connecting register files and register utilization indices in them.
Definition at line 66 of file UtilizationStats.hh.
UtilizationStats::UtilizationStats | ( | ) |
|
virtual |
ClockCycleCount UtilizationStats::busWrites | ( | const std::string & | busName | ) | const |
Returns the count of writes to the given bus.
busName | The name of the bus. |
Definition at line 192 of file UtilizationStats.cc.
References buses_, and MapTools::containsKey().
Referenced by ProximBusDetailsCmd::Do(), InfoProcCommand::execute(), SimulatorFrontend::finishSimulation(), and ProximMachineStateWindow::setUtilizationHighlights().
|
virtual |
Accumulates the utilization counts for each machine part used by the instruction.
instructionData | The instruction. |
executionCounts | Execution counts of the instruction. |
Implements SimulationStatisticsCalculator.
Definition at line 74 of file UtilizationStats.cc.
References TTAProgram::Move::bus(), buses_, TTAProgram::Move::destination(), TTAProgram::Move::destinationSocket(), TTAProgram::Terminal::functionUnit(), fuOperations_, fus_, TTAProgram::MoveGuard::guard(), TTAProgram::Move::guard(), guardFUAccesses_, guardRegisterReads(), guardRfAccesses_, highestRegister_, TTAProgram::Terminal::immediateUnit(), TTAProgram::Terminal::index(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediate(), TTAProgram::Terminal::isImmediateRegister(), TTAMachine::BaseFUPort::isTriggering(), TTAProgram::Move::isUnconditional(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), ExecutableInstruction::moveExecutionCount(), TTAMachine::Port::name(), TTAMachine::Component::name(), Operation::name(), TTAProgram::Terminal::operation(), operations_, TTAMachine::BaseFUPort::parentUnit(), TTAProgram::Terminal::port(), TTAMachine::PortGuard::port(), TTAProgram::Terminal::registerFile(), TTAMachine::RegisterGuard::registerFile(), TTAMachine::RegisterGuard::registerIndex(), registerReads(), registerWrites(), rfAccesses_, sockets_, TTAProgram::Move::source(), TTAProgram::Move::sourceSocket(), and StringTools::stringToUpper().
Referenced by CompiledSimUtilizationStats::calculate().
UtilizationStats::FUOperationUtilizationIndex UtilizationStats::FUGuardAccesses | ( | ) | const |
Returns a map containing the FU port guard accesses
Definition at line 355 of file UtilizationStats.cc.
References guardFUAccesses_.
ClockCycleCount UtilizationStats::FUGuardAccesses | ( | const std::string & | fuName, |
const std::string & | fuPort | ||
) | const |
Returns number of reads for a single FU port guard
fuName | Name of the FU |
fuPort | Name of the FU port |
Definition at line 336 of file UtilizationStats.cc.
References guardFUAccesses_.
Referenced by InfoProcCommand::execute().
ClockCycleCount UtilizationStats::guardRegisterReads | ( | const std::string & | rfName, |
int | registerIndex | ||
) | const |
Returns the count of times the guarded register was read during simulation.
rfName | The name of the register file. |
registerIndex | The index of the register. |
Definition at line 292 of file UtilizationStats.cc.
References guardRfAccesses_, and MapTools::valueForKey().
Referenced by calculateForInstruction(), and InfoProcCommand::execute().
int UtilizationStats::highestUsedRegisterIndex | ( | ) | const |
Returns the highest used register index.
This is useful when fetching register access data for sequential simulation.
Definition at line 367 of file UtilizationStats.cc.
References highestRegister_.
ClockCycleCount UtilizationStats::operationExecutions | ( | const std::string & | fuName, |
const std::string & | operationName | ||
) | const |
Returns the total count of given operation executions in given FU.
fuName | The name of the function unit. |
operationName | The name of the operation. |
Definition at line 251 of file UtilizationStats.cc.
References fuOperations_.
ClockCycleCount UtilizationStats::operationExecutions | ( | const std::string & | operationName | ) | const |
Returns the total count of operation executions.
operationName | The name of the operation. |
Definition at line 234 of file UtilizationStats.cc.
References MapTools::containsKey(), and operations_.
Referenced by ProximFUDetailsCmd::Do(), InfoProcCommand::execute(), InfoStatsCommand::execute(), and SimulatorFrontend::finishSimulation().
ClockCycleCount UtilizationStats::registerReads | ( | const std::string & | rfName, |
int | registerIndex | ||
) | const |
Returns the count of times the given register was read during simulation.
rfName | The name of the register file. |
registerIndex | The index of the register. |
Definition at line 270 of file UtilizationStats.cc.
References rfAccesses_, and MapTools::valueForKey().
Referenced by calculateForInstruction(), ProximRFDetailsCmd::Do(), ProximIUDetailsCmd::Do(), InfoProcCommand::execute(), InfoStatsCommand::execute(), and SimulatorFrontend::finishSimulation().
ClockCycleCount UtilizationStats::registerWrites | ( | const std::string & | rfName, |
int | registerIndex | ||
) | const |
Returns the count of times the given register was written during simulation.
rfName | The name of the register file. |
registerIndex | The index of the register. |
Definition at line 314 of file UtilizationStats.cc.
References rfAccesses_, and MapTools::valueForKey().
Referenced by calculateForInstruction(), ProximRFDetailsCmd::Do(), ProximIUDetailsCmd::Do(), InfoProcCommand::execute(), InfoStatsCommand::execute(), and SimulatorFrontend::finishSimulation().
ClockCycleCount UtilizationStats::socketWrites | ( | const std::string & | socketName | ) | const |
Returns the count of writes to the given socket.
socketName | The name of the socket. |
Definition at line 206 of file UtilizationStats.cc.
References MapTools::containsKey(), and sockets_.
Referenced by ProximSocketDetailsCmd::Do(), InfoProcCommand::execute(), SimulatorFrontend::finishSimulation(), and ProximMachineStateWindow::setUtilizationHighlights().
ClockCycleCount UtilizationStats::triggerCount | ( | const std::string & | fuName | ) | const |
Returns the count of operation triggers in given FU.
fuName | The name of the FU. |
Definition at line 220 of file UtilizationStats.cc.
References MapTools::containsKey(), and fus_.
Referenced by ProximFUDetailsCmd::Do(), InfoProcCommand::execute(), SimulatorFrontend::finishSimulation(), and ProximMachineStateWindow::setUtilizationHighlights().
|
private |
Bus write counts.
Definition at line 103 of file UtilizationStats.hh.
Referenced by busWrites(), and calculateForInstruction().
|
private |
Index for operation utilizations for each function unit.
Definition at line 109 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and operationExecutions().
|
private |
Function unit utilizations, i.e., total operation triggerings.
Definition at line 105 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and triggerCount().
|
private |
Guard FU port accesses.
Definition at line 116 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and FUGuardAccesses().
|
private |
Guard register accesses for each register in a RF.
Definition at line 114 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and guardRegisterReads().
|
private |
The highest register index used. This is an uglish way to fetch register access info for sequential simulation.
Definition at line 120 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and highestUsedRegisterIndex().
|
private |
Operation utilizations (started operations).
Definition at line 107 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and operationExecutions().
|
private |
Register read and write data for each register in each register file.
Definition at line 111 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), registerReads(), and registerWrites().
|
private |
Socket write counts.
Definition at line 101 of file UtilizationStats.hh.
Referenced by calculateForInstruction(), and socketWrites().