22 #ifndef OTAWA_IPET_BRANCHINSPECTION_
23 #define OTAWA_IPET_BRANCHINSPECTION_
27 #include <elm/genstruct/HashTable.h>
34 #define CLAIRE_INFOS 0
37 namespace otawa {
namespace bpred {
76 inline int getBit(
int v,
int n) {
return ((v & 1 << n)>0)?1:0; }
77 inline void setBit(
int&v,
int n) { v |= (1<<n); }
94 bool isClassExit(BHG* bhg, BHGNode* src,
bool& src_withT,
bool& src_withNT);
void processCFG__Global2B(WorkSpace *ws, CFG *cfg)
void processCFG__Global1B(WorkSpace *ws, CFG *cfg)
bool isClassEntry(BHG *bhg, BHGNode *src)
CFG * cfg(void) const
Get the current CFG.
Definition: CFGProcessor.h:56
elm::genstruct::Vector< int > stat_nbbr
Definition: BPredProcessor.h:63
void setMitraInit(const char *binary_histo)
Converts a string containing a binary number into a bitset and sets the class parameter mitraInit...
Definition: BPredProcessor.cpp:211
bool explicit_mode
Definition: BPredProcessor.h:67
unsigned int BHT
Definition: BPredProcessor.h:58
virtual void configure(const PropList &props)
Configures the parameters of the class from the given PropList.
Definition: BPredProcessor.cpp:301
BasicBlock * getFirstBranch(BasicBlock *bb, CFG *cfg)
bool withStats
Definition: BPredProcessor.h:62
Class to declare simple a processor.
Definition: Registration.h:213
This class implements a set as a bit vector.
Definition: BitSet.h:82
String BitSet_to_String(const dfa::BitSet &bs)
Converts a BitSet into a String.
Definition: BPredProcessor.cpp:231
bool contains(const elm::genstruct::Vector< BBHGNode * > &v, BBHGNode &n, BBHGNode *&contained)
~BPredProcessor(void)
The destructor.
Definition: BPredProcessor.cpp:201
void setBit(int &v, int n)
Definition: BPredProcessor.h:77
This is a specialization of the CFGProcessor class dedicated to branch prediction.
Definition: BPredProcessor.h:47
dfa::BitSet * mitraInit
Definition: BPredProcessor.h:66
String stats_str
Definition: BPredProcessor.h:64
void generateClasses(CFG *cfg, BSets &bs)
WorkSpace * ws
Definition: Processor.h:185
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
Control Flow Graph representation.
Definition: CFG.h:42
elm::genstruct::Vector< dfa::BitSet * > stat_hist
Definition: BPredProcessor.h:65
void generateBBHG(CFG *cfg, BBHG &bbhg)
void historyPlusOne(dfa::BitSet &h)
method_t
Definition: features.h:28
void CS__Global1b(WorkSpace *fw, CFG *cfg, BHG *bhg, BBHG *bbhg, elm::genstruct::Vector< BCG * > &bcgs, elm::genstruct::HashTable< String, ilp::Var * > &ht_vars)
String bin_to_str(int i)
Definition: BPredProcessor.cpp:318
bool dumpBBHG
Definition: BPredProcessor.h:59
void CS__Global2b_not_mitra(WorkSpace *fw, CFG *cfg, BHG *bhg, elm::genstruct::Vector< BCG * > &graphs, elm::genstruct::HashTable< String, ilp::Var * > &ht_vars)
method_t method
Definition: BPredProcessor.h:60
BasicBlock * getBB(int id, CFG *cfg)
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
void generateBCGs(elm::genstruct::Vector< BCG * > &bcgs, BHG &bhg)
void processCFG__Bimodal(WorkSpace *ws, CFG *cfg)
bool isClassExit(BHG *bhg, BHGNode *src, bool &src_withT, bool &src_withNT)
This is a specialization of the processor class dedicated to CFG processing.
Definition: CFGProcessor.h:35
String predictorToString()
bool dumpBCG
Definition: BPredProcessor.h:59
bool isBranch(BasicBlock *bb)
elm::genstruct::Vector< int > stat_addr
Definition: BPredProcessor.h:63
void CS__NoConflict_2bCounter(WorkSpace *fw, BasicBlock *bb)
bool dumpBHG
Definition: BPredProcessor.h:59
void CS__BiModal(WorkSpace *fw, CFG *cfg, BSets &bs, elm::genstruct::Vector< BCG * > &graphs)
unsigned int BHG_history_size
Definition: BPredProcessor.h:61
bool isLinked(BHGEdge *dir, BHGNode *dest, dfa::BitSet &h, elm::genstruct::HashTable< BHGNode *, BHGNode * > &visited_nodes)
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
void computePredecessors(CFG *cfg, BasicBlock *bb, elm::genstruct::Vector< int > *bit_sets, elm::genstruct::Vector< int > &in_outs, BSets &bs, int addr, int visited[])
dfa::BitSet lshift_BitSet(dfa::BitSet bs, int dec, bool val_in=false)
Operates a left-shift to the BitSet, filling the new free bit(s) with the given state (true or false)...
Definition: BPredProcessor.cpp:248
This a list of properties.
Definition: PropList.h:63
void simplifyCFG(CFG *cfg, BSets &bs, int addr, elm::genstruct::Vector< BCG * > &graphs)
void CS__Global1b_mitra(WorkSpace *fw, CFG *cfg, BBHG *bhg, elm::genstruct::HashTable< String, ilp::Var * > &ht_vars)
virtual void processCFG(WorkSpace *ws, CFG *cfg)
That's the overloaded method that creates the new constraint system defined by the given method...
Definition: BPredProcessor.cpp:271
void processCFG__NoConflict_2bCounter(WorkSpace *ws, CFG *cfg)
BPredProcessor(p::declare &r=reg)
Build a new branch prediction processor.
Definition: BPredProcessor.cpp:192
void getBranches(BasicBlock *bb, dfa::BitSet bs, elm::genstruct::Vector< BHGNode * > &suivants, CFG *cfg, BasicBlock *entryBr)
bool withMitra
Definition: BPredProcessor.h:62
String genStats(WorkSpace *ws, CFG *cfg)
int getBit(int v, int n)
Definition: BPredProcessor.h:76
void generateBHG(CFG *cfg, BHG &bhg)
static p::declare reg
Definition: BPredProcessor.h:49
void CS__Global2b(WorkSpace *fw, CFG *cfg, BHG *bhg, elm::genstruct::Vector< BCG * > &graphs, elm::genstruct::HashTable< String, ilp::Var * > &ht_vars)