Skip to content

Commit 12937c6

Browse files
oharboeclaude
andcommitted
fix: truncate module name in partition log filename, skip existing filegroups
Long module names (e.g. bp_multi_top parameters) exceed filesystem path limits. Truncate to 80 chars in the log filename. Also skip creating filegroups in orfs_design() when they already exist in the BUILD.bazel (fixes riscv32i-mock-sram conflict). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 610aab7 commit 12937c6

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

bazel/orfs.bzl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,21 @@ def orfs_design(platform = None, design = None):
5252
)
5353

5454
# Create filegroups for wildcard source patterns (e.g. ADDITIONAL_LEFS)
55+
existing_rules = native.existing_rules()
5556
for fg_name, fg_glob in [
5657
("lef", ["*.lef"]),
5758
("lib", ["*.lib"]),
5859
("gds", ["*.gds.gz"]),
5960
("verilog", ["*.v", "*.sv"]),
6061
]:
61-
srcs = native.glob(fg_glob, allow_empty = True)
62-
if srcs:
63-
native.filegroup(
64-
name = fg_name,
65-
srcs = srcs,
66-
visibility = ["//visibility:public"],
67-
)
62+
if fg_name not in existing_rules:
63+
srcs = native.glob(fg_glob, allow_empty = True)
64+
if srcs:
65+
native.filegroup(
66+
name = fg_name,
67+
srcs = srcs,
68+
visibility = ["//visibility:public"],
69+
)
6870

6971
pkg = native.package_name() # e.g., "flow/designs/asap7/gcd"
7072
parts = pkg.split("/")

flow/scripts/synth_partition.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ for module in "${MY_MODULES[@]}"; do
5757
# SYNTH_CHECKPOINT: skip coarse synth + keep_hierarchy (already done)
5858
# SYNTH_BLACKBOXES: all other kept modules are blackboxed
5959
# DESIGN_NAME: override to this module
60+
# Truncate module name in log filename to avoid filesystem limits
61+
log_module="${module:0:80}"
6062
SYNTH_CHECKPOINT="$RESULTS_DIR/1_1_yosys_keep.rtlil" \
6163
SYNTH_BLACKBOXES="$BLACKBOXES" \
6264
DESIGN_NAME="$module" \
6365
"$SCRIPTS_DIR/synth.sh" \
6466
"$SCRIPTS_DIR/synth.tcl" \
65-
"$LOG_DIR/1_2_yosys_partition_${PARTITION_ID}_${module}.log"
67+
"$LOG_DIR/1_2_yosys_partition_${PARTITION_ID}_${log_module}.log"
6668

6769
# Append this module's netlist to partition output
6870
cat "$RESULTS_DIR/1_2_yosys.v" >> "$OUTPUT"

0 commit comments

Comments
 (0)