Commit 25ffb5fc authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

Was tested, can point out DU nodes as unsafe but cannot display the addresses.

parent 296cff6c
......@@ -13,8 +13,8 @@ class ACSSecurity
_acs = *new otawa::icat3::ACS();
};
inline ACSSecurity(otawa::icat3::ACS acs) {
this->_acs = acs;
this->_prev = otawa::Bag<otawa::icache::Access>();
_acs = acs;
_prev = otawa::Bag<otawa::icache::Access>();
}
void copy(ACSSecurity b){
_acs.copy(b._acs);
......
......@@ -95,8 +95,8 @@ p::declare ExistHitPrevAnalysis::reg = p::init("lrusecurity::ExistHitPrevAnalysi
p::feature EXIST_HIT_PREV_ANALYSIS_FEATURE("lrusecurity::EXIST_HIT_PREV_ANALYSIS_FEATURE", p::make<ExistHitPrevAnalysis>());
p::id<icat3::Container<ACSSecurity> > EXIST_HIT_PREV_IN("lrusecurity::EXIST_HIT_PREV_IN");
p::id<icat3::Container<ACSSecurity> > EXIST_HIT_PREV_IN("lrusecurity::EXIST_HIT_PREV_IN");
p::id<icat3::Container<ACSSecurity> > EXIST_HIT_PREV_INIT("lrusecurity::EXIST_HIT_PREV_INIT");
p::id<icat3::Container<ACSSecurity> > EXIST_HIT_PREV_INIT("lrusecurity::EXIST_HIT_PREV_INIT");
}; // namespace lrusecurity
......@@ -44,7 +44,15 @@ void ExistHitPrevDomain::join(t& dcss, const t& scss)
}
//join of the Prev is a union
dcss._prev = scss._prev;
int fullsize = dcss._prev.size()+scss._prev.size();
Bag<icache::Access> newbag = *new Bag<icache::Access>(fullsize);
for (int i = 0 ; i < fullsize; ++i){
if (i < dcss._prev.size())
newbag[i] = dcss._prev[i];
else
newbag[i] = scss._prev[i - dcss._prev.size()];
}
dcss._prev = newbag;
}
void ExistHitPrevDomain::fetch(t& acss, const icache::Access ac, lrupreanalysis::ACSManager& mustManager)
......@@ -54,12 +62,10 @@ void ExistHitPrevDomain::fetch(t& acss, const icache::Access ac, lrupreanalysis:
icat3::ACS a = acss._acs;
if(a[0] == icat3::BOT_AGE)
return;
for(int i = 0; i < _n; i++) {
ASSERT(a[i] != icat3::BOT_AGE);
if(i == b)
continue;
if(a[i] < mustManager.mustAge(lb) && a[i] < _A)
a[i]++;
}
......@@ -67,9 +73,8 @@ void ExistHitPrevDomain::fetch(t& acss, const icache::Access ac, lrupreanalysis:
//Updating prev
for(int i = 0; i < _n; i++) {
if (a[i] == icat3::BOT_AGE)
if (a[i] == _A)
acss._prev = *new Bag<icache::Access>();
if (i == b)
acss._prev = *new Bag<icache::Access>(1, &ac);
}
......
......@@ -103,18 +103,18 @@ protected:
case icache::PREFETCH: _out << "PREFETCH\t"; break;
}
SecurityCategory cat = SECURITY_CATEGORY(access);
if(cat == SecurityCategory::SAFE)
_out << "SAFE\t\t";
else {
_out << "UNSAFE\t\t";
if (EXIST_HIT_PREV_IN(access)) {
// Bag<icache::Access> prev = EXIST_HIT_PREV_IN(access)._prev;
// for (int i = 0; i < prev.size(); ++i)
// _out << &prev[i]->address();
_out << "some address";
int set = icat3::LBLOCKS(ws)->cache()->set(access->address());
if(cat == SecurityCategory::UNSAFE){
_out << "UNSAFE ";
if (bb->hasProp(EXIST_HIT_PREV_IN)) {
Bag<icache::Access> prev = (*EXIST_HIT_PREV_IN(bb))[set]._prev;
for (int i = 0; i < prev.size(); ++i)
_out <<"blabla";
}
}
else
_out << "\t\t";
_out << "BB " << bb->index() << "\t\t";
printLine(ws, bb->address(), bb->topAddress().offset());
_out << io::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment