Skip to content
Merged
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
14 changes: 7 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ git_override(
bazel_dep(name = "bazel-orfs", dev_dependency = True)
bazel_dep(name = "bazel-orfs-verilog", dev_dependency = True)

BAZEL_ORFS_COMMIT = "ce6efd96dfe39a9c4ef244f8712386f071545d77"
BAZEL_ORFS_COMMIT = "3a5ddd7eb48c363717e65903ae4573d528327fd3"

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

# To bump version, run: bazelisk run @bazel-orfs//:bump
#
# `patches =` keeps small bazel-orfs fixes vendored in this repo while
# we iterate, instead of round-tripping every change through a
# bazel-orfs PR + pin bump. When a patch lands upstream, drop the
# entry here and bump BAZEL_ORFS_COMMIT.
git_override(
module_name = "bazel-orfs",
commit = BAZEL_ORFS_COMMIT,
patch_strip = 1,
patches = [
# Adds orfs_design(user_sources=[VAR,...]) / orfs_flow(user_sources={...})
# so design-private SOURCE_VARS path hooks (e.g. SDC_FILE_EXTRA in
# flow/designs/asap7/mock-cpu) bypass the variables.yaml validator
# without polluting the ORFS-wide variable schema. Drop once upstream
# bazel-orfs lands the user_sources= API.
"//bazel:0001-orfs_design-add-user_sources.patch",
"//patches/bazel-orfs:0001-render_gds-monkey-patch-PDK_CONFIGS-not-gdsii_use_custom_config.patch",
],
remote = BAZEL_ORFS_REMOTE,
)
Expand Down
153 changes: 0 additions & 153 deletions bazel/0001-orfs_design-add-user_sources.patch

This file was deleted.

1 change: 1 addition & 0 deletions flow/designs/design.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def design(config = "config.mk", user_arguments = [], user_sources = [], local_a
user_arguments = user_arguments,
user_sources = user_sources,
local_arguments = local_arguments,
blender = True,
Comment thread
oharboe marked this conversation as resolved.
Resolved
)

def files(group, extra_srcs = None):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 0010e181efa28210dbf7839e6e6131139cc705bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind@ascenium.com>
Date: Mon, 18 May 2026 00:06:14 +0200
Subject: [PATCH] render_gds: monkey-patch PDK_CONFIGS instead of
gdsii_use_custom_config

The addon's gdsii_use_custom_config=True branch in import_gdsii skips
initialising pdk_info and addon_dir, both of which are still used a
few lines later to resolve color_path -- so any non-default
layerstack YAML trips UnboundLocalError inside the addon.

Patch the addon's PDK_CONFIGS dict at runtime instead, pointing the
selected PDK's config_path entry at our trimmed YAML. The else
branch then fires normally, pdk_info is set, color_path resolves,
and Path's absolute-RHS semantic makes addon_dir / Path(abs_path)
evaluate to the absolute path.
---
tools/blendergds/render_gds.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/blendergds/render_gds.py b/tools/blendergds/render_gds.py
index cbe116c..b53da1e 100644
--- a/tools/blendergds/render_gds.py
+++ b/tools/blendergds/render_gds.py
@@ -289,11 +289,19 @@ def main():
# in seconds rather than 5-7 minutes + 16 GB RSS. No-op for
# PDKs without a preset and for designs whose full stack is
# already small enough.
+ # We can't go through the addon's `gdsii_use_custom_config = True`
+ # path: that branch in `import_gdsii` skips initialising
+ # `pdk_info` and `addon_dir`, both of which are still used
+ # afterwards to resolve `color_path` -- so a custom YAML trips
+ # `UnboundLocalError: pdk_info` inside the addon. Instead,
+ # monkey-patch PDK_CONFIGS[pdk]['config_path'] to point at the
+ # trimmed YAML (absolute path -- `addon_dir / Path("/abs")`
+ # evaluates to the absolute path in pathlib, so the else branch
+ # in the addon picks it up correctly).
trimmed = _trim_layerstack(addon, addon_root, args.pdk, tmp)
if trimmed is not None:
yaml_path, kept_layers, missing = trimmed
- bpy.context.scene.gdsii_use_custom_config = True
- bpy.context.scene.gdsii_config_path = str(yaml_path)
+ addon.PDK_CONFIGS.setdefault(args.pdk, {})["config_path"] = str(yaml_path)
_log_phase(
"layerstack-trimmed",
extra=(
--
2.51.0

8 changes: 8 additions & 0 deletions patches/bazel-orfs/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Vendored patches applied on top of the bazel-orfs git_override pin.
These are small fixes we keep here to reduce churn while iterating;
when they land upstream, drop the entry from MODULE.bazel and bump
BAZEL_ORFS_COMMIT instead.
"""

exports_files(glob(["*.patch"]))