Commit 250f2ec7 authored by Hejing Li's avatar Hejing Li
Browse files

simulation/host.py: fix dependency

parent 01f4aa6e
...@@ -46,11 +46,17 @@ class HostSim(sim_base.Simulator): ...@@ -46,11 +46,17 @@ class HostSim(sim_base.Simulator):
def dependencies(self) -> tp.List[sim_base.Simulator]: def dependencies(self) -> tp.List[sim_base.Simulator]:
deps = [] deps = []
for h in self.hosts: for h in self._components:
for dev in h.ifs: for dev in h.ifs:
# todo: find_sim looks up all the component-simulator mappings if not dev.is_connected():
# from experimetn object and returns the simulator used for this component raise Exception("host interface is not connected")
deps.append(self.experiment.find_sim(dev.component)) else:
if dev.channel.a == dev:
peer_if = dev.channel.b
else:
peer_if = dev.channel.a
deps.append(self._simulation.find_sim(peer_if.component))
return deps return deps
def add(self, host: 'Host'): def add(self, host: 'Host'):
...@@ -131,11 +137,11 @@ class Gem5Sim(HostSim): ...@@ -131,11 +137,11 @@ class Gem5Sim(HostSim):
def prep_cmds(self, inst: inst_base.Instantiation) -> tp.List[str]: def prep_cmds(self, inst: inst_base.Instantiation) -> tp.List[str]:
cmds = [f'mkdir -p {env.gem5_cpdir(self)}'] cmds = [f'mkdir -p {inst._env._cpdir}']
if inst.env.restore_cp and self.modify_checkpoint_tick: if inst._env._restore_cp and self.modify_checkpoint_tick:
cmds.append( cmds.append(
f'python3 {env.utilsdir}/modify_gem5_cp_tick.py --tick 0 ' f'python3 {inst.utilsdir}/modify_gem5_cp_tick.py --tick 0 '
f'--cpdir {env.gem5_cpdir(self)}' f'--cpdir {inst.gem5_cpdir(self)}'
) )
return cmds return cmds
......
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