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
913f172f
Commit
913f172f
authored
Jun 05, 2022
by
Antoine Kaufmann
Browse files
experiments: add pci validation experiment
parent
f301750d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
experiments/pyexps/pci_validation.py
experiments/pyexps/pci_validation.py
+81
-0
No files found.
experiments/pyexps/pci_validation.py
0 → 100644
View file @
913f172f
# Copyright 2021 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Validation experiment for our PCI interface by running with the builtin gem5
e1000 NIC, and then with the extracted gem5 e1000 NIC connected through
SimBricks."""
import
simbricks.experiments
as
exp
import
simbricks.simulators
as
sim
import
simbricks.nodeconfig
as
node
experiments
=
[]
for
internal
in
[
True
,
False
]:
if
internal
:
e
=
exp
.
Experiment
(
'pci_validation-internal'
)
else
:
e
=
exp
.
Experiment
(
'pci_validation-external'
)
e
.
checkpoint
=
False
net
=
sim
.
SwitchNet
()
e
.
add_network
(
net
)
server
=
sim
.
Gem5Host
()
server
.
name
=
'server'
nc_server
=
node
.
E1000LinuxNode
()
nc_server
.
prefix
=
24
nc_server
.
ip
=
'10.0.0.1'
nc_server
.
force_mac_addr
=
'00:90:00:00:00:01'
nc_server
.
app
=
node
.
NetperfServer
()
server
.
set_config
(
nc_server
)
e
.
add_host
(
server
)
client
=
sim
.
Gem5Host
()
client
.
name
=
'client'
nc_client
=
node
.
E1000LinuxNode
()
nc_client
.
prefix
=
24
nc_client
.
ip
=
'10.0.0.2'
nc_client
.
force_mac_addr
=
'00:90:00:00:00:02'
nc_client
.
app
=
node
.
NetperfClient
()
nc_client
.
app
.
server_ip
=
'10.0.0.1'
nc_client
.
app
.
duration_tp
=
-
1000000
nc_client
.
app
.
duration_lat
=
-
1000
client
.
set_config
(
nc_client
)
client
.
wait
=
True
e
.
add_host
(
client
)
for
h
in
[
client
,
server
]:
h
.
cpu_type
=
h
.
cpu_type_cp
=
'TimingSimpleCPU'
h
.
extra_main_args
.
append
(
'--debug-flags=SimBricksEthernet,SimBricksPci,EthernetAll,EthernetDesc'
)
if
internal
:
h
.
add_netdirect
(
net
)
else
:
nic
=
sim
.
E1000NIC
()
nic
.
debug
=
True
nic
.
set_network
(
net
)
# force same mac address in HW as in gem5 (same default for both)
nic
.
mac
=
'00:90:00:00:00:01'
h
.
add_nic
(
nic
)
e
.
add_nic
(
nic
)
experiments
.
append
(
e
)
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