Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 9610e24b authored by Valentin Touzeau's avatar Valentin Touzeau Committed by EXT Valentin Touzeau
Browse files

WIP

parent b0ce5e43
[elm-plugin]
name=exactlru
deps=otawa/icat3;otawalru
deps=otawa/icat3;otawalru;lrumc
description=Perform an exact May/Must analysis of L1 I cache
author=Valentin Touzeau
#ifndef ABSTRACT_VALUE_H
#define ABSTRACT_VALUE_H
namespace exactlru
{
template <typename AbstractValuePolicy>
class AbstractValue : public AbstractValuePolicy
{
public:
friend AbstractValuePolicy;
using Block = otawa::icat3::LBlock;
AbstractValue();
AbstractValue(const otawa::icat3::LBlock* focus, const otawa::icat3::LBlockCollection& coll, int set);
};
} // namespace exactlru
#endif // ABSTRACT_VALUE_H
......@@ -30,6 +30,8 @@
#include <otawa/icat3/features.h>
#include <exactlru/features.h>
#include <exactlru/MayAnalysis/MayManager.h>
#include <otawalru/features.h>
#include <lrumc/features.h>
#include "../ZDD/MayAbstractValuePolicy.h"
#include "../ZDD/ZDDMayDomainPolicy.h"
#include "../GeneratorsSet/GSMayAbstractValuePolicy.h"
......@@ -142,11 +144,30 @@ protected:
void processWorkSpace(WorkSpace*) override
{
for(int i = 0; i < m_coll->size(); ++i) {
const icat3::LBlockSet& s = (*m_coll)[i];
for(int j = 0; j < s.size(); ++j)
processLBlock(s[j]);
std::set<const icat3::LBlock*> toRefine;
for(CFGCollection::BlockIter b(m_cfgs); b; b++) {
if(!b->isBasic())
continue;
BasicBlock* bb = b->toBasic();
for(Block::EdgeIter edgeIter(bb->ins()); edgeIter; ++edgeIter) {
Edge* e = *edgeIter;
Bag<icache::Access>& bag = icache::ACCESSES(e).ref();
processBag(toRefine, bag);
}
Bag<icache::Access>& bag = icache::ACCESSES(bb).ref();
processBag(toRefine, bag);
}
for(const icat3::LBlock* lb : toRefine)
processLBlock(lb);
// for(int i = 0; i < m_coll->size(); ++i) {
// const icat3::LBlockSet& s = (*m_coll)[i];
// for(int j = 0; j < s.size(); ++j)
// processLBlock(s[j]);
// }
}
void destroy(WorkSpace*) override
......@@ -156,6 +177,23 @@ protected:
}
private:
void processBag(std::set<const icat3::LBlock*>& set, Bag<icache::Access>& bag)
{
for(int i = 0; i < bag.size(); ++i) {
lrumc::RefinementCategory refCat = lrumc::REFINEMENT_CATEGORY(bag[i]);
MissCategory e = MissCategory::NC;
if(refCat == lrumc::RefinementCategory::CLASSIFIED &&
icat3::CATEGORY(bag[i]) == icat3::AM)
e = MissCategory::AM;
MISS_CATEGORY(bag[i]) = e;
if(refCat == lrumc::RefinementCategory::AM_CANDIDATE ||
refCat == lrumc::RefinementCategory::AH_AM_CANDIDATE)
set.insert(icat3::LBLOCK(&bag[i]));
}
}
void processLBlock(const icat3::LBlock* lb)
{
......@@ -197,7 +235,8 @@ private:
icat3::LBlock* lb = icat3::LBLOCK(accs[i]);
if(lb == focus) {
if(logFor(LOG_BLOCK)) {
log << "\t\tFunction " << b->cfg()->label() << ", " << const_cast<Block*>(b) << ": " << io::endl;
log << "\t\tFunction " << b->cfg()->label() << ", ";
log << const_cast<Block*>(b) << ": " << io::endl;
log << "\t\t\tAccess (" << accs[i] << ") is ";
}
if(man.alwaysMiss()) {
......@@ -223,6 +262,7 @@ private:
p::declare MayAnalysis::reg = p::init("exactlru::MayAnalysis", Version(1, 0, 0))
.require(icat3::LBLOCKS_FEATURE)
.require(lrumc::REFINEMENT_CATEGORY_FEATURE)
.require(COLLECTED_CFG_FEATURE)
.provide(EXACT_MAY_ANALYSIS_FEATURE)
.make<MayAnalysis>();
......
......@@ -26,6 +26,7 @@
#include <otawa/cfg/features.h>
#include <otawa/icache/features.h>
#include <otawa/icat3/features.h>
#include <lrumc/features.h>
#include <exactlru/features.h>
#include <exactlru/MustAnalysis/MustManager.h>
#include "../ZDD/MustAbstractValuePolicy.h"
......@@ -140,11 +141,30 @@ protected:
void processWorkSpace(WorkSpace*) override
{
for(int i = 0; i < m_coll->size(); ++i) {
const icat3::LBlockSet& s = (*m_coll)[i];
for(int j = 0; j < s.size(); ++j)
processLBlock(s[j]);
std::set<const icat3::LBlock*> toRefine;
for(CFGCollection::BlockIter b(m_cfgs); b; b++) {
if(!b->isBasic())
continue;
BasicBlock* bb = b->toBasic();
for(Block::EdgeIter edgeIter(bb->ins()); edgeIter; ++edgeIter) {
Edge* e = *edgeIter;
Bag<icache::Access>& bag = icache::ACCESSES(e).ref();
processBag(toRefine, bag);
}
Bag<icache::Access>& bag = icache::ACCESSES(bb).ref();
processBag(toRefine, bag);
}
for(const icat3::LBlock* lb : toRefine)
processLBlock(lb);
// for(int i = 0; i < m_coll->size(); ++i) {
// const icat3::LBlockSet& s = (*m_coll)[i];
// for(int j = 0; j < s.size(); ++j)
// processLBlock(s[j]);
// }
}
void destroy(WorkSpace*) override
......@@ -154,6 +174,23 @@ protected:
}
private:
void processBag(std::set<const icat3::LBlock*>& set, Bag<icache::Access>& bag)
{
for(int i = 0; i < bag.size(); ++i) {
lrumc::RefinementCategory refCat = lrumc::REFINEMENT_CATEGORY(bag[i]);
HitCategory e = HitCategory::NC;
if(refCat == lrumc::RefinementCategory::CLASSIFIED &&
icat3::CATEGORY(bag[i]) == icat3::AH)
e = HitCategory::AH;
HIT_CATEGORY(bag[i]) = e;
if(refCat == lrumc::RefinementCategory::AH_CANDIDATE ||
refCat == lrumc::RefinementCategory::AH_AM_CANDIDATE)
set.insert(icat3::LBLOCK(&bag[i]));
}
}
void processLBlock(const icat3::LBlock* lb)
{
......@@ -222,6 +259,7 @@ private:
p::declare MustAnalysis::reg = p::init("exactlru::MustAnalysis", Version(1, 0, 0))
.require(icat3::LBLOCKS_FEATURE)
.require(lrumc::REFINEMENT_CATEGORY_FEATURE)
.require(COLLECTED_CFG_FEATURE)
.provide(EXACT_MUST_ANALYSIS_FEATURE)
.make<MustAnalysis>();
......
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