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
7f057804
Commit
7f057804
authored
5 years ago
by
Forget Julien
Browse files
Options
Downloads
Patches
Plain Diff
Added option to specify output file name.
parent
4b173c06
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
simplify/main.ml
+9
-1
9 additions, 1 deletion
simplify/main.ml
simplify/options.ml
+3
-1
3 additions, 1 deletion
simplify/options.ml
simplify/to_c.ml
+5
-1
5 additions, 1 deletion
simplify/to_c.ml
with
17 additions
and
3 deletions
simplify/main.ml
+
9
−
1
View file @
7f057804
...
@@ -13,10 +13,18 @@ let compile source_name contexts =
...
@@ -13,10 +13,18 @@ let compile source_name contexts =
let
ctx'
=
new_ctx
f'
ctx
.
loop_hierarchy
ctx
.
loop_bounds
in
let
ctx'
=
new_ctx
f'
ctx
.
loop_hierarchy
ctx
.
loop_bounds
in
To_c
.
c_context
source_name
ctx'
To_c
.
c_context
source_name
ctx'
else
else
let
out_f
=
if
(
!
Options
.
out_name
=
""
)
then
Format
.
std_formatter
else
let
out_ch
=
open_out
!
Options
.
out_name
in
Format
.
formatter_of_out_channel
out_ch
in
List
.
iter
List
.
iter
(
fun
ctx
->
(
fun
ctx
->
let
f'
=
simplify
ctx
.
loop_hierarchy
ctx
.
formula
in
let
f'
=
simplify
ctx
.
loop_hierarchy
ctx
.
formula
in
Format
.
fprintf
Format
.
std_formatter
"%a %a@."
Format
.
fprintf
out_f
"%a %a@."
Wcet_formula
.
pp
f'
Wcet_formula
.
pp
f'
Loops
.
pp_hier
ctx
.
loop_hierarchy
Loops
.
pp_hier
ctx
.
loop_hierarchy
)
)
...
...
This diff is collapsed.
Click to expand it.
simplify/options.ml
+
3
−
1
View file @
7f057804
...
@@ -27,9 +27,11 @@ let extension = ".pwf"
...
@@ -27,9 +27,11 @@ let extension = ".pwf"
let
debug
=
ref
false
let
debug
=
ref
false
let
to_c
=
ref
false
let
to_c
=
ref
false
let
out_name
=
ref
""
let
options
=
[
let
options
=
[
"-c"
,
Arg
.
Set
to_c
,
"Compile a (single) formula to C code"
;
"-c"
,
Arg
.
Set
to_c
,
"Compile a (single) formula to C code"
;
"-debug"
,
Arg
.
Set
debug
,
"Run in debug mode"
;
"-debug"
,
Arg
.
Set
debug
,
"Run in debug mode"
;
"-o"
,
Arg
.
Set_string
out_name
,
"Speficies the output file name"
;
"-version"
,
Arg
.
Unit
(
fun
()
->
print_endline
version
)
,
"Print version"
"-version"
,
Arg
.
Unit
(
fun
()
->
print_endline
version
)
,
"Print version"
]
]
This diff is collapsed.
Click to expand it.
simplify/to_c.ml
+
5
−
1
View file @
7f057804
...
@@ -109,7 +109,11 @@ let c_formula out_f f =
...
@@ -109,7 +109,11 @@ let c_formula out_f f =
let
c_context
source_name
ctx
=
let
c_context
source_name
ctx
=
let
basename
=
Filename
.
chop_suffix
source_name
Options
.
extension
in
let
basename
=
Filename
.
chop_suffix
source_name
Options
.
extension
in
let
outname
=
basename
^
".h"
in
let
outname
=
if
(
!
Options
.
out_name
=
""
)
then
basename
^
".h"
else
!
Options
.
out_name
in
let
out_ch
=
open_out
outname
in
let
out_ch
=
open_out
outname
in
let
out_f
=
formatter_of_out_channel
out_ch
in
let
out_f
=
formatter_of_out_channel
out_ch
in
c_loop_bounds
out_f
ctx
.
loop_bounds
;
c_loop_bounds
out_f
ctx
.
loop_bounds
;
...
...
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