Otawa  0.10
CATDFA.h
Go to the documentation of this file.
1 /*
2  * CATDFA class interface
3  * Copyright (c) 2006, IRIT UPS.
4  *
5  * This file is part of OTAWA
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
20  * 02110-1301 USA
21  */
22 #ifndef OTAWA_CAT_CATDFA_H_
23 #define OTAWA_CAT_CATDFA_H_
24 
25 #include <otawa/dfa/BitSet.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 
31 
32 namespace otawa {
33 
34 class BasicBlock;
35 class LBlockSet;
36 
37 namespace cat {
38 
39 class CATDomain: public dfa::BitSet {
40 
41 public:
42  inline CATDomain(int size) : dfa::BitSet(size) {
43  }
44  void reset(void) {
45  empty();
46  }
47  void join(CATDomain *d) {
48  add(*d);
49  }
50  void meet(CATDomain *d) {
51  mask(*d);
52  }
53  bool equals(CATDomain *d) {
54  return(BitSet::equals(*d));
55  }
56 };
57 
58 
59 class CATProblem {
61  const hard::Cache *cach;
63  int size;
64  static int vars;
65 
66  public:
67 
69 
70  CATDomain *empty(void) {
71  CATDomain *tmp = new CATDomain(size);
72  tmp->reset();
73  return(tmp);
74  }
75 
78 
79  void free(CATDomain *d) {
80  delete d;
81  }
82 
83  CATProblem (LBlockSet *point, int _size, const hard::Cache *mem, WorkSpace *_fw){
84  lines = point;
85  size = _size;
86  cach = mem;
87  fw = _fw;
88  };
89 
90 };
91 
92 } } // otawa::cat
93 
94 #endif // OTAWA_CAT_CATDFA_H_
bool equals(CATDomain *d)
Definition: CATDFA.h:53
void empty(void)
Remove all items from the bit set.
Definition: BitSet.h:109
CATDomain(int size)
Definition: CATDFA.h:42
static int vars
Definition: CATDFA.h:64
void reset(void)
Definition: CATDFA.h:44
void meet(CATDomain *d)
Definition: CATDFA.h:50
CATDomain * empty(void)
Definition: CATDFA.h:70
This class implements a set as a bit vector.
Definition: BitSet.h:82
CATDomain domain_t
Definition: CATDFA.h:68
BitSet(void)
Definition: BitSet.h:101
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
LBlockSet * lines
Definition: CATDFA.h:60
Control Flow Graph representation.
Definition: CFG.h:42
const hard::Cache * cach
Definition: CATDFA.h:61
uint32 size
CATProblem(LBlockSet *point, int _size, const hard::Cache *mem, WorkSpace *_fw)
Definition: CATDFA.h:83
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
WorkSpace * fw
Definition: CATDFA.h:62
int size
Definition: CATDFA.h:63
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
This class contains the configuration of a level of cache of processor.
Definition: Cache.h:34
Definition: CATDFA.h:59
CATDomain * gen(CFG *cfg, BasicBlock *bb)
Definition: cat_CATDFA.cpp:30
This class represents the list of l-blocks of a task for a chosen cache row.
Definition: LBlockSet.h:38
CATDomain * preserve(CFG *cfg, BasicBlock *bb)
Definition: cat_CATDFA.cpp:57
dtd::Element cfg(dtd::make("cfg", _CFG).attr(id).content((entry,*bb, exit,*edge)))
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
void free(CATDomain *d)
Definition: CATDFA.h:79
void join(CATDomain *d)
Definition: CATDFA.h:47
void add(int index)
Add an item to the bit set.
Definition: BitSet.h:112
Definition: CATDFA.h:39