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
0edb169b
Commit
0edb169b
authored
Apr 04, 2021
by
Jialin Li
Browse files
experiments: update experiment scripts to match new repo structure
parent
c52dfdef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
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
+8
-8
No files found.
experiments/run.py
View file @
0edb169b
...
...
@@ -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 @
0edb169b
...
...
@@ -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 @
0edb169b
...
...
@@ -223,30 +223,30 @@ class CorundumVerilatorNIC(NICSim):
return
512
def
run_cmd
(
self
,
env
):
return
self
.
basic_run_cmd
(
env
,
'corundum/corundum_verilator'
,
return
self
.
basic_run_cmd
(
env
,
'
sims/nic/
corundum/corundum_verilator'
,
str
(
self
.
clock_freq
))
class
CorundumBMNIC
(
NICSim
):
def
run_cmd
(
self
,
env
):
return
self
.
basic_run_cmd
(
env
,
'corundum_bm/corundum_bm'
)
return
self
.
basic_run_cmd
(
env
,
'
sims/nic/
corundum_bm/corundum_bm'
)
class
I40eNIC
(
NICSim
):
def
run_cmd
(
self
,
env
):
return
self
.
basic_run_cmd
(
env
,
'i40e_bm/i40e_bm'
)
return
self
.
basic_run_cmd
(
env
,
'
sims/nic/
i40e_bm/i40e_bm'
)
class
WireNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
assert
len
(
self
.
nics
)
==
2
return
'%s/net
_
wire/net_wire %s %s %d %d %d'
%
\
return
'%s/
sims/
net
/
wire/net_wire %s %s %d %d %d'
%
\
(
env
.
repodir
,
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