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
113c8fbd
"git@developer.sourcefind.cn:cnjsdfcy/simbricks.git" did not exist on "3423cf0f96db9df1fa4e5bbfd5ce525d7c0b2662"
Commit
113c8fbd
authored
Apr 21, 2021
by
Hejing Li
Browse files
Merge branch 'master' of github.com:simbricks/simbricks
parents
0b4d507b
878a01f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
28 deletions
+42
-28
.gitignore
.gitignore
+1
-0
README.md
README.md
+32
-19
experiments/simbricks/simulators.py
experiments/simbricks/simulators.py
+9
-9
No files found.
.gitignore
View file @
113c8fbd
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
*.ko
*.ko
.*.cmd
.*.cmd
*.pyc
*.pyc
*.swp
__pycache__/
__pycache__/
_vimrc_local.vim
_vimrc_local.vim
sims/nic/corundum/obj_dir
sims/nic/corundum/obj_dir
...
...
README.md
View file @
113c8fbd
...
@@ -15,33 +15,46 @@ Code structure:
...
@@ -15,33 +15,46 @@ Code structure:
+
`netsim_common/`
: helper library for network simulations
+
`netsim_common/`
: helper library for network simulations
+
`libnicbm/`
: helper library for behavioral nic models
+
`libnicbm/`
: helper library for behavioral nic models
# Dependencies
-
Tested to work on Ubuntu 18.04
-
Verilator (branch v4.010)
-
unzip
-
libpcap-dev
-
libglib2.0-dev
-
python (>= 3.7)
-
libgoogle-perftools-dev
-
libboost-iostreams-dev
-
scons
-
ninja-build
-
libpixman-1-dev
-
qemu
# Building
# Building
-
`unzip`
,
`libpcap-dev`
-
External dependencies for qemu:
`libglib2.0-dev libpixman-1-dev`
-
External dependencies for gem5:
`scons`
,
`python-dev`
,
`libgoogle-perftools-dev`
Then build everything with:
First, initialize all submodules:
```
git submodule init
git submodule update
```
Then, build the project, all submodules, and experiment images:
```
```
make -j`nproc` all external build-images
make -j`nproc` all external build-images
```
```
Note: building system images requires KVM support (and KVM permissions).
# Running
# Running
We use the scripts in the
`experiments/`
directory.
`make`
in that directory
A list of available simulations is listed in
`experiments/pyexps`
.
should run all the experiments for the paper. This will take a while (>>1h).
While simulations can be run in parallel, some of them use a lot of core, and we
To run one of the simulations:
currently don't have jobserver integration, so blindly running make with a high
```
`-j`
parameter here is a bad idea. You can run individual experiment (see
cd experiments
`experiments/*`
for their names) with
`make out/$NAME/1/ready`
, which will
python3 run.py pyexps/EXP
result in log files in
`out/$NAME/1/`
. Start with one of the qemu simulations.
```
where
`EXP`
is the name of the simulation file.
To run the experiments multiple times which restore from the common check point,
the script should be added to EXP_CP in experiments/makefile. There should be a
pair script has "-mck" as suffix to that experiment script to make the check point.
(eg. gem5-timing-corundum-verilator-pair-cp.sh AND gem5-timing-corundum-verilator-pair-cp-mck.sh)
The script doesn't need to restore from the common check point, should be added to
EXP_NCP in experiments/makefile
## Running Qemu
## Running Qemu
...
...
experiments/simbricks/simulators.py
View file @
113c8fbd
...
@@ -223,30 +223,30 @@ class CorundumVerilatorNIC(NICSim):
...
@@ -223,30 +223,30 @@ class CorundumVerilatorNIC(NICSim):
return
512
return
512
def
run_cmd
(
self
,
env
):
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
))
str
(
self
.
clock_freq
))
class
CorundumBMNIC
(
NICSim
):
class
CorundumBMNIC
(
NICSim
):
def
run_cmd
(
self
,
env
):
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
):
class
I40eNIC
(
NICSim
):
def
run_cmd
(
self
,
env
):
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
):
class
WireNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
def
run_cmd
(
self
,
env
):
assert
len
(
self
.
nics
)
==
2
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
+
'/sims/net'
,
env
.
nic_eth_path
(
self
.
nics
[
0
]),
(
env
.
repodir
,
env
.
nic_eth_path
(
self
.
nics
[
0
]),
env
.
nic_eth_path
(
self
.
nics
[
1
]),
env
.
nic_eth_path
(
self
.
nics
[
1
]),
self
.
sync_mode
,
self
.
sync_period
,
self
.
eth_latency
)
self
.
sync_mode
,
self
.
sync_period
,
self
.
eth_latency
)
class
SwitchNet
(
NetSim
):
class
SwitchNet
(
NetSim
):
def
run_cmd
(
self
,
env
):
def
run_cmd
(
self
,
env
):
cmd
=
env
.
repodir
+
'/sims/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
}
'
cmd
+=
f
' -m
{
self
.
sync_mode
}
-S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
'
for
n
in
self
.
nics
:
for
n
in
self
.
nics
:
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
cmd
+=
' -s '
+
env
.
nic_eth_path
(
n
)
...
@@ -262,7 +262,7 @@ class NS3DumbbellNet(NetSim):
...
@@ -262,7 +262,7 @@ class NS3DumbbellNet(NetSim):
else
:
else
:
ports
+=
'--CosimPortRight='
+
env
.
nic_eth_path
(
n
)
+
' '
ports
+=
'--CosimPortRight='
+
env
.
nic_eth_path
(
n
)
+
' '
cmd
=
env
.
repodir
+
'/sims/external
'
+
'
/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
)
print
(
cmd
)
return
cmd
return
cmd
...
@@ -273,7 +273,7 @@ class NS3BridgeNet(NetSim):
...
@@ -273,7 +273,7 @@ class NS3BridgeNet(NetSim):
for
n
in
self
.
nics
:
for
n
in
self
.
nics
:
ports
+=
'--CosimPort='
+
env
.
nic_eth_path
(
n
)
+
' '
ports
+=
'--CosimPort='
+
env
.
nic_eth_path
(
n
)
+
' '
cmd
=
env
.
repodir
+
'/sims/external
'
+
'
/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
)
print
(
cmd
)
return
cmd
return
cmd
...
@@ -290,7 +290,7 @@ class NS3SequencerNet(NetSim):
...
@@ -290,7 +290,7 @@ class NS3SequencerNet(NetSim):
ports
+=
'--EndhostSequencerPort='
+
env
.
nic_eth_path
(
n
)
+
' '
ports
+=
'--EndhostSequencerPort='
+
env
.
nic_eth_path
(
n
)
+
' '
else
:
else
:
raise
Exception
(
'Wrong NIC type'
)
raise
Exception
(
'Wrong NIC type'
)
cmd
=
env
.
repodir
+
'/sims/external
'
+
'
/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
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