Commit db8ee8f1 authored by Maeva Ramarjiaona's avatar Maeva Ramarjiaona

correcting implementation for compilation

parent 499fa2b4
......@@ -5,7 +5,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
set(PLUGIN "lrusecurity") # plugin name
set(NAMESPACE "") # namespace
set(SOURCES "src/lrusecurity.cpp"
"src/lrusecurity_ProcessorExample.cpp"
"src/lrusecurity_SecurityCatBuilder.cpp"
"src/Prev/lrusecurity_ExistHitPrevAnalysis.cpp"
"src/Prev/lrusecurity_ExistHitPrevDomain.cpp"
"src/Prev/lrusecurity_ExistHitPrevAdapter.cpp"
)
# script
......
#ifndef LRUSECURITY_ACSSECURITY_H_
#define LRUSECURITY_ACSSECURITY_H_
#include <otawa/icache/features.h>
#include <otawa/icat3/features.h>
#include <lrusecurity/features.h>
namespace lrusecurity
{
class ACSSecurity
{
public:
inline ACSSecurity(otawa::icat3::ACS acs) {
this->_acs = acs;
this->_prev = otawa::Bag<otawa::icache::Access>();
}
otawa::icat3::ACS _acs;
otawa::Bag<otawa::icache::Access> _prev;
};
}
#endif //LRUSECURITY_ACSSECURITY_H
......@@ -20,7 +20,10 @@ enum class SecurityCategory{
UNSAFE
};
//Specifying which calls are making the program unsafe
extern otawa::p::feature SECURITY_CATEGORY_FEATURE;
extern otawa::p::id<SecurityCategory> SECURITY_CATEGORY;
} // namespace lrusecurity
#endif // LRUMC_FEATURES_H
[elm-plugin]
name=lrusecurity
deps=otawa/icat3;lruzdd
deps=otawa/icat3;lruzdd;lrumc;lrupreanalysis
description=Information Leakage Cache Analysis for LRU policy
author=Valentin Touzeau, Maeva Ramarijaona
......@@ -7,7 +7,8 @@
#include <lrusecurity/features.h>
namespace lrusecurity
public class ACSSecurity : class otawa::icat3::ACS
{
class ACSSecurity : public class otawa::icat3::ACS
{
public:
inline ACSSecurity(icat3::ACS acs) {
......@@ -18,5 +19,5 @@ public class ACSSecurity : class otawa::icat3::ACS
}
otawa::Bag<icache::Access> _prev;
}
}
#endif //LRUSECURITY_ACSSECURITY_H
......@@ -20,8 +20,10 @@ ExistHitPrevDomain::ExistHitPrevDomain(
{
}
bool ExistHitPrevDomain::equals(const t& a, const t& b) const
bool ExistHitPrevDomain::equals(const t& acss, const t& bcss) const
{
icat3::ACS a = acss._acs;
icat3::ACS b = bcss._acs;
for(int i = 0; i < _n; i++)
if(a[i] != b[i])
return false;
......@@ -43,11 +45,11 @@ void ExistHitPrevDomain::join(t& d, const t& s)
d._prev = d._prev << s._prev;
}
void ExistHitPrevDomain::fetch(t& a, const icat3::Access ac, lrupreanalysis::ACSManager& mustManager)
void ExistHitPrevDomain::fetch(t& acss, const icat3::Access ac, lrupreanalysis::ACSManager& mustManager)
{
icat3::LBlock *lb = icat3::LBLOCK(ac);
int b = lb->index();
icat3::ACS a = acss._acs;
if(a[0] == icat3::BOT_AGE)
return;
......@@ -64,10 +66,10 @@ void ExistHitPrevDomain::fetch(t& a, const icat3::Access ac, lrupreanalysis::ACS
//Updating prev
for(int i = 0; i < _n; i++) {
if (a[i] == icat3::BOT_AGE)
a._prev = otawa::Bag<icache::Access>::Bag();
acss._prev = otawa::Bag<icache::Access>::Bag();
if (i == b)
a._prev = otawa::Bag<icache::Access>::Bag(1, &ac);
acss._prev = otawa::Bag<icache::Access>::Bag(1, &ac);
}
}
......
......@@ -51,10 +51,10 @@ protected:
void processAccesses(Bag<icache::Access>& accs, Block *v) {
for(int i = 0; i < accs.count(); i++) {
SecurityCategory cat;
lrusecurity::SecurityCategory cat;
if (lrupreanalysis::ExactCategory(accs[i]) ==
lrupreanalysis::ExactCategory::DU) {
if (Loop::of(v) != Loop::top(v->cfg())) {
if (Loop::of(v) != Loop::top(v.cfg())) {
cat = SecurityCategory::UNSAFE;
}
else
......@@ -69,7 +69,7 @@ protected:
case SecurityCategory::SAFE:
log << "SAFE";
break;
case DUCategory::UNSAFE:
case SecurityCategory::UNSAFE:
log << "UNSAFE";
break;
}
......@@ -87,7 +87,7 @@ protected:
p::declare SecurityCatBuilder::reg = p::init("lrusecurity::SecurityCatBuilder", Version(1, 0, 0))
.extend<BBProcessor>()
.make<DUCatBuilder>()
.make<SecurityCatBuilder>()
.require(otawa::icat3::LBLOCKS_FEATURE)
.require(otawa::hard::MEMORY_FEATURE)
.require(lrupreanalysis::LRU_CLASSIFICATION_FEATURE)
......
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