OpenASIP  2.0
DesignSpaceExplorer.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 DesignSpaceExplorer.hh
26  *
27  * Declaration of DesignSpaceExplorer class.
28  *
29  * @author Jari Mäntyneva 2006 (jari.mantyneva-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_DESIGN_SPACE_EXPLORER_HH
34 #define TTA_DESIGN_SPACE_EXPLORER_HH
35 
36 #include <set>
37 #include <vector>
38 #include <istream>
39 #include "Application.hh"
40 #include "Exception.hh"
41 #include "SimulatorConstants.hh"
42 #include "PluginTools.hh"
43 #include "Estimator.hh"
44 #include "DSDBManager.hh"
45 #include "TestApplication.hh"
46 #include "BaseLineReader.hh"
47 
48 class CostEstimates;
49 class ExecutionTrace;
51 
52 namespace TTAMachine {
53  class Machine;
54 }
55 
56 namespace TTAProgram {
57  class Program;
58 }
59 
60 namespace IDF {
61  class MachineImplementation;
62 }
63 
64 /**
65  * Design space explorer interface provides methods to automatically evaluate
66  * machine configurations and select best implementations to the processor
67  * components according the test applications set in Design Space Database
68  * (DSDB).
69  */
71 public:
73  virtual ~DesignSpaceExplorer();
74 
75  virtual void setDSDB(DSDBManager& dsdb);
76 
77  virtual bool evaluate(
78  const DSDBManager::MachineConfiguration& configuration,
79  CostEstimates& results=dummyEstimate_, bool estimate=false);
80 
81  virtual DSDBManager& db();
83  const std::string& pluginName, DSDBManager* dsdb = NULL);
84 
85  std::vector<DesignSpaceExplorerPlugin*> getPlugins();
86 
89  const double& frequency = 0.0,
90  const double& maxArea = 0.0,
91  const bool& createEstimates = true,
92  const std::string& icDec = "DefaultICDecoder",
93  const std::string& icDecHDB = "asic_130nm_1.5V.hdb");
97  const double& frequency = 0.0,
98  const double& maxArea = 0.0,
99  const bool& createEstimates = true,
100  const std::string& icDec = "DefaultICDecoder",
101  const std::string& icDecHDB = "asic_130nm_1.5V.hdb");
103  const TTAMachine::Machine& mach,
104  const double& frequency = 0.0,
105  const double& maxArea = 0.0,
106  const std::string& icDec = "DefaultICDecoder",
107  const std::string& icDecHDB = "asic_130nm_1.5V.hdb") const;
108  void createEstimateData(
109  const TTAMachine::Machine& mach,
110  const IDF::MachineImplementation& idf,
112  CostEstimator::DelayInNanoSeconds& longestPathDelay);
115 
116 protected:
118  const std::string applicationFile,
120  TCEString paramOptions = "-O3");
121 
122  const ExecutionTrace* simulate(
124  const TestApplication& testApplication,
125  const ClockCycleCount& maxCycles, ClockCycleCount& runnedCycles,
126  const bool tracing, const bool useCompiledSimulation = false,
127  std::vector<ClockCycleCount>* executionCounts = NULL);
128 
129 private:
130  /// Design space database where results are stored.
132  /// The plugin tool.
134  /// The estimator frontend.
136  /// Output stream.
137  std::ostringstream* oStream_;
138  /// Used for the default evaluate() argument.
140 
141 };
142 
143 #endif
DesignSpaceExplorer::evaluate
virtual bool evaluate(const DSDBManager::MachineConfiguration &configuration, CostEstimates &results=dummyEstimate_, bool estimate=false)
Definition: DesignSpaceExplorer.cc:133
BaseLineReader.hh
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
DesignSpaceExplorer::db
virtual DSDBManager & db()
Definition: DesignSpaceExplorer.cc:300
CostEstimates
Definition: CostEstimates.hh:57
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
Exception.hh
PluginTools
Definition: PluginTools.hh:53
DesignSpaceExplorer::addConfToDSDB
RowID addConfToDSDB(const DSDBManager::MachineConfiguration &conf)
Definition: DesignSpaceExplorer.cc:755
DesignSpaceExplorerPlugin
Definition: DesignSpaceExplorerPlugin.hh:55
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
CostEstimator::Estimator
Definition: Estimator.hh:85
DesignSpaceExplorer::dummyEstimate_
static CostEstimates dummyEstimate_
Used for the default evaluate() argument.
Definition: DesignSpaceExplorer.hh:139
CostEstimator::AreaInGates
double AreaInGates
type for area values in equivalent gates
Definition: CostEstimatorTypes.hh:35
DesignSpaceExplorer::createImplementationAndStore
RowID createImplementationAndStore(const DSDBManager::MachineConfiguration &conf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb")
Definition: DesignSpaceExplorer.cc:597
Estimator.hh
DesignSpaceExplorer::createEstimateData
void createEstimateData(const TTAMachine::Machine &mach, const IDF::MachineImplementation &idf, CostEstimator::AreaInGates &area, CostEstimator::DelayInNanoSeconds &longestPathDelay)
Definition: DesignSpaceExplorer.cc:735
SimulatorConstants.hh
DesignSpaceExplorer::estimator_
CostEstimator::Estimator estimator_
The estimator frontend.
Definition: DesignSpaceExplorer.hh:135
DesignSpaceExplorer::selectComponents
IDF::MachineImplementation * selectComponents(const TTAMachine::Machine &mach, const double &frequency=0.0, const double &maxArea=0.0, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb") const
Definition: DesignSpaceExplorer.cc:698
DesignSpaceExplorer::schedule
TTAProgram::Program * schedule(const std::string applicationFile, TTAMachine::Machine &machine, TCEString paramOptions="-O3")
Definition: DesignSpaceExplorer.cc:315
DSDBManager::MachineConfiguration
Definition: DSDBManager.hh:78
DesignSpaceExplorer::DesignSpaceExplorer
DesignSpaceExplorer()
Definition: DesignSpaceExplorer.cc:82
DesignSpaceExplorer::getPlugins
std::vector< DesignSpaceExplorerPlugin * > getPlugins()
Definition: DesignSpaceExplorer.cc:557
ExecutionTrace
Definition: ExecutionTrace.hh:56
Application.hh
DesignSpaceExplorer::pluginTool_
static PluginTools pluginTool_
The plugin tool.
Definition: DesignSpaceExplorer.hh:133
DSDBManager
Definition: DSDBManager.hh:76
DesignSpaceExplorer::loadExplorerPlugin
static DesignSpaceExplorerPlugin * loadExplorerPlugin(const std::string &pluginName, DSDBManager *dsdb=NULL)
Definition: DesignSpaceExplorer.cc:527
PluginTools.hh
DesignSpaceExplorer::simulate
const ExecutionTrace * simulate(const TTAProgram::Program &program, const TTAMachine::Machine &machine, const TestApplication &testApplication, const ClockCycleCount &maxCycles, ClockCycleCount &runnedCycles, const bool tracing, const bool useCompiledSimulation=false, std::vector< ClockCycleCount > *executionCounts=NULL)
Definition: DesignSpaceExplorer.cc:416
DSDBManager.hh
CostEstimator::DelayInNanoSeconds
double DelayInNanoSeconds
type for propagation delays in nano seconds
Definition: CostEstimatorTypes.hh:39
DesignSpaceExplorer::createImplementation
bool createImplementation(const DSDBManager::MachineConfiguration &conf, DSDBManager::MachineConfiguration &newConf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb")
Definition: DesignSpaceExplorer.cc:650
DesignSpaceExplorer::setDSDB
virtual void setDSDB(DSDBManager &dsdb)
Definition: DesignSpaceExplorer.cc:107
TCEString
Definition: TCEString.hh:53
DesignSpaceExplorer::oStream_
std::ostringstream * oStream_
Output stream.
Definition: DesignSpaceExplorer.hh:137
DesignSpaceExplorer::~DesignSpaceExplorer
virtual ~DesignSpaceExplorer()
Definition: DesignSpaceExplorer.cc:93
DesignSpaceExplorer::dsdb_
DSDBManager * dsdb_
Design space database where results are stored.
Definition: DesignSpaceExplorer.hh:131
ClockCycleCount
CycleCount ClockCycleCount
Alias for ClockCycleCount.
Definition: SimulatorConstants.hh:57
DesignSpaceExplorer
Definition: DesignSpaceExplorer.hh:70
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
TTAMachine
Definition: Assembler.hh:48
TestApplication
Definition: TestApplication.hh:46
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
IDF
Definition: DSDBManager.hh:54
TTAMachine::Machine
Definition: Machine.hh:73
TestApplication.hh