Otawa  0.10
features.h
Go to the documentation of this file.
1 /*
2  * otawa::clp module features
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2013, IRIT UPS.
6  *
7  * OTAWA is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * OTAWA is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OTAWA; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef OTAWA_CLP_FEATURES_H_
22 #define OTAWA_CLP_FEATURES_H_
23 
26 #include <otawa/prog/sem.h>
27 
28 namespace otawa {
29 
30 class ClpProblem;
31 
32 namespace clp {
33 
34 class Manager {
35 public:
36  typedef t::uint32 step_t;
37  static const step_t
38  NEW_SEM = 0x01,
39  NEW_PATH = 0x02,
40  NEW_INST = 0x04,
41  ENDED = 0;
42  static bool newSem(step_t s) { return s & NEW_SEM; }
43  static bool newPath(step_t s) { return s & NEW_PATH; }
44  static bool newInst(step_t s) { return s & NEW_INST; }
45  static bool isEnded(step_t s) { return !s; }
46 
47  Manager(WorkSpace *ws);
49  step_t next(void);
50  sem::inst sem(void);
51  Inst *inst(void);
52  State *state(void);
53  inline int ipc(void) { return i; }
54 
55 private:
56  ClpProblem *p;
59  int i;
60  bool new_path;
61 };
62 
63 extern SilentFeature FEATURE;
64 
67 
68 } } // otawa::clp
69 
70 #endif /* OTAWA_CLP_FEATURES_H_ */
The usual Feature class has as drawback to exhibit completely the processing of the feature and there...
Definition: SilentFeature.h:32
State * state(void)
Get the state result of the last interpretation.
Definition: clp_analysis.cpp:2628
Identifier< clp::State > STATE_IN
Put on a basic block, it's the CLP state at the begining of the block.
static bool newSem(step_t s)
Test if the given step result contains the flag Manager::NEW_SEM.
Definition: features.h:42
static bool newPath(step_t s)
Test if the given step result contains the flag Manager::NEW_PATH.
Definition: features.h:43
BasicBlock::InstIter mi
Definition: features.h:57
t::uint32 step_t
Definition: features.h:36
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
step_t start(BasicBlock *bb)
Start the interpretation of a basic block.
Definition: clp_analysis.cpp:2561
clp::State * cs
Definition: features.h:58
Identifier< clp::State > STATE_OUT
Put on a basic block, it's the CLP state at the end of the block.
step_t next(void)
Go to the next step in the interpretation of the basic block.
Definition: clp_analysis.cpp:2581
SilentFeature FEATURE
This features ensure that the clp analysis has been identified.
Inst * inst(void)
Get the current interpreted machine instruction.
Definition: clp_analysis.cpp:2619
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
static const step_t NEW_INST
Definition: features.h:40
The abstract state of the computer (abstract domain).
Definition: ClpState.h:42
static bool isEnded(step_t s)
Definition: features.h:45
Manager(WorkSpace *ws)
Create a manager for the current workspace.
Definition: clp_analysis.cpp:2552
This class allows to exploit the result of a CLP analysis.
Definition: features.h:34
static const step_t NEW_SEM
Definition: features.h:38
int i
Definition: features.h:59
static bool newInst(step_t s)
Test if the given step result contains the flag Manager::NEW_INST.
Definition: features.h:44
static const step_t NEW_PATH
Definition: features.h:39
ClpProblem * p
Definition: features.h:56
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
bool new_path
Definition: features.h:60
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
static const step_t ENDED
Definition: features.h:41
This structure class represents an instruction in the semantics representation of machine instruction...
Definition: inst.h:110
int ipc(void)
Get the current semantic instruction PC.
Definition: features.h:53
clp::State s
Definition: features.h:58
sem::inst sem(void)
Get the last interpreted semantic instruction.
Definition: clp_analysis.cpp:2610
uint32_t uint32
Iterator for instructions in the basic block.
Definition: BasicBlock.h:70