"vscode:/vscode.git/clone" did not exist on "7b55d334d592037b1bb9b3389ce26828a3073407"
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): ...@@ -29,6 +29,9 @@ class HostSim(Simulator):
nic.name = self.name + '.' + nic.name nic.name = self.name + '.' + nic.name
self.nics.append(nic) self.nics.append(nic)
def set_config(self, nc):
self.node_config = nc
class NICSim(Simulator): class NICSim(Simulator):
network = None network = None
name = '' name = ''
...@@ -92,6 +95,10 @@ class Gem5Host(HostSim): ...@@ -92,6 +95,10 @@ class Gem5Host(HostSim):
cpu_type_cp = 'X86KvmCPU' cpu_type_cp = 'X86KvmCPU'
cpu_type = 'TimingSimpleCPU' cpu_type = 'TimingSimpleCPU'
def set_config(self, nc):
nc.sim = 'gem5'
super().set_config(nc)
def resreq_cores(self): def resreq_cores(self):
return 1 return 1
...@@ -175,9 +182,12 @@ def create_basic_hosts(e, num, name_prefix, net, nic_class, host_class, ...@@ -175,9 +182,12 @@ def create_basic_hosts(e, num, name_prefix, net, nic_class, host_class,
host = host_class() host = host_class()
host.name = '%s.%d' % (name_prefix, i) host.name = '%s.%d' % (name_prefix, i)
host.node_config = nc_class()
host.node_config.ip = '10.0.0.%d' % (ip_start + i) node_config = nc_class()
host.node_config.app = app_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) host.add_nic(nic)
e.add_nic(nic) e.add_nic(nic)
e.add_host(host) 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