"...en/git@developer.sourcefind.cn:OpenDAS/mmdetection3d.git" did not exist on "e943e84d51ac4208084326f6dc13bade42b049ec"
Commit ae372841 authored by Jonas Kaufmann's avatar Jonas Kaufmann Committed by Antoine Kaufmann
Browse files

simulators.py: add doc strings for synchronization attributes

parent 2e754b87
...@@ -95,7 +95,14 @@ class PCIDevSim(Simulator): ...@@ -95,7 +95,14 @@ class PCIDevSim(Simulator):
super().__init__() super().__init__()
self.sync_mode = 0 self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
self.start_tick = 0 self.start_tick = 0
"""The timestamp at which to start the simulation. This is useful when
the simulator is only attached at a later point in time and needs to
synchronize with connected simulators. For example, this could be used
when taking checkpoints to only attach certain simulators after the
checkpoint has been taken."""
self.sync_period = 500 self.sync_period = 500
"""Period in nanoseconds of sending synchronization messages from this """Period in nanoseconds of sending synchronization messages from this
device to connected components.""" device to connected components."""
...@@ -171,6 +178,8 @@ class NetSim(Simulator): ...@@ -171,6 +178,8 @@ class NetSim(Simulator):
self.opt = '' self.opt = ''
self.sync_mode = 0 self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
self.sync_period = 500 self.sync_period = 500
"""Synchronization period in nanoseconds from this network to connected """Synchronization period in nanoseconds from this network to connected
components.""" components."""
...@@ -284,6 +293,8 @@ class HostSim(Simulator): ...@@ -284,6 +293,8 @@ class HostSim(Simulator):
self.cpu_freq = '4GHz' self.cpu_freq = '4GHz'
self.sync_mode = 0 self.sync_mode = 0
"""Synchronization mode. 0 is running unsynchronized, 1 synchronized.
Depending on the concrete simulator, there may be additional modes."""
self.sync_period = 500 self.sync_period = 500
"""Period in nanoseconds of sending synchronization messages from this """Period in nanoseconds of sending synchronization messages from this
device to connected components.""" device to connected components."""
...@@ -344,6 +355,7 @@ class QemuHost(HostSim): ...@@ -344,6 +355,7 @@ class QemuHost(HostSim):
super().__init__(node_config) super().__init__(node_config)
self.sync = False self.sync = False
""""Whether to synchronize with attached simulators."""
def resreq_cores(self): def resreq_cores(self):
if self.sync: if self.sync:
...@@ -779,6 +791,7 @@ class SwitchNet(NetSim): ...@@ -779,6 +791,7 @@ class SwitchNet(NetSim):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.sync = True self.sync = True
"""Whether to synchronize with attached simulators."""
def run_cmd(self, env): def run_cmd(self, env):
cmd = env.repodir + '/sims/net/switch/net_switch' cmd = env.repodir + '/sims/net/switch/net_switch'
......
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