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

finilazing the chain of processors

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