Otawa  0.10
LBlockSet.h
Go to the documentation of this file.
1 /*
2  * LBlockSet interface
3  * Copyright (c) 2005-12, 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_CACHE_LBLOCKSET_H
23 #define OTAWA_CACHE_LBLOCKSET_H
24 
25 #include <elm/assert.h>
26 #include <otawa/properties.h>
27 #include <otawa/instruction.h>
28 #include <elm/genstruct/Vector.h>
29 #include <elm/genstruct/Table.h>
30 #include <otawa/cache/LBlock.h>
31 #include <elm/PreIterator.h>
32 
33 using namespace elm;
34 
35 namespace otawa {
36 
37 // LBlockSet class
38 class LBlockSet {
39  friend class CCGDFA;
40 public:
41 
42  // Iterator class
43  class Iterator: public elm::genstruct::Vector<LBlock *>::Iterator {
44  public:
45  inline Iterator(LBlockSet& lbset):
46  elm::genstruct::Vector<LBlock *>::Iterator(lbset.listelbc) { }
47  };
48 
49  // Methods
50  LBlockSet(int row, const hard::Cache *cache);
51  int add(LBlock *node);
52  inline int count(void) { return listelbc.length(); }
53  inline int cacheBlockCount(void) { return listelbc.length(); }
54  inline LBlock *lblock(int i) { return listelbc[i]; }
55  inline int set(void) { return linenumber; }
56  inline const hard::Cache *cache(void) const { return _cache; }
57 
58  // deprecated
59  int line(void) { return linenumber; }
60 
61 private:
66 };
67 
68 // Properties
71 
72 } //otawa
73 
74 #endif // OTAWA_CACHE_LBLOCKSET_H
Iterator(LBlockSet &lbset)
Definition: LBlockSet.h:45
int cacheBlockCount(void)
Get the internal counter of l-block number (only used internally).
Definition: LBlockSet.h:53
elm::genstruct::Vector< LBlock * > listelbc
Definition: LBlockSet.h:63
int cblock_count
Definition: LBlockSet.h:64
Identifier< LBlockSet ** > LBLOCKS
This property is used for storing the list of L-Blocks.
int linenumber
Definition: LBlockSet.h:62
const hard::Cache * _cache
Definition: LBlockSet.h:65
This class contains the configuration of a level of cache of processor.
Definition: Cache.h:34
The l-block is an abstraction allowing to split the basic block according to the bound of the cache b...
Definition: LBlock.h:43
StringOption cache(command, 'c',"cache","used cache","path","")
int line(void)
Definition: LBlockSet.h:59
This class represents the list of l-blocks of a task for a chosen cache row.
Definition: LBlockSet.h:38
const hard::Cache * cache(void) const
Definition: LBlockSet.h:56
int count(void)
Get a number for a new l-block in the set.
Definition: LBlockSet.h:52
inst add(int d, int a, int b)
Definition: inst.h:163
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
Identifier< genstruct::AllocatedTable< LBlock * > * > BB_LBLOCKS
This property is used for storing the list of L-Blocks of a BasicBlock.
LBlock * lblock(int i)
Get the l-block with the given index.
Definition: LBlockSet.h:54
int set(void)
Get the set number of the l-blocks in the cache.
Definition: LBlockSet.h:55
Definition: LBlockSet.h:43