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
999540e2
authored
Nov 21, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for utilization based simulation.
parent
2e5cf367
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
run.py
+3
-3
tasksetgen.py
+28
-6
No files found.
run.py
View file @
999540e2
...
...
@@ -14,9 +14,9 @@ def get_exp_cnt(path):
def
main
():
parser
=
argparse
.
ArgumentParser
(
'Run all the scripts so everything works fine.'
)
parser
.
add_argument
(
'experiments'
,
type
=
int
,
nargs
=
1
,
default
=
1
,
parser
.
add_argument
(
'experiments'
,
type
=
int
,
nargs
=
'?'
,
default
=
1
,
help
=
'The number of experiments to be run.'
)
parser
.
add_argument
(
'utilization'
,
type
=
float
,
nargs
=
'?'
,
default
=
1
,
parser
.
add_argument
(
'utilization'
,
type
=
float
,
nargs
=
'?'
,
help
=
'The utilization for the experiments to be run.'
,
default
=
None
)
...
...
@@ -32,7 +32,7 @@ def main():
cnt
=
0
remain
=
args
.
experiments
while
remain
>
0
:
if
parser
.
utilization
is
not
None
:
if
args
.
utilization
is
not
None
:
subprocess
.
call
([
'./tasksetgen.py'
,
'--microseconds'
,
'--uniform'
,
'5'
,
'--utilization {}:{}'
.
format
(
args
.
utilization
-
0.25
,
args
.
utilization
+
0.25
),
str
(
remain
),
'experiments/ese2016_{}'
.
format
(
cnt
),
...
...
tasksetgen.py
View file @
999540e2
...
...
@@ -128,6 +128,9 @@ def main():
default
=
'.'
)
parser
.
add_argument
(
'experiment_target'
,
type
=
str
,
help
=
'Output directory for experiments.'
,
nargs
=
'?'
,
default
=
'.'
)
parser
.
add_argument
(
'--utility'
,
type
=
str
,
help
=
'The utility for which tasksets should be generated. Is a range such as 2.5:3.5'
,
nargs
=
1
)
parser
.
add_argument
(
'--baseclock'
,
type
=
str
,
default
=
'system_clock'
,
nargs
=
'?'
,
help
=
'The clock which is to be used for the execution.'
)
...
...
@@ -174,16 +177,35 @@ def main():
else
:
distribution
=
Distribution
.
uniform
utility
=
None
try
:
utility_val
=
args
.
utility
.
split
(
':'
)
if
len
(
utility_val
>
3
):
print
(
'Invalid utility specified.'
,
file
=
sys
.
sterr
)
sys
.
exit
(
1
)
utility
=
[
float
(
util
)
for
util
in
utility_val
]
except
AttributeError
:
pass
print
(
'Generating tasks…'
,
file
=
sys
.
stderr
)
tasksets
=
[]
while
len
(
tasksets
)
<
args
.
tasksetcount
:
taskset
=
[]
while
len
(
taskset
)
<
args
.
cores
+
1
or
\
calc_utilization
(
taskset
)
<=
args
.
cores
and
\
hyperperiod
(
taskset
)
<
300000
:
# Limit hyperperiod to 5 minutes
taskset
.
append
(
create_task
(
distribution
))
if
len
(
taskset
)
>=
args
.
cores
+
1
:
tasksets
.
append
(
taskset
)
if
utility
is
None
:
while
len
(
taskset
)
<
args
.
cores
+
1
or
\
calc_utilization
(
taskset
)
<=
args
.
cores
and
\
hyperperiod
(
taskset
)
<
300000
:
# Limit hyperperiod to 5 minutes
taskset
.
append
(
create_task
(
distribution
))
if
len
(
taskset
)
>=
args
.
cores
+
1
:
tasksets
.
append
(
taskset
)
else
:
taskset_util
=
calc_utilization
(
taskset
)
while
taskset_util
<
utility
[
0
]
and
taskset_util
<
utility
[
1
]:
taskset
.
append
(
create_task
(
distribution
))
if
taskset_util
<
utility
[
1
]:
if
len
(
taskset
)
>=
args
.
cores
+
1
:
tasksets
.
append
(
taskset
)
now
=
datetime
.
datetime
.
now
()
...
...
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