Skip to content

Commit

Permalink
tools/cexenum: Avoid buffering smtbmc's --progress stderr output
Browse files Browse the repository at this point in the history
We were discarding that output anyway and before YosysHQ/mau#5 this
could lead to the mau internal `stderr.readline()` failing.
  • Loading branch information
jix committed Dec 14, 2023
1 parent aa2a96d commit eeee1a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/cexenum/cexenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ def __init__(self, smt2_model: Path):
[
"yosys-smtbmc",
"--incremental",
"--noprogress",
*App.smtbmc_options,
str(smt2_model),
],
Expand All @@ -481,7 +482,11 @@ def __init__(self, smt2_model: Path):

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(
Expand Down

0 comments on commit eeee1a1

Please sign in to comment.