Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WSymb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
WSymb
Commits
4b173c06
Commit
4b173c06
authored
5 years ago
by
Forget Julien
Browse files
Options
Downloads
Patches
Plain Diff
argv fix for dumpcft (header file arg is now unused).
parent
594926d3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumpcft.cpp
+6
-38
6 additions, 38 deletions
dumpcft.cpp
example/Makefile
+5
-2
5 additions, 2 deletions
example/Makefile
with
11 additions
and
40 deletions
dumpcft.cpp
+
6
−
38
View file @
4b173c06
...
@@ -69,8 +69,8 @@ static bool is_strictly_in(Block *inner, Block *outer) {
...
@@ -69,8 +69,8 @@ static bool is_strictly_in(Block *inner, Block *outer) {
}
}
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
if
((
argc
<
4
)
||
(
argc
>
5
))
{
if
((
argc
<
3
)
||
(
argc
>
4
))
{
fprintf
(
stderr
,
"usage: %s <ARM binary>
<output header file>
<formula file> [<entry fct (by default main)>]
\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
"usage: %s <ARM binary> <formula file> [<entry fct (by default main)>]
\n
"
,
argv
[
0
]);
exit
(
1
);
exit
(
1
);
}
}
WorkSpace
*
ws
=
NULL
;
WorkSpace
*
ws
=
NULL
;
...
@@ -108,7 +108,7 @@ int main(int argc, char **argv) {
...
@@ -108,7 +108,7 @@ int main(int argc, char **argv) {
// produce awcet
// produce awcet
CFG
*
entry
=
nullptr
;
CFG
*
entry
=
nullptr
;
const
char
*
entryname
=
(
argc
>=
5
)
?
argv
[
4
]
:
"main"
;
const
char
*
entryname
=
(
argc
>=
4
)
?
argv
[
3
]
:
"main"
;
elm
::
String
entryname_s
(
entryname
);
elm
::
String
entryname_s
(
entryname
);
for
(
CFGCollection
::
Iter
iter
(
*
coll
);
iter
();
iter
++
)
{
for
(
CFGCollection
::
Iter
iter
(
*
coll
);
iter
();
iter
++
)
{
if
(
entryname_s
==
(
*
iter
)
->
name
())
{
if
(
entryname_s
==
(
*
iter
)
->
name
())
{
...
@@ -130,32 +130,11 @@ int main(int argc, char **argv) {
...
@@ -130,32 +130,11 @@ int main(int argc, char **argv) {
CFTREE
(
entry
)
->
exportToAWCET
(
&
f
);
CFTREE
(
entry
)
->
exportToAWCET
(
&
f
);
cout
<<
"done."
<<
endl
;
cout
<<
"done."
<<
endl
;
cout
<<
"Exporting AWCET to header file..."
<<
endl
;
FILE
*
outfile
=
fopen
(
argv
[
2
],
"w"
);
int
max_loop_id
=
0
;
int
max_loop_id
=
0
;
fprintf
(
outfile
,
"int loop_bounds(int loop_id) {
\n
switch(loop_id) {
\n
"
);
for
(
CFGCollection
::
Iter
iter
(
*
coll
);
iter
();
iter
++
)
{
cout
<<
"managing loop bounds for "
<<
(
*
iter
)
->
label
()
<<
endl
;
for
(
CFG
::
BlockIter
iter2
((
*
iter
)
->
blocks
());
iter2
();
iter2
++
)
{
if
(
LOOP_HEADER
(
*
iter2
))
{
if
(
max_loop_id
<
(
*
iter2
)
->
id
())
{
max_loop_id
=
(
*
iter2
)
->
id
();
}
int
bound
=
MAX_ITERATION
(
*
iter2
);
fprintf
(
outfile
,
" case %d: return %d;
\n
"
,
(
*
iter2
)
->
id
(),
bound
);
}
}
}
fprintf
(
outfile
,
" default: abort();
\n
"
);
fprintf
(
outfile
,
" }
\n
}
\n
"
);
fix_virtualized_loopinfo
(
entry
);
fix_virtualized_loopinfo
(
entry
);
FILE
*
pwf_file
=
fopen
(
argv
[
3
],
"w"
);
FILE
*
pwf_file
=
fopen
(
argv
[
2
],
"w"
);
long
long
*
loop_bounds
=
(
long
long
*
)
malloc
(
sizeof
(
long
long
)
*
max_loop_id
+
1
);
long
long
*
loop_bounds
=
(
long
long
*
)
malloc
(
sizeof
(
long
long
)
*
max_loop_id
+
1
);
for
(
int
i
=
0
;
i
<=
max_loop_id
;
i
++
)
for
(
int
i
=
0
;
i
<=
max_loop_id
;
i
++
)
loop_bounds
[
i
]
=
-
1
;
loop_bounds
[
i
]
=
-
1
;
...
@@ -171,38 +150,27 @@ int main(int argc, char **argv) {
...
@@ -171,38 +150,27 @@ int main(int argc, char **argv) {
writePWF
(
&
f
,
pwf_file
,
loop_bounds
);
writePWF
(
&
f
,
pwf_file
,
loop_bounds
);
fprintf
(
pwf_file
,
" loops: "
);
fprintf
(
pwf_file
,
" loops: "
);
fprintf
(
outfile
,
"int loop_hierarchy(int inner, int outer) {
\n
switch(inner) {
\n
"
);
for
(
CFGCollection
::
Iter
iter
(
*
coll
);
iter
();
iter
++
)
{
for
(
CFGCollection
::
Iter
iter
(
*
coll
);
iter
();
iter
++
)
{
for
(
CFG
::
BlockIter
iter2
((
*
iter
)
->
blocks
());
iter2
();
iter2
++
)
{
for
(
CFG
::
BlockIter
iter2
((
*
iter
)
->
blocks
());
iter2
();
iter2
++
)
{
if
(
LOOP_HEADER
(
*
iter2
))
{
if
(
LOOP_HEADER
(
*
iter2
))
{
loop_bounds
[(
*
iter2
)
->
id
()]
=
MAX_ITERATION
((
*
iter2
));
loop_bounds
[(
*
iter2
)
->
id
()]
=
MAX_ITERATION
((
*
iter2
));
printf
(
"bounding loop %d with %d
\n
"
,
(
*
iter2
)
->
id
(),
loop_bounds
[(
*
iter2
)
->
id
()]);
printf
(
"bounding loop %d with %d
\n
"
,
(
*
iter2
)
->
id
(),
loop_bounds
[(
*
iter2
)
->
id
()]);
fprintf
(
outfile
,
" case %d: switch (outer) {
\n
"
,
(
*
iter2
)
->
id
());
for
(
CFGCollection
::
Iter
iter3
(
*
coll
);
iter3
();
iter3
++
)
{
for
(
CFGCollection
::
Iter
iter3
(
*
coll
);
iter3
();
iter3
++
)
{
for
(
CFG
::
BlockIter
iter4
((
*
iter3
)
->
blocks
());
iter4
();
iter4
++
)
{
for
(
CFG
::
BlockIter
iter4
((
*
iter3
)
->
blocks
());
iter4
();
iter4
++
)
{
if
(
LOOP_HEADER
(
*
iter4
))
{
if
(
LOOP_HEADER
(
*
iter4
))
{
if
(
is_strictly_in
(
*
iter2
,
*
iter4
))
{
if
(
is_strictly_in
(
*
iter2
,
*
iter4
))
{
fprintf
(
outfile
,
" case %d: return 1;
\n
"
,
(
*
iter4
)
->
id
());
fprintf
(
pwf_file
,
"l:%u _C l:%u; "
,
(
*
iter2
)
->
id
(),
(
*
iter4
)
->
id
());
fprintf
(
pwf_file
,
"l%u _C l%u; "
,
(
*
iter2
)
->
id
(),
(
*
iter4
)
->
id
());
}
}
}
}
}
}
}
}
fprintf
(
outfile
,
" default: return 0;
\n
}
\n
"
);
}
}
}
}
}
}
fprintf
(
outfile
,
" default: abort();
\n
"
);
fprintf
(
outfile
,
" }
\n
}
\n
"
);
fprintf
(
pwf_file
,
" endl
\n
"
);
fprintf
(
pwf_file
,
" endl
\n
"
);
fprintf
(
outfile
,
"formula_t f = "
);
compute_eta_count
(
&
f
);
writeC
(
&
f
,
outfile
,
0
);
fprintf
(
outfile
,
";
\n
"
);
fclose
(
pwf_file
);
fclose
(
out
file
);
fclose
(
pwf_
file
);
free
(
loop_bounds
);
free
(
loop_bounds
);
}
}
This diff is collapsed.
Click to expand it.
example/Makefile
+
5
−
2
View file @
4b173c06
...
@@ -11,8 +11,11 @@ pwcet_instantiator: pwcet_instantiator.c example-pwcet.h ../pwcet/include/pwcet-
...
@@ -11,8 +11,11 @@ pwcet_instantiator: pwcet_instantiator.c example-pwcet.h ../pwcet/include/pwcet-
cc
$(
CFLAGS
)
-c
pwcet_instantiator.c
cc
$(
CFLAGS
)
-c
pwcet_instantiator.c
cc
$(
LDFLAGS
)
-o
pwcet_instantiator pwcet_instantiator.c
$(
LDLIBS
)
cc
$(
LDFLAGS
)
-o
pwcet_instantiator pwcet_instantiator.c
$(
LDLIBS
)
example-pwcet.h example.pwf
:
example example.ff
example-pwcet.h
:
example-pwcet.pwf
../dumpcft ./example example-pwcet.h example.pwf
cd
../simplify
;
./swymplify
-c
../example/example-pwcet.pwf
;
cd
-
example-pwcet.pwf
:
example example.ff
../dumpcft ./example example-pwcet.pwf
example
:
example.c
example
:
example.c
$(
ARMCC
)
$(
ARMCFLAGS
)
-g
-O0
-o
example example.c
-static
$(
ARMCC
)
$(
ARMCFLAGS
)
-g
-O0
-o
example example.c
-static
...
...
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