Commit 8073e668 authored by Jonas Kaufmann's avatar Jonas Kaufmann
Browse files

orchestration/simulation: actually return sets for supported_socket_types()

parent aa0cb6a7
...@@ -287,7 +287,7 @@ class Simulator(utils_base.IdObj, abc.ABC): ...@@ -287,7 +287,7 @@ class Simulator(utils_base.IdObj, abc.ABC):
def supported_socket_types( def supported_socket_types(
self, interface: sys_conf.Interface self, interface: sys_conf.Interface
) -> set[inst_socket.sockType]: ) -> set[inst_socket.sockType]:
return [] return {}
# Sockets to be cleaned up: always the CONNECTING sockets # Sockets to be cleaned up: always the CONNECTING sockets
# pylint: disable=unused-argument # pylint: disable=unused-argument
...@@ -452,6 +452,11 @@ class Simulation(utils_base.IdObj): ...@@ -452,6 +452,11 @@ class Simulation(utils_base.IdObj):
self.update_channel_mapping(sys_chan=chan, sim_chan=channel) self.update_channel_mapping(sys_chan=chan, sim_chan=channel)
return channel return channel
def get_channel(self, chan: sys_conf.Channel) -> sim_chan.Channel:
if not self.is_channel_instantiated(chan):
raise RuntimeError(f"Channel {chan} is not instantiated")
return self._chan_map[chan]
def all_simulators(self) -> list[Simulator]: def all_simulators(self) -> list[Simulator]:
return self._sim_list return self._sim_list
......
...@@ -61,7 +61,7 @@ class HostSim(sim_base.Simulator): ...@@ -61,7 +61,7 @@ class HostSim(sim_base.Simulator):
def supported_socket_types( def supported_socket_types(
self, interface: system.Interface self, interface: system.Interface
) -> set[inst_base.SockType]: ) -> set[inst_base.SockType]:
return [inst_socket.SockType.CONNECT] return {inst_base.SockType.CONNECT}
class Gem5Sim(HostSim): class Gem5Sim(HostSim):
......
...@@ -50,7 +50,7 @@ class NetSim(sim_base.Simulator): ...@@ -50,7 +50,7 @@ class NetSim(sim_base.Simulator):
def supported_socket_types( def supported_socket_types(
self, interface: sys_base.Interface self, interface: sys_base.Interface
) -> set[inst_socket.SockType]: ) -> set[inst_socket.SockType]:
return [inst_base.SockType.CONNECT] return {inst_socket.SockType.CONNECT}
def toJSON(self) -> dict: def toJSON(self) -> dict:
json_obj = super().toJSON() json_obj = super().toJSON()
......
...@@ -45,7 +45,7 @@ class PCIDevSim(sim_base.Simulator): ...@@ -45,7 +45,7 @@ class PCIDevSim(sim_base.Simulator):
def supported_socket_types( def supported_socket_types(
self, interface: sys_base.Interface self, interface: sys_base.Interface
) -> set[inst_socket.SockType]: ) -> set[inst_socket.SockType]:
return [inst_socket.SockType.LISTEN] return {inst_socket.SockType.LISTEN}
class NICSim(PCIDevSim): class NICSim(PCIDevSim):
......
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