Commit d718f718 authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona
Browse files

debug for new definition of ACSSecurity done.

parent f6edcf6a
...@@ -9,13 +9,14 @@ namespace lrusecurity ...@@ -9,13 +9,14 @@ namespace lrusecurity
{ {
public: public:
ACSSecurity() = default; ACSSecurity() = default;
ACSSecurity(int n) : elm::AllocArray<otawa::Bag<otawa::Address>>(n){ ACSSecurity(int n) : elm::AllocArray<otawa::Bag<otawa::Address>>(n){
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
(*this)[i] = otawa::Bag<otawa::Address>(); (*this)[i] = otawa::Bag<otawa::Address>();
} }
inline ACSSecurity(int n, const otawa::Bag<otawa::Address>& bag) : elm::AllocArray<otawa::Bag<otawa::Address>>(n, bag){ ACSSecurity(int n, otawa::Address addr) : elm::AllocArray<otawa::Bag<otawa::Address>>(n) {
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
(*this)[i] = bag; (*this)[i] = otawa::Bag<otawa::Address>(1, &addr);
} }
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const; void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
}; };
......
...@@ -75,7 +75,6 @@ void ExistHitPrevAnalysis::processSet(int set, WorkSpace* ws) ...@@ -75,7 +75,6 @@ void ExistHitPrevAnalysis::processSet(int set, WorkSpace* ws)
ExistHitPrevAdapter ada(set, _initExistHitPrev ? &_initExistHitPrev->get(set) : nullptr, *_coll, *_cfgs, ws); ExistHitPrevAdapter ada(set, _initExistHitPrev ? &_initExistHitPrev->get(set) : nullptr, *_coll, *_cfgs, ws);
ai::SimpleAI<ExistHitPrevAdapter> ana(ada); ai::SimpleAI<ExistHitPrevAdapter> ana(ada);
ana.run(); ana.run();
// store the results // store the results
for(CFGCollection::BlockIter b(_cfgs); b; b++) for(CFGCollection::BlockIter b(_cfgs); b; b++)
if(b->isBasic()) { if(b->isBasic()) {
......
...@@ -11,7 +11,7 @@ ExistHitPrevDomain::ExistHitPrevDomain( ...@@ -11,7 +11,7 @@ ExistHitPrevDomain::ExistHitPrevDomain(
const t *init) : const t *init) :
_n(coll[set].count()), _n(coll[set].count()),
_bot(_n), _bot(_n),
_top(_n, Bag<Address>()),//TO CHANGE _top(_n, Address(0x0)),//TO CHANGE
_set(set), _set(set),
_coll(coll), _coll(coll),
_A(coll.A()), _A(coll.A()),
...@@ -30,7 +30,15 @@ bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const ...@@ -30,7 +30,15 @@ bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const
void ExistHitPrevDomain::join(t& dcss, const t& scss) void ExistHitPrevDomain::join(t& dcss, const t& scss)
{ {
for (int i = 0; i < _n; i++){ for (int i = 0; i < _n; i++){
int newsize = dcss[i].size()+scss[i].size();
Bag<Address> newbag = Bag<Address>(newsize);
for (int j = 0; j < newsize; j++) {
if (j < dcss[i].size())
newbag[j]=dcss[i][j];
else
newbag[j]=scss[i][j - dcss[i].size()];
}
dcss[i] = Bag<Address>(newbag);
} }
...@@ -39,11 +47,13 @@ void ExistHitPrevDomain::join(t& dcss, const t& scss) ...@@ -39,11 +47,13 @@ void ExistHitPrevDomain::join(t& dcss, const t& scss)
{ {
icat3::LBlock *lb = icat3::LBLOCK(access); icat3::LBlock *lb = icat3::LBLOCK(access);
int b = lb->index(); int b = lb->index();
for (int i = 0; i < _n; i++) for (int i = 0; i < _n; i++){
if (i == b) if (i == b){
acss[i] = Bag<Address>();//TO CHANGE Address smol[] = {access.address()};
acss[i] = Bag<Address>(1,smol);}
else if (ehManager.existHitAge(lb) == _A) else if (ehManager.existHitAge(lb) == _A)
acss[i] = Bag<Address>(); acss[i] = Bag<Address>();
}
} }
void ExistHitPrevDomain::update(const icache::Access& access, t& a, lrumc::ACSManager& ehManager) void ExistHitPrevDomain::update(const icache::Access& access, t& a, lrumc::ACSManager& ehManager)
......
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