3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2026-07-09 04:50:19 +00:00

fix aiger witness handling for combinational designs (empty newlines are semantically important for aiw output parsed from log)

This commit is contained in:
N. Engelhardt 2026-07-06 19:58:52 +02:00
parent 97e47c471c
commit d11cc34cb3
3 changed files with 30 additions and 2 deletions

View file

@ -91,6 +91,7 @@ class SbyProc:
self.noprintregex = None
self.notify = []
self.linebuffer = ""
self.preserve_whitespace = False
self.logstderr = logstderr
self.silent = silent
self.wait = False
@ -125,7 +126,7 @@ class SbyProc:
self.task.log(f"{click.style(self.info, fg='magenta')}: {line}")
def handle_output(self, line):
if self.terminated or len(line) == 0:
if self.terminated or (len(line) == 0 and not self.preserve_whitespace):
return
if self.output_callback is not None:
line = self.output_callback(line)
@ -296,7 +297,11 @@ class SbyProc:
if outs[-1] != '\n':
self.linebuffer += outs
break
outs = (self.linebuffer + outs).strip()
outs = self.linebuffer + outs
if self.preserve_whitespace:
outs = outs.rstrip("\r\n")
else:
outs = outs.strip()
self.linebuffer = ""
self.handle_output(outs)

View file

@ -106,6 +106,8 @@ def run(mode, task, engine_idx, engine):
)
if solver_args[0] not in ["avy", "rIC3"]:
proc.checkretcode = True
if not json_output:
proc.preserve_whitespace = True
proc_status = None
produced_cex = False

View file

@ -0,0 +1,21 @@
[tasks]
aigbmc
ric3
[options]
mode bmc
depth 1
expect fail
[engines]
aigbmc: aiger aigbmc
ric3: aiger rIC3
[script]
read -formal top.sv
prep -top top
[file top.sv]
module top(input a);
always @* assert (!a);
endmodule