OpenASIP  2.0
StaticProgramAnalyzer.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 StaticProgramAnalyzer.hh
26  *
27  * Declaration of a class that analyzes sequential program code.
28  *
29  * @author Jari Mäntyneva 2007 (jari.mantyneva-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef STATIC_PROGRAM_ANALYZER_HH
34 #define STATIC_PROGRAM_ANALYZER_HH
35 
36 #include <string>
37 #include <set>
38 #include <map>
39 #include "BaseType.hh"
40 
41 namespace TTAProgram {
42  class Program;
43 }
44 
45 /**
46  * Analyzes sequential programs operation use, register needs and
47  * immediate widths.
48  */
50 public:
52  virtual ~StaticProgramAnalyzer();
53 
55  std::set<std::string> operationsUsed() const;
56  std::set<SIntWord> integerRegisterIndexes() const;
57  std::map<int, int> immediateBitWidths() const;
59  void resetCounters();
60 
61 private:
62  /// Set of integer variables used in the applications.
63  std::set<SIntWord> integerVariables_;
64  /// Set of operations used in the applications.
65  std::set<std::string> operations_;
66  /// Set of immediate widths used in the applications.
67  std::map<int, int> immediates_;
68  /// Memory used by programs
69  unsigned int biggestAddress_;
70 
71 };
72 
73 
74 #endif
TTAProgram
Definition: Estimator.hh:65
TTAProgram::Program
Definition: Program.hh:63
StaticProgramAnalyzer
Definition: StaticProgramAnalyzer.hh:49
InstructionAddress
UInt32 InstructionAddress
Definition: BaseType.hh:175
BaseType.hh
StaticProgramAnalyzer::biggestAddress
InstructionAddress biggestAddress() const
Definition: StaticProgramAnalyzer.cc:148
StaticProgramAnalyzer::immediates_
std::map< int, int > immediates_
Set of immediate widths used in the applications.
Definition: StaticProgramAnalyzer.hh:67
StaticProgramAnalyzer::resetCounters
void resetCounters()
Definition: StaticProgramAnalyzer.cc:157
StaticProgramAnalyzer::operations_
std::set< std::string > operations_
Set of operations used in the applications.
Definition: StaticProgramAnalyzer.hh:65
StaticProgramAnalyzer::integerRegisterIndexes
std::set< SIntWord > integerRegisterIndexes() const
Definition: StaticProgramAnalyzer.cc:128
StaticProgramAnalyzer::~StaticProgramAnalyzer
virtual ~StaticProgramAnalyzer()
Definition: StaticProgramAnalyzer.cc:57
StaticProgramAnalyzer::StaticProgramAnalyzer
StaticProgramAnalyzer()
Definition: StaticProgramAnalyzer.cc:50
StaticProgramAnalyzer::integerVariables_
std::set< SIntWord > integerVariables_
Set of integer variables used in the applications.
Definition: StaticProgramAnalyzer.hh:63
StaticProgramAnalyzer::addProgram
void addProgram(const TTAProgram::Program &program)
Definition: StaticProgramAnalyzer.cc:67
StaticProgramAnalyzer::immediateBitWidths
std::map< int, int > immediateBitWidths() const
Definition: StaticProgramAnalyzer.cc:138
StaticProgramAnalyzer::operationsUsed
std::set< std::string > operationsUsed() const
Definition: StaticProgramAnalyzer.cc:118
program
find Finds info of the inner loops in the program
Definition: InnerLoopFinder.cc:80
StaticProgramAnalyzer::biggestAddress_
unsigned int biggestAddress_
Memory used by programs.
Definition: StaticProgramAnalyzer.hh:69