Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Touzeau
lrusecurity
Commits
a4019af3
Commit
a4019af3
authored
Sep 30, 2019
by
otawa
Browse files
Merge remote-tracking branch 'origin/update_otawa' into dev
parents
9b4cac53
6f22e5ba
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/Prev/lrusecurity_ExistHitPrevAdapter.cpp
View file @
a4019af3
...
...
@@ -32,7 +32,7 @@ void ExistHitPrevAdapter::update(Block *v, t& d)
t
s
;
// update and join along edges
for
(
auto
e
=
_graph
.
preds
(
v
);
e
;
e
++
)
{
for
(
auto
e
=
_graph
.
preds
(
v
);
e
()
;
e
++
)
{
Block
*
w
=
e
->
source
();
_domain
.
copy
(
s
,
_store
.
get
(
w
));
...
...
@@ -47,7 +47,7 @@ void ExistHitPrevAdapter::update(Block *v, t& d)
// apply edge
{
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
e
);
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
*
e
);
if
(
accs
.
count
()
>
0
)
update
(
accs
,
s
);
}
...
...
src/Prev/lrusecurity_ExistHitPrevAnalysis.cpp
View file @
a4019af3
...
...
@@ -45,8 +45,8 @@ void ExistHitPrevAnalysis::setup(WorkSpace* ws)
auto
start
=
std
::
chrono
::
system_clock
::
now
();
// prepare containers
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
b
)).
configure
(
*
_coll
);
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
*
b
)).
configure
(
*
_coll
);
// compute ACS
for
(
int
i
=
0
;
i
<
_coll
->
cache
()
->
setCount
();
i
++
)
{
...
...
@@ -65,8 +65,8 @@ void ExistHitPrevAnalysis::setup(WorkSpace* ws)
void
ExistHitPrevAnalysis
::
destroy
(
WorkSpace
*
)
{
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
EXIST_HIT_PREV_IN
(
b
).
remove
();
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
EXIST_HIT_PREV_IN
(
*
b
).
remove
();
}
void
ExistHitPrevAnalysis
::
processSet
(
int
set
,
WorkSpace
*
ws
)
...
...
@@ -76,11 +76,11 @@ void ExistHitPrevAnalysis::processSet(int set, WorkSpace* ws)
ai
::
SimpleAI
<
ExistHitPrevAdapter
>
ana
(
ada
);
ana
.
run
();
// store the results
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
if
(
b
->
isBasic
())
{
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
b
))[
set
],
ada
.
store
().
get
(
b
));
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
*
b
))[
set
],
ada
.
store
().
get
(
*
b
));
if
(
logFor
(
LOG_BLOCK
))
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
b
))
<<
io
::
endl
;
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
*
b
))
<<
io
::
endl
;
}
}
...
...
src/Prev_Over/lrusecurity_ExistHitPrevOAdapter.cpp
View file @
a4019af3
...
...
@@ -32,7 +32,7 @@ void ExistHitPrevOAdapter::update(Block *v, t& d)
t
s
;
// update and join along edges
for
(
auto
e
=
_graph
.
preds
(
v
);
e
;
e
++
)
{
for
(
auto
e
=
_graph
.
preds
(
v
);
e
()
;
e
++
)
{
Block
*
w
=
e
->
source
();
_domain
.
copy
(
s
,
_store
.
get
(
w
));
...
...
@@ -47,7 +47,7 @@ void ExistHitPrevOAdapter::update(Block *v, t& d)
// apply edge
{
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
e
);
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
*
e
);
if
(
accs
.
count
()
>
0
)
update
(
accs
,
s
);
}
...
...
src/Prev_Over/lrusecurity_ExistHitPrevOAnalysis.cpp
View file @
a4019af3
...
...
@@ -45,8 +45,8 @@ void ExistHitPrevOAnalysis::setup(WorkSpace* ws)
auto
start
=
std
::
chrono
::
system_clock
::
now
();
// prepare containers
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
b
)).
configure
(
*
_coll
);
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
*
b
)).
configure
(
*
_coll
);
// compute ACS
for
(
int
i
=
0
;
i
<
_coll
->
cache
()
->
setCount
();
i
++
)
{
...
...
@@ -65,8 +65,8 @@ void ExistHitPrevOAnalysis::setup(WorkSpace* ws)
void
ExistHitPrevOAnalysis
::
destroy
(
WorkSpace
*
)
{
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
EXIST_HIT_PREV_IN
(
b
).
remove
();
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
EXIST_HIT_PREV_IN
(
*
b
).
remove
();
}
void
ExistHitPrevOAnalysis
::
processSet
(
int
set
,
WorkSpace
*
ws
)
...
...
@@ -76,11 +76,11 @@ void ExistHitPrevOAnalysis::processSet(int set, WorkSpace* ws)
ai
::
SimpleAI
<
ExistHitPrevOAdapter
>
ana
(
ada
);
ana
.
run
();
// store the results
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
if
(
b
->
isBasic
())
{
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
b
))[
set
],
ada
.
store
().
get
(
b
));
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
*
b
))[
set
],
ada
.
store
().
get
(
*
b
));
if
(
logFor
(
LOG_BLOCK
))
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
b
))
<<
io
::
endl
;
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
*
b
))
<<
io
::
endl
;
}
}
...
...
src/Prev_Under/lrusecurity_ExistHitPrevUAdapter.cpp
View file @
a4019af3
...
...
@@ -38,7 +38,7 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
bool
first
=
true
;
// update and join along edges
for
(
auto
e
=
_graph
.
preds
(
v
);
e
;
e
++
)
{
for
(
auto
e
=
_graph
.
preds
(
v
);
e
()
;
e
++
)
{
Block
*
w
=
e
->
source
();
_domain
.
copy
(
s
,
_store
.
get
(
w
));
...
...
@@ -58,7 +58,7 @@ void ExistHitPrevUAdapter::update(Block *v, t& d)
// apply edge
{
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
e
);
const
Bag
<
icache
::
Access
>&
accs
=
icache
::
ACCESSES
(
*
e
);
if
(
accs
.
count
()
>
0
)
update
(
accs
,
s
);
}
...
...
src/Prev_Under/lrusecurity_ExistHitPrevUAnalysis.cpp
View file @
a4019af3
...
...
@@ -45,8 +45,8 @@ void ExistHitPrevUAnalysis::setup(WorkSpace* ws)
auto
start
=
std
::
chrono
::
system_clock
::
now
();
// prepare containers
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
b
)).
configure
(
*
_coll
);
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
(
*
EXIST_HIT_PREV_IN
(
*
b
)).
configure
(
*
_coll
);
// compute ACS
for
(
int
i
=
0
;
i
<
_coll
->
cache
()
->
setCount
();
i
++
)
{
...
...
@@ -65,8 +65,8 @@ void ExistHitPrevUAnalysis::setup(WorkSpace* ws)
void
ExistHitPrevUAnalysis
::
destroy
(
WorkSpace
*
)
{
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
EXIST_HIT_PREV_IN
(
b
).
remove
();
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
EXIST_HIT_PREV_IN
(
*
b
).
remove
();
}
void
ExistHitPrevUAnalysis
::
processSet
(
int
set
,
WorkSpace
*
ws
)
...
...
@@ -76,11 +76,11 @@ void ExistHitPrevUAnalysis::processSet(int set, WorkSpace* ws)
ai
::
SimpleAI
<
ExistHitPrevUAdapter
>
ana
(
ada
);
ana
.
run
();
// store the results
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
;
b
++
)
for
(
CFGCollection
::
BlockIter
b
(
_cfgs
);
b
()
;
b
++
)
if
(
b
->
isBasic
())
{
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
b
))[
set
],
ada
.
store
().
get
(
b
));
ada
.
domain
().
copy
((
*
EXIST_HIT_PREV_IN
(
*
b
))[
set
],
ada
.
store
().
get
(
*
b
));
if
(
logFor
(
LOG_BLOCK
))
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
b
))
<<
io
::
endl
;
log
<<
"
\t\t\t
"
<<
*
b
<<
": "
<<
ada
.
domain
().
print
(
ada
.
store
().
get
(
*
b
))
<<
io
::
endl
;
}
}
...
...
src/lrusecurity_Displayer.cpp
View file @
a4019af3
...
...
@@ -100,7 +100,7 @@ protected:
BasicBlock
*
bb
=
b
->
toBasic
();
for
(
Block
::
EdgeIter
edgeIter
(
bb
->
ins
());
edgeIter
;
++
edgeIter
)
{
for
(
Block
::
EdgeIter
edgeIter
(
bb
->
ins
());
edgeIter
()
;
++
edgeIter
)
{
const
Edge
*
e
=
*
edgeIter
;
const
Bag
<
icache
::
Access
>&
bag
=
otawa
::
icache
::
ACCESSES
(
e
);
processBag
(
ws
,
cfg
,
bag
,
bb
);
...
...
src/lrusecurity_SecurityCatBuilder.cpp
View file @
a4019af3
...
...
@@ -36,7 +36,7 @@ protected:
virtual
void
processBB
(
WorkSpace
*
,
CFG
*
cfg
,
Block
*
v
)
{
for
(
Block
::
EdgeIter
e
=
v
->
outs
();
e
;
e
++
)
{
for
(
Block
::
EdgeIter
e
=
v
->
outs
();
e
()
;
e
++
)
{
if
(
logFor
(
LOG_BLOCK
))
log
<<
"
\t\t\t\t
process "
<<
*
e
<<
io
::
endl
;
if
(
v
->
isSynth
()
&&
v
->
toSynth
()
->
callee
())
...
...
@@ -46,7 +46,7 @@ protected:
//otawa::sgraph::LoopIdentifier loopv = otawa::sgraph::LoopIdentifier::loopOf(v);
///otawa::sgraph::LoopIdentifier loope = otawa::sgraph::LoopIdentifier::loopOf(e.sink());
processAccesses
(
*
icache
::
ACCESSES
(
v
));
processAccesses
(
*
icache
::
ACCESSES
(
e
));
processAccesses
(
*
icache
::
ACCESSES
(
*
e
));
}
}
...
...
Write
Preview
Supports
Markdown
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