OpenASIP  2.0
ICDecoderEstimatorPlugin.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 ICDecoderEstimatorPlugin.hh
26  *
27  * Declaration of ICDecoderEstimatorPlugin class.
28  *
29  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_IC_DECODER_ESTIMATOR_PLUGIN_HH
34 #define TTA_IC_DECODER_ESTIMATOR_PLUGIN_HH
35 
36 #include "CostEstimationPlugin.hh"
37 #include "TransportPath.hh"
40 
41 namespace TTAMachine {
42  class Machine;
43  class ControlUnit;
44 }
45 namespace TTAProgram {
46  class Program;
47 }
48 
49 namespace HDB {
50  class HDBRegistry;
51 }
52 
53 namespace IDF {
54  class MachineImplementation;
55 }
56 
57 class ExecutionTrace;
58 
59 namespace CostEstimator {
60 /**
61  * Base class for plugins that are able to estimate costs of a IC and
62  * decoder combination.
63  */
65 public:
66 
68  const std::string& name);
69  virtual ~ICDecoderEstimatorPlugin();
70 
71  virtual bool estimateICDelayOfPath(
72  HDB::HDBRegistry& hdbRegistry,
73  const TransportPath& path,
74  const IDF::MachineImplementation& machineImplementation,
75  const IDF::SocketImplementationLocation& sourceSocketImplementation,
76  const IDF::BusImplementationLocation& busImplementation,
78  destinationSocketImplementation,
79  DelayInNanoSeconds& delay);
80 
81  virtual bool estimateICArea(
82  HDB::HDBRegistry& hdbRegistry,
84  const IDF::MachineImplementation& machineImplementation,
85  AreaInGates& area);
86 
87  virtual bool estimateICEnergy(
88  HDB::HDBRegistry& hdbRegistry,
90  const IDF::MachineImplementation& machineImplementation,
92  const ExecutionTrace& traceDB,
93  EnergyInMilliJoules& energy);
94 
96 };
97 
98 }
99 
100 /**
101  * Exports the given class as an IC&decoder estimator.
102  *
103  * @note The class name of the estimator MUST be [PLUGIN_NAME__]Estimator,
104  * thus an estimator exported with EXPORT_ICDEC_ESTIMATOR(Example)
105  * exports a class called ExampleEstimator.
106  */
107 #define EXPORT_ICDEC_ESTIMATOR(PLUGIN_NAME__) \
108 extern "C" { \
109  ICDecoderEstimatorPlugin*\
110  create_estimator_plugin_##PLUGIN_NAME__(\
111  ) { \
112  PLUGIN_NAME__##Estimator* instance = \
113  new PLUGIN_NAME__##Estimator(#PLUGIN_NAME__);\
114  return instance;\
115  }\
116  void delete_estimator_plugin_##PLUGIN_NAME__(\
117  ICDecoderEstimatorPlugin* target) {\
118  delete target;\
119  }\
120 }
121 
122 #endif
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
HDB
Definition: CostDatabase.hh:49
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
CostEstimator::CostEstimationPlugin::name
virtual std::string name() const
Definition: CostEstimationPlugin.cc:63
CostEstimator::AreaInGates
double AreaInGates
type for area values in equivalent gates
Definition: CostEstimatorTypes.hh:35
CostEstimator::ICDecoderEstimatorPlugin::generateControlUnit
virtual TTAMachine::ControlUnit * generateControlUnit()
Definition: ICDecoderEstimatorPlugin.cc:141
CostEstimator::ICDecoderEstimatorPlugin::ICDecoderEstimatorPlugin
ICDecoderEstimatorPlugin(const std::string &name)
Definition: ICDecoderEstimatorPlugin.cc:49
BusImplementationLocation.hh
CostEstimator::ICDecoderEstimatorPlugin::estimateICEnergy
virtual bool estimateICEnergy(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy)
Definition: ICDecoderEstimatorPlugin.cc:124
CostEstimator::EnergyInMilliJoules
double EnergyInMilliJoules
type for consumed energy in milli joules
Definition: CostEstimatorTypes.hh:37
HDB::HDBRegistry
Definition: HDBRegistry.hh:46
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
ExecutionTrace
Definition: ExecutionTrace.hh:56
CostEstimator::ICDecoderEstimatorPlugin::~ICDecoderEstimatorPlugin
virtual ~ICDecoderEstimatorPlugin()
Definition: ICDecoderEstimatorPlugin.cc:57
SocketImplementationLocation.hh
CostEstimator::CostEstimationPlugin
Definition: CostEstimationPlugin.hh:45
TransportPath.hh
CostEstimator::DelayInNanoSeconds
double DelayInNanoSeconds
type for propagation delays in nano seconds
Definition: CostEstimatorTypes.hh:39
CostEstimator::ICDecoderEstimatorPlugin
Definition: ICDecoderEstimatorPlugin.hh:64
CostEstimationPlugin.hh
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
Definition: CostEstimationPlugin.cc:36
CostEstimator::ICDecoderEstimatorPlugin::estimateICArea
virtual bool estimateICArea(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, AreaInGates &area)
Definition: ICDecoderEstimatorPlugin.cc:102
CostEstimator::ICDecoderEstimatorPlugin::estimateICDelayOfPath
virtual bool estimateICDelayOfPath(HDB::HDBRegistry &hdbRegistry, const TransportPath &path, const IDF::MachineImplementation &machineImplementation, const IDF::SocketImplementationLocation &sourceSocketImplementation, const IDF::BusImplementationLocation &busImplementation, const IDF::SocketImplementationLocation &destinationSocketImplementation, DelayInNanoSeconds &delay)
Definition: ICDecoderEstimatorPlugin.cc:80
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
IDF
Definition: DSDBManager.hh:54
TTAMachine::Machine
Definition: Machine.hh:73