Commit fe223e29 authored by Hejing Li's avatar Hejing Li
Browse files

some error fixes

parent eb611e2c
......@@ -23,6 +23,7 @@
from __future__ import annotations
import abc
import itertools
import time
import typing as tp
import simbricks.orchestration.system as sys_conf
......@@ -51,7 +52,7 @@ class Simulator(utils_base.IdObj):
self.extra_deps: list[Simulator] = []
self.name: str = ""
self.experiment: sim_base.Simulation = simulation
self._components: set[sys_conf.Component] = []
self._components: set[sys_conf.Component] = set()
self._relative_executable_path: str = relative_executable_path
@staticmethod
......@@ -311,8 +312,6 @@ class Simulation(utils_base.IdObj):
def all_simulators(self) -> tp.Iterable[Simulator]:
"""Returns all simulators defined to run in this experiment."""
# TODO: FIXME
raise Exception("needs fixed implementation")
return itertools.chain(
self.hosts, self.pcidevs, self.memdevs, self.netmems, self.networks
)
......
......@@ -37,7 +37,7 @@ class HostSim(sim_base.Simulator):
def __init__(self, e: sim_base.Simulation):
super().__init__(e)
self.hosts: tp.List['Host']
self.hosts: tp.List['Host'] = []
self.wait = True
def full_name(self) -> str:
......@@ -54,7 +54,7 @@ class HostSim(sim_base.Simulator):
def add(self, host: 'Host'):
self.hosts.append(host)
self.name = f'{self.hosts.id}'
self.name = f'{self._id}'
self.experiment.add_host(self)
self.experiment.sys_sim_map[host] = self
......
......@@ -59,14 +59,15 @@ class NICSim(PCIDevSim):
def __init__(self, e: base.Simulation) -> None:
super().__init__(e)
self.experiment = e
self.nics: tp.List[PCIDevSim] = []
self.nics: tp.List[sys_conf.SimplePCIeNIC] = []
self.start_tick = 0
def add(self, nic: PCIDevSim):
def add(self, nic: sys_conf.SimplePCIeNIC):
self.nics.append(nic)
# nic.sim = self
self.experiment.add_nic(self)
self.name = f'{nic.id}'
self.experiment.sys_sim_map[nic] = self
self.name = f'{nic._id}'
def basic_args(self, env: ExpEnv, extra: tp.Optional[str] = None) -> str:
cmd = (
......
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