Commit f6edcf6a authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

Changing the nature of ACSSecurity again to take into account the fact that an...

Changing the nature of ACSSecurity again to take into account the fact that an access might have multiple predecessors
parent dc25fecb
......@@ -5,17 +5,17 @@
#include <otawa/base.h>
namespace lrusecurity
{
class ACSSecurity : public elm::AllocArray<otawa::Address>
class ACSSecurity : public elm::AllocArray<otawa::Bag<otawa::Address>>
{
public:
ACSSecurity() = default;
ACSSecurity(int n) : elm::AllocArray<otawa::Address>(n){
ACSSecurity(int n) : elm::AllocArray<otawa::Bag<otawa::Address>>(n){
for (int i = 0; i < n; i++)
(*this)[i] = otawa::Address();
(*this)[i] = otawa::Bag<otawa::Address>();
}
ACSSecurity(int n, const otawa::Address& adr) : elm::AllocArray<otawa::Address>(n, adr){
inline ACSSecurity(int n, const otawa::Bag<otawa::Address>& bag) : elm::AllocArray<otawa::Bag<otawa::Address>>(n, bag){
for (int i = 0; i < n; i++)
(*this)[i] = adr;
(*this)[i] = bag;
}
void print(int set, const otawa::icat3::LBlockCollection& coll, elm::io::Output& out= elm::cout) const;
};
......
......@@ -21,7 +21,7 @@ public:
inline const t& init(void) const { return _init; }
inline void print(const t& a, otawa::io::Output& out) const { a.print(_set, _coll, out); }
inline elm::io::Printable<t, ExistHitPrevDomain> print(const t& a) const { return elm::io::p(a, *this); }
inline bool contains(const t& a, int i) { return(a[i] != otawa::Address()); }
inline bool contains(const t& a, int i) { return(a[i] !=otawa::Bag< otawa::Address>()); }
inline void copy(t& d, const t& s) { d.copy(s); }
bool equals(const t& a, const t& b) const;
void join(t& d, const t& s);
......
......@@ -11,7 +11,7 @@ ExistHitPrevDomain::ExistHitPrevDomain(
const t *init) :
_n(coll[set].count()),
_bot(_n),
_top(_n, Address(0)),
_top(_n, Bag<Address>()),//TO CHANGE
_set(set),
_coll(coll),
_A(coll.A()),
......@@ -29,20 +29,21 @@ 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++)
if(dcss[i].offset() <= scss[i].offset())
dcss[i] = scss[i];
for (int i = 0; i < _n; i++){
}
}
void ExistHitPrevDomain::fetch(t& acss, const icache::Access& access, lrumc::ACSManager& ehManager)
{
icat3::LBlock *lb = icat3::LBLOCK(access);
int b = lb->index();
for (int i = 0; i < _n; i++)
if (i == b)
acss[i] = access.address();
acss[i] = Bag<Address>();//TO CHANGE
else if (ehManager.existHitAge(lb) == _A)
acss[i] = Address();
acss[i] = Bag<Address>();
}
void ExistHitPrevDomain::update(const icache::Access& access, t& a, lrumc::ACSManager& ehManager)
......
......@@ -107,7 +107,8 @@ protected:
if (bb->hasProp(EXIST_HIT_PREV_IN)) {
ACSSecurity prev = (*EXIST_HIT_PREV_IN(bb))[set];
int index = otawa::icat3::LBLOCK(access)->index();
_out << prev[index];
for (int i = 0; i < prev[index].size(); i++)
_out << prev[index][i];
}
......
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