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
6ae843e2
authored
Dec 01, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved to simpy4 processes
parent
ab0cc5e1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
17 deletions
+16
-17
script.py
+2
-1
simso/core/Job.py
+3
-4
simso/core/Processor.py
+10
-11
simso/core/Task.py
+1
-1
No files found.
script.py
View file @
6ae843e2
...
...
@@ -19,7 +19,7 @@ def main(argv):
configuration
.
cycles_per_ms
=
1
configuration
.
duration
=
4
20
*
configuration
.
cycles_per_ms
configuration
.
duration
=
20
*
configuration
.
cycles_per_ms
# Add tasks:
configuration
.
add_task
(
name
=
"T1"
,
identifier
=
1
,
period
=
7
,
...
...
@@ -49,4 +49,5 @@ def main(argv):
for
log
in
model
.
logs
:
print
(
log
)
main
(
sys
.
argv
)
simso/core/Job.py
View file @
6ae843e2
...
...
@@ -49,12 +49,11 @@ class Job:
self
.
_on_activate
()
self
.
process
=
None
self
.
processor_ok
=
self
.
_sim
.
event
()
self
.
context_ok
=
self
.
_sim
.
event
()
self
.
context_ok
.
succeed
()
self
.
context_ready
=
True
self
.
process
=
self
.
_sim
.
process
(
self
.
activate_job
())
def
is_active
(
self
):
"""
...
...
@@ -93,7 +92,7 @@ class Job:
self
.
_monitor
.
observe
(
JobEvent
(
self
,
JobEvent
.
PREEMPTED
))
self
.
_sim
.
logger
.
log
(
self
.
name
+
" Preempted! ret: "
+
str
(
"Don't know what to pass else?"
),
kernel
=
True
)
# TODO: what to pass as interrupted?
str
(
self
.
ret
),
kernel
=
True
)
# TODO: what to pass as interrupted?
def
_on_terminated
(
self
):
self
.
_on_stop_exec
()
...
...
simso/core/Processor.py
View file @
6ae843e2
...
...
@@ -150,33 +150,32 @@ class Processor:
if
not
self
.
_evts
:
job
=
self
.
_running
if
job
:
# yield job.context_ok
while
not
job
.
context_ready
:
yield
self
.
_model
.
timeout
(
1
)
yield
job
.
context_ok
self
.
monitor
.
observe
(
ProcCxtLoadEvent
())
# overhead load context
yield
self
.
_model
.
timeout
(
self
.
cl_overhead
)
self
.
monitor
.
observe
(
ProcCxtLoadEvent
(
terminated
=
True
))
# job.interruptReset() # TODO: does this interrupt need handling?
job
.
processor_ok
.
succeed
()
job
.
processor_ok
=
self
.
_model
.
event
()
self
.
monitor
.
observe
(
ProcRunEvent
(
job
))
job
.
context_ready
=
False
else
:
self
.
monitor
.
observe
(
ProcIdleEvent
())
# Wait event.
first_yield
=
True
while
not
self
.
_evts
:
yield
self
.
_model
.
timeout
(
1
)
if
job
:
# self._model.interrupt(job)
# job.process.interrupt()
if
first_yield
:
yield
self
.
_model
.
timeout
(
0
)
first_yield
=
False
else
:
yield
self
.
_model
.
timeout
(
1
)
if
job
and
job
.
is_active
():
job
.
process
.
interrupt
()
self
.
monitor
.
observe
(
ProcCxtSaveEvent
())
# overhead save context
yield
self
.
_model
.
timeout
(
self
.
cs_overhead
)
self
.
monitor
.
observe
(
ProcCxtSaveEvent
(
terminated
=
True
))
# job.context_ok = self._model.event()
job
.
context_ready
=
True
job
.
context_ok
=
self
.
_model
.
event
()
evt
=
self
.
_evts
.
popleft
()
if
evt
[
0
]
==
RESCHED
:
...
...
simso/core/Task.py
View file @
6ae843e2
...
...
@@ -285,7 +285,7 @@ class GenericTask:
if
len
(
self
.
_activations_fifo
)
==
0
:
self
.
job
=
job
self
.
_sim
.
process
(
job
.
activate_job
())
job
.
process
=
self
.
_sim
.
process
(
job
.
activate_job
())
self
.
_activations_fifo
.
append
(
job
)
self
.
_jobs
.
append
(
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