Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lrusecurity
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Touzeau
lrusecurity
Commits
58e4f002
Commit
58e4f002
authored
Jul 09, 2019
by
Maeva Ramarijaona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_display' into 'dev'
Fix display See merge request
!1
parents
c71e01f1
cb7dfd4c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
98 deletions
+111
-98
src/Prev_Over/ExistHitPrevOAdapter.h
src/Prev_Over/ExistHitPrevOAdapter.h
+1
-1
src/Prev_Over/ExistHitPrevODomain.h
src/Prev_Over/ExistHitPrevODomain.h
+2
-2
src/Prev_Over/lrusecurity_ExistHitPrevODomain.cpp
src/Prev_Over/lrusecurity_ExistHitPrevODomain.cpp
+36
-36
src/Prev_Under/lrusecurity_ExistHitPrevUAdapter.cpp
src/Prev_Under/lrusecurity_ExistHitPrevUAdapter.cpp
+5
-4
src/Prev_Under/lrusecurity_ExistHitPrevUAnalysis.cpp
src/Prev_Under/lrusecurity_ExistHitPrevUAnalysis.cpp
+3
-2
src/Prev_Under/lrusecurity_ExistHitPrevUDomain.cpp
src/Prev_Under/lrusecurity_ExistHitPrevUDomain.cpp
+44
-43
src/lrusecurity_Displayer.cpp
src/lrusecurity_Displayer.cpp
+20
-10
No files found.
src/Prev_Over/ExistHitPrevOAdapter.h
View file @
58e4f002
...
...
@@ -31,7 +31,7 @@ public:
void
update
(
otawa
::
Block
*
v
,
t
&
d
);
private:
lru
mc
::
ACSManager
_mayManager
;
lru
preanalysis
::
eh_em
::
ACSManager
_mayManager
;
domain_t
_domain
;
graph_t
_graph
;
store_t
_store
;
...
...
src/Prev_Over/ExistHitPrevODomain.h
View file @
58e4f002
...
...
@@ -25,8 +25,8 @@ public:
inline
void
copy
(
t
&
d
,
const
t
&
s
)
{
d
.
copy
(
s
);
}
bool
equals
(
const
t
&
a
,
const
t
&
b
)
const
;
void
join
(
t
&
d
,
const
t
&
s
);
void
fetch
(
t
&
a
,
const
otawa
::
icache
::
Access
&
ac
,
lru
mc
::
ACSManager
&
mayManager
);
void
update
(
const
otawa
::
icache
::
Access
&
access
,
t
&
a
,
lru
mc
::
ACSManager
&
mayManager
);
void
fetch
(
t
&
a
,
const
otawa
::
icache
::
Access
&
ac
,
lru
preanalysis
::
eh_em
::
ACSManager
&
mayManager
);
void
update
(
const
otawa
::
icache
::
Access
&
access
,
t
&
a
,
lru
preanalysis
::
eh_em
::
ACSManager
&
mayManager
);
private:
int
_n
;
...
...
src/Prev_Over/lrusecurity_ExistHitPrevODomain.cpp
View file @
58e4f002
...
...
@@ -6,17 +6,17 @@ namespace lrusecurity
{
ExistHitPrevODomain
::
ExistHitPrevODomain
(
const
icat3
::
LBlockCollection
&
coll
,
int
set
,
const
t
*
init
)
:
_n
(
coll
[
set
].
count
()),
_bot
(
_n
),
_top
(
_n
,
Address
(
0x0
)),
//TO CHANGE
_set
(
set
),
const
icat3
::
LBlockCollection
&
coll
,
int
set
,
const
t
*
init
)
:
_n
(
coll
[
set
].
count
()),
_bot
(
_n
),
_top
(
_n
,
Address
(
0x0
)),
//TO CHANGE
_set
(
set
),
_coll
(
coll
),
_A
(
coll
.
A
()),
_init
(
init
?
*
init
:
_top
),
_tmp
(
_n
)
_A
(
coll
.
A
()),
_init
(
init
?
*
init
:
_top
),
_tmp
(
_n
)
{
}
...
...
@@ -27,9 +27,10 @@ bool ExistHitPrevODomain::equals(const t& acss, const t& bcss) const
return
false
;
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
();
Bag
<
Address
>
newbag
=
Bag
<
Address
>
(
newsize
);
for
(
int
j
=
0
;
j
<
newsize
;
j
++
)
{
...
...
@@ -40,45 +41,44 @@ bool ExistHitPrevODomain::equals(const t& acss, const t& bcss) const
}
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
);
int
b
=
lb
->
index
();
for
(
int
i
=
0
;
i
<
_n
;
i
++
){
if
(
i
==
b
){
Address
smol
[]
=
{
access
.
address
()};
acss
[
i
]
=
Bag
<
Address
>
(
1
,
smol
);}
else
if
(
mayManager
.
mayAge
(
lb
)
==
_A
)
Address
smol
[]
=
{
access
.
address
()};
acss
[
i
]
=
Bag
<
Address
>
(
1
,
smol
);
}
else
if
(
mayManager
.
mayAge
(
_coll
[
_set
][
i
]
)
==
_A
)
acss
[
i
]
=
Bag
<
Address
>
();
}
}
void
ExistHitPrevODomain
::
update
(
const
icache
::
Access
&
access
,
t
&
a
,
lru
mc
::
ACSManager
&
mayManager
)
void
ExistHitPrevODomain
::
update
(
const
icache
::
Access
&
access
,
t
&
a
,
lru
preanalysis
::
eh_em
::
ACSManager
&
mayManager
)
{
switch
(
access
.
kind
())
{
switch
(
access
.
kind
())
{
case
icache
::
FETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
fetch
(
a
,
access
,
mayManager
);
break
;
case
icache
::
FETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
fetch
(
a
,
access
,
mayManager
);
break
;
case
icache
::
PREFETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
{
copy
(
_tmp
,
a
);
fetch
(
a
,
access
,
mayManager
);
join
(
a
,
_tmp
);
}
break
;
case
icache
::
PREFETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
{
copy
(
_tmp
,
a
);
fetch
(
a
,
access
,
mayManager
);
join
(
a
,
_tmp
);
}
break
;
case
icache
::
NONE
:
break
;
case
icache
::
NONE
:
break
;
default:
ASSERT
(
false
);
}
default:
ASSERT
(
false
);
}
}
}
// namespace lrusecurity
src/Prev_Under/lrusecurity_ExistHitPrevUAdapter.cpp
View file @
58e4f002
#include "ExistHitPrevUAdapter.h"
#include <lrupreanalysis/ExistHitDomain.h>
...
...
@@ -7,13 +6,14 @@ using namespace otawa;
namespace
lrusecurity
{
ExistHitPrevUAdapter
::
ExistHitPrevUAdapter
(
int
set
,
const
t
*
init
,
const
icat3
::
LBlockCollection
&
coll
,
const
CFGCollection
&
cfgs
,
otawa
::
WorkSpace
*
ws
)
:
_set
(
set
),
_set
(
set
),
_ehManager
(
ws
),
_domain
(
coll
,
set
,
init
),
_graph
(
cfgs
),
...
...
@@ -29,7 +29,6 @@ void ExistHitPrevUAdapter::update(const Bag<icache::Access>& accs, t& d)
}
}
void
ExistHitPrevUAdapter
::
update
(
Block
*
v
,
t
&
d
)
{
_domain
.
copy
(
d
,
_domain
.
bot
());
...
...
@@ -44,11 +43,12 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
_domain
.
copy
(
s
,
_store
.
get
(
w
));
_ehManager
.
start
(
w
);
if
(
first
)
{
first
=
false
;
_ehManager
.
ehDomain
(
_set
).
copy
(
d_eh
,
_ehManager
.
ehDomain
(
_set
).
bot
());
}
// apply block
{
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
w
);
...
...
@@ -68,6 +68,7 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
lrupreanalysis
::
eh_em
::
ExistHitDomain
::
t
*
tmp
=
_ehManager
.
ehValue
(
_set
);
ASSERT
(
tmp
&&
"tmp null"
);
lrupreanalysis
::
eh_em
::
ExistHitDomain
::
t
&
s_eh
=
*
tmp
;
ASSERT
(
d_eh
.
count
()
==
s_eh
.
count
());
_domain
.
join
(
d
,
s
,
d_eh
,
s_eh
);
_ehManager
.
ehDomain
(
_set
).
join
(
d_eh
,
s_eh
);
}
...
...
src/Prev_Under/lrusecurity_ExistHitPrevUAnalysis.cpp
View file @
58e4f002
#include "ExistHitPrevUAnalysis.h"
#include <chrono>
...
...
@@ -12,6 +11,7 @@
#include "ExistHitPrevUAdapter.h"
#include "ExistHitPrevUDomain.h"
using
namespace
otawa
;
namespace
lrusecurity
...
...
@@ -24,6 +24,7 @@ ExistHitPrevUAnalysis::ExistHitPrevUAnalysis(p::declare& r) :
_cfgs
(
nullptr
)
{
}
void
ExistHitPrevUAnalysis
::
configure
(
const
PropList
&
props
)
{
Processor
::
configure
(
props
);
...
...
@@ -61,13 +62,13 @@ void ExistHitPrevUAnalysis::setup(WorkSpace* ws)
if
(
logFor
(
LOG_FUN
))
log
<<
"
\t
Exist Hit Prev Analysis running time: "
<<
elapsed
.
count
()
<<
" s"
<<
io
::
endl
;
}
void
ExistHitPrevUAnalysis
::
destroy
(
WorkSpace
*
)
{
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
EXIST_HIT_PREV_IN
(
b
).
remove
();
}
void
ExistHitPrevUAnalysis
::
processSet
(
int
set
,
WorkSpace
*
ws
)
{
// perform the analysis
...
...
src/Prev_Under/lrusecurity_ExistHitPrevUDomain.cpp
View file @
58e4f002
...
...
@@ -6,17 +6,17 @@ namespace lrusecurity
{
ExistHitPrevUDomain
::
ExistHitPrevUDomain
(
const
icat3
::
LBlockCollection
&
coll
,
int
set
,
const
t
*
init
)
:
_n
(
coll
[
set
].
count
()),
_bot
(
_n
),
_top
(
_n
,
Address
(
0x0
)),
//TO CHANGE
_set
(
set
),
const
icat3
::
LBlockCollection
&
coll
,
int
set
,
const
t
*
init
)
:
_n
(
coll
[
set
].
count
()),
_bot
(
_n
),
_top
(
_n
,
Address
(
0x0
)),
//TO CHANGE
_set
(
set
),
_coll
(
coll
),
_A
(
coll
.
A
()),
_init
(
init
?
*
init
:
_top
),
_tmp
(
_n
)
_A
(
coll
.
A
()),
_init
(
init
?
*
init
:
_top
),
_tmp
(
_n
)
{
}
...
...
@@ -27,61 +27,62 @@ bool ExistHitPrevUDomain::equals(const t& acss, const t& bcss) const
return
false
;
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
++
){
if
(
s_eh
[
i
]
<
d_eh
[
i
]
||
(
d_eh
[
i
]
==
-
1
&&
s_eh
[
i
]
!=
-
1
)){
for
(
int
i
=
0
;
i
<
_n
;
i
++
)
{
if
(
s_eh
[
i
]
<
d_eh
[
i
]
||
(
d_eh
[
i
]
==
-
1
&&
s_eh
[
i
]
!=
-
1
))
{
dcss
[
i
]
=
scss
[
i
];
}
else
if
(
s_eh
[
i
]
==
d_eh
[
i
]){
int
fullsize
=
(
dcss
[
i
]).
size
()
+
(
scss
[
i
]).
size
();
Bag
<
Address
>
tmp
=
Bag
<
Address
>
(
fullsize
);
for
(
int
j
=
0
;
j
<
fullsize
;
j
++
){
if
(
j
<
(
dcss
[
i
]).
size
())
tmp
[
j
]
=
dcss
[
i
][
j
]
;
else
tmp
[
j
]
=
scss
[
i
][
j
-
dcss
[
i
].
size
()];
}
else
if
(
s_eh
[
i
]
==
d_eh
[
i
])
{
int
fullsize
=
(
dcss
[
i
]).
size
()
+
(
scss
[
i
]).
size
();
Bag
<
Address
>
tmp
=
Bag
<
Address
>
(
fullsize
);
for
(
int
j
=
0
;
j
<
fullsize
;
j
++
)
{
if
(
j
<
(
dcss
[
i
]).
size
())
tmp
[
j
]
=
dcss
[
i
][
j
];
else
tmp
[
j
]
=
scss
[
i
][
j
-
dcss
[
i
].
size
()];
}
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
);
int
b
=
lb
->
index
();
for
(
int
i
=
0
;
i
<
_n
;
i
++
){
if
(
i
==
b
){
Address
smol
[]
=
{
access
.
address
()};
acss
[
i
]
=
Bag
<
Address
>
(
1
,
smol
);}
else
if
(
ehManager
.
existHitAge
(
lb
)
==
_A
)
Address
smol
[]
=
{
access
.
address
()};
acss
[
i
]
=
Bag
<
Address
>
(
1
,
smol
);
}
else
if
(
ehManager
.
existHitAge
(
_coll
[
_set
][
i
]
)
==
_A
)
acss
[
i
]
=
Bag
<
Address
>
();
}
}
void
ExistHitPrevUDomain
::
update
(
const
icache
::
Access
&
access
,
t
&
a
,
lrupreanalysis
::
eh_em
::
ACSManager
&
ehManager
)
{
switch
(
access
.
kind
())
{
switch
(
access
.
kind
())
{
case
icache
::
FETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
fetch
(
a
,
access
,
ehManager
);
break
;
case
icache
::
FETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
fetch
(
a
,
access
,
ehManager
);
break
;
case
icache
::
PREFETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
{
copy
(
_tmp
,
a
);
fetch
(
a
,
access
,
ehManager
);
join
(
a
,
_tmp
,
icat3
::
ACS
(),
icat3
::
ACS
());
}
break
;
case
icache
::
PREFETCH
:
if
(
_coll
.
cache
()
->
set
(
access
.
address
())
==
_set
)
{
copy
(
_tmp
,
a
);
fetch
(
a
,
access
,
ehManager
);
join
(
a
,
_tmp
,
icat3
::
ACS
(),
icat3
::
ACS
());
}
break
;
case
icache
::
NONE
:
break
;
case
icache
::
NONE
:
break
;
default:
ASSERT
(
false
);
}
default:
ASSERT
(
false
);
}
}
}
// namespace lrusecurity
src/lrusecurity_Displayer.cpp
View file @
58e4f002
...
...
@@ -7,7 +7,7 @@
#include <otawa/prog/Process.h>
#include <lruexact/features.h>
//#include "SecCFGOutput.h"
using
namespace
otawa
;
using
namespace
otawa
;
namespace
lrusecurity
{
...
...
@@ -57,7 +57,7 @@ protected:
_out
.
setStream
(
*
_stream
);
}
_out
<<
"ACCESS
\t\t
KIND
\t
CATEGORY
\t
BB
\t
"
;
_out
<<
"ACCESS
\t\t
KIND
\t
CATEGORY
\t
\t
BB
\t
"
;
if
(
_line
)
_out
<<
"
\t
LINE"
;
...
...
@@ -105,19 +105,29 @@ protected:
}
_out
<<
"UNSAFE "
;
int
set
=
otawa
::
icat3
::
LBLOCK
(
access
)
->
set
();
int
number
=
0
;
if
(
bb
->
hasProp
(
EXIST_HIT_PREV_IN
))
{
ACSSecurity
prev
=
(
*
EXIST_HIT_PREV_IN
(
bb
))[
set
];
int
index
=
otawa
::
icat3
::
LBLOCK
(
access
)
->
index
();
for
(
int
i
=
0
;
i
<
prev
[
index
].
size
();
i
++
)
_out
<<
prev
[
index
][
i
];
number
=
prev
[
index
].
size
();
for
(
int
i
=
0
;
i
<
number
;
i
++
)
_out
<<
prev
[
index
][
i
]
<<
"
\n\t\t\t\t\b
"
;
// REMONTEE
for
(
int
j
=
0
;
j
<
number
;
j
++
)
_out
<<
"
\033
[1A"
;
}
_out
<<
"
\t\t
"
;
_out
<<
"BB "
<<
bb
->
index
()
<<
"
\t\t
"
;
_out
<<
"
\t\t\t
BB "
<<
bb
->
index
()
<<
"
\t\t
"
;
printLine
(
ws
,
bb
->
address
(),
bb
->
topAddress
().
offset
());
_out
<<
io
::
endl
;
}
// DESCENTE
for
(
int
i
=
0
;
i
<
number
-
1
;
i
++
)
_out
<<
"
\n
//"
;
_out
<<
io
::
endl
;
}
}
void
printLine
(
WorkSpace
*
ws
,
Address
begin
,
Address
::
offset_t
offset
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment