Skip to content

Commit 2039457

Browse files
committed
build: patch bazel-orfs synth_partition SYNTH_SKIP_KEEP truthy check
ORFS variables.yaml defaults SYNTH_SKIP_KEEP to "0" and emits 'export SYNTH_SKIP_KEEP?=0' via defaults.py. bazel-orfs's synth_partition.sh tested the env var with [ -n "$SYNTH_SKIP_KEEP" ], which is true for any non-empty string -- so "0" took the skip-keep branch and grep'd for 1_1_yosys_canonicalize.rtlil that wasn't in the partition action's sandbox. Switch the test to an explicit "1" comparison. Verified with bazelisk build //flow/designs/nangate45/bp_be_top:bp_be_top_synth, which now completes (was failing on the spurious grep). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 8ef0408 commit 2039457

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎MODULE.bazel‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ git_override(
3838
patch_strip = 1,
3939
patches = [
4040
"//bazel/bazel-orfs-patches:0001-stages-register-bazel-injected-vars-in-validator.patch",
41+
"//bazel/bazel-orfs-patches:0002-synth_partition-fix-SYNTH_SKIP_KEEP-truthy-check.patch",
4142
],
4243
remote = BAZEL_ORFS_REMOTE,
4344
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/synth_partition.sh b/synth_partition.sh
2+
index bf3deb5..5fa420b 100755
3+
--- a/synth_partition.sh
4+
+++ b/synth_partition.sh
5+
@@ -21,9 +21,11 @@ OUTPUT="$RESULTS_DIR/partition_${PARTITION_ID}.v"
6+
# JSON format: {"modules": ["mod1", "mod2", ...]}
7+
ALL_MODULES=$(sed 's/.*\[//;s/\].*//;s/"//g;s/,/\n/g;s/ //g' "$KEPT_JSON")
8+
9+
-# When SYNTH_SKIP_KEEP is set, the keep-hierarchy discovery was skipped.
10+
+# When SYNTH_SKIP_KEEP=1, the keep-hierarchy discovery was skipped.
11+
# Partitions read from canonical RTLIL and run full synthesis (coarse+fine).
12+
-if [ -n "${SYNTH_SKIP_KEEP:-}" ]; then
13+
+# ORFS variables.yaml defaults SYNTH_SKIP_KEEP to "0", so test for "1"
14+
+# explicitly rather than -n (which is true for any non-empty string).
15+
+if [ "${SYNTH_SKIP_KEEP:-0}" = "1" ]; then
16+
CHECKPOINT="$RESULTS_DIR/1_1_yosys_canonicalize.rtlil"
17+
# Validate that every SYNTH_KEEP_MODULES entry exists in the canonical RTLIL
18+
RTLIL_MODULES_FILE=$(mktemp)

0 commit comments

Comments
 (0)