Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
f2ed27e5
Commit
f2ed27e5
authored
Jan 14, 2024
by
Antoine Kaufmann
Committed by
Hejing Li
Feb 01, 2024
Browse files
orchestration/simulators.py: add clock drift and offset attr to hosts
Also implements support for passing this through to qemu.
parent
1c2a1c1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
experiments/simbricks/orchestration/simulators.py
experiments/simbricks/orchestration/simulators.py
+12
-0
No files found.
experiments/simbricks/orchestration/simulators.py
View file @
f2ed27e5
...
@@ -298,6 +298,14 @@ class HostSim(Simulator):
...
@@ -298,6 +298,14 @@ class HostSim(Simulator):
"""Latency in nanoseconds for sending messages to components connected
"""Latency in nanoseconds for sending messages to components connected
via Ethernet."""
via Ethernet."""
self
.
sync_drift
:
tp
.
Optional
[
int
]
=
None
"""Conversion factor from SimBricks' picosecond timestamps to the host's
nanosecond clock. None or 1000 is 1:1, while other values result in
simulated clock drift for a host."""
self
.
sync_offset
:
tp
.
Optional
[
int
]
=
None
"""Clock offset for this host in picoseconds. None or 0 does not add an
offset."""
self
.
pcidevs
:
tp
.
List
[
PCIDevSim
]
=
[]
self
.
pcidevs
:
tp
.
List
[
PCIDevSim
]
=
[]
self
.
net_directs
:
tp
.
List
[
NetSim
]
=
[]
self
.
net_directs
:
tp
.
List
[
NetSim
]
=
[]
self
.
memdevs
:
tp
.
List
[
MemDevSim
]
=
[]
self
.
memdevs
:
tp
.
List
[
MemDevSim
]
=
[]
...
@@ -408,6 +416,10 @@ class QemuHost(HostSim):
...
@@ -408,6 +416,10 @@ class QemuHost(HostSim):
cmd
+=
',sync=on'
cmd
+=
',sync=on'
cmd
+=
f
',pci-latency=
{
self
.
pci_latency
}
'
cmd
+=
f
',pci-latency=
{
self
.
pci_latency
}
'
cmd
+=
f
',sync-period=
{
self
.
sync_period
}
'
cmd
+=
f
',sync-period=
{
self
.
sync_period
}
'
if
self
.
sync_drift
is
not
None
:
cmd
+=
f
',sync-drift=
{
self
.
sync_drift
}
'
if
self
.
sync_offset
is
not
None
:
cmd
+=
f
',sync-offset=
{
self
.
sync_offset
}
'
else
:
else
:
cmd
+=
',sync=off'
cmd
+=
',sync=off'
cmd
+=
' '
cmd
+=
' '
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment