From 65f818c1f809481463aad7604fead3d977bb4f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Sun, 8 Nov 2026 10:09:00 +0100 Subject: [PATCH 1/2] chore: drop what the bazel surface removal left behind MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #4501 removed ORFS's MODULE.bazel and BUILD files, and c9e1ba4d3 the plumbing that only they referenced. These files and doc sections describe or serve that build, and nothing reads them now: flow/README.md the bazel targets of every design (_synth, ..., _test) and how to add a design's BUILD.bazel. Those targets and design.bzl are gone. docs/user/BuildLocally.md "Using Bazel to build OpenROAD and run the ORFS flow" runs `bazelisk run //:install_for_bazel`, a target that went with the root BUILD.bazel. "Build OpenROAD and run a few ORFS flows with Bazel" builds designs/asap7/gcd targets and bumps a MODULE.bazel, neither of which exists. bazel/install.sh its only caller was //:install_for_bazel. bazel/README.md describes flow/BUILD.bazel examples and the bazel-orfs version pin in MODULE.bazel. bazel/slang-compat/README a placeholder for when ORFS is the root module consuming tools/OpenROAD through git_override. Without a MODULE.bazel, ORFS is never the root module. flow/util/cred_helper.py a GCP credential helper for the bazel artifact repository (fabdb020b); nothing references it. flow/util/open_plots.sh an xdg-open wrapper for the bazel plot_congestion target, removed in #4085 and #4096. The /bazel/ line in CODEOWNERS goes with the directory. .bazelversion and .bazelignore stay: bazelisk in docker/Dockerfile.claude reads .bazelversion. Signed-off-by: Øyvind Harboe --- .github/CODEOWNERS | 1 - bazel/README.md | 60 ------------------- bazel/install.sh | 123 -------------------------------------- bazel/slang-compat/README | 6 -- docs/user/BuildLocally.md | 51 ---------------- flow/README.md | 60 ------------------- flow/util/cred_helper.py | 93 ---------------------------- flow/util/open_plots.sh | 2 - 8 files changed, 396 deletions(-) delete mode 100644 bazel/README.md delete mode 100755 bazel/install.sh delete mode 100644 bazel/slang-compat/README delete mode 100644 flow/README.md delete mode 100755 flow/util/cred_helper.py delete mode 100755 flow/util/open_plots.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 99076bc5ae..37fd2c6759 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -23,7 +23,6 @@ /tools/AutoTuner/docker-compose.yml @The-OpenROAD-Project/openroad-devops # Bazel build support. -/bazel/ @The-OpenROAD-Project/openroad-devops /.bazelversion @The-OpenROAD-Project/openroad-devops /.bazelignore @The-OpenROAD-Project/openroad-devops diff --git a/bazel/README.md b/bazel/README.md deleted file mode 100644 index 81f90b86fb..0000000000 --- a/bazel/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# OpenROAD-flow-scripts and Bazel integration - -`bazel-orfs` is a Bazel package containing the definitions and logic governing the build process of ORFS designs. -The module uses the `openroad/orfs` docker image to extract the flow scripts with dependencies, builds the Bazel environment around them and defines the methods of calling the ORFS Makefiles with selected designs. - -## Run examples - -`flow/BUILD.bazel` contains definitions for various flows to serve as examples. - -It is recommended to run the utility [Bazelisk](https://github.com/bazelbuild/bazelisk) to manage the version of `bazel` installed on the system. -Details on installation can be found in the `bazel-orfs` [README](https://github.com/The-OpenROAD-Project/bazel-orfs?tab=readme-ov-file#requirements) - -The flow can be ran with the following call structure: - -```bash -bazel build _ -``` - -For example, to run the stage `final`, along with all the dependent stages, call: -```bash -bazel build gcd_final -``` - -Details on usage and defining of the flows are presented in the Usage section of the `bazel-orfs` [README](https://github.com/The-OpenROAD-Project/bazel-orfs?tab=readme-ov-file#usage) - -## Dependency version management - -In the flow scipts, the `bazel-orfs` version is defined as - -```starlark -bazel_dep(name = "bazel-orfs") -git_override( - module_name = "bazel-orfs", - commit = "", - remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git", -) -``` -However, as the referenced documentation shows, the git-based dependency can be overridden with a local repository. -First, remove the `git_override` call entirely and replace it with a `local_path_override` call following this convention: - -```starlark -local_path_override( - module_name = "bazel-orfs", - path = "/replace/with/path/to/local/orfs/repository" -) -``` - -`bazel-orfs` sets a default version of the docker image used to create the Bazel environment. -This selection can be overridden by a following snippet inserted below the `bazel-orfs` declaration and override. - -```starlark -orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories") -orfs.default( - image = "tag-name", - sha256 = "the-hash", -) -``` - -Substitute `tag-name` with the tag of the version needed and `the-hash` with the digest corresponding to the selected tag (without the `sha256:` prefix). - diff --git a/bazel/install.sh b/bazel/install.sh deleted file mode 100755 index 5bfd09ba67..0000000000 --- a/bazel/install.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -set -e - -# ORFS developer install script -# Builds and installs OpenROAD and Yosys to tools/install/ -# where flow/Makefile expects them. -# -# Uses stamp files for fast no-op re-runs (seconds when nothing changed). - -WORKSPACE="${BUILD_WORKSPACE_DIRECTORY:-.}" -INSTALL_DIR="${WORKSPACE}/tools/install" -NUM_THREADS=$(nproc) - -# --- Check system dependencies for yosys/slang builds --- -check_deps() { - local missing_cmds=() - - for cmd in bison flex gawk g++ pkg-config tclsh git cmake; do - if ! command -v "$cmd" &>/dev/null; then - missing_cmds+=("$cmd") - fi - done - - if [[ ${#missing_cmds[@]} -eq 0 ]]; then - return - fi - - echo "ERROR: Missing commands: ${missing_cmds[*]}" - echo "" - - # Platform-specific install hint - if [[ "$(uname -s)" == "Darwin" ]]; then - echo " brew install bison flex gawk cmake pkg-config tcl-tk" - elif command -v apt-get &>/dev/null; then - echo " sudo apt-get install bison flex gawk g++ pkg-config tcl cmake git" - elif command -v dnf &>/dev/null; then - echo " sudo dnf install bison flex gawk gcc-c++ pkgconf tcl cmake git" - elif command -v yum &>/dev/null; then - echo " sudo yum install bison flex gawk gcc-c++ pkgconf tcl cmake git" - elif command -v zypper &>/dev/null; then - echo " sudo zypper install bison flex gawk gcc-c++ pkg-config tcl cmake git" - fi - exit 1 -} - -check_deps - -BUILD_OPENROAD=1 - -usage() { - cat <<'EOF' -Usage: bazelisk run //:install_for_bazel [-- OPTIONS] - -Options: - --help, -h Show this help - --skip-openroad Skip OpenROAD build - --threads N Compilation threads (default: nproc) -EOF - exit 0 -} - -while [[ $# -gt 0 ]]; do - case "$1" in - --help|-h) - usage - ;; - --skip-openroad) - BUILD_OPENROAD=0 - ;; - --threads) - NUM_THREADS="$2" - shift - ;; - *) - echo "Unknown option: $1" - usage - ;; - esac - shift -done - -# --- Check submodules are initialized --- -for sub in tools/OpenROAD tools/yosys; do - if [[ ! -d "${WORKSPACE}/${sub}" ]] || [[ -z "$(ls -A "${WORKSPACE}/${sub}" 2>/dev/null)" ]]; then - echo "ERROR: ${sub} not initialized." - echo "Run: git submodule update --init --recursive" - exit 1 - fi -done - -# --- OpenROAD (delegates to its own //packaging:install) --- -if [[ $BUILD_OPENROAD -eq 1 ]]; then - echo "=== Building OpenROAD with GUI support ===" - (cd "${WORKSPACE}/tools/OpenROAD" && bazelisk run --//:platform=gui //packaging:install) -fi - -# --- Yosys --- -# Uses stamp file for fast no-op: if the yosys submodule commit hasn't -# changed, skip the build entirely. -YOSYS_INSTALL="${INSTALL_DIR}/yosys" -YOSYS_STAMP="${YOSYS_INSTALL}/.yosys_commit" -YOSYS_COMMIT="$(git -C "${WORKSPACE}/tools/yosys" rev-parse HEAD)" - -if [[ -f "${YOSYS_STAMP}" ]] && [[ "$(cat "${YOSYS_STAMP}")" == "${YOSYS_COMMIT}" ]]; then - echo "=== Yosys already up to date (${YOSYS_COMMIT:0:12}) ===" -else - echo "=== Building Yosys ===" - # Yosys 0.67+ builds with CMake (no Makefile); mirrors build_openroad.sh. - ( - cd "${WORKSPACE}/tools/yosys" - cmake -B build . \ - -DCMAKE_BUILD_TYPE=Release \ - -DYOSYS_SKIP_ABC_SUBMODULE_CHECK=ON \ - -DCMAKE_INSTALL_PREFIX="${YOSYS_INSTALL}" - cmake --build build --target install -j "${NUM_THREADS}" - ) - echo "${YOSYS_COMMIT}" > "${YOSYS_STAMP}" - echo "Yosys installed to ${YOSYS_INSTALL}/bin/yosys" -fi - -echo "" -echo "=== Done ===" -echo "cd flow && make" diff --git a/bazel/slang-compat/README b/bazel/slang-compat/README deleted file mode 100644 index 03051c7e29..0000000000 --- a/bazel/slang-compat/README +++ /dev/null @@ -1,6 +0,0 @@ -Placeholder directory for the @slang alias build file to internally -manifest. tools/OpenROAD's MODULE.bazel declares -new_local_repository(name="slang", path="bazel/slang-compat"); the -relative path resolves against the root workspace, so when ORFS is the -root module consuming openroad via git_override the directory must -exist here too. Mirrors tools/OpenROAD/bazel/slang-compat. diff --git a/docs/user/BuildLocally.md b/docs/user/BuildLocally.md index 15ccf7ff9c..9747b62260 100644 --- a/docs/user/BuildLocally.md +++ b/docs/user/BuildLocally.md @@ -12,20 +12,6 @@ cd OpenROAD-flow-scripts sudo ./setup.sh ``` -## Using Bazel to build OpenROAD and run the ORFS flow (unsupported) - -For ORFS/OpenROAD developers. Most of `./setup.sh` isn't needed when -building OpenROAD with Bazel — this provides the bare minimum to build -OpenROAD and test ORFS flows. No sudo required. -Install [Bazelisk](https://bazel.build/install/bazelisk) first. - -``` shell -git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts -cd OpenROAD-flow-scripts -bazelisk run //:install_for_bazel -cd flow && make -``` - ## Build ``` shell @@ -68,40 +54,3 @@ Set up environment variables using `dev_env.sh`, then start Visual Studio Code. . ./dev_env.sh code tools/OpenROAD/ ``` - -## Build OpenROAD and run a few ORFS flows with Bazel - -Local use case: - -- Install Bazelisk and no other dependencies, no need to run `sudo ./setup.sh` -- Modify & build OpenROAD -- Test built OpenROAD with a few ORFS flows - -The Bazel support in OpenROAD and ORFS is work in progress and some Bazel experience is recommended before going spelunking in the Bazel builds. - -Contributions welcome! - -To build `designs/asap7/gcd:gcd_floorplan`: - - cd flow - (cd ../tools/OpenROAD && bazel build :openroad -c opt) && bazelisk build designs/asap7/gcd:gcd_floorplan - -Or to run all flows currently available in Bazel - - cd flow - (cd ../tools/OpenROAD && bazel build :openroad -c opt) && bazelisk build ... - -Note! ORFS uses the OpenROAD Bazel built binary in stop-gap way until OpenROAD has been switched to bzlmod, after which to build all flows becomes simpler as ORFS will build the requisite OpenROAD directly: - - cd flow - bazelisk build ... - -ORFS uses [bazel-orfs](https://github.com/The-OpenROAD-Project/bazel-orfs) to implement the flow and gets some depedencies, like yosys, from the Docker image. Over time, all dependencies should be built with Bazel and the dependency on the ORFS Docker image will be phased out. - -### Upgrading MODULE.bazel with the latest bazel-orfs and ORFS Docker image - -Run: - - bazelisk run @bazel-orfs//:bump - -Then commit MODULE.bazel and MODULE.bazel.lock. diff --git a/flow/README.md b/flow/README.md deleted file mode 100644 index d2d6e75e31..0000000000 --- a/flow/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# bazel-orfs - -Bazel front-end for the ORFS Make flow. Designs declared via -`config.mk` are exposed as Bazel targets through -[bazel-orfs](https://github.com/The-OpenROAD-Project/bazel-orfs). - -## Targets - -For a design at `flow/designs///` with `DESIGN_NAME = -`: - -| Target | Output | -|---|---| -| `_synth` | Yosys synthesis | -| `_floorplan` | Floorplan + I/O placement | -| `_place` | Placement | -| `_cts` | Clock tree synthesis | -| `_grt` | Global routing | -| `_route` | Detailed routing | -| `_final` | Final + fill | -| `_generate_abstract` | LEF/LIB abstract | -| `_test` | Full flow + QoR check | - -Stages depend on the previous, so `_final` runs the whole flow. - -```bash -bazelisk build //flow/designs/asap7/gcd:gcd_synth -bazelisk test //flow/designs/asap7/gcd:gcd_test -bazelisk run //flow/designs/asap7/gcd:gcd_update -bazelisk query //flow/designs/asap7/...:* -``` - -## Adding a design - -```starlark -# flow/designs///BUILD.bazel -load("//flow/designs:design.bzl", "design") - -design() -``` - -If `flow/designs/src//BUILD.bazel` is missing, add: - -```starlark -load("//flow/designs:design.bzl", "files") - -files("verilog") -``` - -The QoR check is the dashboard check described in -`docs/contrib/Metrics.md`. The committed `rules-base.json` files it used -to read were removed, so bazel-orfs no longer has that file to mark a -design as CI-tested. Until bazel-orfs picks another marker, its generated -test targets carry `tags = ["manual"]` for every design. - -## Parallelism - -Each OpenROAD invocation takes `-threads `. A wildcard -`bazelisk test` runs designs in parallel and overcommits the host. Cap -with `--jobs=N`. diff --git a/flow/util/cred_helper.py b/flow/util/cred_helper.py deleted file mode 100755 index e87c80b0df..0000000000 --- a/flow/util/cred_helper.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python3 -# -# Returns information about user's GCP entitlements -# -# Usage: cred_helper.py [get|test] -# -# get prints the GCP auth token -# test prints the user's GCP entitlements -# -# Calling script without arguments prints out usage information and then exits with a non-zero code (per spec) -# - -import subprocess -import requests -import json -import re -import sys - - -def get_gcloud_auth_token(test): - """ - Returns the gcloud auth token based on the user.bazelrc - """ - - with open("user.bazelrc") as f: - all = f.read() - match = re.search(r"# user: (.*)", all) - if match is None: - sys.exit('Did not find username in user.bazelrc file as "# user: "') - USER = match.group(1) - - cmd = ["gcloud", "auth", "print-access-token", USER] - if test: - print("Running: " + subprocess.list2cmdline(cmd)) - result = subprocess.run(cmd, capture_output=True, text=True, check=True) - token = result.stdout.strip() - return token - - -def generate_credentials(test): - """ - Generate the credentials in a form that Bazel wants, which is the - Authorization key points to a list - """ - - bearer_token = get_gcloud_auth_token(test) - - # Create the JSON object with the required format - credentials = {"headers": {"Authorization": [f"Bearer {bearer_token}"]}} - return credentials - - -def test_permissions(credentials, bucket_name): - """ - Tests the user's entitlements for this bucket - - Note that the call to check the permissions needs the Authorization key to - point to a string and not a list. So, take the first element in the list - and make it the only value - """ - - credentials["headers"]["Authorization"] = credentials["headers"]["Authorization"][0] - url = ( - f"https://storage.googleapis.com/storage/v1/b/{bucket_name}/iam/testPermissions" - ) - permissions = {"permissions": ["storage.buckets.get", "storage.objects.create"]} - - response = requests.get(url, params=permissions, headers=credentials["headers"]) - response.raise_for_status() - return response.json() - - -def main(): - if ( - len(sys.argv) <= 1 - or (len(sys.argv) == 2 and sys.argv[1] not in ["get", "test"]) - or len(sys.argv) >= 3 - ): - sys.exit("Usage: python cred_helper.py [get|test]") - test = sys.argv[1] == "test" - - credentials = generate_credentials(test) - if not test: - print(json.dumps(credentials, indent=2)) - return - - permissions = test_permissions(credentials, "megaboom-bazel-artifacts") - - print(json.dumps(permissions, indent=2)) - - -if __name__ == "__main__": - main() diff --git a/flow/util/open_plots.sh b/flow/util/open_plots.sh deleted file mode 100755 index 8ff044b165..0000000000 --- a/flow/util/open_plots.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -xdg-open $1 From 2fcc29195ac1a1c9c1bde1280efcc27516475eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Sun, 15 Nov 2026 17:52:04 +0100 Subject: [PATCH 2/2] chore: drop the in-tree bazel test docs, openroad.sh and a stale comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-up. These also only served the removed bazel build: flow/designs/README.md documents the design.bzl targets and `bazelisk test //flow/designs/...`; neither exists. flow/test/openroad.sh runs openroad from a Bazel external repo path; nothing calls it. .github/dependabot.yml the comment that MODULE.bazel is not covered; there is no MODULE.bazel. Signed-off-by: Øyvind Harboe --- .github/dependabot.yml | 1 - flow/designs/README.md | 63 ------------------------------------------ flow/test/openroad.sh | 6 ---- 3 files changed, 70 deletions(-) delete mode 100644 flow/designs/README.md delete mode 100755 flow/test/openroad.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9cce84325a..31bfb76b75 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,5 @@ version: 2 -# MODULE.bazel is not covered: Dependabot has no Bazel ecosystem. updates: - package-ecosystem: "github-actions" directory: "/" diff --git a/flow/designs/README.md b/flow/designs/README.md deleted file mode 100644 index 0e2c510d2a..0000000000 --- a/flow/designs/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Fast local OpenROAD-SYN testing loop - -The maintainers' QoR signal comes from Jenkins runs published at -. The targets described here are -its local counterpart: the same designs, judged by the same dashboard -rules through `make metadata-check` (see `docs/contrib/Metrics.md`), but -built locally through Bazel so the loop can be sharpened onto exactly the -design, engine, and stage being worked on — fast enough for an agent -(e.g. Claude) to iterate against. - -Every design gets manual forced-engine flow variants (see -`design.bzl`), regardless of the engine its config.mk selects: - -- `_syn_*` pins `SYNTH_USE_SYN=1` (OpenROAD-SYN), so any design - can be tested under SYN before its config.mk officially switches. -- `_yosys_*` pins the yosys engine, so the baseline stays - reproducible after a design switches (asap7/gcd today). - -CI-tested designs get two QoR tiers per variant: - -- `__synth_test` — the fast tier: synthesis only, - checked against the `synth__`/`constraints__` subset of the rules - (`make metadata-synth`). - Minutes. QoR-only — without LEC it cannot prove correctness, so use - it to iterate, not to conclude. -- `__test` — the full flow against all rules: the real, - dashboard-equivalent gate. It reuses the fast tier's synthesis - action, so escalating from fast to full never repeats synthesis. - -## The loop - -Build/test whatever is relevant to what you are changing — one design, -one stage, one tier, or a whole suite: - -```sh -# fastest signal for one design -bazelisk test //flow/designs/asap7/jpeg:jpeg_encoder_syn_synth_test - -# the real gate for that design -bazelisk test //flow/designs/asap7/jpeg:jpeg_encoder_syn_test - -# a single stage, for triage -bazelisk build //flow/designs/asap7/jpeg:jpeg_encoder_syn_route - -# yosys A/B on an officially-SYN design -bazelisk test //flow/designs/asap7/gcd:gcd_yosys_test - -# suite-wide status (asap7): fast tier, then the full flows -bazelisk test --keep_going //flow/designs/asap7:syn_synth_test -bazelisk test --keep_going //flow/designs/asap7:syn_test -``` - -The `syn-dashboard` target that summarised these results as a markdown -table read the output of the removed rules-file check, so it was removed -with it. Read the `QoR check:` line in each test's `metadata-check.log` -instead. - -The suites include designs that fail OpenROAD-SYN today on purpose — -they are a status signal, not a green-only gate. A build failure (e.g. -synthesis dies) records no test result at all, so run the suites with -`--keep_going` and check their output for `FAILED TO BUILD`; designs -too slow for the suites are listed in `SYN_SLOW_DESIGNS` -(`asap7/BUILD`) and reproduced individually. diff --git a/flow/test/openroad.sh b/flow/test/openroad.sh deleted file mode 100755 index d47e20263b..0000000000 --- a/flow/test/openroad.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -e -# HACK while we're waiting for OpenROAD to be switched to MODULE.bazel -# OpenROAD has its own TCL library -unset TCL_LIBRARY -./external/_main~_repo_rules~openroad/openroad "$@"