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
39cf74ee
Commit
39cf74ee
authored
Nov 22, 2020
by
Hejing Li
Browse files
simulators.py: add dctcp host create
parent
b1fef328
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
experiments/modes/simulators.py
experiments/modes/simulators.py
+30
-1
No files found.
experiments/modes/simulators.py
View file @
39cf74ee
...
...
@@ -18,6 +18,7 @@ class HostSim(Simulator):
name
=
''
wait
=
False
sleep
=
0
cpu_freq
=
'3GHz'
def
__init__
(
self
):
self
.
nics
=
[]
...
...
@@ -93,6 +94,7 @@ class Gem5Host(HostSim):
cpu_type_cp
=
'X86KvmCPU'
cpu_type
=
'TimingSimpleCPU'
def
set_config
(
self
,
nc
):
nc
.
sim
=
'gem5'
super
().
set_config
(
nc
)
...
...
@@ -114,7 +116,7 @@ class Gem5Host(HostSim):
cmd
=
(
f
'
{
env
.
gem5_path
}
--outdir=
{
env
.
gem5_outdir
(
self
)
}
'
f
'
{
env
.
gem5_py_path
}
--caches --l2cache --l3cache '
'--l1d_size=32kB --l1i_size=32kB --l2_size=2MB --l3_size=32MB '
'--cacheline_size=64 --cpu-clock=
3GHz
'
f
'--cacheline_size=64 --cpu-clock=
{
self
.
cpu_freq
}
'
f
'--checkpoint-dir=
{
env
.
gem5_cpdir
(
self
)
}
'
f
'--kernel=
{
env
.
gem5_kernel_path
}
'
f
'--disk-image=
{
env
.
hd_raw_path
(
self
.
node_config
.
disk_image
)
}
'
...
...
@@ -235,3 +237,30 @@ def create_basic_hosts(e, num, name_prefix, net, nic_class, host_class,
hosts
.
append
(
host
)
return
hosts
def
create_dctcp_hosts
(
e
,
num
,
name_prefix
,
net
,
nic_class
,
host_class
,
nc_class
,
app_class
,
cpu_freq
,
mtu
,
ip_start
=
1
):
hosts
=
[]
for
i
in
range
(
0
,
num
):
nic
=
nic_class
()
#nic.name = '%s.%d' % (name_prefix, i)
nic
.
set_network
(
net
)
host
=
host_class
()
host
.
name
=
'%s.%d'
%
(
name_prefix
,
i
)
host
.
freq
=
cpu_freq
node_config
=
nc_class
()
node_config
.
mtu
=
mtu
node_config
.
ip
=
'192.168.64.%d'
%
(
ip_start
+
i
)
node_config
.
app
=
app_class
()
host
.
set_config
(
node_config
)
host
.
add_nic
(
nic
)
e
.
add_nic
(
nic
)
e
.
add_host
(
host
)
hosts
.
append
(
host
)
return
hosts
\ No newline at end of file
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