OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 
EstimatorCmdLineOptionsoperator= (const EstimatorCmdLineOptions &)
 Assignment not allowed.
 

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.
 
std::map< std::string, CmdLineOptionParser * > optionShortNames_
 Database for holding options with their short names as a key.
 
std::vector< std::string > commandLine_
 Command line is stored here.
 
std::vector< std::string > arguments_
 Command line arguments are stored here.
 
std::vector< std::string > prefixes_
 Legal prefixes are stored here.
 

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("") {
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));
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));
82 "run total area estimation",
87 "run longest path estimation",
92 "run total energy consumption estimation",
94}
const std::string SWS_TOTALENERGY
Short switch string for setting the total energy consumed estimation.
const std::string SWS_TPEF
Short switch string for setting the TPEF (program).
const std::string SWS_TOTALAREA
Short switch string for setting the total area estimation.
const std::string SWL_TOTALAREA
Long switch string for setting the total area estimation.
const std::string SWL_TRACE
Long switch string for setting the TraceDB.
const std::string SWL_LONGESTPATH
Long switch string for setting the longest path estimation.
const std::string SWS_TRACE
Short switch string for setting the TraceDB.
const std::string SWL_TPEF
Long switch string for setting the TPEF (program).
const std::string SWL_TOTALENERGY
Long switch string for setting the total energy consumed estimation.
const std::string SWS_LONGESTPATH
Short switch string for setting the longest path estimation.
void addOption(CmdLineOptionParser *opt)

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}
virtual bool isFlagOn() const
CmdLineOptionParser * findOption(std::string name) const

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}
virtual void printHelp() const

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}
static std::string TCEVersionString()

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()) {
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}
virtual std::string String(int index=0) const

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: