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
78096317
Commit
78096317
authored
Jul 09, 2019
by
Mishigan
Browse files
fix non affichage de certain accès précedents
parent
c71e01f1
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/Prev_Over/ExistHitPrevOAdapter.h
View file @
78096317
...
...
@@ -31,7 +31,7 @@ public:
void
update
(
otawa
::
Block
*
v
,
t
&
d
);
private:
lrum
c
::
ACSManager
_mayManager
;
lru
preanalysis
::
eh_e
m
::
ACSManager
_mayManager
;
domain_t
_domain
;
graph_t
_graph
;
store_t
_store
;
...
...
src/Prev_Over/ExistHitPrevODomain.h
View file @
78096317
...
...
@@ -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
,
lrum
c
::
ACSManager
&
mayManager
);
void
update
(
const
otawa
::
icache
::
Access
&
access
,
t
&
a
,
lrum
c
::
ACSManager
&
mayManager
);
void
fetch
(
t
&
a
,
const
otawa
::
icache
::
Access
&
ac
,
lru
preanalysis
::
eh_e
m
::
ACSManager
&
mayManager
);
void
update
(
const
otawa
::
icache
::
Access
&
access
,
t
&
a
,
lru
preanalysis
::
eh_e
m
::
ACSManager
&
mayManager
);
private:
int
_n
;
...
...
src/Prev_Over/lrusecurity_ExistHitPrevODomain.cpp
View file @
78096317
...
...
@@ -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
,
lrum
c
::
ACSManager
&
mayManager
)
void
ExistHitPrevODomain
::
update
(
const
icache
::
Access
&
access
,
t
&
a
,
lru
preanalysis
::
eh_e
m
::
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 @
78096317
#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 @
78096317
#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 @
78096317
...
...
@@ -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
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