Otawa  0.10
LBlockBuilder.h
Go to the documentation of this file.
1 /*
2  * LBlockBuilder class interface
3  * Copyright (c) 2005-12, IRIT UPS <casse@irit.fr>
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 Foobar; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef OTAWA_CACHE_LBLOCKBUILDER_H
22 #define OTAWA_CACHE_LBLOCKBUILDER_H
23 
24 #include <otawa/proc/BBProcessor.h>
25 #include <otawa/cache/LBlockSet.h>
26 #include <otawa/proc/Feature.h>
27 #include <elm/genstruct/Vector.h>
28 #include <elm/genstruct/Table.h>
29 
30 namespace otawa {
31 
32 namespace hard {
33  class Cache;
34  class Memory;
35 }
36 
37 // LBlockBuilder class
38 class LBlockBuilder: public BBProcessor {
39 public:
40  static p::declare reg;
42 
43 protected:
44  virtual void processBB(WorkSpace *fw, CFG *cfg, BasicBlock *bb);
45  virtual void cleanup(WorkSpace *fw);
46  virtual void setup(WorkSpace *fw);
47 
48 private:
51  const hard::Memory *mem;
53  void addLBlock(BasicBlock *bb, Inst *inst, int& index, genstruct::AllocatedTable<LBlock *> *lblocks);
54 };
55 
56 // Features
58 
59 } // otawa
60 
61 #endif // OTAWA_CACHE_LBLOCKBUILDER_H
struct otawa::sem::inst inst
virtual void processBB(WorkSpace *fw, CFG *cfg, BasicBlock *bb)
Perform the work of the given basic block.
Definition: cache_LBlockBuilder.cpp:155
This processor is dedicated to the basic block process thru proccessBB() method.
Definition: BBProcessor.h:72
CFG * cfg(void) const
Get the current CFG.
Definition: CFGProcessor.h:56
static p::declare reg
Definition: LBlockBuilder.h:40
genstruct::HashTable< ot::mask, int > block_map
Definition: LBlockBuilder.h:52
Abstract class to represent the registered processors.
Definition: Registration.h:80
Class to declare simple a processor.
Definition: Registration.h:213
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
Class to represent the whole memory of the platform.
Definition: Memory.h:173
void addLBlock(BasicBlock *bb, Inst *inst, int &index, genstruct::AllocatedTable< LBlock * > *lblocks)
Add an lblock to the lblock lists.
Definition: cache_LBlockBuilder.cpp:115
virtual void cleanup(WorkSpace *fw)
This method is called after the end of the processor analysis to let it do some clean up...
Definition: cache_LBlockBuilder.cpp:99
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
const hard::Memory * mem
Definition: LBlockBuilder.h:51
This class represents the list of l-blocks of a task for a chosen cache row.
Definition: LBlockSet.h:38
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
LBlockSet ** lbsets
Definition: LBlockBuilder.h:49
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
Feature< LBlockBuilder > COLLECTED_LBLOCKS_FEATURE
This properties is set on the first instruction of each lblock and points to the lblock.
This processor builds the list of l-blocks for each lines of instruction cache and stores it in the C...
Definition: LBlockBuilder.h:38
LBlockBuilder(AbstractRegistration &r=reg)
Build a new l-block builder.
Definition: cache_LBlockBuilder.cpp:66
virtual void setup(WorkSpace *fw)
This method is called before an anlysis to let the processor do some initialization.
Definition: cache_LBlockBuilder.cpp:72
A feature is a set of facilities, usually provided using properties, available on a framework...
Definition: Feature.h:46
const hard::Cache * cache
Definition: LBlockBuilder.h:50