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
92753179
You need to sign in or sign up before continuing.
Commit
92753179
authored
Oct 01, 2022
by
Hejing Li
Committed by
Antoine Kaufmann
Feb 14, 2023
Browse files
experiments: add memswitch support
parent
251b51f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+37
-0
No files found.
experiments/simbricks/orchestration/simulators.py
View file @
92753179
...
@@ -623,6 +623,43 @@ class SwitchNet(NetSim):
...
@@ -623,6 +623,43 @@ class SwitchNet(NetSim):
return
cleanup
return
cleanup
class
MemSwitchNet
(
NetSim
):
def
__init__
(
self
):
super
().
__init__
()
self
.
sync
=
True
""" AS_ID,VADDR_START,VADDR_END,MEMNODE_MAC,PHYS_START """
self
.
mem_map
=
[]
def
run_cmd
(
self
,
env
):
cmd
=
env
.
repodir
+
'/sims/mem/memswitch/memswitch'
cmd
+=
f
' -S
{
self
.
sync_period
}
-E
{
self
.
eth_latency
}
'
if
not
self
.
sync
:
cmd
+=
' -u'
if
len
(
env
.
pcap_file
)
>
0
:
cmd
+=
' -p '
+
env
.
pcap_file
for
(
_
,
n
)
in
self
.
connect_sockets
(
env
):
cmd
+=
' -s '
+
n
for
(
_
,
n
)
in
self
.
listen_sockets
(
env
):
cmd
+=
' -h '
+
n
for
m
in
self
.
mem_map
:
cmd
+=
' -m '
+
f
'
{
m
[
0
]
}
,
{
m
[
1
]
}
,
{
m
[
2
]
}
,'
cmd
+=
(
''
.
join
(
reversed
(
m
[
3
].
split
(
':'
))))
cmd
+=
f
',
{
m
[
4
]
}
'
return
cmd
def
sockets_cleanup
(
self
,
env
):
# cleanup here will just have listening eth sockets, switch also creates
# shm regions for each with a "-shm" suffix
cleanup
=
[]
for
s
in
super
().
sockets_cleanup
(
env
):
cleanup
.
append
(
s
)
cleanup
.
append
(
s
+
'-shm'
)
return
cleanup
class
TofinoNet
(
NetSim
):
class
TofinoNet
(
NetSim
):
def
__init__
(
self
):
def
__init__
(
self
):
...
...
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