OpenASIP  2.0
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"
44 #include "MachineImplementation.hh"
48 #include "TransportPath.hh"
50 
51 class ExecutionTrace;
52 class UtilizationStats;
53 class FUCostEstimationPlugin;
54 class RFCostEstimationPlugin;
55 
56 namespace TTAMachine {
57  class Machine;
58  class FunctionUnit;
59  class BaseRegisterFile;
60  class FUPort;
61  class RFPort;
62  class Port;
63 }
64 
65 namespace TTAProgram {
66  class Program;
67 }
68 
69 namespace 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  */
85 class Estimator {
86 public:
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 
182 private:
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
CostEstimator::RFCostEstimationPlugin
Definition: RFCostEstimationPlugin.hh:67
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
RFImplementationLocation.hh
CostEstimator::Estimator::totalAreaOfRegisterFiles
AreaInGates totalAreaOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition: Estimator.cc:162
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
CostEstimator::Estimator::totalArea
AreaInGates totalArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
area estimation functions
Definition: Estimator.cc:84
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
Exception.hh
CostEstimator::Estimator::functionUnitPortWriteDelay
DelayInNanoSeconds functionUnitPortWriteDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
Definition: Estimator.cc:679
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
CostEstimator::Estimator::totalEnergy
EnergyInMilliJoules totalEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
energy estimation functions
Definition: Estimator.cc:433
CostEstimator::Estimator::longestPath
DelayInNanoSeconds longestPath(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
delay estimation functions
Definition: Estimator.cc:915
CostEstimator::Estimator::registerFilePortWriteDelay
DelayInNanoSeconds registerFilePortWriteDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
Definition: Estimator.cc:756
FUCostEstimationPluginRegistry.hh
CostEstimator::Estimator
Definition: Estimator.hh:85
CostEstimator::Estimator::functionUnitMaximumComputationDelay
DelayInNanoSeconds functionUnitMaximumComputationDelay(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation)
Definition: Estimator.cc:834
CostEstimator::AreaInGates
double AreaInGates
type for area values in equivalent gates
Definition: CostEstimatorTypes.hh:35
CostEstimator::Estimator::findAllICPaths
static TransportPathList * findAllICPaths(const TTAMachine::Machine &machine)
Definition: Estimator.cc:1228
CostEstimator::Estimator::registerFileArea
AreaInGates registerFileArea(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
Definition: Estimator.cc:398
ICDecoderCostEstimationPluginRegistry.hh
RFCostEstimationPluginRegistry.hh
BusImplementationLocation.hh
TTAMachine::RFPort
Definition: RFPort.hh:45
FUCostEstimationPlugin.hh
CostEstimator::Estimator::icEnergy
EnergyInMilliJoules icEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition: Estimator.cc:456
CostEstimator::EnergyInMilliJoules
double EnergyInMilliJoules
type for consumed energy in milli joules
Definition: CostEstimatorTypes.hh:37
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
CostEstimator::Estimator::totalEnergyOfRegisterFiles
EnergyInMilliJoules totalEnergyOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition: Estimator.cc:645
TTAMachine::FUPort
Definition: FUPort.hh:46
CostEstimator::FUCostEstimationPlugin
Definition: FUCostEstimationPlugin.hh:66
CostEstimator::Estimator::Estimator
Estimator()
Definition: Estimator.cc:64
CostEstimatorTypes.hh
TTAMachine::BaseRegisterFile
Definition: BaseRegisterFile.hh:48
CostEstimator::TransportPathList
std::list< TransportPath > TransportPathList
Definition: TransportPath.hh:76
ExecutionTrace
Definition: ExecutionTrace.hh:56
CostEstimator::Estimator::rfCostFunctionPluginOfImplementation
RFCostEstimationPlugin & rfCostFunctionPluginOfImplementation(const IDF::RFImplementationLocation &implementation)
Definition: Estimator.cc:312
CostEstimator::Estimator::fuCostFunctionPluginOfImplementation
FUCostEstimationPlugin & fuCostFunctionPluginOfImplementation(const IDF::FUImplementationLocation &implementation)
Definition: Estimator.cc:260
SocketImplementationLocation.hh
CostEstimator::Estimator::functionUnitPortReadDelay
DelayInNanoSeconds functionUnitPortReadDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
Definition: Estimator.cc:718
FUImplementationLocation.hh
CostEstimator::Estimator::decompressorDelay
DelayInNanoSeconds decompressorDelay(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
CostEstimator::Estimator::icDecoderEstimatorPluginRegistry_
ICDecoderCostEstimationPluginRegistry icDecoderEstimatorPluginRegistry_
all accessed IC&decoder plugins are stored in this registry
Definition: Estimator.hh:206
CostEstimator::Estimator::rfEstimatorPluginRegistry_
RFCostEstimationPluginRegistry rfEstimatorPluginRegistry_
all accessed RF estimation plugins are stored in this registry
Definition: Estimator.hh:204
TransportPath.hh
CostEstimator::Estimator::totalAreaOfFunctionUnits
AreaInGates totalAreaOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition: Estimator.cc:103
CostEstimator::DelayInNanoSeconds
double DelayInNanoSeconds
type for propagation delays in nano seconds
Definition: CostEstimatorTypes.hh:39
CostEstimator::Estimator::registerFileEnergy
EnergyInMilliJoules registerFileEnergy(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition: Estimator.cc:551
CostEstimator::Estimator::~Estimator
virtual ~Estimator()
Definition: Estimator.cc:70
CostEstimator::Estimator::icArea
AreaInGates icArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
Definition: Estimator.cc:206
CostEstimator::Estimator::estimateSocketToSocketDelayOfPath
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)
Definition: Estimator.cc:1316
CostEstimator::Estimator::functionUnitEnergy
EnergyInMilliJoules functionUnitEnergy(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition: Estimator.cc:510
CostEstimator::CostEstimationPluginRegistry< FUCostEstimationPlugin >
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
TTAMachine
Definition: Assembler.hh:48
CostEstimator::TransportPath
Definition: TransportPath.hh:52
CostEstimator::Estimator::registerFileMaximumComputationDelay
DelayInNanoSeconds registerFileMaximumComputationDelay(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
Definition: Estimator.cc:876
CostEstimator::Estimator::functionUnitArea
AreaInGates functionUnitArea(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry)
Definition: Estimator.cc:364
CostEstimator
Definition: CostEstimationPlugin.cc:36
CostEstimator::Estimator::fuEstimatorPluginRegistry_
FUCostEstimationPluginRegistry fuEstimatorPluginRegistry_
all accessed FU estimation plugins are stored in this registry
Definition: Estimator.hh:202
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
CostEstimator::Estimator::registerFilePortReadDelay
DelayInNanoSeconds registerFilePortReadDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
Definition: Estimator.cc:793
UtilizationStats
Definition: UtilizationStats.hh:50
MachineImplementation.hh
TTAMachine::Machine
Definition: Machine.hh:73
CostEstimator::Estimator::totalEnergyOfFunctionUnits
EnergyInMilliJoules totalEnergyOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
Definition: Estimator.cc:592