Commit d65037e1 authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

fixing compilation errors in ExistHitPrev analysis

parent c79e9ce5
......@@ -3,16 +3,23 @@
#include <otawa/icache/features.h>
#include <otawa/icat3/features.h>
#include <lrusecurity/features.h>
#include <otawa/util/Bag.h>
namespace lrusecurity
{
class ACSSecurity
{
public:
ACSSecurity(){
_acs = *new otawa::icat3::ACS();
};
inline ACSSecurity(otawa::icat3::ACS acs) {
this->_acs = acs;
this->_prev = otawa::Bag<otawa::icache::Access>();
}
void copy(ACSSecurity b){
_acs.copy(b._acs);
_prev = otawa::Bag<otawa::icache::Access>(b._prev);
};
otawa::icat3::ACS _acs;
otawa::Bag<otawa::icache::Access> _prev;
};
......
......@@ -7,13 +7,13 @@
#include <otawa/proc/AbstractFeature.h>
#include <otawa/icat3/features.h>
#include "ACSSecurity.h"
#include <lrusecurity/ACSSecurity.h>
namespace lrusecurity {
// Exist-Hit with previous access
extern otawa::p::feature EXIST_HIT_PREV_ANALYSIS_FEATURE;
extern otawa::p::id<otawa::icat3::Container<lrusecurity::ACSSecurity> > EXIST_HIT_PREV_INIT;
extern otawa::p::id<otawa::icat3::Container<lrusecurity::ACSSecurity> > EXIST_HIT_PREV_IN;
extern otawa::p::id<otawa::icat3::Container<ACSSecurity> > EXIST_HIT_PREV_INIT;
extern otawa::p::id<otawa::icat3::Container<ACSSecurity> > EXIST_HIT_PREV_IN;
enum class SecurityCategory{
SAFE,
......
......@@ -16,7 +16,7 @@ namespace lrusecurity
class ExistHitPrevAdapter
{
public:
using domain_t = ExistHitPrevDomain;
using domain_t = ExistHitPrevDomain;
using t = typename domain_t::t;
using graph_t = otawa::CompositeCFG;
using store_t = otawa::ai::ArrayStore<domain_t, graph_t>;
......
......@@ -24,7 +24,7 @@ protected:
private:
void processSet(int i, otawa::WorkSpace* ws);
const otawa::icat3::Container<otawa::icat3::ACS>* _initExistHit;
const otawa::icat3::Container<ACSSecurity>* _initExistHitPrev;
const otawa::icat3::LBlockCollection* _coll;
const otawa::CFGCollection* _cfgs;
};
......
......@@ -10,17 +10,17 @@
namespace lrusecurity
{
class ExistHitDomain {
class ExistHitPrevDomain {
public:
using t = ACSSecurity;
using t = ACSSecurity;
ExistHitDomain(const otawa::icat3::LBlockCollection& coll, int set, const t* init);
ExistHitPrevDomain(const otawa::icat3::LBlockCollection& coll, int set, const t* init);
inline const t& bot(void) const { return _bot; }
inline const t& top(void) const { return _top; }
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, ExistHitDomain> print(const t& a) const { return elm::io::p(a, *this); }
inline bool contains(const t& a, int i) { return(a[i] != otawa::icat3::BOT_AGE); }
inline void print(const t& a, otawa::io::Output& out) const { a._acs.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._acs[i] != otawa::icat3::BOT_AGE); }
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);
......
......@@ -30,8 +30,10 @@ bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const
return true;
}
void ExistHitPrevDomain::join(t& d, const t& s)
void ExistHitPrevDomain::join(t& dcss, const t& scss)
{
icat3::ACS d = dcss._acs;
icat3::ACS s = scss._acs;
for(int i = 0; i < _n; i++) {
// d[i] = min(d[i], s[i])
if(d[i] == icat3::BOT_AGE)
......@@ -42,10 +44,10 @@ void ExistHitPrevDomain::join(t& d, const t& s)
}
//join of the Prev is a union
d._prev = d._prev << s._prev;
dcss._prev = ;
}
void ExistHitPrevDomain::fetch(t& acss, const icat3::Access ac, lrupreanalysis::ACSManager& mustManager)
void ExistHitPrevDomain::fetch(t& acss, const icache::Access ac, lrupreanalysis::ACSManager& mustManager)
{
icat3::LBlock *lb = icat3::LBLOCK(ac);
int b = lb->index();
......
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