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
f7d76917
Commit
f7d76917
authored
Jun 19, 2020
by
Antoine Kaufmann
Browse files
experiments: add ns3 bridge experiment
parent
98ae1d1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
experiments/Makefile
experiments/Makefile
+1
-0
experiments/common-functions.sh
experiments/common-functions.sh
+21
-0
experiments/experiments/qemu-ns3-bridge-pair.sh
experiments/experiments/qemu-ns3-bridge-pair.sh
+14
-0
No files found.
experiments/Makefile
View file @
f7d76917
...
...
@@ -12,6 +12,7 @@ EXPERIMENTS := \
qemu-corundum-verilator-pair
\
gem5-kvm-corundum-bm-pair
\
gem5-timing-corundum-verilator-pair
\
qemu-ns3-bridge-pair
\
BUILDDIR
:=
build
OUTDIR
:=
out
...
...
experiments/common-functions.sh
View file @
f7d76917
...
...
@@ -22,6 +22,11 @@ if [ ! -d "$GEM5_BASE" ] ; then
"(local-config.sh)"
exit
1
fi
if
[
!
-d
"
$NS3_BASE
"
]
;
then
echo
"
\$
NS3_BASE should be set to the absolute path to a built ns3 repo"
\
"(local-config.sh)"
exit
1
fi
QEMU_IMAGE
=
$EHSIM_BASE
/images/output-ubuntu1804/ubuntu1804
QEMU_KERNEL
=
$EHSIM_BASE
/images/bzImage
...
...
@@ -125,6 +130,22 @@ run_wire() {
return
$pid
}
# Args:
# - Instance name
# - Port names
run_ns3_bridge
()
{
ports
=
""
for
p
in
$2
;
do
epath
=
"
`
readlink
-f
$OUTDIR
/eth.
$p
`
"
ports
=
"
$ports
--CosimPort=
$epath
"
done
$NS3_BASE
/cosim-run.sh cosim-bridge-example
\
$ports
&>
$OUTDIR
/ns3_bridge.
$1
.log &
pid
=
$!
ALL_PIDS
=
"
$ALL_PIDS
$pid
"
return
$pid
}
cleanup
()
{
echo
Cleaning up
for
p
in
$ALL_PIDS
;
do
...
...
experiments/experiments/qemu-ns3-bridge-pair.sh
0 → 100644
View file @
f7d76917
#!/bin/bash
source
common-functions.sh
init_out qemu-ns3-bridge-pair
run_corundum_bm a
run_corundum_bm b
sleep
0.5
run_ns3_bridge ab
"a b"
run_qemu a a build/qemu-pair-server.tar
run_qemu b b build/qemu-pair-client.tar
client_pid
=
$!
wait
$client_pid
cleanup
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