OpenASIP  2.0
RFCostEstimationPlugin.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 RFCostEstimationPlugin.hh
26  *
27  * Declaration of RFCostEstimationPlugin class and definitions of CPP macros
28  * used to define and export RF cost estimation plugins.
29  *
30  * @author Pekka Jääskeläinen 2005 (pjaaskel-no.spam-cs.tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef TTA_RF_COST_ESTIMATION_PLUGIN_HH
35 #define TTA_RF_COST_ESTIMATION_PLUGIN_HH
36 
37 #include <string>
38 
39 #include "Exception.hh"
40 #include "CostEstimatorTypes.hh"
41 #include "CostEstimationPlugin.hh"
43 
44 namespace HDB {
45  class HDBManager;
46  class FUEntry;
47 }
48 
49 namespace TTAProgram {
50  class Program;
51 }
52 
53 namespace TTAMachine {
54  class BaseRegisterFile;
55  class RFPort;
56 }
57 
58 class ExecutionTrace;
59 class UtilizationStats;
60 
61 namespace CostEstimator {
62 
63 /**
64  * A base interface for all classes that implement pluggable register file
65  * cost estimation algorithms.
66  */
68 public:
69  RFCostEstimationPlugin(const std::string& name);
70  virtual ~RFCostEstimationPlugin();
71 
72  virtual bool estimateArea(
73  const TTAMachine::BaseRegisterFile& architecture,
75  AreaInGates& area,
76  HDB::HDBManager& hdb);
77 
78  virtual bool estimateEnergy(
79  const TTAMachine::BaseRegisterFile& architecture,
82  const ExecutionTrace& traceDB,
83  EnergyInMilliJoules& energy,
84  HDB::HDBManager& hdb);
85 
86  virtual bool estimatePortWriteDelay(
87  const TTAMachine::RFPort& port,
89  DelayInNanoSeconds& inputDelay,
90  HDB::HDBManager& hdb);
91 
92  virtual bool estimatePortReadDelay(
93  const TTAMachine::RFPort& port,
95  DelayInNanoSeconds& outputDelay,
96  HDB::HDBManager& hdb);
97 
99  const TTAMachine::BaseRegisterFile& architecture,
101  DelayInNanoSeconds& computationDelay,
102  HDB::HDBManager& hdb);
103 };
104 
105 /**
106  * Exports the given class as a RF cost estimation plugin.
107  */
108 #define EXPORT_RF_COST_ESTIMATOR_PLUGIN(PLUGIN_NAME__) \
109 extern "C" { \
110  RFCostEstimationPlugin* create_estimator_plugin_##PLUGIN_NAME__(\
111  ) { \
112  PLUGIN_NAME__* instance = new PLUGIN_NAME__(#PLUGIN_NAME__);\
113  return instance;\
114  }\
115  void delete_estimator_plugin_##PLUGIN_NAME__(\
116  RFCostEstimationPlugin* target) {\
117  delete target;\
118  }\
119 }
120 
121 }
122 
123 /**
124  * Defines the description string for the plugin.
125  *
126  * Can be used only inside a plugin class definition.
127  *
128  * @param TEXT__ The description string.
129  */
130 #define DESCRIPTION(TEXT__) \
131 public:\
132  virtual std::string description() const { return TEXT__; }\
133  int* XXXXXd_escrip__tion__
134 
135 #endif
CostEstimator::RFCostEstimationPlugin
Definition: RFCostEstimationPlugin.hh:67
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
RFImplementationLocation.hh
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
HDB
Definition: CostDatabase.hh:49
CostEstimator::CostEstimationPlugin::name
virtual std::string name() const
Definition: CostEstimationPlugin.cc:63
Exception.hh
CostEstimator::RFCostEstimationPlugin::~RFCostEstimationPlugin
virtual ~RFCostEstimationPlugin()
Definition: RFCostEstimationPlugin.cc:52
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
CostEstimator::AreaInGates
double AreaInGates
type for area values in equivalent gates
Definition: CostEstimatorTypes.hh:35
TTAMachine::RFPort
Definition: RFPort.hh:45
CostEstimator::EnergyInMilliJoules
double EnergyInMilliJoules
type for consumed energy in milli joules
Definition: CostEstimatorTypes.hh:37
CostEstimatorTypes.hh
CostEstimator::RFCostEstimationPlugin::estimatePortReadDelay
virtual bool estimatePortReadDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &outputDelay, HDB::HDBManager &hdb)
Definition: RFCostEstimationPlugin.cc:126
TTAMachine::BaseRegisterFile
Definition: BaseRegisterFile.hh:48
CostEstimator::RFCostEstimationPlugin::estimateArea
virtual bool estimateArea(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, AreaInGates &area, HDB::HDBManager &hdb)
Definition: RFCostEstimationPlugin.cc:64
CostEstimator::RFCostEstimationPlugin::estimateMaximumComputationDelay
virtual bool estimateMaximumComputationDelay(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &computationDelay, HDB::HDBManager &hdb)
Definition: RFCostEstimationPlugin.cc:149
ExecutionTrace
Definition: ExecutionTrace.hh:56
HDB::HDBManager
Definition: HDBManager.hh:82
CostEstimator::CostEstimationPlugin
Definition: CostEstimationPlugin.hh:45
CostEstimator::DelayInNanoSeconds
double DelayInNanoSeconds
type for propagation delays in nano seconds
Definition: CostEstimatorTypes.hh:39
CostEstimator::RFCostEstimationPlugin::estimatePortWriteDelay
virtual bool estimatePortWriteDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &inputDelay, HDB::HDBManager &hdb)
Definition: RFCostEstimationPlugin.cc:108
CostEstimationPlugin.hh
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
CostEstimator::RFCostEstimationPlugin::RFCostEstimationPlugin
RFCostEstimationPlugin(const std::string &name)
Definition: RFCostEstimationPlugin.cc:44
TTAMachine
Definition: Assembler.hh:48
CostEstimator
Definition: CostEstimationPlugin.cc:36
UtilizationStats
Definition: UtilizationStats.hh:50
CostEstimator::RFCostEstimationPlugin::estimateEnergy
virtual bool estimateEnergy(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy, HDB::HDBManager &hdb)
Definition: RFCostEstimationPlugin.cc:88