Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin_cache_blocks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OTAWA-plugins
plugin_cache_blocks
Commits
fb080996
Commit
fb080996
authored
3 years ago
by
Bouquillon Fabien
Browse files
Options
Downloads
Patches
Plain Diff
script
parent
a6c4c553
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
vulnerability/include/type.h
+98
-0
98 additions, 0 deletions
vulnerability/include/type.h
with
98 additions
and
0 deletions
vulnerability/include/type.h
0 → 100644
+
98
−
0
View file @
fb080996
#ifndef TYPE_H
#define TYPE_H
#include
<otawa/otawa.h>
#include
<otawa/base.h>
#include
<vector>
namespace
otawa
{
namespace
vulnerability
{
struct
Cache_Miss
{
Address
adr
;
long
vul
;
long
time
;
};
template
<
typename
T
>
T
vector_union
(
T
v1
,
T
v2
)
{
T
v3
;
for
(
auto
iter_v
=
v1
.
begin
();
iter_v
!=
v1
.
end
();
iter_v
++
)
{
v3
.
push_back
(
*
iter_v
);
}
for
(
auto
iter_v
=
v2
.
begin
();
iter_v
!=
v2
.
end
();
iter_v
++
)
{
v3
.
push_back
(
*
iter_v
);
}
return
v3
;
}
template
<
typename
T
>
T
get_set
(
T
v1
)
{
T
v2
;
for
(
auto
iter_v
=
v1
.
begin
();
iter_v
!=
v1
.
end
();
iter_v
++
)
{
bool
already_in
=
false
;
for
(
auto
iter_v2
=
v2
.
begin
();
iter_v2
!=
v2
.
end
();
iter_v2
++
)
{
if
(
*
iter_v2
==
*
iter_v
)
{
already_in
=
true
;
break
;
}
}
if
(
!
already_in
)
{
v2
.
push_back
(
*
iter_v
);
}
}
return
v2
;
}
struct
Memory_block
{
int
block_id
;
int
nb_index
;
int
nb_way
;
BasicBlock
*
bb_ptr
;
std
::
vector
<
struct
Memory_block
*>
pred
;
std
::
vector
<
struct
Memory_block
*>
suc
;
std
::
vector
<
Address
>
*
lmb_gen
;
std
::
vector
<
Address
>
*
rmb_gen
;
std
::
vector
<
std
::
vector
<
Address
>>
*
rmb_in
;
std
::
vector
<
std
::
vector
<
Address
>>
*
rmb_out
;
std
::
vector
<
std
::
vector
<
Address
>>
*
lmb_in
;
std
::
vector
<
std
::
vector
<
Address
>>
*
lmb_out
;
Memory_block
(
int
nb_index
,
int
nb_way
,
BasicBlock
*
bb
)
{
this
->
bb_ptr
=
bb
;
this
->
nb_index
=
nb_index
;
this
->
nb_way
=
nb_way
;
this
->
rmb_in
=
new
std
::
vector
<
std
::
vector
<
Address
>>
[
nb_index
];
this
->
rmb_out
=
new
std
::
vector
<
std
::
vector
<
Address
>>
[
nb_index
];
this
->
lmb_in
=
new
std
::
vector
<
std
::
vector
<
Address
>>
[
nb_index
];
this
->
lmb_out
=
new
std
::
vector
<
std
::
vector
<
Address
>>
[
nb_index
];
this
->
lmb_gen
=
new
std
::
vector
<
Address
>
[
nb_index
];
this
->
rmb_gen
=
new
std
::
vector
<
Address
>
[
nb_index
];
for
(
int
i
=
0
;
i
<
nb_index
;
i
++
)
{
this
->
rmb_in
[
i
].
clear
();
this
->
lmb_in
[
i
].
clear
();
this
->
rmb_out
[
i
].
clear
();
this
->
lmb_out
[
i
].
clear
();
this
->
rmb_gen
[
i
].
clear
();
this
->
lmb_gen
[
i
].
clear
();
}
}
~
Memory_block
()
{
delete
this
->
rmb_in
;
delete
this
->
rmb_out
;
delete
this
->
lmb_in
;
delete
this
->
lmb_out
;
delete
this
->
lmb_gen
;
delete
this
->
rmb_gen
;
}
};
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment