OpenASIP  2.0
Public Member Functions | Private Member Functions | List of all members
EstimatorCmdLineOptions Class Reference

#include <EstimatorCmdLineOptions.hh>

Inheritance diagram for EstimatorCmdLineOptions:
Inheritance graph
Collaboration diagram for EstimatorCmdLineOptions:
Collaboration graph

Public Member Functions

 EstimatorCmdLineOptions ()
 
virtual ~EstimatorCmdLineOptions ()
 
virtual void printVersion () const
 
virtual void printHelp () const
 
bool runOnlyEstimations () const
 
bool totalArea () const
 
bool longestPath () const
 
bool totalEnergy () const
 
std::string TPEF ()
 
std::string traceDB ()
 
- Public Member Functions inherited from CmdLineOptions
 CmdLineOptions (std::string description, std::string version="")
 
virtual ~CmdLineOptions ()
 
void parse (char *argv[], int argc)
 
void parse (std::string argv[], int argc)
 
void parse (std::vector< std::string > argv)
 
virtual bool isVerboseSwitchDefined () const
 
virtual bool isVerboseSpamSwitchDefined () const
 
- Public Member Functions inherited from CmdLineParser
 CmdLineParser (std::string description)
 
virtual ~CmdLineParser ()
 
virtual void storeOptions (Options &options)
 
virtual int numberOfArguments () const
 
virtual std::string argument (int index) const
 

Private Member Functions

 EstimatorCmdLineOptions (const EstimatorCmdLineOptions &)
 Copying not allowed. More...
 
EstimatorCmdLineOptionsoperator= (const EstimatorCmdLineOptions &)
 Assignment not allowed. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CmdLineOptions
bool optionGiven (std::string key) const
 
- Protected Member Functions inherited from CmdLineParser
void addOption (CmdLineOptionParser *opt)
 
CmdLineOptionParserfindOption (std::string name) const
 
bool parseOption (std::string option, std::string &name, std::string &arguments, std::string &prefix, bool &hasArgument) const
 
bool readPrefix (std::string &option, std::string &prefix, bool &longOption) const
 
bool isPrefix (std::string name) const
 
- Protected Attributes inherited from CmdLineParser
std::map< std::string, CmdLineOptionParser * > optionLongNames_
 Database for holding options with their long names as a key. More...
 
std::map< std::string, CmdLineOptionParser * > optionShortNames_
 Database for holding options with their short names as a key. More...
 
std::vector< std::string > commandLine_
 Command line is stored here. More...
 
std::vector< std::string > arguments_
 Command line arguments are stored here. More...
 
std::vector< std::string > prefixes_
 Legal prefixes are stored here. More...
 

Detailed Description

Command line option class for Simulator.

Definition at line 43 of file EstimatorCmdLineOptions.hh.

Constructor & Destructor Documentation

◆ EstimatorCmdLineOptions() [1/2]

EstimatorCmdLineOptions::EstimatorCmdLineOptions ( )

Constructor.

Definition at line 65 of file EstimatorCmdLineOptions.cc.

