Commit 78096317 authored by Mishigan's avatar Mishigan

fix non affichage de certain accès précedents

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