projects
/
SymbiYosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0df73ea
)
Use monotonic clock for timeouts
author
Jannis Harder
<me@jix.one>
Mon, 25 Apr 2022 13:43:59 +0000
(15:43 +0200)
committer
Jannis Harder
<me@jix.one>
Wed, 15 Jun 2022 12:11:25 +0000
(14:11 +0200)
sbysrc/sby_core.py
patch
|
blob
|
history
diff --git
a/sbysrc/sby_core.py
b/sbysrc/sby_core.py
index eec0fe6611acd1f507c0cba0aec520254bc8d024..2e092c42626f374d313748023c434d730a054ca5 100644
(file)
--- a/
sbysrc/sby_core.py
+++ b/
sbysrc/sby_core.py
@@
-22,7
+22,7
@@
if os.name == "posix":
import subprocess
from shutil import copyfile, copytree, rmtree
from select import select
import subprocess
from shutil import copyfile, copytree, rmtree
from select import select
-from time import
time
, localtime, sleep, strftime
+from time import
monotonic
, localtime, sleep, strftime
from sby_design import SbyProperty, SbyModule, design_hierarchy
all_procs_running = []
from sby_design import SbyProperty, SbyModule, design_hierarchy
all_procs_running = []
@@
-349,7
+349,7
@@
class SbyTask(SbyConfig):
self.procs_running = []
self.procs_pending = []
self.procs_running = []
self.procs_pending = []
- self.start_clock_time =
time
()
+ self.start_clock_time =
monotonic
()
if os.name == "posix":
ru = resource.getrusage(resource.RUSAGE_CHILDREN)
if os.name == "posix":
ru = resource.getrusage(resource.RUSAGE_CHILDREN)
@@
-392,7
+392,7
@@
class SbyTask(SbyConfig):
proc.poll()
if self.opt_timeout is not None:
proc.poll()
if self.opt_timeout is not None:
- total_clock_time = int(
time
() - self.start_clock_time)
+ total_clock_time = int(
monotonic
() - self.start_clock_time)
if total_clock_time > self.opt_timeout:
self.log(f"Reached TIMEOUT ({self.opt_timeout} seconds). Terminating all subprocesses.")
self.status = "TIMEOUT"
if total_clock_time > self.opt_timeout:
self.log(f"Reached TIMEOUT ({self.opt_timeout} seconds). Terminating all subprocesses.")
self.status = "TIMEOUT"
@@
-734,7
+734,7
@@
class SbyTask(SbyConfig):
self.taskloop()
self.taskloop()
- total_clock_time = int(
time
() - self.start_clock_time)
+ total_clock_time = int(
monotonic
() - self.start_clock_time)
if os.name == "posix":
ru = resource.getrusage(resource.RUSAGE_CHILDREN)
if os.name == "posix":
ru = resource.getrusage(resource.RUSAGE_CHILDREN)