OpenASIP
2.0
|
#include <StaticProgramAnalyzer.hh>
Public Member Functions | |
StaticProgramAnalyzer () | |
virtual | ~StaticProgramAnalyzer () |
void | addProgram (const TTAProgram::Program &program) |
std::set< std::string > | operationsUsed () const |
std::set< SIntWord > | integerRegisterIndexes () const |
std::map< int, int > | immediateBitWidths () const |
InstructionAddress | biggestAddress () const |
void | resetCounters () |
Private Attributes | |
std::set< SIntWord > | integerVariables_ |
Set of integer variables used in the applications. More... | |
std::set< std::string > | operations_ |
Set of operations used in the applications. More... | |
std::map< int, int > | immediates_ |
Set of immediate widths used in the applications. More... | |
unsigned int | biggestAddress_ |
Memory used by programs. More... | |
Analyzes sequential programs operation use, register needs and immediate widths.
Definition at line 49 of file StaticProgramAnalyzer.hh.
StaticProgramAnalyzer::StaticProgramAnalyzer | ( | ) |
The constructor.
Definition at line 50 of file StaticProgramAnalyzer.cc.
|
virtual |
void StaticProgramAnalyzer::addProgram | ( | const TTAProgram::Program & | program | ) |
Adds a new program to the analyzer and analyzes it. Results are added to the previously analyzed results.
program | Sequential program to be analyzed. |
Definition at line 67 of file StaticProgramAnalyzer.cc.
References biggestAddress_, TTAProgram::DataMemory::dataDefinition(), TTAProgram::DataMemory::dataDefinitionCount(), TTAProgram::Move::destination(), immediates_, TTAProgram::Terminal::index(), integerVariables_, TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediate(), TTAProgram::Terminal::isOpcodeSetting(), TTAProgram::Address::location(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), Operation::name(), TTAProgram::Terminal::operation(), operations_, program, MathTools::requiredBits(), TTAProgram::DataDefinition::size(), TTAProgram::Move::source(), TTAProgram::DataDefinition::startAddress(), StringTools::stringToLower(), SimValue::unsignedValue(), and TTAProgram::Terminal::value().
InstructionAddress StaticProgramAnalyzer::biggestAddress | ( | ) | const |
Returns the biggest instruction address used in the analyzed programs.
Definition at line 148 of file StaticProgramAnalyzer.cc.
References biggestAddress_.
std::map< int, int > StaticProgramAnalyzer::immediateBitWidths | ( | ) | const |
Returns set of immediate bit widths used in the analyzed programs.
Definition at line 138 of file StaticProgramAnalyzer.cc.
References immediates_.
std::set< SIntWord > StaticProgramAnalyzer::integerRegisterIndexes | ( | ) | const |
Returns set of register indexes used in the analyzed programs.
Definition at line 128 of file StaticProgramAnalyzer.cc.
References integerVariables_.
std::set< std::string > StaticProgramAnalyzer::operationsUsed | ( | ) | const |
Returns set of operations used in the analyzed programs.
Operation names in the se are in lower case.
Definition at line 118 of file StaticProgramAnalyzer.cc.
References operations_.
void StaticProgramAnalyzer::resetCounters | ( | ) |
Resets the all counters used be the analyzer.
Definition at line 157 of file StaticProgramAnalyzer.cc.
References integerVariables_, and operations_.
|
private |
Memory used by programs.
Definition at line 69 of file StaticProgramAnalyzer.hh.
Referenced by addProgram(), and biggestAddress().
|
private |
Set of immediate widths used in the applications.
Definition at line 67 of file StaticProgramAnalyzer.hh.
Referenced by addProgram(), and immediateBitWidths().
|
private |
Set of integer variables used in the applications.
Definition at line 63 of file StaticProgramAnalyzer.hh.
Referenced by addProgram(), integerRegisterIndexes(), and resetCounters().
|
private |
Set of operations used in the applications.
Definition at line 65 of file StaticProgramAnalyzer.hh.
Referenced by addProgram(), operationsUsed(), and resetCounters().