3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-01-26 20:08:44 +00:00

Merge pull request #5593 from RCoeurjoly/RCoeurjoly/5574_fix

abc: handle ABC script errors instead of hanging
This commit is contained in:
KrystalDelusion 2026-01-23 07:16:48 +13:00 committed by GitHub
commit 125609105d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

@ -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;

11
tests/techmap/bug5574.ys Normal file
View file

@ -0,0 +1,11 @@
# 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;