OpenASIP  2.0
Public Types | Public Member Functions | Protected Attributes | List of all members
DesignSpaceExplorerPlugin Class Referenceabstract

#include <DesignSpaceExplorerPlugin.hh>

Inheritance diagram for DesignSpaceExplorerPlugin:
Inheritance graph
Collaboration diagram for DesignSpaceExplorerPlugin:
Collaboration graph

Public Types

typedef std::pair< std::string, ExplorerPluginParameterParameter
 
typedef std::map< std::string, ExplorerPluginParameterParameterMap
 
typedef std::map< std::string, ExplorerPluginParameter >::iterator PMIt
 
typedef std::map< std::string, ExplorerPluginParameter >::const_iterator PMCIt
 

Public Member Functions

virtual bool requiresStartingPointArchitecture () const =0
 
virtual bool producesArchitecture () const =0
 
virtual bool requiresHDB () const =0
 
virtual bool requiresSimulationData () const =0
 
virtual bool requiresApplication () const
 
virtual std::string description () const
 
void addParameter (TCEString name, ExplorerPluginParameterType type, bool compulsory=true, TCEString defaultValue="", TCEString description="")
 
template<typename T >
void readCompulsoryParameter (const std::string paramName, T &param) const
 
template<typename T >
void readOptionalParameter (const std::string paramName, T &param) const
 
template<typename RT >
RT parameterValue (const std::string &paramName) const
 
- Public Member Functions inherited from DesignSpaceExplorer
 DesignSpaceExplorer ()
 
virtual ~DesignSpaceExplorer ()
 
virtual void setDSDB (DSDBManager &dsdb)
 
virtual bool evaluate (const DSDBManager::MachineConfiguration &configuration, CostEstimates &results=dummyEstimate_, bool estimate=false)
 
virtual DSDBManagerdb ()
 
std::vector< DesignSpaceExplorerPlugin * > getPlugins ()
 
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")
 
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")
 
IDF::MachineImplementationselectComponents (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
 
void createEstimateData (const TTAMachine::Machine &mach, const IDF::MachineImplementation &idf, CostEstimator::AreaInGates &area, CostEstimator::DelayInNanoSeconds &longestPathDelay)
 
RowID addConfToDSDB (const DSDBManager::MachineConfiguration &conf)
 

Protected Attributes

std::string pluginName_
 the name of the explorer plugin More...
 
ParameterMap parameters_
 Parameters for the plugin. More...
 

pluginName Name of the plugin.

The constructor of the DesignExplorerPlugin class.

Parameters
dsdbDesign space data base to be used with the plugin.
virtual ~DesignSpaceExplorerPlugin ()
 
virtual void giveParameter (const std::string &name, const std::string &value)
 
virtual std::string name () const
 
virtual void setPluginName (const std::string &pluginName)
 
virtual std::vector< RowIDexplore (const RowID &startPointConfigurationID, const unsigned int &maxIter=0)
 
virtual bool hasParameter (const std::string &paramName) const
 
ParameterMap parameters () const
 
virtual bool booleanValue (const std::string &parameter) const
 
 DesignSpaceExplorerPlugin ()
 
void checkParameters () const
 

Additional Inherited Members

- Static Public Member Functions inherited from DesignSpaceExplorer
static DesignSpaceExplorerPluginloadExplorerPlugin (const std::string &pluginName, DSDBManager *dsdb=NULL)
 
- Protected Member Functions inherited from DesignSpaceExplorer
TTAProgram::Programschedule (const std::string applicationFile, TTAMachine::Machine &machine, TCEString paramOptions="-O3")
 
const ExecutionTracesimulate (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)
 

Detailed Description

A base interface for all classes that implement pluggable design space explorer algorithms.

Plugins are allowed to store state data to itself, thus, the plugin instances are not allowed to be "recycled" for multiple uses, but a new instance should be created always.

Definition at line 55 of file DesignSpaceExplorerPlugin.hh.

Member Typedef Documentation

◆ Parameter

Definition at line 67 of file DesignSpaceExplorerPlugin.hh.

◆ ParameterMap

Definition at line 69 of file DesignSpaceExplorerPlugin.hh.

◆ PMCIt

typedef std::map<std::string, ExplorerPluginParameter>::const_iterator DesignSpaceExplorerPlugin::PMCIt

Definition at line 73 of file DesignSpaceExplorerPlugin.hh.

◆ PMIt

typedef std::map<std::string, ExplorerPluginParameter>::iterator DesignSpaceExplorerPlugin::PMIt

Definition at line 71 of file DesignSpaceExplorerPlugin.hh.

Constructor & Destructor Documentation

◆ ~DesignSpaceExplorerPlugin()

DesignSpaceExplorerPlugin::~DesignSpaceExplorerPlugin ( )
virtual

The destructor.

Definition at line 56 of file DesignSpaceExplorerPlugin.cc.

56  {
57 }

◆ DesignSpaceExplorerPlugin()

DesignSpaceExplorerPlugin::DesignSpaceExplorerPlugin ( )
protected

Definition at line 48 of file DesignSpaceExplorerPlugin.cc.

48  :
50 }

