Commit 78096317 authored by Mishigan's avatar Mishigan

fix non affichage de certain accès précedents

parent c71e01f1
......@@ -31,7 +31,7 @@ public:
void update(otawa::Block *v, t& d);
private:
lrumc::ACSManager _mayManager;
lrupreanalysis::eh_em::ACSManager _mayManager;
domain_t _domain;
graph_t _graph;
store_t _store;
......
......@@ -25,8 +25,8 @@ public:
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);
void fetch(t& a, const otawa::icache::Access& ac, lrumc::ACSManager& mayManager);
void update(const otawa::icache::Access& access, t& a, lrumc::ACSManager& mayManager);
void fetch(t& a, const otawa::icache::Access& ac, lrupreanalysis::eh_em::ACSManager& mayManager);
void update(const otawa::icache::Access& access, t& a, lrupreanalysis::eh_em::ACSManager& mayManager);
private:
int _n;
......
......@@ -8,10 +8,10 @@ namespace lrusecurity
ExistHitPrevODomain::ExistHitPrevODomain(
const icat3::LBlockCollection& coll,
int set,
const t *init) :
const t *init):
_n(coll[set].count()),
_bot(_n),
_top(_n, Address(0x0)),//TO CHANGE
_top(_n, Address(0x0)), //TO CHANGE
_set(set),
_coll(coll),
_A(coll.A()),
......@@ -27,7 +27,8 @@ bool ExistHitPrevODomain::equals(const t& acss, const t& bcss) const
return false;
return true;
}
void ExistHitPrevODomain::join(t& dcss, const t& scss)
void ExistHitPrevODomain::join(t& dcss, const t& scss)
{
for (int i = 0; i < _n; i++){
int newsize = dcss[i].size()+scss[i].size();
......@@ -40,23 +41,22 @@ bool ExistHitPrevODomain::equals(const t& acss, const t& bcss) const
}
dcss[i] = Bag<Address>(newbag);
}
}
void ExistHitPrevODomain::fetch(t& acss, const icache::Access& access, lrumc::ACSManager& mayManager)
void ExistHitPrevODomain::fetch(t& acss, const icache::Access& access, lrupreanalysis::eh_em::ACSManager& mayManager)
{
icat3::LBlock *lb = icat3::LBLOCK(access);
int b = lb->index();
for (int i = 0; i < _n; i++){
if (i == b){
Address smol[] = {access.address()};
acss[i] = Bag<Address>(1,smol);}
else if (mayManager.mayAge(lb) == _A)
acss[i] = Bag<Address>(1, smol);
} else if (mayManager.mayAge(_coll[_set][i]) == _A)
acss[i] = Bag<Address>();
}
}
void ExistHitPrevODomain::update(const icache::Access& access, t& a, lrumc::ACSManager& mayManager)
void ExistHitPrevODomain::update(const icache::Access& access, t& a, lrupreanalysis::eh_em::ACSManager& mayManager)
{
switch(access.kind()) {
......
#include "ExistHitPrevUAdapter.h"
#include <lrupreanalysis/ExistHitDomain.h>
......@@ -7,6 +6,7 @@ using namespace otawa;
namespace lrusecurity
{
ExistHitPrevUAdapter::ExistHitPrevUAdapter(
int set,
const t* init,
......@@ -29,7 +29,6 @@ void ExistHitPrevUAdapter::update(const Bag<icache::Access>& accs, t& d)
}
}
void ExistHitPrevUAdapter::update(Block *v, t& d)
{
_domain.copy(d, _domain.bot());
......@@ -44,6 +43,7 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
_domain.copy(s, _store.get(w));
_ehManager.start(w);
if(first) {
first = false;
_ehManager.ehDomain(_set).copy(d_eh, _ehManager.ehDomain(_set).bot());
......@@ -68,6 +68,7 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
lrupreanalysis::eh_em::ExistHitDomain::t* tmp = _ehManager.ehValue(_set);
ASSERT(tmp && "tmp null");
lrupreanalysis::eh_em::ExistHitDomain::t& s_eh = *tmp;
ASSERT(d_eh.count() == s_eh.count());
_domain.join(d, s, d_eh, s_eh);
_ehManager.ehDomain(_set).join(d_eh, s_eh);
}
......
#include "ExistHitPrevUAnalysis.h"
#include <chrono>
......@@ -12,6 +11,7 @@
#include "ExistHitPrevUAdapter.h"
#include "ExistHitPrevUDomain.h"
using namespace otawa;
namespace lrusecurity
......@@ -24,6 +24,7 @@ ExistHitPrevUAnalysis::ExistHitPrevUAnalysis(p::declare& r) :
_cfgs(nullptr)
{
}
void ExistHitPrevUAnalysis::configure(const PropList& props)
{
Processor::configure(props);
......@@ -61,13 +62,13 @@ void ExistHitPrevUAnalysis::setup(WorkSpace* ws)
if(logFor(LOG_FUN))
log << "\tExist Hit Prev Analysis running time: " << elapsed.count() << " s" << io::endl;
}
void ExistHitPrevUAnalysis::destroy(WorkSpace*)
{
for(CFGCollection::BlockIter b(_cfgs); b; b++)
EXIST_HIT_PREV_IN(b).remove();
}
void ExistHitPrevUAnalysis::processSet(int set, WorkSpace* ws)
{
// perform the analysis
......
......@@ -8,10 +8,10 @@ namespace lrusecurity
ExistHitPrevUDomain::ExistHitPrevUDomain(
const icat3::LBlockCollection& coll,
int set,
const t *init) :
const t *init):
_n(coll[set].count()),
_bot(_n),
_top(_n, Address(0x0)),//TO CHANGE
_top(_n, Address(0x0)), //TO CHANGE
_set(set),
_coll(coll),
_A(coll.A()),
......@@ -27,34 +27,35 @@ bool ExistHitPrevUDomain::equals(const t& acss, const t& bcss) const
return false;
return true;
}
void ExistHitPrevUDomain::join(t& dcss, const t& scss, icat3::ACS d_eh, icat3::ACS s_eh)
void ExistHitPrevUDomain::join(t& dcss, const t& scss, icat3::ACS d_eh, icat3::ACS s_eh)
{
for (int i = 0; i < _n; i++){
if (s_eh[i] < d_eh[i] || (d_eh[i] == -1 && s_eh[i] != -1)){
for (int i = 0; i < _n; i++) {
if (s_eh[i] < d_eh[i] || (d_eh[i] == -1 && s_eh[i] != -1)) {
dcss[i] = scss[i];
}
else if (s_eh[i] == d_eh[i]){
int fullsize = (dcss[i]).size()+(scss[i]).size();
Bag<Address> tmp = Bag<Address>(fullsize);
for (int j = 0; j < fullsize; j++){
} else if (s_eh[i] == d_eh[i]) {
int fullsize = (dcss[i]).size() + (scss[i]).size();
Bag <Address> tmp = Bag <Address> (fullsize);
for (int j = 0; j < fullsize; j++) {
if (j < (dcss[i]).size())
tmp[j] = dcss[i][j] ;
tmp[j] = dcss[i][j];
else
tmp[j] = scss[i][j-dcss[i].size()];
tmp[j] = scss[i][j - dcss[i].size()];
}
dcss[i] = tmp;
}
}
}
void ExistHitPrevUDomain::fetch(t& acss, const icache::Access& access, lrupreanalysis::eh_em::ACSManager& ehManager)
void ExistHitPrevUDomain::fetch(t& acss, const icache::Access& access, lrupreanalysis::eh_em:: ACSManager & ehManager)
{
icat3::LBlock *lb = icat3::LBLOCK(access);
int b = lb->index();
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>(1, smol);
} else if (ehManager.existHitAge(_coll[_set][i]) == _A)
acss[i] = Bag<Address>();
}
}
......
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