Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/syn/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
# Copyright (c) 2026, The OpenROAD Authors

load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("@rules_shell//shell:sh_test.bzl", "sh_test")

# End-to-end repro for a SIGSEGV in syn::map_combinationals (the post-ABC
# mapper introduced in #10473). Runs the openroad binary against a 2-input
# AND Tcl repro and expects exit 0 with "OK" on stdout. Currently fails;
# tagged manual so CI does not turn red on the unfixed bug.
sh_test(
name = "synthesize_minimal_and_sigsegv_test",
Comment thread
oharboe marked this conversation as resolved.
size = "small",
srcs = ["run_openroad_repro.sh"],
args = [
"$(rootpath //:openroad)",
"$(rootpath synthesize_minimal_and.tcl)",
],
data = [
"synthesize_minimal_and.sv",
"synthesize_minimal_and.tcl",
"//:openroad",
"//test:regression_resources",
],
tags = ["manual"],
)

# No gtest_main on ir/graph/opt tests: ABC (via //src/syn/src/ir →
# TritModel) ships its own main() that wins over gtest_main; each TU
Expand Down
20 changes: 20 additions & 0 deletions src/syn/test/run_openroad_repro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Wrapper for sh_test targets that run the openroad binary against a Tcl
# repro.
#
# Bazel's sh_test sets cwd to the runfiles workspace root before
# invoking this script, so test data (asap7 lib files, the .sv RTL,
# the openroad binary itself) is reachable via "./" relative paths
# without any explicit cd or workspace-name detection.
#
# args:
# $1 - rootpath to the openroad binary
# $2 - rootpath to the Tcl script
set -euo pipefail
OPENROAD_BIN="$1"
TCL="$2"
# The "./" prefix on the binary is needed so exec resolves it relative
# to cwd rather than PATH-searching; the Tcl script is just a file
# argument and goes through openroad's own open(), which handles both
# relative-to-cwd and absolute paths without it.
exec "./${OPENROAD_BIN}" -no_splash -no_init -exit "${TCL}"
3 changes: 3 additions & 0 deletions src/syn/test/synthesize_minimal_and.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module synthesize_minimal_and (input wire a, input wire b, output wire q);
assign q = a & b;
endmodule
26 changes: 26 additions & 0 deletions src/syn/test/synthesize_minimal_and.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Minimal reproducer for a SIGSEGV in syn::map_combinationals (the post-ABC
# mapper introduced in #10473). Any design with at least one AND node in
# the post-ABC AIG crashes; a single 2-input AND is the smallest input
# that triggers it.
#
# Expected behavior once fixed: synthesize completes and "OK" is printed.
# Current behavior: SIGSEGV inside syn::map_combinationals immediately
# after the "[INFO SYN-0023] abc_roundtrip: after ABC: 1 ANDs ..." log line.
#
# Paths are workspace-root-relative; the wrapper sh_test cd's into the
# Bazel runfiles workspace before invoking openroad.

read_lef test/asap7/asap7_tech_1x_201209.lef
read_lef test/asap7/asap7sc7p5t_28_R_1x_220121a.lef
read_liberty test/asap7/asap7sc7p5t_AO_RVT_FF_nldm_211120.lib.gz
read_liberty test/asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz
read_liberty test/asap7/asap7sc7p5t_OA_RVT_FF_nldm_211120.lib.gz
read_liberty test/asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz
read_liberty test/asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib

sv_elaborate -D SYNTHESIS --top synthesize_minimal_and --std=1364-2005 \
src/syn/test/synthesize_minimal_and.sv
syn::stats
synthesize

puts "OK"
Loading