Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Tobias Langer
/
experiment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ce8e8d7a
authored
Oct 05, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added template and taskset description parsing.
parent
b6cbbb24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
generate.py
+7
-5
template/defines.h
+30
-0
No files found.
generate.py
View file @
ce8e8d7a
...
@@ -18,6 +18,7 @@ import os
...
@@ -18,6 +18,7 @@ import os
import
argparse
import
argparse
import
shutil
import
shutil
import
json
import
json
import
pystache
def
query_yes_no
(
question
,
default
=
None
):
def
query_yes_no
(
question
,
default
=
None
):
"""
"""
...
@@ -55,11 +56,15 @@ def create_dir(filename):
...
@@ -55,11 +56,15 @@ def create_dir(filename):
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
return
True
return
True
def
create_header
(
headerfile
,
tasks
,
destination
):
def
create_header
(
headerfile
,
experiment
,
destination
):
"""
"""
Create a header file for the experiment.
Create a header file for the experiment.
"""
"""
pass
with
open
(
headerfile
,
'r'
)
as
header_template
:
template
=
header_template
.
read
()
header_txt
=
pystache
.
render
(
template
,
experiment
)
with
open
(
destination
,
'w'
)
as
header
:
print
(
header_txt
,
file
=
header
)
def
main
():
def
main
():
"""
"""
...
@@ -93,9 +98,6 @@ def main():
...
@@ -93,9 +98,6 @@ def main():
print
(
'Skipping experiment '
,
experiment
[
'name'
],
file
=
sys
.
stderr
)
print
(
'Skipping experiment '
,
experiment
[
'name'
],
file
=
sys
.
stderr
)
continue
continue
# Read tasks
tasks
=
[]
# Add header
# Add header
print
(
'create header file'
)
print
(
'create header file'
)
create_header
(
args
.
headerfile
,
experiment
,
experiment_dir
)
create_header
(
args
.
headerfile
,
experiment
,
experiment_dir
)
...
...
template/defines.h
0 → 100644
View file @
ce8e8d7a
{{
#
includes
}}
#include{{name}}
{{
/
includes
}}
{{
#
data_description
}}
struct
{{
name
}}
{
{{
#
fields
}}
{{
type
}}
{{
name
}};
{{
/
fields
}}
};
{{
/
data_description
}}
{{
#
data
}}
{{
type
}}
{{
name
}}[]
=
{
{{
#
elem
}}
.
wcet
=
{{
wcet
}}
.
period
=
{{
period
}}
.
deadline
=
{{
deadline
}}
.
periodical
=
{{
periodical
}}
.
ticktype
=
{{
ticktype
}}
{{
/
elem
}}
};
{{
/
data
}}
{{
#
executions
}}
int
executions
=
500
;
{{
/
executions
}}
{{
^
executions
}}
int
executions
=
1
;
{{
/
executions
}}
Write
Preview
Markdown
is supported
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