65  : CmdLineOptions("") {
66  addOption(
68  SWL_TPEF,
69  "sets the TTA program exchange format file (TPEF) from which to "
70  "load the estimated program (required for energy estimation only)",
71  SWS_TPEF));
72  addOption(
74  SWL_TRACE,
75  "sets the simulation trace database (TraceDB) from which to "
76  "load the simulation data of the estimated program (required for "
77  "energy estimation only)",
78  SWS_TRACE));
79  addOption(
82  "run total area estimation",
83  SWS_TOTALAREA));
84  addOption(
87  "run longest path estimation",
89  addOption(
92  "run total energy consumption estimation",
94 }

References CmdLineParser::addOption(), SWL_LONGESTPATH, SWL_TOTALAREA, SWL_TOTALENERGY, SWL_TPEF, SWL_TRACE, SWS_LONGESTPATH, SWS_TOTALAREA, SWS_TOTALENERGY, SWS_TPEF, and SWS_TRACE.

Here is the call graph for this function:

◆ ~EstimatorCmdLineOptions()

EstimatorCmdLineOptions::~EstimatorCmdLineOptions ( )
virtual

Destructor.

Definition at line 99 of file EstimatorCmdLineOptions.cc.

99  {
100 }

◆ EstimatorCmdLineOptions() [2/2]

EstimatorCmdLineOptions::EstimatorCmdLineOptions ( const EstimatorCmdLineOptions )
private

Copying not allowed.

Member Function Documentation

◆ longestPath()

bool EstimatorCmdLineOptions::longestPath ( ) const

Checks if run longest path estimation option was given.

Returns
True if option was given and was not "no" prefixed

Definition at line 187 of file EstimatorCmdLineOptions.cc.

187  {
188  if (findOption(SWL_LONGESTPATH)->isDefined()) {
190  }
191  return false;
192 }

References CmdLineParser::findOption(), CmdLineOptionParser::isFlagOn(), and SWL_LONGESTPATH.

Here is the call graph for this function:

◆ operator=()

EstimatorCmdLineOptions& EstimatorCmdLineOptions::operator= ( const EstimatorCmdLineOptions )
private

Assignment not allowed.

◆ printHelp()

void EstimatorCmdLineOptions::printHelp ( ) const
virtual

Prints the help menu of the program.

Reimplemented from CmdLineOptions.

Definition at line 115 of file EstimatorCmdLineOptions.cc.

115  {
116  printVersion();
117  std::cout << std::endl
118  << "usage: estimate [options] ADF IDF "
119  << std::endl
120  << std::endl
121  << "ADF and IDF are required always, TPEF and TraceDB only for "
122  << "energy estimation, which is not performed in case they are "
123  << "not given."
124  << std::endl;
126 }

References CmdLineOptions::printHelp(), and printVersion().

Here is the call graph for this function:

◆ printVersion()

void EstimatorCmdLineOptions::printVersion ( ) const
virtual

Prints the version of the program.

Implements CmdLineOptions.

Definition at line 106 of file EstimatorCmdLineOptions.cc.

106  {
107  std::cout << "estimate - TTA Processor Cost Estimator "
108  << Application::TCEVersionString() << std::endl;
109 }

References Application::TCEVersionString().

Referenced by printHelp().

Here is the call graph for this function:

◆ runOnlyEstimations()

bool EstimatorCmdLineOptions::runOnlyEstimations ( ) const

Test if estimation selection flags are given, returns true is so.

Returns
True if estimation selection flags are given.

Definition at line 158 of file EstimatorCmdLineOptions.cc.

158  {
159  if (findOption(SWL_TOTALAREA)->isDefined() ||
160  findOption(SWL_LONGESTPATH)->isDefined() ||
161  findOption(SWL_LONGESTPATH)->isDefined()) {
162 
163  return true;
164  }
165  return false;
166 }

References CmdLineParser::findOption(), SWL_LONGESTPATH, and SWL_TOTALAREA.

Here is the call graph for this function:

◆ totalArea()

bool EstimatorCmdLineOptions::totalArea ( ) const

Checks if run total area estimation option was given.

Returns
True if option was given and was not "no" prefixed

Definition at line 174 of file EstimatorCmdLineOptions.cc.

174  {
175  if (findOption(SWL_TOTALAREA)->isDefined()) {
176  return findOption(SWL_TOTALAREA)->isFlagOn();
177  }
178  return false;
179 }

References CmdLineParser::findOption(), CmdLineOptionParser::isFlagOn(), and SWL_TOTALAREA.

Here is the call graph for this function:

◆ totalEnergy()

bool EstimatorCmdLineOptions::totalEnergy ( ) const

Checks if run total energy consumption estimation option was given.

Returns
True if option was given and was not "no" prefixed

Definition at line 200 of file EstimatorCmdLineOptions.cc.

200  {
201  if (findOption(SWL_TOTALENERGY)->isDefined()) {
203  }
204  return false;
205 }

References CmdLineParser::findOption(), CmdLineOptionParser::isFlagOn(), and SWL_TOTALENERGY.

Here is the call graph for this function:

◆ TPEF()

std::string EstimatorCmdLineOptions::TPEF ( )

Returns the TPEF file name given by the user.

If no value is given in the parsed command line, returns an empty string.

Returns
The TPEF file name.

Definition at line 136 of file EstimatorCmdLineOptions.cc.

136  {
137  return findOption(SWL_TPEF)->String();
138 }

References CmdLineParser::findOption(), CmdLineOptionParser::String(), and SWL_TPEF.

Here is the call graph for this function:

◆ traceDB()

std::string EstimatorCmdLineOptions::traceDB ( )

Returns the TraceDB file name given by the user.

If no value is given in the parsed command line, returns an empty string.

Returns
The TraceDB file name.

Definition at line 148 of file EstimatorCmdLineOptions.cc.

148  {
149  return findOption(SWL_TRACE)->String();
150 }

References CmdLineParser::findOption(), CmdLineOptionParser::String(), and SWL_TRACE.

Here is the call graph for this function:

The documentation for this class was generated from the following files:
SWL_TOTALENERGY
const std::string SWL_TOTALENERGY
Long switch string for setting the total energy consumed estimation.
Definition: EstimatorCmdLineOptions.cc:58
SWS_TPEF
const std::string SWS_TPEF
Short switch string for setting the TPEF (program).
Definition: EstimatorCmdLineOptions.cc:43
CmdLineOptionParser::isFlagOn
virtual bool isFlagOn() const
Definition: CmdLineOptionParser.cc:126
SWL_LONGESTPATH
const std::string SWL_LONGESTPATH
Long switch string for setting the longest path estimation.
Definition: EstimatorCmdLineOptions.cc:54
SWL_TRACE
const std::string SWL_TRACE
Long switch string for setting the TraceDB.
Definition: EstimatorCmdLineOptions.cc:45
CmdLineParser::addOption
void addOption(CmdLineOptionParser *opt)
SWS_TOTALENERGY
const std::string SWS_TOTALENERGY
Short switch string for setting the total energy consumed estimation.
Definition: EstimatorCmdLineOptions.cc:60
CmdLineOptions::CmdLineOptions
CmdLineOptions(std::string description, std::string version="")
Definition: CmdLineOptions.cc:73
BoolCmdLineOptionParser
Definition: CmdLineOptionParser.hh:278
EstimatorCmdLineOptions::printVersion
virtual void printVersion() const
Definition: EstimatorCmdLineOptions.cc:106
SWS_TRACE
const std::string SWS_TRACE
Short switch string for setting the TraceDB.
Definition: EstimatorCmdLineOptions.cc:47
CmdLineOptions::printHelp
virtual void printHelp() const
Definition: CmdLineOptions.cc:262
SWL_TPEF
const std::string SWL_TPEF
Long switch string for setting the TPEF (program).
Definition: EstimatorCmdLineOptions.cc:41
SWS_TOTALAREA
const std::string SWS_TOTALAREA
Short switch string for setting the total area estimation.
Definition: EstimatorCmdLineOptions.cc:52
CmdLineOptionParser::String
virtual std::string String(int index=0) const
Definition: CmdLineOptionParser.cc:102
SWL_TOTALAREA
const std::string SWL_TOTALAREA
Long switch string for setting the total area estimation.
Definition: EstimatorCmdLineOptions.cc:50
CmdLineParser::findOption
CmdLineOptionParser * findOption(std::string name) const
Definition: CmdLineParser.cc:160
Application::TCEVersionString
static std::string TCEVersionString()
Definition: Application.cc:510
StringCmdLineOptionParser
Definition: CmdLineOptionParser.hh:180
SWS_LONGESTPATH
const std::string SWS_LONGESTPATH
Short switch string for setting the longest path estimation.
Definition: EstimatorCmdLineOptions.cc:56