OpenASIP 2.2
Loading...
Searching...
No Matches
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"
43
44namespace HDB {
45 class HDBManager;
46 class FUEntry;
47}
48
49namespace TTAProgram {
50 class Program;
51}
52
53namespace TTAMachine {
54 class BaseRegisterFile;
55 class RFPort;
56}
57
58class ExecutionTrace;
60
61namespace CostEstimator {
62
63/**
64 * A base interface for all classes that implement pluggable register file
65 * cost estimation algorithms.
66 */
68public:
69 RFCostEstimationPlugin(const std::string& name);
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__) \
109extern "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__) \
131public:\
132 virtual std::string description() const { return TEXT__; }\
133 int* XXXXXd_escrip__tion__
134
135#endif
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
find Finds info of the inner loops in the program
virtual bool estimatePortWriteDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &inputDelay, HDB::HDBManager &hdb)
virtual bool estimateEnergy(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy, HDB::HDBManager &hdb)
virtual bool estimateArea(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, AreaInGates &area, HDB::HDBManager &hdb)
virtual bool estimateMaximumComputationDelay(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &computationDelay, HDB::HDBManager &hdb)
virtual bool estimatePortReadDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementation, DelayInNanoSeconds &outputDelay, HDB::HDBManager &hdb)
double AreaInGates
type for area values in equivalent gates
double DelayInNanoSeconds
type for propagation delays in nano seconds
double EnergyInMilliJoules
type for consumed energy in milli joules