"...resnet50_tensorflow.git" did not exist on "2b436a1285ec07bf2f1fe5f9ffef6bafdef0de76"
Commit cbd825e1 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

HostSim: pass node_config in __init__

parent 74a9f167
...@@ -195,9 +195,9 @@ class NetSim(Simulator): ...@@ -195,9 +195,9 @@ class NetSim(Simulator):
class HostSim(Simulator): class HostSim(Simulator):
"""Base class for host simulators.""" """Base class for host simulators."""
def __init__(self): def __init__(self, node_config: NodeConfig):
super().__init__() super().__init__()
self.node_config: tp.Optional[NodeConfig] = None self.node_config = node_config
"""Config for the simulated host. """ """Config for the simulated host. """
self.name = '' self.name = ''
self.wait = False self.wait = False
...@@ -229,9 +229,6 @@ class HostSim(Simulator): ...@@ -229,9 +229,6 @@ class HostSim(Simulator):
net.hosts_direct.append(self) net.hosts_direct.append(self)
self.net_directs.append(net) self.net_directs.append(net)
def set_config(self, nc: NodeConfig):
self.node_config = nc
def dependencies(self): def dependencies(self):
deps = [] deps = []
for dev in self.pcidevs: for dev in self.pcidevs:
...@@ -247,8 +244,8 @@ class HostSim(Simulator): ...@@ -247,8 +244,8 @@ class HostSim(Simulator):
class QemuHost(HostSim): class QemuHost(HostSim):
"""Qemu host simulator.""" """Qemu host simulator."""
def __init__(self): def __init__(self, node_config: NodeConfig):
super().__init__() super().__init__(node_config)
self.sync = False self.sync = False
self.cpu_freq = '4GHz' self.cpu_freq = '4GHz'
...@@ -314,8 +311,9 @@ class QemuHost(HostSim): ...@@ -314,8 +311,9 @@ class QemuHost(HostSim):
class Gem5Host(HostSim): class Gem5Host(HostSim):
"""Gem5 host simulator.""" """Gem5 host simulator."""
def __init__(self): def __init__(self, node_config: NodeConfig):
super().__init__() node_config.sim = 'gem5'
super().__init__(node_config)
self.cpu_type_cp = 'X86KvmCPU' self.cpu_type_cp = 'X86KvmCPU'
self.cpu_type = 'TimingSimpleCPU' self.cpu_type = 'TimingSimpleCPU'
self.sys_clock = '1GHz' self.sys_clock = '1GHz'
...@@ -323,10 +321,6 @@ class Gem5Host(HostSim): ...@@ -323,10 +321,6 @@ class Gem5Host(HostSim):
self.extra_config_args = [] self.extra_config_args = []
self.variant = 'fast' self.variant = 'fast'
def set_config(self, nc):
nc.sim = 'gem5'
super().set_config(nc)
def resreq_cores(self): def resreq_cores(self):
return 1 return 1
......
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