Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
simso
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
6a71b5bc
authored
May 28, 2015
by
Maxime Chéramy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a laxity property to the Job objects.
parent
a3663753
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
simso/core/Job.py
+19
-1
simso/schedulers/EDCL.py
+5
-8
simso/schedulers/EDZL.py
+1
-2
No files found.
simso/core/Job.py
View file @
6a71b5bc
...
@@ -169,16 +169,30 @@ class Job(Process):
...
@@ -169,16 +169,30 @@ class Job(Process):
@property
@property
def
ret
(
self
):
def
ret
(
self
):
"""
"""
Remaining execution time.
Remaining execution time
in ms
.
"""
"""
return
self
.
wcet
-
self
.
actual_computation_time
return
self
.
wcet
-
self
.
actual_computation_time
@property
@property
def
laxity
(
self
):
"""
Dynamic laxity of the job in ms.
"""
return
(
self
.
absolute_deadline
-
self
.
ret
)
*
self
.
sim
.
cycles_per_ms
-
self
.
sim
.
now
()
@property
def
computation_time
(
self
):
def
computation_time
(
self
):
"""
Time spent executing the job in ms.
"""
return
float
(
self
.
computation_time_cycles
)
/
self
.
_sim
.
cycles_per_ms
return
float
(
self
.
computation_time_cycles
)
/
self
.
_sim
.
cycles_per_ms
@property
@property
def
computation_time_cycles
(
self
):
def
computation_time_cycles
(
self
):
"""
Time spent executing the job.
"""
if
self
.
_last_exec
is
None
:
if
self
.
_last_exec
is
None
:
return
int
(
self
.
_computation_time
)
return
int
(
self
.
_computation_time
)
else
:
else
:
...
@@ -187,6 +201,10 @@ class Job(Process):
...
@@ -187,6 +201,10 @@ class Job(Process):
@property
@property
def
actual_computation_time
(
self
):
def
actual_computation_time
(
self
):
"""
Computation time in ms as if the processor speed was 1.0 during the
whole execution.
"""
return
float
(
return
float
(
self
.
actual_computation_time_cycles
)
/
self
.
_sim
.
cycles_per_ms
self
.
actual_computation_time_cycles
)
/
self
.
_sim
.
cycles_per_ms
...
...
simso/schedulers/EDCL.py
View file @
6a71b5bc
...
@@ -21,14 +21,12 @@ class EDCL(Scheduler):
...
@@ -21,14 +21,12 @@ class EDCL(Scheduler):
job
.
cpu
.
resched
()
job
.
cpu
.
resched
()
def
update_laxity
(
self
):
def
update_laxity
(
self
):
for
t
in
self
.
task_list
:
for
task
in
self
.
task_list
:
if
t
.
is_active
():
if
task
.
is_active
():
job
=
t
.
job
job
=
task
.
job
laxity
=
(
job
.
absolute_deadline
-
job
.
ret
)
*
self
.
sim
.
cycles_per_ms
-
self
.
sim
.
now
()
# if laxity is less than 0, the job will never respect its deadline,
# if laxity is less than 0, the job will never respect its deadline,
# so we do not consider this job as critical
# so we do not consider this job as critical
if
laxity
==
0
:
if
job
.
laxity
==
0
:
job
.
data
[
'priority'
]
=
0
job
.
data
[
'priority'
]
=
0
else
:
else
:
job
.
data
[
'priority'
]
=
job
.
absolute_deadline
job
.
data
[
'priority'
]
=
job
.
absolute_deadline
...
@@ -54,4 +52,4 @@ class EDCL(Scheduler):
...
@@ -54,4 +52,4 @@ class EDCL(Scheduler):
if
(
cpu_min
.
running
is
None
or
if
(
cpu_min
.
running
is
None
or
cpu_min
.
running
.
absolute_deadline
>
job
.
absolute_deadline
):
cpu_min
.
running
.
absolute_deadline
>
job
.
absolute_deadline
):
return
(
job
,
cpu_min
)
return
(
job
,
cpu_min
)
\ No newline at end of file
simso/schedulers/EDZL.py
View file @
6a71b5bc
...
@@ -58,8 +58,7 @@ class EDZL(Scheduler):
...
@@ -58,8 +58,7 @@ class EDZL(Scheduler):
# Recherche du prochain event ZeroLaxity pour configurer le timer.
# Recherche du prochain event ZeroLaxity pour configurer le timer.
minimum
=
None
minimum
=
None
for
job
in
self
.
ready_list
:
for
job
in
self
.
ready_list
:
zl_date
=
int
((
job
.
absolute_deadline
-
job
.
ret
zl_date
=
job
.
laxity
)
*
self
.
sim
.
cycles_per_ms
-
self
.
sim
.
now
())
if
(
minimum
is
None
or
minimum
[
0
]
>
zl_date
)
and
zl_date
>
0
:
if
(
minimum
is
None
or
minimum
[
0
]
>
zl_date
)
and
zl_date
>
0
:
minimum
=
(
zl_date
,
job
)
minimum
=
(
zl_date
,
job
)
...
...
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