Otawa  0.10
DFA.h
Go to the documentation of this file.
1 /*
2  * CCGDFA class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2006, 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_CCG_CCGDFA_H
22 #define OTAWA_CCG_CCGDFA_H
23 
24 #include <otawa/dfa/BitSet.h>
25 #include <otawa/cache/LBlockSet.h>
26 #include <otawa/ipet/IPET.h>
27 #include <otawa/ilp.h>
28 #include <otawa/prop/Identifier.h>
29 #include <otawa/hard/Cache.h>
30 #include <otawa/cfg.h>
31 
32 namespace otawa {
33 
34 // Extern classes
35 class BasicBlock;
36 class LBlockSet;
37 
38 namespace ccg {
39 
40 class Domain: public dfa::BitSet {
41 public:
42  inline Domain(int size) : dfa::BitSet(size) { }
43  inline void reset(void) { empty(); }
44  inline void join(Domain *d) { add(*d); }
45  inline void meet(Domain *d) { mask(*d); }
46  inline bool equals(Domain *d) { return(dfa::BitSet::equals(*d)); }
47 };
48 
49 // Problem Class
50 class Problem {
51 public:
52  typedef Domain domain_t;
53 
54  inline Problem (LBlockSet *_ccggraph, int _size , const hard::Cache *_cach, WorkSpace *_fw)
55  { ccggraph = _ccggraph; cach = _cach; size = _size; fw = _fw; }
56 
57  Domain *empty(void) {
58  Domain *tmp = new Domain(size);
59  tmp->reset();
60  return(tmp);
61  }
62 
65 
66  inline void free(Domain *d) { delete d; }
67 
68 private:
70  const hard::Cache *cach;
71  static int vars;
72  int size;
74 };
75 
76 } } // otawa::ccg
77 
78 #endif // OTAWA_CCG_CCGDFA_H
void meet(Domain *d)
Definition: DFA.h:45
Domain(int size)
Definition: DFA.h:42
Problem(LBlockSet *_ccggraph, int _size, const hard::Cache *_cach, WorkSpace *_fw)
Definition: DFA.h:54
Domain * gen(CFG *cfg, BasicBlock *bb)
Definition: ccg_DFA.cpp:47
void reset(void)
Definition: DFA.h:43
void empty(void)
Remove all items from the bit set.
Definition: BitSet.h:109
void join(Domain *d)
Definition: DFA.h:44
WorkSpace * fw
Definition: DFA.h:73
static int vars
Definition: DFA.h:71
This class implements a set as a bit vector.
Definition: BitSet.h:82
LBlockSet * ccggraph
Definition: DFA.h:69
BitSet(void)
Definition: BitSet.h:101
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
const hard::Cache * cach
Definition: DFA.h:70
uint32 size
Domain domain_t
Definition: DFA.h:52
void mask(const BitSet &set)
Keep only in this set the items also containted in the given one (performs intersection operation)...
Definition: BitSet.h:122
Domain * preserve(CFG *cfg, BasicBlock *bb)
Definition: ccg_DFA.cpp:75
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
bool equals(Domain *d)
Definition: DFA.h:46
This class contains the configuration of a level of cache of processor.
Definition: Cache.h:34
bool equals(const BitSet &set) const
Test if two bit sets are equals.
Definition: BitSet.h:115
Domain * empty(void)
Definition: DFA.h:57
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
Definition: DFA.h:40
This class represents the list of l-blocks of a task for a chosen cache row.
Definition: features.h:75
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
int size
Definition: DFA.h:72
void free(Domain *d)
Definition: DFA.h:66
void add(int index)
Add an item to the bit set.
Definition: BitSet.h:112
Definition: DFA.h:50