OpenASIP 2.2
Loading...
Searching...
No Matches
FUCostEstimationPlugin.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 FUCostEstimationPlugin.hh
26 *
27 * Declaration of FUCostEstimationPlugin class and definition of CPP macro
28 * used to export FU 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_FU_COST_ESTIMATION_PLUGIN_HH
35#define TTA_FU_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 FunctionUnit;
55 class FUPort;
56}
57
58class ExecutionTrace;
60
61namespace CostEstimator {
62/**
63 * An interface for classes that implement pluggable function unit cost
64 * estimation algorithms.
65 */
67public:
68 FUCostEstimationPlugin(const std::string& name);
70
71 virtual bool estimateArea(
72 const TTAMachine::FunctionUnit& architecture,
74 AreaInGates& area,
75 HDB::HDBManager& hdb);
76
77 virtual bool estimateEnergy(
78 const TTAMachine::FunctionUnit& architecture,
81 const ExecutionTrace& traceDB,
82 EnergyInMilliJoules& energy,
83 HDB::HDBManager& hdb);
84
85 virtual bool estimatePortWriteDelay(
86 const TTAMachine::FUPort& port,
88 DelayInNanoSeconds& inputDelay,
89 HDB::HDBManager& hdb);
90
91 virtual bool estimatePortReadDelay(
92 const TTAMachine::FUPort& port,
94 DelayInNanoSeconds& outputDelay,
95 HDB::HDBManager& hdb);
96
98 const TTAMachine::FunctionUnit& architecture,
100 DelayInNanoSeconds& computationDelay,
101 HDB::HDBManager& hdb);
102};
103
104/**
105 * Exports the given class as an FU cost estimation plugin.
106 */
107#define EXPORT_FU_COST_ESTIMATOR_PLUGIN(PLUGIN_NAME__) \
108extern "C" { \
109 FUCostEstimationPlugin* create_estimator_plugin_##PLUGIN_NAME__(\
110 ) { \
111 PLUGIN_NAME__* instance = new PLUGIN_NAME__(#PLUGIN_NAME__);\
112 return instance;\
113 }\
114 void delete_estimator_plugin_##PLUGIN_NAME__(\
115 FUCostEstimationPlugin* target) {\
116 delete target;\
117 }\
118}
119
120}
121
122/**
123 * Defines the description string for the plugin.
124 *
125 * Can be used only inside a plugin class definition.
126 *
127 * @param TEXT__ The description string.
128 */
129#define DESCRIPTION(TEXT__) \
130public:\
131 virtual std::string description() const { return TEXT__; }\
132 int* XXXXXd_escrip__tion__
133
134#endif
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
find Finds info of the inner loops in the program
virtual bool estimatePortReadDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementation, DelayInNanoSeconds &outputDelay, HDB::HDBManager &hdb)
virtual bool estimatePortWriteDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementation, DelayInNanoSeconds &inputDelay, HDB::HDBManager &hdb)
virtual bool estimateArea(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation, AreaInGates &area, HDB::HDBManager &hdb)
virtual bool estimateEnergy(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy, HDB::HDBManager &hdb)
virtual bool estimateMaximumComputationDelay(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation, DelayInNanoSeconds &computationDelay, 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