diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-03-29 21:59:30 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-03-29 21:59:30 +0200 |
commit | dd5fab69c135135fa46b6325a39c184a2ddc6156 (patch) | |
tree | 5876f9e89cbb9dca10b6c2bed6093bcc029e2874 /backends/smt2 | |
parent | a48c7e5abfc1dd406039991ebac73db59c8a432f (diff) | |
download | yosys-dd5fab69c135135fa46b6325a39c184a2ddc6156.tar.gz yosys-dd5fab69c135135fa46b6325a39c184a2ddc6156.tar.bz2 yosys-dd5fab69c135135fa46b6325a39c184a2ddc6156.zip |
Add smtio status msgs when --progress is inactive
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'backends/smt2')
-rw-r--r-- | backends/smt2/smtio.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py index d8e095e6b..bf72e8916 100644 --- a/backends/smt2/smtio.py +++ b/backends/smt2/smtio.py @@ -302,13 +302,13 @@ class SmtIo: return "" return self.p_queue.get() - def p_poll(self): + def p_poll(self, timeout=0.1): assert self.p is not None assert self.p_running if self.p_next is not None: return False try: - self.p_next = self.p_queue.get(True, 0.1) + self.p_next = self.p_queue.get(True, timeout) return False except Empty: return True @@ -646,6 +646,27 @@ class SmtIo: print("\b \b" * num_bs, end="", file=sys.stderr) sys.stderr.flush() + else: + count = 0 + while self.p_poll(60): + count += 1 + msg = None + + if count == 1: + msg = "1 minute" + + elif count in [5, 10, 15, 30]: + msg = "%d minutes" % count + + elif count == 60: + msg = "1 hour" + + elif count % 60 == 0: + msg = "%d hours" % (count // 60) + + if msg is not None: + print("%s waiting for solver (%s)" % (self.timestamp(), msg), flush=True) + result = self.read() if self.debug_file: |