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
0b4d507b
Commit
0b4d507b
authored
Apr 04, 2021
by
Hejing Li
Browse files
correct sim path
parent
c52dfdef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
experiments/run.py
experiments/run.py
+1
-0
experiments/simbricks/experiments.py
experiments/simbricks/experiments.py
+4
-4
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+6
-6
No files found.
experiments/run.py
View file @
0b4d507b
...
...
@@ -24,6 +24,7 @@ import argparse
import
sys
import
os
import
importlib
import
importlib.util
import
pickle
import
fnmatch
import
simbricks.experiments
as
exp
...
...
experiments/simbricks/experiments.py
View file @
0b4d507b
...
...
@@ -187,11 +187,11 @@ class ExpEnv(object):
self
.
repodir
=
os
.
path
.
abspath
(
repo_path
)
self
.
workdir
=
os
.
path
.
abspath
(
workdir
)
self
.
cpdir
=
os
.
path
.
abspath
(
cpdir
)
self
.
qemu_img_path
=
self
.
repodir
+
'/qemu/build/qemu-img'
self
.
qemu_path
=
self
.
repodir
+
'/qemu/build/x86_64-softmmu/qemu-system-x86_64'
self
.
qemu_img_path
=
self
.
repodir
+
'/
sims/external/
qemu/build/qemu-img'
self
.
qemu_path
=
self
.
repodir
+
'/
sims/external/
qemu/build/x86_64-softmmu/qemu-system-x86_64'
self
.
qemu_kernel_path
=
self
.
repodir
+
'/images/bzImage'
self
.
gem5_path
=
self
.
repodir
+
'/gem5/build/X86/gem5.opt'
self
.
gem5_py_path
=
self
.
repodir
+
'/gem5/configs/simbricks/simbricks.py'
self
.
gem5_path
=
self
.
repodir
+
'/
sims/external/
gem5/build/X86/gem5.opt'
self
.
gem5_py_path
=
self
.
repodir
+
'/
sims/external/
gem5/configs/simbricks/simbricks.py'
self
.
gem5_kernel_path
=
self
.
repodir
+
'/images/vmlinux'
def
hdcopy_path
(
self
,
sim
):
...
...
experiments/simbricks/simulators.py
View file @
0b4d507b
...
...
@@ -76,7 +76,7 @@ class NICSim(Simulator):
def
basic_run_cmd
(
self
,
env
,
name
,
extra
=
None
):
cmd
=
'%s/%s %s %s %s %d 0 %d %d %d'
%
\
(
env
.
repodir
,
name
,
env
.
nic_pci_path
(
self
),
env
.
nic_eth_path
(
self
),
(
env
.
repodir
+
'/sims/nic'
,
name
,
env
.
nic_pci_path
(
self
),
env
.
nic_eth_path
(
self
),
env
.
nic_shm_path
(
self
),
self
.
sync_mode
,
self
.
sync_period
,
self
.
pci_latency
,
self
.
eth_latency
)
...
...
@@ -240,13 +240,13 @@ class WireNet(NetSim):
def
run_cmd
(
self
,
env
):
assert
len
(
self
.
nics
)
==
2
return
'%s/net_wire/net_wire %s %s %d %d %d'
%
\
(
env
.
repodir
,
env
.
nic_eth_path
(
self
.
nics
[
0
]),
(
env
.
repodir
+
'/sims/net'
,
env
.
nic_eth_path
(
self
.
nics
[
0
]),
env
.
nic_eth_path
(
self
.
nics
[
1
]),
self
.
sync_mode
,
self
.
sync_period
,
self
.
eth_latency
)
class
SwitchNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
cmd
=
env
.
repodir
+
'/
net_
switch/net_switch'
cmd
=
env
.
repodir
+
'/
sims/net'
+
'/
switch/net_switch'
cmd
+=
f
' -m
{
self
.
sync_mode
}
-S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
'
for
n
in
self
.
nics
:
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
...
...
@@ -262,7 +262,7 @@ class NS3DumbbellNet(NetSim):
else
:
ports
+=
'--CosimPortRight='
+
env
.
nic_eth_path
(
n
)
+
' '
cmd
=
env
.
repodir
+
'/ns-3'
+
'/cosim-run.sh cosim cosim-dumbbell-example '
+
ports
+
' '
+
self
.
opt
cmd
=
env
.
repodir
+
'/sims/external'
+
'/ns-3'
+
'/cosim-run.sh cosim cosim-dumbbell-example '
+
ports
+
' '
+
self
.
opt
print
(
cmd
)
return
cmd
...
...
@@ -273,7 +273,7 @@ class NS3BridgeNet(NetSim):
for
n
in
self
.
nics
:
ports
+=
'--CosimPort='
+
env
.
nic_eth_path
(
n
)
+
' '
cmd
=
env
.
repodir
+
'/ns-3'
+
'/cosim-run.sh cosim cosim-bridge-example '
+
ports
+
' '
+
self
.
opt
cmd
=
env
.
repodir
+
'/sims/external'
+
'/ns-3'
+
'/cosim-run.sh cosim cosim-bridge-example '
+
ports
+
' '
+
self
.
opt
print
(
cmd
)
return
cmd
...
...
@@ -290,7 +290,7 @@ class NS3SequencerNet(NetSim):
ports
+=
'--EndhostSequencerPort='
+
env
.
nic_eth_path
(
n
)
+
' '
else
:
raise
Exception
(
'Wrong NIC type'
)
cmd
=
env
.
repodir
+
'/ns-3'
+
'/cosim-run.sh sequencer sequencer-single-switch-example '
+
ports
+
' '
+
self
.
opt
cmd
=
env
.
repodir
+
'/sims/external'
+
'/ns-3'
+
'/cosim-run.sh sequencer sequencer-single-switch-example '
+
ports
+
' '
+
self
.
opt
return
cmd
...
...
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