OpenASIP 2.2
Loading...
Searching...
No Matches
UtilizationStats.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file UtilizationStats.hh
26 *
27 * Declaration of UtilizationStats class.
28 *
29 * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_UTILIZATION_STATS_HH
34#define TTA_UTILIZATION_STATS_HH
35
36#include <map>
37#include <string>
38
40#include "SimulatorConstants.hh"
41
42namespace TTAMachine {
43 class Guard;
44}
45
46/**
47 * Calculates processor utilization data from instructions and their
48 * execution counts.
49 */
51public:
52 /// Index for connecting component names to utilization counts.
53 typedef std::map<std::string, ClockCycleCount> ComponentUtilizationIndex;
54 /// Index for connecting register indices to utilization counts.
55 /// The first number in the pair is the count of reads, and the second
56 /// is the count of writes.
57 typedef std::map<int, std::pair<ClockCycleCount, ClockCycleCount> >
59 /// Index for connecting function unit and operations implemented in them
60 /// to utilization counts.
61 typedef std::map<std::string, ComponentUtilizationIndex>
63 /// Index for connecting register files and register utilization indices
64 /// in them.
65 typedef std::map<std::string, RegisterUtilizationIndex>
67
69 virtual ~UtilizationStats();
70
71 virtual void calculateForInstruction(
72 const TTAProgram::Instruction& instructionData,
73 const ExecutableInstruction& executionCounts);
74
75 ClockCycleCount busWrites(const std::string& busName) const;
76 ClockCycleCount socketWrites(const std::string& socketName) const;
77 ClockCycleCount triggerCount(const std::string& fuName) const;
79 const std::string& operationName) const;
81 const std::string& fuName, const std::string& operationName) const;
83 const std::string& rfName,
84 int registerIndex) const;
86 const std::string& rfName,
87 int registerIndex) const;
89 const std::string& rfName,
90 int registerIndex) const;
92 const std::string& fuName,
93 const std::string& fuPort) const;
94
96
97 int highestUsedRegisterIndex() const;
98
99private:
100 /// Socket write counts.
102 /// Bus write counts.
104 /// Function unit utilizations, i.e., total operation triggerings.
106 /// Operation utilizations (started operations).
108 /// Index for operation utilizations for each function unit.
110 /// Register read and write data for each register in each register file.
112
113 /// Guard register accesses for each register in a RF.
115 /// Guard FU port accesses
117
118 /// The highest register index used. This is an uglish way to fetch
119 /// register access info for sequential simulation.
121};
122
123#endif
CycleCount ClockCycleCount
Alias for ClockCycleCount.
ComponentUtilizationIndex operations_
Operation utilizations (started operations).
std::map< std::string, ComponentUtilizationIndex > FUOperationUtilizationIndex
Index for connecting function unit and operations implemented in them to utilization counts.
int highestRegister_
The highest register index used. This is an uglish way to fetch register access info for sequential s...
int highestUsedRegisterIndex() const
FUOperationUtilizationIndex FUGuardAccesses() const
virtual ~UtilizationStats()
ClockCycleCount busWrites(const std::string &busName) const
ClockCycleCount operationExecutions(const std::string &operationName) const
FUOperationUtilizationIndex fuOperations_
Index for operation utilizations for each function unit.
ClockCycleCount triggerCount(const std::string &fuName) const
ComponentUtilizationIndex fus_
Function unit utilizations, i.e., total operation triggerings.
ClockCycleCount guardRegisterReads(const std::string &rfName, int registerIndex) const
ClockCycleCount registerReads(const std::string &rfName, int registerIndex) const
virtual void calculateForInstruction(const TTAProgram::Instruction &instructionData, const ExecutableInstruction &executionCounts)
RFRegisterUtilizationIndex guardRfAccesses_
Guard register accesses for each register in a RF.
ComponentUtilizationIndex sockets_
Socket write counts.
std::map< std::string, RegisterUtilizationIndex > RFRegisterUtilizationIndex
Index for connecting register files and register utilization indices in them.
std::map< int, std::pair< ClockCycleCount, ClockCycleCount > > RegisterUtilizationIndex
Index for connecting register indices to utilization counts. The first number in the pair is the coun...
ClockCycleCount registerWrites(const std::string &rfName, int registerIndex) const
ComponentUtilizationIndex buses_
Bus write counts.
std::map< std::string, ClockCycleCount > ComponentUtilizationIndex
Index for connecting component names to utilization counts.
ClockCycleCount socketWrites(const std::string &socketName) const
RFRegisterUtilizationIndex rfAccesses_
Register read and write data for each register in each register file.
FUOperationUtilizationIndex guardFUAccesses_
Guard FU port accesses.