From f1fc704c84418318154d63de15fa1d3ae36d4292 Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Wed, 7 Jan 2026 23:46:33 +0100 Subject: [PATCH 1/3] abc: handle ABC script errors instead of hanging --- passes/techmap/abc.cc | 6 ++++++ tests/techmap/bug5574.ys | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/techmap/bug5574.ys diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index e25a6facd..3f6e07e15 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..c347a0436 --- /dev/null +++ b/tests/techmap/bug5574.ys @@ -0,0 +1,7 @@ +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 From 41a098172d4328f96cad3b2bd7acc4e3c7d53f3f Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Thu, 8 Jan 2026 05:10:43 +0000 Subject: [PATCH 2/3] Expect an error from the bug5574.ys test --- tests/techmap/bug5574.ys | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/techmap/bug5574.ys b/tests/techmap/bug5574.ys index c347a0436..d986e688d 100644 --- a/tests/techmap/bug5574.ys +++ b/tests/techmap/bug5574.ys @@ -1,3 +1,4 @@ +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; From 0f478a5952da2e6c6b2e0cca99a78486d9fe4c01 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 20 Jan 2026 05:56:14 +1300 Subject: [PATCH 3/3] tests/bug5574: Fix for non threaded abc --- tests/techmap/bug5574.ys | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/techmap/bug5574.ys b/tests/techmap/bug5574.ys index d986e688d..56b290a4a 100644 --- a/tests/techmap/bug5574.ys +++ b/tests/techmap/bug5574.ys @@ -1,8 +1,11 @@ -logger -expect error "ABC: Error: This command can only be applied to an AIG" 1 +# On Linux, with a spawned abc, this message is the error +# otherwise the error is the failure to load the output.blif +logger -expect log "ABC: Error: This command can only be applied to an AIG" 1 +logger -expect error "ABC" 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 +abc -script +resub,-K,8;