From eeee1a1ec56468e8737d8d8b449db15167977b5d Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 30 Nov 2023 16:46:20 +0100 Subject: [PATCH] tools/cexenum: Avoid buffering smtbmc's --progress stderr output We were discarding that output anyway and before YosysHQ/mau#5 this could lead to the mau internal `stderr.readline()` failing. --- tools/cexenum/cexenum.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/cexenum/cexenum.py b/tools/cexenum/cexenum.py index ea8c348..13ead1b 100755 --- a/tools/cexenum/cexenum.py +++ b/tools/cexenum/cexenum.py @@ -470,6 +470,7 @@ class Smtbmc(tl.process.Process): [ "yosys-smtbmc", "--incremental", + "--noprogress", *App.smtbmc_options, str(smt2_model), ], @@ -481,7 +482,11 @@ class Smtbmc(tl.process.Process): async def on_run(self) -> None: def output_handler(event: tl.process.StdoutEvent): - result = json.loads(event.output) + line = event.output.strip() + if line.startswith('{'): + result = json.loads(event.output) + else: + result = dict(msg=line) tl.log_debug(f"smtbmc > {result!r}") if "err" in result: exception = tl.logging.LoggedError(