Otawa  0.10
Builder.h
Go to the documentation of this file.
1 /*
2  * CCGBuilder 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_BUILDER_H
22 #define OTAWA_CCG_BUILDER_H
23 
24 #include <elm/assert.h>
25 #include <elm/genstruct/Table.h>
26 #include <otawa/proc/Processor.h>
27 #include <otawa/ccg/features.h>
28 
29 namespace otawa {
30 
31 using namespace elm::genstruct;
32 
33 // Extern classes
34 class LBlockSet;
35 class CFG;
36 class LBlockSet;
37 
38 namespace ccg {
39 
40 // Collection class
41 class Collection {
42  friend class Builder;
44  inline Collection(int cnt): ccgs(cnt)
45  { for(int i = 0; i < cnt; i++) ccgs[i] = 0; }
46 public:
47  inline ~Collection(void)
48  { for(int i = 0; i < ccgs.count(); i++) if(ccgs[i]) delete ccgs[i]; }
49  inline int length(void) const { return ccgs.count(); }
50  inline Graph *get(int index) const { return ccgs[index]; }
51  inline Graph *operator[](int index) const { return get(index); }
52 };
53 
54 
55 // Builder class
56 class Builder: public Processor {
57 public:
59 
60  static p::declare reg;
61  Builder(p::declare& r = reg);
62 
63  virtual void processWorkSpace(WorkSpace *fw);
64 
65 private:
66  void processLBlockSet(WorkSpace *fw, LBlockSet *lbset);
67 };
68 
69 } } // otawa::ccg
70 
71 #endif // OTAWA_CCG_CCGBUILDER_H
~Collection(void)
Definition: Builder.h:47
Class to declare simple a processor.
Definition: Registration.h:213
Collection(int cnt)
Definition: Builder.h:44
Graph * operator[](int index) const
Definition: Builder.h:51
This processor builds the Cache Conflict Graph of the current task.
Definition: Builder.h:56
The processor class is implemented by all code processor.
Definition: Processor.h:49
Definition: Builder.h:41
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
static p::declare reg
Definition: Builder.h:60
static Identifier< bool > NON_CONFLICT
Definition: Builder.h:58
int length(void) const
Definition: Builder.h:49
AllocatedTable< Graph * > ccgs
Definition: Builder.h:43
This class represents the list of l-blocks of a task for a chosen cache row.
Definition: features.h:75
Definition: features.h:107