OpenASIP 2.2
Loading...
Searching...
No Matches
Estimator.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 Estimator.hh
26 *
27 * Declaration of Estimator class
28 *
29 * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_COST_ESTIMATOR_HH
34#define TTA_COST_ESTIMATOR_HH
35
36#include <set>
37
38#include "Exception.hh"
39#include "CostEstimatorTypes.hh"
48#include "TransportPath.hh"
50
51class ExecutionTrace;
53class FUCostEstimationPlugin;
54class RFCostEstimationPlugin;
55
56namespace TTAMachine {
57 class Machine;
58 class FunctionUnit;
59 class BaseRegisterFile;
60 class FUPort;
61 class RFPort;
62 class Port;
63}
64
65namespace TTAProgram {
66 class Program;
67}
68
69namespace CostEstimator {
70
71/**
72 * The frontend to hardware cost estimation functionality.
73 *
74 * This class is used by clients that need to estimate area, energy, or
75 * delay of a whole TTA processor or parts of it.
76 *
77 * The estimation functions of this interface throw CannotEstimateCost,
78 * because it really is an exceptional situation when this class
79 * cannot estimate, because it's client's responsibility to make sure
80 * all plugins etc. can be found for estimating the machine. In case
81 * of single plugins, the situation is not exceptional, but they provide
82 * estimation as a "capability", thus they signal explicitly whether they
83 * can estimate a cost or not by returning true or false, respectively.
84 */
85class Estimator {
86public:
87 Estimator();
88 virtual ~Estimator();
89
90 /// area estimation functions
91
94 const IDF::MachineImplementation& machineImplementation);
95
98 const IDF::MachineImplementation& machineImplementation);
99
102 const IDF::MachineImplementation& machineImplementation);
103
106 const IDF::MachineImplementation& machineImplementation);
107
109 const TTAMachine::FunctionUnit& architecture,
110 const IDF::FUImplementationLocation& implementationEntry);
111
113 const TTAMachine::BaseRegisterFile& architecture,
114 const IDF::RFImplementationLocation& implementationEntry);
115
116 /// energy estimation functions
117
120 const IDF::MachineImplementation& machineImplementation,
121 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
122
125 const IDF::MachineImplementation& machineImplementation,
126 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
127
129 const TTAMachine::FunctionUnit& architecture,
130 const IDF::FUImplementationLocation& implementationEntry,
131 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
132
134 const TTAMachine::BaseRegisterFile& architecture,
135 const IDF::RFImplementationLocation& implementationEntry,
136 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
137
140 const IDF::MachineImplementation& machineImplementation,
141 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
142
145 const IDF::MachineImplementation& machineImplementation,
146 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
147
148 /// delay estimation functions
149
152 const IDF::MachineImplementation& machineImplementation);
153
156 const IDF::MachineImplementation& machineImplementation);
157
159 const TTAMachine::FUPort& port,
160 const IDF::FUImplementationLocation& implementationEntry);
161
163 const TTAMachine::FUPort& port,
164 const IDF::FUImplementationLocation& implementationEntry);
165
167 const TTAMachine::FunctionUnit& architecture,
169
171 const TTAMachine::BaseRegisterFile& architecture,
172 const IDF::RFImplementationLocation& implementationEntry);
173
175 const TTAMachine::RFPort& port,
176 const IDF::RFImplementationLocation& implementationEntry);
177
179 const TTAMachine::RFPort& port,
180 const IDF::RFImplementationLocation& implementationEntry);
181
182private:
185
187 const std::string pluginPath, const std::string pluginName,
188 const TransportPath& path,
189 const IDF::MachineImplementation& machineImplementation,
190 const IDF::SocketImplementationLocation& sourceSocketImplementation,
191 const IDF::BusImplementationLocation& busImplementation,
193 destinationSocketImplementation);
194
197
200
201 /// all accessed FU estimation plugins are stored in this registry
203 /// all accessed RF estimation plugins are stored in this registry
205 /// all accessed IC&decoder plugins are stored in this registry
207};
208
209}
210
211#endif
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
TTAMachine::Machine * machine
the architecture definition of the estimated processor
find Finds info of the inner loops in the program
AreaInGates icArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition Estimator.cc:206
FUCostEstimationPluginRegistry fuEstimatorPluginRegistry_
all accessed FU estimation plugins are stored in this registry
Definition Estimator.hh:202
FUCostEstimationPlugin & fuCostFunctionPluginOfImplementation(const IDF::FUImplementationLocation &implementation)
Definition Estimator.cc:260
AreaInGates totalAreaOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition Estimator.cc:103
EnergyInMilliJoules registerFileEnergy(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition Estimator.cc:551
AreaInGates totalAreaOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition Estimator.cc:162
EnergyInMilliJoules totalEnergyOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition Estimator.cc:592
ICDecoderCostEstimationPluginRegistry icDecoderEstimatorPluginRegistry_
all accessed IC&decoder plugins are stored in this registry
Definition Estimator.hh:206
EnergyInMilliJoules icEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition Estimator.cc:456
RFCostEstimationPluginRegistry rfEstimatorPluginRegistry_
all accessed RF estimation plugins are stored in this registry
Definition Estimator.hh:204
AreaInGates totalArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
area estimation functions
Definition Estimator.cc:84
EnergyInMilliJoules totalEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
energy estimation functions
Definition Estimator.cc:433
DelayInNanoSeconds decompressorDelay(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
static TransportPathList * findAllICPaths(const TTAMachine::Machine &machine)
DelayInNanoSeconds registerFileMaximumComputationDelay(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
Definition Estimator.cc:876
DelayInNanoSeconds functionUnitMaximumComputationDelay(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation)
Definition Estimator.cc:834
DelayInNanoSeconds estimateSocketToSocketDelayOfPath(const std::string pluginPath, const std::string pluginName, const TransportPath &path, const IDF::MachineImplementation &machineImplementation, const IDF::SocketImplementationLocation &sourceSocketImplementation, const IDF::BusImplementationLocation &busImplementation, const IDF::SocketImplementationLocation &destinationSocketImplementation)
DelayInNanoSeconds registerFilePortWriteDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
Definition Estimator.cc:756
DelayInNanoSeconds longestPath(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
delay estimation functions
Definition Estimator.cc:915
EnergyInMilliJoules totalEnergyOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition Estimator.cc:645
AreaInGates registerFileArea(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
Definition Estimator.cc:398
AreaInGates functionUnitArea(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry)
Definition Estimator.cc:364
DelayInNanoSeconds functionUnitPortReadDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
Definition Estimator.cc:718
RFCostEstimationPlugin & rfCostFunctionPluginOfImplementation(const IDF::RFImplementationLocation &implementation)
Definition Estimator.cc:312
DelayInNanoSeconds registerFilePortReadDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
Definition Estimator.cc:793
DelayInNanoSeconds functionUnitPortWriteDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
Definition Estimator.cc:679
EnergyInMilliJoules functionUnitEnergy(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition Estimator.cc:510
double AreaInGates
type for area values in equivalent gates
std::list< TransportPath > TransportPathList
double DelayInNanoSeconds
type for propagation delays in nano seconds
double EnergyInMilliJoules
type for consumed energy in milli joules