Member Function Documentation

◆ addParameter()

void DesignSpaceExplorerPlugin::addParameter ( TCEString  name,
ExplorerPluginParameterType  type,
bool  compulsory = true,
TCEString  defaultValue = "",
TCEString  description = "" 
)
inline

◆ booleanValue()

bool DesignSpaceExplorerPlugin::booleanValue ( const std::string &  parameter) const
virtual

Returns the boolean value of the given parameter if parameter can be considered as a boolean.

Parameters
parameterThe string to be converted to a boolean value
Returns
Boolean value of the parameter
Exceptions
IllegalParametersGiven parameter could not be considerer as boolean value

Definition at line 132 of file DesignSpaceExplorerPlugin.cc.

132  {
133  std::string lowCase = StringTools::stringToLower(parameter);
134  if (lowCase == "true" || lowCase == "1") {
135  return true;
136  } else if (lowCase == "false" || lowCase == "0") {
137  return false;
138  } else {
139  throw IllegalParameters(__FILE__, __LINE__, __func__);
140  }
141 }

References __func__, and StringTools::stringToLower().

Here is the call graph for this function:

◆ checkParameters()

void DesignSpaceExplorerPlugin::checkParameters ( ) const
protected

Checks that all compulsory parameters are set for the plugin.

Definition at line 147 of file DesignSpaceExplorerPlugin.cc.

147  {
148  for (PMCIt it = parameters_.begin(); it != parameters_.end(); it++) {
149  if (it->second.isCompulsory() && !it->second.isSet()) {
150  std::string msg = it->second.name() + " parameter is needed.";
151  throw IllegalParameters(__FILE__, __LINE__, __func__, msg);
152  }
153  }
154 }

References __func__, and parameters_.

◆ description()

virtual std::string DesignSpaceExplorerPlugin::description ( ) const
inlinevirtual

Referenced by printPlugins().

◆ explore()

std::vector< RowID > DesignSpaceExplorerPlugin::explore ( const RowID startPointConfigurationID,
const unsigned int &  maxIter = 0 
)
virtual

Explores the design space from the starting point machine and returns best exploring results as configuration IDs.

Exploring creates new machine configurations (architecture, implementation) that are ordered so that the best results are first in the result vector.

Parameters
startPointStarting point machine configuration for the plugin.
maxIterMaximum number of design space points the plugin is allowed to explore. Default value for maxIter is zero when the iteration number is not taken into account. In that case the exploration runs indefinetly or stops at a point defined by the algorithm.
Returns
Ordered vector of IDs of the best machine configurations where the target programs can be successfully run. The IDs of the best machine configurations are first in the result vector. Returns an empty vector if does not find any possible machine configurations.

Reimplemented in FrequencySweepExplorer, SimpleICOptimizer, ImmediateGenerator, ConnectionSweeper, ImplementationSelector, ComponentAdder, MinimizeMachine, GrowMachine, VectorLSGenerator, RemoveUnconnectedComponents, BlocksConnectIC, MinimalOpSet, VLIWConnectIC, Evaluate, and ADFCombiner.

Definition at line 174 of file DesignSpaceExplorerPlugin.cc.

175  {
176 
177  std::vector<RowID> result;
178  return result;
179 }

Referenced by FrequencySweepExplorer::callPlugin(), BlocksConnectICCmd::Do(), VLIWConnectICCmd::Do(), SimpleICOptimizer::explore(), ADFCombiner::explore(), FrequencySweepExplorer::explore(), and main().

◆ giveParameter()

void DesignSpaceExplorerPlugin::giveParameter ( const std::string &  name,
const std::string &  value 
)
virtual

Gives a plugin parameter value.

Parameters
nameThe parameter name.
valueThe value to be set for the parameter.

Definition at line 89 of file DesignSpaceExplorerPlugin.cc.

90  {
91  PMIt it = parameters_.find(name);
92  if (it == parameters_.end()) {
93  std::string msg = "Plugin has no parameter named: " + name;
94  throw InstanceNotFound(__FILE__, __LINE__, __func__, msg);
95  }
96  it->second.setValue(value);
97 }

References __func__, name(), and parameters_.

Referenced by SimpleICOptimizer::explore(), ADFCombiner::explore(), FrequencySweepExplorer::explore(), and loadPluginParameters().

