Skip to content
Closed
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
35 changes: 34 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ bazel_dep(name = "rules_nodejs", version = "6.7.3", dev_dependency = True)
bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)

BAZEL_ORFS_COMMIT = "78f19f25cec73bdec3517a76465dec7ce17ce227"
BAZEL_ORFS_COMMIT = "90ad965f712f5317b67e08afd84e66425fcf6dd5"

BAZEL_ORFS_REMOTE = "https://github.com/The-OpenROAD-Project/bazel-orfs.git"

Expand Down Expand Up @@ -151,6 +151,9 @@ archive_override(
patch_strip = 1,
patches = [
"//bazel/bazel-orfs-patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
# Mirror of bazel-orfs patches/0037 (ORFS PR #4333), adapted to the
# ORFS_COMMIT pinned here. Drop at the next ORFS bump once #4333 lands.
"//bazel/bazel-orfs-patches:0036-orfs-single-writer-1_synth-sdc.patch",
],
sha256 = "8325c6755215857a87a84db078d47dfbb2dfcbef70eaf0dd376fe5a7a363cd58",
strip_prefix = "OpenROAD-flow-scripts-" + ORFS_COMMIT,
Expand All @@ -160,6 +163,19 @@ archive_override(
bazel_dep(name = "yosys", version = "0.62.bcr.2", dev_dependency = True)
bazel_dep(name = "yosys-slang", version = "0.0.0", dev_dependency = True)

# BCR's yosys-slang 0.0.0 source.json points at the GitHub tarball of
# povik/yosys-slang@6760afa2; after the repo's rename GitHub regenerated
# that tarball (new bytes, top-level dir now sv-elab-<sha>), so fresh
# fetches fail BCR's integrity check. Same commit, content verified
# identical to the git tree; only integrity and strip_prefix corrected.
# Drop once BCR publishes a fixed yosys-slang entry.
archive_override(
module_name = "yosys-slang",
Comment on lines +172 to +173

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this related to the sdc? I think you have another PR for this change

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I also filed povik/sv-elab#362 to have stable hashes.
I will create a new updated BCR module.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created new BCR release for sv-elab: bazelbuild/bazel-central-registry#9571

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hzeller I take it you will create a PR when it lands?

Claude added that slang noice to this PR because it failed locally, not because it was related to bumping bazel-orfs.

Your problem goes away if you create a PR with bazelisk run @bazel-orfs//:bump, though you may want to hold off on that until this strom of bazel bcr upgrades is done....

integrity = "sha256-NBmPLtey0xdcPOPJ+xxskfKNvP5THZe5HWsSxIQxve8=",
strip_prefix = "sv-elab-6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20",
urls = ["https://github.com/povik/yosys-slang/archive/6760afa2c9b9ba231a9c6a9e94f0939dd39f0a20.tar.gz"],
)

# --- Extensions ---

llvm = use_extension(
Expand Down Expand Up @@ -264,3 +280,20 @@ single_version_override(
patches = ["//bazel:scip_tinycthread_tny_prefix.patch"],
version = "9.2.3",
)

# sed-4.9's gnulib lib/memchr.c only `#undef memchr` inside glibc's own
# build (_LIBC); on glibc 2.41+ <string.h> defines memchr as a _Generic
# macro, so the `__memchr (...)` function header expands into
# "_Generic(...)(...)" and clang rejects it. Force the undef to run
# unconditionally. Mirrored from bazel-orfs's MODULE.bazel: sed is pulled
# in via bazel-orfs, whose single_version_override is ignored when
# OpenROAD is the root module.
single_version_override(
module_name = "sed",
patch_cmds = [
# -i.bak (not bare -i) so BSD sed on macOS accepts it too.
"sed -i.bak 's|^#ifdef _LIBC$|#if 1|' lib/memchr.c",
"rm lib/memchr.c.bak",
],
Comment thread
oharboe marked this conversation as resolved.
version = "4.9.bcr.5",
)
18 changes: 10 additions & 8 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.harboe@zylin.com>
Date: Mon, 6 Jul 2026 11:17:45 +0200
Subject: [PATCH] synth: single writer for 1_synth.sdc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Variant of ORFS PR #4333 against the ORFS_COMMIT pinned here
(no synth_syn.tcl at this commit), plus the flow/BUILD.bazel
exports_files(scripts/synth.tcl) that newer bazel-orfs needs for
its _synth_tcl attr (already on ORFS master). Drop this patch at
the next ORFS bump once #4333 lands.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
---
flow/BUILD.bazel | 9 +++++++++
flow/scripts/synth.tcl | 4 ----
flow/scripts/synth_odb.tcl | 9 ++++++---
flow/scripts/synth_preamble.tcl | 1 -
4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/flow/BUILD.bazel b/flow/BUILD.bazel
index 62e012594..41add0830 100644
--- a/flow/BUILD.bazel
+++ b/flow/BUILD.bazel
@@ -5,6 +5,15 @@ exports_files(
visibility = ["//visibility:public"],
)

+# Expose synth.tcl as an addressable source label so bazel-orfs can
+# point its `_synth_tcl` attr default at `@orfs//flow:scripts/synth.tcl`
+# instead of vendoring its own (drifting) copy at the bazel-orfs repo
+# root. See bazel-orfs `private/rules.bzl`.
+exports_files(
+ ["scripts/synth.tcl"],
+ visibility = ["//visibility:public"],
+)
+
# files shared between scripts/synth.sh and scripts/flow.sh steps
MAKEFILE_SHARED = [
"scripts/variables.json",
diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl
index 1c9e548c5..25a0728fd 100644
--- a/flow/scripts/synth.tcl
+++ b/flow/scripts/synth.tcl
@@ -273,7 +273,3 @@ if {

# Write synthesized design
write_verilog -nohex -nodec $::env(RESULTS_DIR)/1_2_yosys.v
-# One day a more sophisticated synthesis will write out a modified
-# .sdc file after synthesis. For now, just copy the input .sdc file,
-# making synthesis more consistent with other stages.
-log_cmd exec cp $::env(SDC_FILE) $::env(RESULTS_DIR)/1_synth.sdc
diff --git a/flow/scripts/synth_odb.tcl b/flow/scripts/synth_odb.tcl
index d6f53cda3..d0abab512 100644
--- a/flow/scripts/synth_odb.tcl
+++ b/flow/scripts/synth_odb.tcl
@@ -25,9 +25,12 @@ source_step_tcl PRE SYNTH
log_cmd eliminate_dead_logic

source_step_tcl POST SYNTH
-orfs_write_db $::env(RESULTS_DIR)/1_synth.odb
+# Producing 1_synth.odb/.sdc is this step's contract:
+# unconditional, no WRITE_ODB_AND_SDC_EACH_STAGE.
+log_cmd write_db $::env(RESULTS_DIR)/1_synth.odb
# Canonicalize 1_synth.sdc. The original SDC_FILE provided by
# the user could have dependencies, such as sourcing util.tcl,
# which are read in here and a canonicalized version is written
-# out by OpenSTA that has no dependencies.
-orfs_write_sdc $::env(RESULTS_DIR)/1_synth.sdc
+# out by OpenSTA that has no dependencies. Sole writer of
+# 1_synth.sdc.
+log_cmd write_sdc -no_timestamp $::env(RESULTS_DIR)/1_synth.sdc
diff --git a/flow/scripts/synth_preamble.tcl b/flow/scripts/synth_preamble.tcl
index af43512c0..58c016a7a 100644
--- a/flow/scripts/synth_preamble.tcl
+++ b/flow/scripts/synth_preamble.tcl
@@ -14,7 +14,6 @@ if { [env_var_exists_and_non_empty SYNTH_NETLIST_FILES] } {
# keep things simple we just use the creation date
log_cmd exec cat {*}$::env(SYNTH_NETLIST_FILES) > $::env(RESULTS_DIR)/1_2_yosys.v
}
- log_cmd exec cp -p $::env(SDC_FILE) $::env(RESULTS_DIR)/1_synth.sdc
if { [env_var_exists_and_non_empty CACHED_REPORTS] } {
log_cmd exec cp -p {*}$::env(CACHED_REPORTS) $::env(REPORTS_DIR)/.
}
Loading