From 4d1b68871746e469a71eaeab3036a71ca04bdc00 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 21 Nov 2025 14:46:01 +1300 Subject: [PATCH 1/3] Tests: Add testcase for problematic ABC DONE check --- tests/techmap/bug5495.abc | 2 ++ tests/techmap/bug5495.sh | 7 +++++++ tests/techmap/bug5495.v | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 tests/techmap/bug5495.abc create mode 100755 tests/techmap/bug5495.sh create mode 100644 tests/techmap/bug5495.v diff --git a/tests/techmap/bug5495.abc b/tests/techmap/bug5495.abc new file mode 100644 index 000000000..60a29a58a --- /dev/null +++ b/tests/techmap/bug5495.abc @@ -0,0 +1,2 @@ + +fraig_store; fraig_restore diff --git a/tests/techmap/bug5495.sh b/tests/techmap/bug5495.sh new file mode 100755 index 000000000..181797e32 --- /dev/null +++ b/tests/techmap/bug5495.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if ! timeout 5 ../../yosys bug5495.v -p 'hierarchy; techmap; abc -script bug5495.abc' ; then + echo "Yosys failed to complete" + exit 1 +fi + diff --git a/tests/techmap/bug5495.v b/tests/techmap/bug5495.v new file mode 100644 index 000000000..37ce73ec8 --- /dev/null +++ b/tests/techmap/bug5495.v @@ -0,0 +1,7 @@ +module simple(I1, I2, O); + input wire I1; + input wire I2; + output wire O; + + assign O = I1 | I2; +endmodule From e33ca173889a9a7791f3bae94cc88aa38c053c79 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 21 Nov 2025 03:50:07 +0000 Subject: [PATCH 2/3] Force a newline to appear before YOSYS_ABC_DONE --- passes/techmap/abc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/techmap/abc.cc b/passes/techmap/abc.cc index 3a814d0b7..0963ecfde 100644 --- a/passes/techmap/abc.cc +++ b/passes/techmap/abc.cc @@ -1064,7 +1064,7 @@ void AbcModuleState::prepare_module(RTLIL::Design *design, RTLIL::Module *module abc_script += stringf("; write_blif %s/output.blif", run_abc.tempdir_name); abc_script = add_echos_to_abc_cmd(abc_script); #if defined(__linux__) && !defined(YOSYS_DISABLE_SPAWN) - abc_script += "; echo \"YOSYS_ABC_DONE\"\n"; + abc_script += "; echo; echo \"YOSYS_ABC_DONE\"\n"; #endif for (size_t i = 0; i+1 < abc_script.size(); i++) From 44ab884b062a38385d91b893390413cad6fdea82 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Fri, 21 Nov 2025 16:30:27 +1300 Subject: [PATCH 3/3] bug5495.sh: Skip test if timeout isn't available --- tests/techmap/bug5495.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/techmap/bug5495.sh b/tests/techmap/bug5495.sh index 181797e32..64bf2ca99 100755 --- a/tests/techmap/bug5495.sh +++ b/tests/techmap/bug5495.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if ! which timeout ; then + echo "No 'timeout', skipping test" + exit 0 +fi + if ! timeout 5 ../../yosys bug5495.v -p 'hierarchy; techmap; abc -script bug5495.abc' ; then echo "Yosys failed to complete" exit 1