"vscode:/vscode.git/clone" did not exist on "b7aeecaf3e6da14e173cfe83872f77e6fa74caa1"
Unverified Commit ef2f229b authored by Jakob Görgen's avatar Jakob Görgen
Browse files

added simualtor cleanup_commands

parent ce2027ee
...@@ -249,6 +249,9 @@ class Simulator(utils_base.IdObj): ...@@ -249,6 +249,9 @@ class Simulator(utils_base.IdObj):
def checkpoint_commands(self) -> list[str]: def checkpoint_commands(self) -> list[str]:
return [] return []
def cleanup_commands(self) -> list[str]:
return []
@abc.abstractmethod @abc.abstractmethod
def supported_socket_types(self) -> set[inst_base.SockType]: def supported_socket_types(self) -> set[inst_base.SockType]:
return [] return []
......
...@@ -91,6 +91,9 @@ class Gem5Sim(HostSim): ...@@ -91,6 +91,9 @@ class Gem5Sim(HostSim):
def checkpoint_commands(self) -> list[str]: def checkpoint_commands(self) -> list[str]:
return ["m5 checkpoint"] return ["m5 checkpoint"]
def cleanup_commands(self) -> list[str]:
return ["m5 exit"]
def run_cmd(self, inst: inst_base.Instantiation) -> str: def run_cmd(self, inst: inst_base.Instantiation) -> str:
cpu_type = self.cpu_type cpu_type = self.cpu_type
if inst.create_cp(): if inst.create_cp():
......
...@@ -105,9 +105,13 @@ class BaseLinuxHost(FullSystemHost): ...@@ -105,9 +105,13 @@ class BaseLinuxHost(FullSystemHost):
def cleanup_cmds(self, inst: instantiation.Instantiation) -> list[str]: def cleanup_cmds(self, inst: instantiation.Instantiation) -> list[str]:
"""Commands to run to cleanup node.""" """Commands to run to cleanup node."""
return self._concat_app_cmds( cmds = self._concat_app_cmds(
inst, app.BaseLinuxApplication.cleanup_cmds.__name__ inst, app.BaseLinuxApplication.cleanup_cmds.__name__
) )
sim = inst.find_sim_by_spec(spec=self)
cleanup = sim.cleanup_commands()
cmds += cleanup
return cmds
def config_files(self, inst: instantiation.Instantiation) -> dict[str, tp.IO]: def config_files(self, inst: instantiation.Instantiation) -> dict[str, tp.IO]:
""" """
......
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