Commit d718f718 authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

debug for new definition of ACSSecurity done.

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