Here is the call graph for this function:

◆ hasParameter()

bool DesignSpaceExplorerPlugin::hasParameter ( const std::string &  paramName) const
virtual

Tells whether the plugin has the given parameter defined.

Parameters
paramNameName of the parameter.
Returns
True if the given parameter is defined, otherwise false.

Definition at line 106 of file DesignSpaceExplorerPlugin.cc.

106  {
107  return parameters_.find(paramName)->second.isSet();
108 }

References parameters_.

◆ name()

std::string DesignSpaceExplorerPlugin::name ( ) const
virtual

Returns the plugin name.

Returns
The plugin name as a string.

Definition at line 77 of file DesignSpaceExplorerPlugin.cc.

77  {
78  return pluginName_;
79 }

References pluginName_.

Referenced by CallExplorerPluginWindow::CallExplorerPluginWindow(), FrequencySweepExplorer::callPlugin(), and giveParameter().

◆ parameters()

DesignSpaceExplorerPlugin::ParameterMap DesignSpaceExplorerPlugin::parameters ( ) const

Makes a copy of the parameters of the plugin and returns it.

Returns
ParameterMap map of the explorer plugin parameters.

Definition at line 117 of file DesignSpaceExplorerPlugin.cc.

117  {
118  return parameters_;
119 }

References parameters_.

Referenced by printPluginParamInfo().

◆ parameterValue()

template<typename RT >
RT DesignSpaceExplorerPlugin::parameterValue ( const std::string &  paramName) const

◆ producesArchitecture()

virtual bool DesignSpaceExplorerPlugin::producesArchitecture ( ) const
pure virtual

◆ readCompulsoryParameter()

template<typename T >
void DesignSpaceExplorerPlugin::readCompulsoryParameter ( const std::string  paramName,
T &  param 
) const

◆ readOptionalParameter()

template<typename T >
void DesignSpaceExplorerPlugin::readOptionalParameter ( const std::string  paramName,
T &  param 
) const

◆ requiresApplication()

virtual bool DesignSpaceExplorerPlugin::requiresApplication ( ) const
inlinevirtual

◆ requiresHDB()

virtual bool DesignSpaceExplorerPlugin::requiresHDB ( ) const
pure virtual

◆ requiresSimulationData()

virtual bool DesignSpaceExplorerPlugin::requiresSimulationData ( ) const
pure virtual

◆ requiresStartingPointArchitecture()

virtual bool DesignSpaceExplorerPlugin::requiresStartingPointArchitecture ( ) const
pure virtual

◆ setPluginName()

void DesignSpaceExplorerPlugin::setPluginName ( const std::string &  pluginName)
virtual

Sets the plugin name.

Parameters
pluginNameName of the plugin.

Definition at line 66 of file DesignSpaceExplorerPlugin.cc.

66  {
67  pluginName_ = pluginName;
68 }

References pluginName_.

Member Data Documentation

◆ parameters_

ParameterMap DesignSpaceExplorerPlugin::parameters_
protected

Parameters for the plugin.

Definition at line 116 of file DesignSpaceExplorerPlugin.hh.

Referenced by checkParameters(), giveParameter(), hasParameter(), and parameters().

◆ pluginName_

std::string DesignSpaceExplorerPlugin::pluginName_
protected

the name of the explorer plugin

Definition at line 114 of file DesignSpaceExplorerPlugin.hh.

Referenced by name(), and setPluginName().


The documentation for this class was generated from the following files:
DesignSpaceExplorerPlugin::pluginName_
std::string pluginName_
the name of the explorer plugin
Definition: DesignSpaceExplorerPlugin.hh:114
IllegalParameters
Definition: Exception.hh:113
DesignSpaceExplorer::DesignSpaceExplorer
DesignSpaceExplorer()
Definition: DesignSpaceExplorer.cc:82
DesignSpaceExplorerPlugin::parameters_
ParameterMap parameters_
Parameters for the plugin.
Definition: DesignSpaceExplorerPlugin.hh:116
__func__
#define __func__
Definition: Application.hh:67
DesignSpaceExplorerPlugin::name
virtual std::string name() const
Definition: DesignSpaceExplorerPlugin.cc:77
DesignSpaceExplorerPlugin::PMCIt
std::map< std::string, ExplorerPluginParameter >::const_iterator PMCIt
Definition: DesignSpaceExplorerPlugin.hh:73
DesignSpaceExplorerPlugin::PMIt
std::map< std::string, ExplorerPluginParameter >::iterator PMIt
Definition: DesignSpaceExplorerPlugin.hh:71
StringTools::stringToLower
static std::string stringToLower(const std::string &source)
Definition: StringTools.cc:160
InstanceNotFound
Definition: Exception.hh:304