OpenASIP 2.2
Loading...
Searching...
No Matches
ComponentImplementationSelector.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 ComponentImplementationSelector.hh
26 *
27 * Declaration of ComponentImplementationSelector class
28 *
29 * @author Jari Mäntyneva 2006 (jari.mantyneva-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_COMPONENT_IMPLEMENTATION_SELECTOR_HH
34#define TTA_COMPONENT_IMPLEMENTATION_SELECTOR_HH
35
36#include <set>
37#include <map>
38#include <list>
39#include <string>
40#include "Application.hh"
41#include "HDBRegistry.hh"
42#include "HDBManager.hh"
43#include "Estimator.hh"
44#include "DSDBManager.hh"
45
46namespace TTAMachine {
47 class FunctionUnit;
48 class RegisterFile;
49 class ImmediateUnit;
50}
51namespace TTAProgram {
52 class Program;
53}
54namespace IDF {
55 class UnitImplementationLocation;
59}
60
61class Operation;
62class ExecutionTrace;
63class CostEstimates;
64
65/**
66 * Purpose of the component implementation selector class is to select suitable
67 * implementations to architecture components. The component implementation
68 * selector uses HDB to look for implementations and returns set of suitable
69 * implementations that fulfill the given cost requirements.
70 * Class uses cost estimator to estimate the costs of suitable implementations.
71 * Cost estimation data includes energy estimations of all program cases that
72 * are set.
73 */
75public:
78
79 void addHDB(const HDB::HDBManager& hdb);
80 void addCase(
81 const TTAProgram::Program& program, const ExecutionTrace& traceDB);
82
83 std::map<const IDF::FUImplementationLocation*, CostEstimates*>
85 const TTAMachine::FunctionUnit& fu, double frequencyMHz = 0,
86 double maxArea = 0);
87 std::list<TTAMachine::FunctionUnit*>
89 const std::set<std::string>& operationSet, int width = 0) const;
90
91 std::map<const IDF::RFImplementationLocation*, CostEstimates*>
93 const TTAMachine::RegisterFile& rf, bool guarded = false,
94 double frequencyMHz = 0, double maxArea = 0);
95
96 std::map<const IDF::IUImplementationLocation*, CostEstimates*>
98 const TTAMachine::ImmediateUnit& iu, double frequencyMHz = 0,
99 double maxArea = 0);
100
103 TTAMachine::Machine* mach = NULL,
104 const std::string& icDecoder = "ic_hdb",
105 const std::string& icDecoderHDB = "asic_130nm_1.5V.hdb",
106 const double& frequency = 0, const double& maxArea = 0);
107
109 const TTAMachine::Machine* mach,
110 const std::string& icDecoder = "ic_hdb",
111 const std::string& icDecoderHDB = "asic_130nm_1.5V.hdb",
112 const double& frequency = 0, const double& maxArea = 0);
113
114 void selectFUs(
116 const double& frequency = 0, const double& maxArea = 0,
117 const bool& filterLongestPathDelay = true);
118
119 void selectRFs(
121 const double& frequency = 0, const double& maxArea = 0);
122
123 void selectIUs(
125 const double& frequency = 0, const double& maxArea = 0);
126
127private:
128 /// HDBs from which implementations are serched are stored in this set
129 std::set<std::string> usedHDBs_;
130 /// Cost estimator to estimate the unit costs.
132
133 struct implComp {
134 bool operator() (const std::pair<const IDF::UnitImplementationLocation*, CostEstimates*>& p1,
135 const std::pair<const IDF::UnitImplementationLocation*, CostEstimates*>& p2) const {
136 return p1.first->id() < p2.first->id();
137 }
138 };
139
140};
141
142#endif
find Finds info of the inner loops in the program
std::set< std::string > usedHDBs_
HDBs from which implementations are serched are stored in this set.
void selectRFs(const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0)
std::list< TTAMachine::FunctionUnit * > fuArchsByOpSetWithMinLatency(const std::set< std::string > &operationSet, int width=0) const
void selectFUs(const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0, const bool &filterLongestPathDelay=true)
std::map< const IDF::FUImplementationLocation *, CostEstimates * > fuImplementations(const TTAMachine::FunctionUnit &fu, double frequencyMHz=0, double maxArea=0)
std::map< const IDF::RFImplementationLocation *, CostEstimates * > rfImplementations(const TTAMachine::RegisterFile &rf, bool guarded=false, double frequencyMHz=0, double maxArea=0)
std::map< const IDF::IUImplementationLocation *, CostEstimates * > iuImplementations(const TTAMachine::ImmediateUnit &iu, double frequencyMHz=0, double maxArea=0)
void selectIUs(const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0)
void selectComponentsToConf(DSDBManager::MachineConfiguration &conf, DSDBManager &dsdb, TTAMachine::Machine *mach=NULL, const std::string &icDecoder="ic_hdb", const std::string &icDecoderHDB="asic_130nm_1.5V.hdb", const double &frequency=0, const double &maxArea=0)
CostEstimator::Estimator estimator_
Cost estimator to estimate the unit costs.
void addCase(const TTAProgram::Program &program, const ExecutionTrace &traceDB)
IDF::MachineImplementation * selectComponents(const TTAMachine::Machine *mach, const std::string &icDecoder="ic_hdb", const std::string &icDecoderHDB="asic_130nm_1.5V.hdb", const double &frequency=0, const double &maxArea=0)
UnitImplementationLocation IUImplementationLocation
UnitImplementationLocation RFImplementationLocation
UnitImplementationLocation FUImplementationLocation
bool operator()(const std::pair< const IDF::UnitImplementationLocation *, CostEstimates * > &p1, const std::pair< const IDF::UnitImplementationLocation *, CostEstimates * > &p2) const