Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
250f2ec7
Commit
250f2ec7
authored
Sep 23, 2024
by
Hejing Li
Browse files
simulation/host.py: fix dependency
parent
01f4aa6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
experiments/simbricks/orchestration/simulation/host.py
experiments/simbricks/orchestration/simulation/host.py
+14
-8
No files found.
experiments/simbricks/orchestration/simulation/host.py
View file @
250f2ec7
...
@@ -46,11 +46,17 @@ class HostSim(sim_base.Simulator):
...
@@ -46,11 +46,17 @@ class HostSim(sim_base.Simulator):
def
dependencies
(
self
)
->
tp
.
List
[
sim_base
.
Simulator
]:
def
dependencies
(
self
)
->
tp
.
List
[
sim_base
.
Simulator
]:
deps
=
[]
deps
=
[]
for
h
in
self
.
hos
ts
:
for
h
in
self
.
_componen
ts
:
for
dev
in
h
.
ifs
:
for
dev
in
h
.
ifs
:
# todo: find_sim looks up all the component-simulator mappings
if
not
dev
.
is_connected
():
# from experimetn object and returns the simulator used for this component
raise
Exception
(
"host interface is not connected"
)
deps
.
append
(
self
.
experiment
.
find_sim
(
dev
.
component
))
else
:
if
dev
.
channel
.
a
==
dev
:
peer_if
=
dev
.
channel
.
b
else
:
peer_if
=
dev
.
channel
.
a
deps
.
append
(
self
.
_simulation
.
find_sim
(
peer_if
.
component
))
return
deps
return
deps
def
add
(
self
,
host
:
'Host'
):
def
add
(
self
,
host
:
'Host'
):
...
@@ -131,11 +137,11 @@ class Gem5Sim(HostSim):
...
@@ -131,11 +137,11 @@ class Gem5Sim(HostSim):
def
prep_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
tp
.
List
[
str
]:
def
prep_cmds
(
self
,
inst
:
inst_base
.
Instantiation
)
->
tp
.
List
[
str
]:
cmds
=
[
f
'mkdir -p
{
env
.
gem5_cpdir
(
self
)
}
'
]
cmds
=
[
f
'mkdir -p
{
inst
.
_env
.
_cpdir
}
'
]
if
inst
.
env
.
restore_cp
and
self
.
modify_checkpoint_tick
:
if
inst
.
_
env
.
_
restore_cp
and
self
.
modify_checkpoint_tick
:
cmds
.
append
(
cmds
.
append
(
f
'python3
{
env
.
utilsdir
}
/modify_gem5_cp_tick.py --tick 0 '
f
'python3
{
inst
.
utilsdir
}
/modify_gem5_cp_tick.py --tick 0 '
f
'--cpdir
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--cpdir
{
inst
.
gem5_cpdir
(
self
)
}
'
)
)
return
cmds
return
cmds
...
...
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