Skip to content
Snippets Groups Projects
Commit 6877d15f authored by hcasse's avatar hcasse
Browse files

Merge branch 'master' of

git+ssh://git.renater.fr:2222/scmrepos/git/otawa/otawa

# Conflicts:
#	include/otawa/etime/AbstractTimeBuilder.h
#	src/etime/StandardILPGenerator.cpp
parents 50abfd5a 8dd06ace
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,8 @@ XCFGVisitor<D>::XCFGVisitor(const CFGCollection& _cfgs, D& domain)
// Record nodes and CFG next nodes
int bbi = 0, cfgi = 0;
for(CFGCollection::Iter cfg(cfgs); cfg; cfg++, cfgi++)
for(CFG::BlockIter bb = cfg->blocks(); bb; bb++, bbi++) {
for(CFGCollection::Iter cfg(cfgs); cfg(); cfg++, cfgi++)
for(CFG::BlockIter bb = cfg->blocks(); bb(); bb++, bbi++) {
nodes[bbi].bb = bb;
nodes[bbi].cfg = cfgi;
if(bb->isSynth()) {
......@@ -94,7 +94,7 @@ template <class D>
XCFGVisitor<D>::~XCFGVisitor(void) {
// Release INDEX on CFGs
for(CFGCollection::Iter cfg(cfgs); cfg; cfg++)
for(CFGCollection::Iter cfg(cfgs); cfg(); cfg++)
cfg->removeProp(&INDEX);
// Free memory
......@@ -115,7 +115,7 @@ void XCFGVisitor<D>::visitPreds(XIterativeDFA< XCFGVisitor<D> >& engine, int nod
else if(info.from != -1)
engine.nextPred(info.from);
else
for(BasicBlock::EdgeIter edge = info.bb->ins(); edge; edge++)
for(BasicBlock::EdgeIter edge = info.bb->ins(); edge(); edge++)
engine.nextPred(offs[info.cfg] + edge->source()->index());
}
......
......@@ -273,7 +273,7 @@ inline int WideningFixPoint<Listener>::collect2(Block* bb, const GC *gc) const {
// mark all the states on edge going out from bb
int i = 0;
for(Block::EdgeIter out = bb->ins(); out; out++) {
for(Block::EdgeIter out = bb->ins(); out(); out++) {
typename Listener::Problem::Domain* s = *STATE(*out);
if (s != 0) {
s->collect(gc);
......
......@@ -50,7 +50,7 @@ public:
inline Event *operator->() const { return _e; }
inline Inst *inst() const { return _e->inst(); }
inline bool isStatic() const { return _e->occurrence() == etime::ALWAYS || _e->occurrence() == etime::NEVER; }
inline bool isDynamic() const { return !isDynamic(); }
inline bool isDynamic() const { return !isStatic(); }
private:
Event *_e;
......
......@@ -65,7 +65,7 @@ public:
: _prob(prob), _set(set), _id(id) {
const CFGCollection *col = INVOLVED_CFGS(ws);
for(int i = 0; i < col->count(); i++)
for(CFG::BlockIter bb = col->get(i)->blocks(); bb; bb++)
for(CFG::BlockIter bb = col->get(i)->blocks(); bb(); bb++)
prob.init(_id(bb)[_set], prob.bottom());
}
......
......@@ -300,12 +300,16 @@ void StandardEventBuilder::setup(WorkSpace *ws) {
// look if instruction cacheL1 is available
has_il1 = ws->isProvided(ICACHE_ONLY_CONSTRAINT2_FEATURE);
if(has_il1 && logFor(LOG_CFG))
log << "\tevents for instruction cache L1\n";
has_dl1 = ws->isProvided(dcache::CONSTRAINTS_FEATURE);
if(has_dl1) {
const hard::CacheConfiguration *caches = hard::CACHE_CONFIGURATION_FEATURE.get(ws);
wb = caches->dataCache()->writePolicy() == hard::Cache::WRITE_BACK;
if(wb && !ws->isProvided(dcache::PURGE_FEATURE))
throw ProcessorException(*this, "write-back L1 data cache but no purge analysis provided (dcache::PURGE_FEATURE)!");
if(logFor(LOG_CFG))
log << "\tevents for data cache L1\n";
}
// look if branch prediction is available
......
......@@ -222,10 +222,16 @@ void ILPGenerator::sortEvents(Vector<EventCase>& events) {
class EventCaseComparator {
public:
static inline int compare(const EventCase& c1, const EventCase& c2) {
if(c1.part() != c2.part())
if(c1.part() != c2.part()){
return c1.part() - c2.part();
else
}
else{
if (c1.event()->inst()->address() != c2.event()->inst()->address())
return c1.event()->inst()->address().compare(c2.event()->inst()->address());
else
//return reinterpret_cast<intptr_t>(c2.event()->unit()) - reinterpret_cast<intptr_t>(c1.event()->unit());
return -Comparator<const hard::PipelineUnit *>::compare(c2.event()->unit(),c1.event()->unit());
}
}
};
elm::quicksort(events, EventCaseComparator());
......@@ -527,9 +533,10 @@ void StandardILPGenerator::process(Edge *e) {
seq->addLast(new ParExeInst(i, v, otawa::BLOCK, index++));
process(e, seq, events, dyn_cnt);
delete seq;
return;
}
// try with remove prolog
// try to remove prolog
events.clear();
collectBlock(events, v);
sortEvents(events);
......@@ -541,9 +548,12 @@ void StandardILPGenerator::process(Edge *e) {
seq->addLast(new ParExeInst(i, v, otawa::BLOCK, index++));
process(e, seq, events, dyn_cnt);
delete seq;
return;
}
// starting split of the block
if(logFor(LOG_BB))
log << "\t\t\ttoo many dynamic events (" << dyn_cnt << "): split required\n";
int ei = 0;
auto ii = v->insts();
while(ei < events.length()) {
......@@ -554,30 +564,37 @@ void StandardILPGenerator::process(Edge *e) {
Inst *faulty = nullptr;
while(ei < events.length()) {
split_events.add(events[ei]);
ei++;
if(events[ei].isDynamic())
dyn_cnt++;
if(dyn_cnt > _eth) {
faulty = events[ei].inst();
break;
}
ei++;
}
// roll-back events of the faulty instruction
if(faulty != nullptr)
while(events[ei - 1].inst() == faulty) {
ei--;
if(events[ei - 1].isDynamic())
if(faulty != nullptr){
while(events[ei].inst() == faulty) {
if(events[ei].isDynamic())
dyn_cnt++;
ei--;
split_events.removeLast();
}
ei++;
}
// compute the time
ParExeSequence *seq = new ParExeSequence();
int index = 0;
while(ii() && (ei >= events.length() || *ii != events[ei].event()->inst()))
while(ii() && (ei >= events.length() || *ii != events[ei].event()->inst())) {
seq->addLast(new ParExeInst(*ii, v, otawa::BLOCK, index++));
ii++;
}
if(logFor(LOG_BB))
log << "\t\t\tcomputing for " << seq->first()->inst()->address()
<< " to " << seq->last()->inst()->address() << io::endl;
process(e, seq, split_events, dyn_cnt);
delete seq;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment