OpenASIP  2.0
Public Member Functions | List of all members
CompiledSimUtilizationStats Class Reference

#include <CompiledSimUtilizationStats.hh>

Inheritance diagram for CompiledSimUtilizationStats:
Inheritance graph
Collaboration diagram for CompiledSimUtilizationStats:
Collaboration graph

Public Member Functions

 CompiledSimUtilizationStats ()
 
virtual ~CompiledSimUtilizationStats ()
 
virtual void calculate (const TTAProgram::Program &program, const CompiledSimulation &compiledSim)
 
- Public Member Functions inherited from UtilizationStats
 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 ()
 

Additional Inherited Members

- Public Types inherited from UtilizationStats
typedef std::map< std::string, ClockCycleCountComponentUtilizationIndex
 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, ComponentUtilizationIndexFUOperationUtilizationIndex
 Index for connecting function unit and operations implemented in them to utilization counts. More...
 
typedef std::map< std::string, RegisterUtilizationIndexRFRegisterUtilizationIndex
 Index for connecting register files and register utilization indices in them. More...
 

Detailed Description

Calculates processor utilization data for compiled simulations

Definition at line 47 of file CompiledSimUtilizationStats.hh.

Constructor & Destructor Documentation

◆ CompiledSimUtilizationStats()

CompiledSimUtilizationStats::CompiledSimUtilizationStats ( )

Default constructor

Definition at line 47 of file CompiledSimUtilizationStats.cc.

47  {
48 }

◆ ~CompiledSimUtilizationStats()

CompiledSimUtilizationStats::~CompiledSimUtilizationStats ( )
virtual

Default destructor

Definition at line 53 of file CompiledSimUtilizationStats.cc.

53  {
54 }

Member Function Documentation

◆ calculate()

void CompiledSimUtilizationStats::calculate ( const TTAProgram::Program program,
const CompiledSimulation compiledSim 
)
virtual

Definition at line 57 of file CompiledSimUtilizationStats.cc.

59  {
60 
61  // Loop all instructions of a program
62  const Instruction* instr = &program.firstInstruction();
63 
64  int moveNumber = 0;
65 
66  while (instr != &NullInstruction::instance()) {
67 
68  ExecutableInstruction executableInstr;
69 
70  // Add moves and their execution counts
71  for (int i = 0; i < instr->moveCount(); ++i, moveNumber++) {
72  ClockCycleCount execCount = compiledSim.moveExecutionCount(
73  moveNumber, instr->address().location());
74  DummyExecutableMove* move = new DummyExecutableMove(execCount);
75  executableInstr.addExecutableMove(move);
76  }
77 
78  // Calculate execution counts so far
79  UtilizationStats::calculateForInstruction(*instr, executableInstr);
80 
81  instr = &program.nextInstruction(*instr);
82  }
83 }

References ExecutableInstruction::addExecutableMove(), TTAProgram::Instruction::address(), UtilizationStats::calculateForInstruction(), TTAProgram::NullInstruction::instance(), TTAProgram::Address::location(), TTAProgram::Instruction::moveCount(), CompiledSimulation::moveExecutionCount(), and program.

Referenced by SimulatorFrontend::utilizationStatistics().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
ExecutableInstruction
Definition: ExecutableInstruction.hh:49
TTAProgram::Instruction
Definition: Instruction.hh:57
UtilizationStats::calculateForInstruction
virtual void calculateForInstruction(const TTAProgram::Instruction &instructionData, const ExecutableInstruction &executionCounts)
Definition: UtilizationStats.cc:74
DummyExecutableMove
Definition: ExecutableMove.hh:121
ExecutableInstruction::addExecutableMove
void addExecutableMove(ExecutableMove *move)
Definition: ExecutableInstruction.cc:64
TTAProgram::Address::location
InstructionAddress location() const
CompiledSimulation::moveExecutionCount
virtual ClockCycleCount moveExecutionCount(int moveNumber, InstructionAddress address) const
Definition: CompiledSimulation.cc:365
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
TTAProgram::Instruction::moveCount
int moveCount() const
Definition: Instruction.cc:176
TTAProgram::Instruction::address
Address address() const
Definition: Instruction.cc:327