Commit 4aeb3c90 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: automatically set gem5 type in node config

parent 472f608c
......@@ -29,6 +29,9 @@ class HostSim(Simulator):
nic.name = self.name + '.' + nic.name
self.nics.append(nic)
def set_config(self, nc):
self.node_config = nc
class NICSim(Simulator):
network = None
name = ''
......@@ -92,6 +95,10 @@ class Gem5Host(HostSim):
cpu_type_cp = 'X86KvmCPU'
cpu_type = 'TimingSimpleCPU'
def set_config(self, nc):
nc.sim = 'gem5'
super().set_config(nc)
def resreq_cores(self):
return 1
......@@ -175,9 +182,12 @@ def create_basic_hosts(e, num, name_prefix, net, nic_class, host_class,
host = host_class()
host.name = '%s.%d' % (name_prefix, i)
host.node_config = nc_class()
host.node_config.ip = '10.0.0.%d' % (ip_start + i)
host.node_config.app = app_class()
node_config = nc_class()
node_config.ip = '10.0.0.%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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment