Commit 296cff6c authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

finilazing the chain of processors

parent 13e52bcd
......@@ -9,6 +9,7 @@ set(SOURCES "src/lrusecurity.cpp"
"src/Prev/lrusecurity_ExistHitPrevAnalysis.cpp"
"src/Prev/lrusecurity_ExistHitPrevDomain.cpp"
"src/Prev/lrusecurity_ExistHitPrevAdapter.cpp"
"src/lrusecurity_Displayer.cpp"
)
# script
......
#include <lrupreanalysis/features.h>
#include <lrusecurity/features.h>
#include <elm/sys/Path.h>
#include <elm/sys/System.h>
......@@ -10,15 +10,15 @@
using namespace otawa;
namespace lrupreanalysis
namespace lrusecurity
{
class ClassificationDisplayer : public BBProcessor
class SecurityDisplayer : public BBProcessor
{
public:
static otawa::p::declare reg;
ClassificationDisplayer() :
SecurityDisplayer() :
otawa::BBProcessor(reg),
_path(""),
_toFile(false),
......@@ -30,10 +30,10 @@ public:
virtual void configure(const PropList& props) override
{
otawa::BBProcessor::configure(props);
if(props.hasProp(CLASSIFICATION_PATH))
_path = CLASSIFICATION_PATH(props);
if(props.hasProp(CLASSIFICATION_TO_FILE))
_toFile = CLASSIFICATION_TO_FILE(props);
if(props.hasProp(lrupreanalysis::CLASSIFICATION_PATH))
_path = lrupreanalysis::CLASSIFICATION_PATH(props);
if(props.hasProp(lrupreanalysis::CLASSIFICATION_TO_FILE))
_toFile = lrupreanalysis::CLASSIFICATION_TO_FILE(props);
}
protected:
......@@ -102,16 +102,19 @@ protected:
case icache::FETCH: _out << "FETCH\t"; break;
case icache::PREFETCH: _out << "PREFETCH\t"; break;
}
ExactCategory cat = EXACT_CATEGORY(access);
if(cat == ExactCategory::AH)
_out << "AH\t\t";
else if(cat == ExactCategory::AM)
_out << "AM\t\t";
else if(cat == ExactCategory::DU)
_out << "DU\t\t";
else
_out << "NC\t\t";
SecurityCategory cat = SECURITY_CATEGORY(access);
if(cat == SecurityCategory::SAFE)
_out << "SAFE\t\t";
else {
_out << "UNSAFE\t\t";
if (EXIST_HIT_PREV_IN(access)) {
// Bag<icache::Access> prev = EXIST_HIT_PREV_IN(access)._prev;
// for (int i = 0; i < prev.size(); ++i)
// _out << &prev[i]->address();
_out << "some address";
}
}
_out << "BB " << bb->index() << "\t\t";
printLine(ws, bb->address(), bb->topAddress().offset());
_out << io::endl;
......@@ -158,13 +161,9 @@ protected:
bool _mcAnalysis;
};
p::declare ClassificationDisplayer::reg = p::init("lrupreanalysis::ClassificationDisplayer", Version(1, 0, 0))
.require(LRU_CLASSIFICATION_FEATURE)
.make<ClassificationDisplayer>();
p::id<bool> CLASSIFICATION_TO_FILE("lruperanalysis::CLASSIFICATION_TO_FILE", false);
p::id<elm::sys::Path> CLASSIFICATION_PATH("lrupreanalysis::CLASSIFICATION_PATH", "/tmp/");
p::declare SecurityDisplayer::reg = p::init("lrusecurity::SecurityDisplayer", Version(1, 0, 0))
.require(SECURITY_CATEGORY_FEATURE)
.make<SecurityDisplayer>();
} // namespace lrupreanalysis
} // 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