diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index ad4dc5ccd..e73be611a 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -1152,6 +1152,12 @@ bool read_until_abc_done(abc_output_filter &filt, int fd, DeferredLogs &logs) { // Ignore any leftover output, there should only be a prompt perhaps return true; } + // If ABC aborted the sourced script, it returns to the prompt and will + // never print YOSYS_ABC_DONE. Treat this as a failed run, not a hang. + if (line.substr(0, 7) == "Error: ") { + logs.log_error("ABC: %s", line.c_str()); + return false; + } filt.next_line(line); line.clear(); start = p + 1; diff --git a/tests/techmap/bug5574.ys b/tests/techmap/bug5574.ys new file mode 100644 index 000000000..d986e688d --- /dev/null +++ b/tests/techmap/bug5574.ys @@ -0,0 +1,8 @@ +logger -expect error "ABC: Error: This command can only be applied to an AIG" 1 +read_verilog << EOT +module fuzz_mwoqk (input i0, output o0); + assign o0 = i0 ^ 1; +endmodule +EOT +synth +abc -script +resub,-K,8; \ No newline at end of file