# AddingNewDesign.html.md # Adding New Designs to the ORFS This section explains how to add verilog designs to ORFS repository for a full RTL-GDS flow execution. The following design example is based on the design `spm` that implements a Single-port memory using `gf180` platform. This procedure applies to any design for a given platform you choose. **Note:** The commands refer to the base directory as `OpenROAD-flow-scripts/flow` as the starting point for the flow. **Step 1:** Create the Verilog source files directory based on the top module name. ```shell cd designs/src mkdir spm cd spm vi spm.v ``` Copy [this](https://raw.githubusercontent.com/The-OpenROAD-Project/OpenLane/master/designs/spm/src/spm.v) verilog code into spm.v. **Step 2:** Create `config.mk` to define design configuration. ```shell cd designs/gf180 mkdir spm cd spm vi config.mk ``` **Step 3:** Define key design parameters in `config.mk`. ```default export PLATFORM = gf180 export DESIGN_NAME = spm export VERILOG_FILES = $(sort $(wildcard ./designs/src/$(DESIGN_NICKNAME)/*.v)) export SDC_FILE = ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc export CORE_UTILIZATION = 40 export PLACE_DENSITY = 0.60 export TNS_END_PERCENT = 100 ``` To customize or add new variables to the `config.mk` refer to the other built-in design examples or the flow variables list [here](FlowVariables.md). **Step 4:** Define SDC constraints. ```shell cd designs/gf180/spm vi constraint.sdc ``` Edit as required to define design constraints. ```default current_design spm set clk_name core_clock set clk_port_name clk set clk_period 10 set clk_io_pct 0.2 set clk_port [get_ports $clk_port_name] create_clock -name $clk_name -period $clk_period $clk_port set non_clock_inputs [lsearch -inline -all -not -exact [all_inputs] $clk_port] set_input_delay [expr $clk_period * $clk_io_pct] -clock $clk_name $non_clock_inputs set_output_delay [expr $clk_period * $clk_io_pct] -clock $clk_name [all_outputs] ``` Update only `current_design`, `clk_port_name` and `clk_period` as per design requirements. Do not modify the remaining values for the default template. **Step 5:** Add the design name to `Makefile` to run the flow with the `make` command. ```shell vi Makefile ``` Comment (#) any `DESIGN_CONFIG` if already enabled. Add the following lines to `Makefile` and save the changes. ```default DESIGN_CONFIG=./designs/gf180/spm/config.mk ``` Run `make` command to run the flow from RTL to GDSII generation. ```shell make ``` If you do not want to change `Makefile`, you can simply run, ```shell make DESIGN_CONFIG=./designs/gf180/spm/config.mk ``` # BuildLocally.html.md # Build from sources locally ## Clone and Install Dependencies The `setup.sh` script installs all of the dependencies, including OpenROAD dependencies, if they are not already installed. Supported configurations are: Ubuntu 20.04, Ubuntu 22.04, Ubuntu 22.04(aarch64), RHEL 8, RockyLinux 9 and Debian 11. ```shell git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts 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 ./build_openroad.sh --local ``` #### NOTE There is a `build_openroad.log` file that is generated with every build in the main directory. In case of filing issues, it can be uploaded in the “Relevant log output” section of OpenROAD-flow-scripts repo [issue form](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues/new?assignees=&labels=&template=bug_report_with_orfs.yml). ## Verify Installation The binaries should be available on your `$PATH` after setting up the environment. The `make` command runs from RTL-GDSII generation for default design `gcd` with `nangate45` PDK. ```shell source ./env.sh yosys -help yosys -m slang -p "slang_version" openroad -help cd flow make ``` You can view final layout images in OpenROAD GUI using this command. ```shell make gui_final ``` ![gcd_final.webp](images/gcd_final.webp) ## Compiling and debugging in Visual Studio Code Set up environment variables using `dev_env.sh`, then start Visual Studio Code. Please ensure [CMake plugins](https://code.visualstudio.com/docs/cpp/cmake-linux) are installed. ```shell . ./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`: ```none 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 ```none 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: ```none 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: ```none bazelisk run @bazel-orfs//:bump ``` Then commit MODULE.bazel and MODULE.bazel.lock. # BuildWithDocker.html.md # Build from sources using Docker #### NOTE This document describes how to build your own Docker image. If your goal is to use the latest version of OpenROAD-Flow-Scripts, please refer to the [Docker Shell](DockerShell.md) documentation. ## Prerequisites - For this method you only need to install [Docker](https://docs.docker.com/engine/install) on your machine. - Ensure that you have sufficient memory allocated to the Virtual Machine (VM) as per our system requirements. Refer to this [Docker guide](https://docs.docker.com/config/containers/resource_constraints/) for setting CPU cores and memory limits. #### WARNING The `build_openroad.sh` will use the host number of CPUs to compile `openroad`. Please check your Docker daemon setup to make sure all host CPUs are available. If you are not sure, you can check with the command below. If the output number is different from the number of CPUs from your machine, then is recommended that you restrict the number of CPUs used by the scripts (see instructions below). ```shell docker run --rm ubuntu:22.04 nproc ``` ### Build Using Docker from pre-built binaries Courtesy of [Precision Innovations](https://precisioninno.com/), they release `.deb` installers of OpenROAD for Ubuntu and Debian on a regular basis. This greatly helps to reduce the compilation time needed. We recommend to use a Docker image of a supported OS and install OpenROAD using the pre-built binaries from Precision Innovations. You can start the container in an interactive mode using the command below. ```shell docker run -it ubuntu:22.04 ``` Now you are ready to install the prebuilt binaries. Please refer to the instructions for installing prebuilt binaries [here](BuildWithPrebuilt.md). ### Build Using Docker from sources Alternatively, if you would like the latest commits from the OpenROAD repositories, do follow the instructions below. #### Clone and Build The following instructions build the docker image with Ubuntu 22.04 as the base OS: ```shell git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts cd OpenROAD-flow-scripts ./build_openroad.sh ``` You can restrict the number of CPUs with the `-t|--threads N` argument: ```shell ./build_openroad.sh --threads N ``` ## Verify Installation The binaries are only available from inside a Docker container. Here is an example of starting a container from the created Docker image. ```shell docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd)/flow:/OpenROAD-flow-scripts/flow openroad/orfs ``` Then, inside docker: ```shell source ./env.sh yosys -help yosys -m slang -p "slang_version" openroad -help cd flow make exit ``` Alternatively you may also use the `docker_shell` utility as follows. It is important that you are in the `flow` directory. ```shell cd flow util/docker_shell make ``` ## Enable GUI support To use the GUI feature you will need to start the docker with the following command, For Ubuntu/Debian OS users: ```default docker run --rm -it \ -u $(id -u ${USER}):$(id -g ${USER}) \ -v $(pwd)/flow:/OpenROAD-flow-scripts/flow \ -e DISPLAY=${DISPLAY} \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v ${HOME}/.Xauthority:/.Xauthority \ --network host \ --security-opt seccomp=unconfined \ openroad/orfs ``` Running GUI with Docker on Mac OS X users, refer [here](https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc). Then use: ```default docker run --rm -it -e DISPLAY=:0 --network host --privileged ``` Alternatively, you may also use the `docker_shell` utility for GUI as follows. It is important that you are in the `flow` directory. ```shell cd flow util/docker_shell gui_final ``` #### NOTE `docker_shell` is a helpful utility to automate the aforementioned Docker commands using the user’s parameters. Do refer to the documentation [here](DockerShell.md). ## Build Docker Image for Different OS The following instructions build the docker image with a parameterized OS in two stages. These are for CI and developers that wish to use an OS other than Ubuntu 22.04; regular users should use the steps from previous sections. The dev stage installs all dependencies and packages required to run OpenROAD and OpenROAD Flow Scripts. The build stage generates all binaries needed to run the flow (i.e., `openroad` and `yosys`). ```shell git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts cd OpenROAD-flow-scripts ./etc/DockerHelper.sh create -target=dev -os=$OS_NAME ./etc/DockerHelper.sh create -target=builder -os=$OS_NAME ``` # BuildWithPrebuilt.html.md # Using Pre-built Binaries ## Install Klayout and Yosys Please ensure the Klayout version (denoted with `klayoutVersion` variable) is consistent with the one used in [DependencyInstaller script](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/etc/DependencyInstaller.sh). Instructions for installing: - [Klayout>=0.28.8](https://www.klayout.de/build.html) - [Yosys>=0.58](https://github.com/YosysHQ/oss-cad-suite-build/blob/master/README.md#installation) ## Install OpenROAD Download pre-built binaries with self-contained dependencies included from the Precision Innovations’ GitHub releases [here](https://github.com/Precision-Innovations/OpenROAD/releases). Thanks to [Precision Innovations](https://precisioninno.com/) for hosting and maintaining these binaries. The following platforms are supported currently: - Ubuntu 20.04/22.04 - Debian 11 Use the following steps to download: Step 1: Click on the [Precision Innovations Github releases link](https://github.com/Precision-Innovations/OpenROAD/releases). Step 2: Download the artifacts for your distribution. Step 3: Run the install command based on platform use package installer. For example Ubuntu 20.04 use: ```shell sudo apt install ./openroad_2.0_amd64-ubuntu20.04.deb ``` ## Verify Installation You may clone the OpenROAD-flow-scripts repository non-recursively. ```default git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git ``` Export path variables accordingly. ```default # these variables are used in flow/Makefile. Do make sure the yosys path is sourced. export OPENROAD_EXE=$(command -v openroad) export YOSYS_EXE=$(command -v yosys) # only if KLayout is built from source export LD_LIBRARY_PATH="/bin:$PATH" yosys -help yosys -m slang -p "slang_version" openroad -help cd flow make make gui_final ``` # BuildWithWSL.html.md # Build with WSL Windows Subsystem for Linux, or WSL for short is a way for you to mount a Linux-based OS onto your Windows machine, allowing you to build OpenROAD-flow-scripts both locally and via Docker. ## Install WSL Instructions to install WSL can be found [here](https://learn.microsoft.com/en-us/windows/wsl/install). You may use any kernel supported, such as: Ubuntu 20.04, Ubuntu 22.04, RHEL 8, RockyLinux 9, Debian 11. We recommend that users follow the Docker build by continuing onto the guide below. However, if you wish to install locally, you may follow the build locally instructions [here](BuildLocally.md). > **TIP**: You may delete your WSL kernel using this [guide](https://pureinfotech.com/remove-linux-distro-wsl/). ## Docker configuration This section assumes you have set up Docker for Windows already. If not, please refer to the Docker official website for instructions [here](https://docs.docker.com/desktop/install/windows-install/). You need to enable the following options to allow WSL to use Docker. General > Use the WSL 2 Based engine (should be default selection) ![WSL1](images/wsl_1.webp) Resources > WSL integration > Enable integration with my default WSL distro and select “Ubuntu-22.04”, or the distribution you installed.
\\\\ ![WSL2](images/wsl_2.webp) ## Accessing WSL You may access WSL from the app named “Ubuntu 22.04 LTS”. Run the following: ```default sudo apt-get update; sudo apt-get upgrade; sudo apt install -y build-essential python3 python3-venv python3-pip make ``` Verify if Docker is running ```default docker run hello-world ``` You should see: ```default Hello from Docker! This message shows that your installation appears to be working correctly. ``` If everything is successful up to this point, congratulations! You are now ready to follow the [Docker guide](BuildWithDocker.md) as you have configured a Linux system with necessary dependencies. # CI.html.md # CI Guide This document describes the pipelines available to the developers and code maintainers in the [Jenkins server](https://jenkins.openroad.tools/). Note that pipelines with the suffix `*-Private` are only available to code maintainers and The OpenROAD Project members as they can contain confidential information. Thus, to access Private pipelines one needs to have authorization to access confidential data and be logged in the Jenkins website. Below there is a list of the available features. Instructions on how to navigate Jenkins to access these features are available [here](https://docs.google.com/presentation/d/1kWHLjUBFcd0stnDaPNi_pt9WFrrsR7tQ95BGhT1yOvw/edit?usp=sharing). - Find your build through Jenkins website or from GitHub. - See test status: Pass/Fail. - Log files for each test. - Build artifacts to reproduce failures. - HTML reports about code coverage and metrics. ## OpenROAD Flow - OpenROAD-flow-script-Public [folder] - `public_tests_all` - Description: runs flow tests that finish in less than three hours. - Target: master branch. - `public_tests_all-pr` - Description: runs flow tests that finish in less than three hours. - Target: all open PRs. - `publish-results-to-dashboard` - Description: uploads metrics to dashboard website. - Target: master branch. - OpenROAD-flow-scripts-Nightly-Public - Description: runs all flow tests including RTLMP designs. - Target: master branch. - OpenROAD-flow-scripts-Private [folder] - `public_tests_small` - Description: runs fast flow tests that finish in less than one hour. - Target: all branches that are not filed as PR. CI will run for PR branches on the public side after “Ready to Sync Public” workflow. - OpenROAD-flow-scripts-All-Tests-Private - Description: runs flow tests for private branches. - Target: secure branches. # CODE_OF_CONDUCT.html.md # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others’ private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at complaints@openroad.tools. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant version 2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html). Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/inclusion). For answers to common questions about this code of conduct, see the FAQ [here](https://www.contributor-covenant.org/faq). Translations are available [here](https://www.contributor-covenant.org/translations). # ClaudeCode.html.md # Running Claude Code in Docker The `claude.sh` script runs [Claude Code](https://docs.anthropic.com/en/docs/claude-code) inside a Docker container with `--dangerously-skip-permissions`. The container provides a sandboxed environment where Claude Code has full shell access but cannot affect the host system beyond the mounted repository. The container supports: - Building and testing OpenROAD with **CMake** and **Bazel** - Running **ORFS flows** (Makefile-based RTL-GDSII) - All file changes reflected on the host via volume mount ## Prerequisites - [Docker](https://docs.docker.com/engine/install) installed on your machine - Claude Code credentials (run `claude` on the host once to authenticate, or set `ANTHROPIC_API_KEY` in your environment) ## Quick start ```shell ./claude.sh ``` On first run the Docker image is built automatically. Credentials from `~/.claude/` are mounted into the container. The ORFS environment (`env.sh`) is sourced automatically so tools are on `PATH` without any manual setup. ## Usage ```default ./claude.sh [OPTIONS] [-- CLAUDE_ARGS...] ``` ### Options | Option | Description | |----------------|----------------------------------------------------------------| | `--build` | Force rebuild the Docker image | | `--shell` | Start a bash shell instead of Claude Code | | `--image NAME` | Override Docker image (default: `openroad/flow-claude:latest`) | | `--name NAME` | Override container name (default: `claude-orfs`) | | `-h`, `--help` | Show help | Arguments after `--` are passed directly to `claude`. ### Examples ```shell # Interactive Claude Code session ./claude.sh # Pass a prompt to Claude Code ./claude.sh -- -p "fix the failing test in src/drt" # Interactive bash shell (for manual builds) ./claude.sh --shell # Force rebuild the image after updates ./claude.sh --build # Run a parallel session CONTAINER_NAME=claude-2 ./claude.sh ``` ## Building and testing inside the container When using `--shell`, tools are already on `PATH`: ```shell # CMake build ./build_openroad.sh --local --no_init -t $(nproc) # Bazel build cd tools/OpenROAD && bazel build //... # Run an ORFS flow cd flow && make DESIGN_CONFIG=./designs/nangate45/gcd/config.mk ``` Claude Code can run these same commands autonomously during an interactive session. ## What persists across runs The container is removed on exit (`--rm`), but the following host directories are mounted so their contents survive: | Host path | Container path | Content | |--------------------------|-------------------|---------------------------------------------| | Repository root | `/workspace` | All source and build artifacts | | `~/.claude/` | `~/.claude/` | Credentials, settings, conversation history | | `~/.cache/bazel-claude/` | `~/.cache/bazel/` | Bazel external dependencies | | `~/.gitconfig` | `~/.gitconfig` | Git identity (read-only) | | `$SSH_AUTH_SOCK` | forwarded | SSH agent for git over SSH | ## Environment variables All environment variables are optional. They are passed into the container when set on the host. | Variable | Purpose | |------------------------------------------------------------|--------------------------------------------------------------| | `ANTHROPIC_API_KEY` | API key (alternative to stored credentials) | | `ANTHROPIC_MODEL` | Model override | | `CLAUDE_IMAGE` | Docker image override (same as `--image`) | | `CONTAINER_NAME` | Container name override (same as `--name`) | | `BAZEL_CACHE_DIR` | Host path for Bazel cache (default: `~/.cache/bazel-claude`) | | `CLAUDE_CODE_USE_BEDROCK` | Use AWS Bedrock | | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` | AWS credentials for Bedrock | ## How it works The setup consists of three files: ### `docker/Dockerfile.claude` Extends the `openroad/flow-ubuntu22.04-dev` base image (which has all OpenROAD build dependencies) with: - Java 21 and Bazelisk (for Bazel 8.x builds) - Node.js 22 LTS and Claude Code CLI - VS Code CLI, sudo, and other convenience tools No source code is copied into the image. Everything comes from the volume mount. ### `docker/claude-entrypoint.sh` Handles UID/GID mapping so files created inside the container have the correct ownership on the host. The entrypoint: 1. Creates a user matching the host UID/GID 2. Sources `env.sh` to set up tool paths 3. Drops privileges via `setpriv` before running the command This follows the same pattern as `tools/OpenROAD/etc/docker-entrypoint.sh` and the `--user` mode in `flow/util/docker_shell`. ### `claude.sh` Wrapper script that assembles the `docker run` command with the correct volume mounts, environment variables, and entrypoint arguments. ## Security model Claude Code runs with `--dangerously-skip-permissions` **inside** the container, meaning it can execute any shell command without confirmation. The Docker container provides the isolation: - File access is limited to the mounted repository - No access to host system packages, services, or other projects - No access to host network services bound to localhost - `docker kill claude-orfs` stops everything instantly #### WARNING The container has network access (required for the Anthropic API and Bazel dependency fetching). Claude Code could in principle make outbound network requests. If this is a concern, use Docker network policies to restrict egress to only the Anthropic API endpoints. # DeveloperGuide.html.md # Developer Guide - Integrate a new platform to OpenROAD Flow: [Guide](PlatformBringUp.md). - Adding a new design: [Guide](../user/AddingNewDesign.md). - Continuous Integration: [Guide](CI.md). - How do I update the codebase? There are different ways to update your codebase depending on the method you installed it. We provide detailed instructions in this [guide](../user/FAQS.md). - How do I contribute? Follow our Git Quickstart guide [here](GitGuide.md). ## Timing and Logging (`run_command.py`) Every flow stage (synthesis, floorplan, CTS, routing, etc.) is wrapped by `flow/scripts/run_command.py`, which replaces the previous GNU `time` + `tee` shell pipeline with a pure-Python implementation. ### What it does `run_command.py` runs a command and: - Measures **wall-clock time**, **CPU time** (user + sys), and **peak memory** using Python’s `time.monotonic()` and `resource.getrusage()`. - Streams output **line-by-line** to both the console and a log file (replacing `tee`), flushing after every line for real-time `tail -f` observability. - Appends an `Elapsed time: ...` line in the format expected by `genElapsedTime.py` and `genMetrics.py`. ### Usage ```default python3 flow/scripts/run_command.py [--log FILE] [--append] [--tee] -- command [args...] ``` | Flag | Effect | |--------------|------------------------------------------------------| | `--log FILE` | Write command output + timing line to FILE | | `--append` | Append to log file instead of overwriting | | `--tee` | Also write output to stdout (like the `tee` command) | ### Monitoring long-running stages When running under Bazel (`bazelisk test ...`) or other batch systems that hide console output, you can monitor progress by finding and tailing the log: ```bash # Find the running stage's log file ps -Af | grep run_command # or ps -Af | grep tmp.log # Watch it in real time tail -f /path/to/logs/4_cts.tmp.log ``` Output appears immediately in the log file (line-buffered with flush), so `tail -f` shows real-time progress. ### Cross-platform support Works on both Linux and macOS using only Python standard library modules. Peak memory is normalized automatically (`ru_maxrss` is KB on Linux, bytes on macOS). ### Testing ```bash python3 -m pytest flow/test/test_run_command.py -v ``` # DockerShell.html.md # Building example design using Docker image The `docker_shell` script is used to launch a command using a OpenROAD-flow-scripts docker image. Also, the current working directory is mapped into the Docker image using the current user’s credentials. ## Build docker image You can skip this step if you would like to use the latest version from the master branch. If you are developing ORFS/OR, you should build your own image. ```default cd OpenROAD-flow-scripts ./build_openroad.sh ``` ## Run ORFS using `docker_shell` Build an example design and run the GUI: ```default cd flow util/docker_shell make util/docker_shell make gui_final ``` You can also launch an interactive bash session: ```default util/docker_shell bash ``` If you need to use a different Docker image than default, override by using the `docker_shell_IMAGE` environment variable: ```default OR_IMAGE=openroad/orfs:v1234 util/docker_shell make ``` If you have built your OpenROAD Docker image using prebuilt binaries, you might want to source custom paths for your modules as follows. ```default OR_IMAGE=openroad_prebuilt_image YOSYS_EXE=/oss-cad-suite/bin/yosys util/docker_shell make ``` ## Using `docker_shell` from outside of `OpenROAD-flow-scripts/flow` folder If you have designs you are keeping in a git source repository that is not a fork of the OpenROAD-flow-scripts git repository, you can still use the `docker_shell` script. Two ways to use `docker_shell` 1. Simply invoke it from the ORFS location. 2. Copy the script into your source folder. This would allow you to build and publish a Docker image to a private Docker repository and lock the ORFS version to the version of your source code. This gives you a way to deploy updates of ORFS easily, publish a new Docker image, modify the copy of `docker_shell` and create a pull request to possibly test your upgrade on your private build serves. # FAQS.html.md # FAQs If you cannot find your question/answer here, please file a GitHub issue to the appropriate repository or start a discussion. - Issues and bugs: - OpenROAD Flow: [https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues) - OpenROAD with OpenROAD Flow Scripts: [https://github.com/The-OpenROAD-Project/OpenROAD/issues](https://github.com/The-OpenROAD-Project/OpenROAD/issues) - Discussions: - OpenROAD Flow: [https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/discussions](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/discussions) ## How can I contribute? Thank you for your willingness to contribute. Please see the [Getting Involved](../contrib/GettingInvolved.md) guide. ## How do I update OpenROAD-flow-scripts? Depending on how you installed OpenROAD-flow-scripts, there are different ways of updating. Regardless, here are the common first steps: ```shell cd OpenROAD-flow-scripts git checkout master git pull ``` Now your local copy of ORFS should be up-to-date. The next step is to build it again with the following command: For WSL/docker based installation, run: ```shell ./build_openroad.sh --clean ``` For local installation, run: ```shell ./build_openroad.sh --local --clean ``` For pre-built binaries, you can run the flow after `git pull` is done. ## How do I update the design reference files? See how to update using the Metrics [guide](../contrib/Metrics.md). ## How do I get better search results? As quoted from [ReadTheDocs](https://docs.readthedocs.io/en/stable/server-side-search/syntax.html#special-queries), this documentation is powered by [Simple Query String](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#) from [Elasticsearch](https://www.elastic.co/elasticsearch/). Here are some helpful patterns: - Exact phrase search: `"global_route"` - Prefix query: `GRT-*`, `BUF*`, `report_*` - Fuzziness: `~N` (tilde followed by a number) after a word indicates edit distance. Helpful if the exact spelling is unknown. For example: `test~2`, `reportfilename~2` # FlowTutorial.html.md # OpenROAD Flow Scripts Tutorial ## Introduction This document describes a tutorial to run the complete OpenROAD flow from RTL-to-GDS using [OpenROAD Flow Scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts). It includes examples of useful design and manual usage in key flow stages to help users gain a good understanding of the [OpenROAD](https://openroad.readthedocs.io/en/latest/main/README.html) application flow, data organization, GUI and commands. This is intended for: - Beginners or new users with some understanding of basic VLSI design flow. Users will learn the basics of installation to use OpenROAD-flow-scripts for the complete RTL-to-GDS flow from here. - Users already familiar with the OpenROAD application and flow but would like to learn more about specific features and commands. ## User Guidelines - This tutorial requires a specific directory structure built by OpenROAD-flow-scripts (ORFS). Do not modify this structure or underlying files since this will cause problems in the flow execution. - User can run the full RTL-to-GDS flow and learn specific flow sections independently. This allows users to learn the flow and tool capabilities at their own pace, time and preference. - Results shown, such as images or outputs of reports and logs, could vary based on release updates. However, the main flow and command structure should generally apply. Note: Please submit any problem found under Issues in the GitHub repository [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues). ## Getting Started This section describes the environment setup to build OpenROAD-flow-scripts and get ready to execute the RTL-to-GDS flow of the open-source design `ibex` using the `sky130hd` technology. `ibex` is a 32 bit RISC-V CPU core (`RV32IMC/EMC`) with a two-stage pipeline. ### Setting Up The Environment Use the `bash` shell to run commands and scripts. #### OpenROAD-flow-scripts Installation To install OpenROAD-flow-scripts, refer to the [Build or installing ORFS Dependencies](https://openroad-flow-scripts.readthedocs.io/en/latest/#build-or-installing-orfs-dependencies) documentation. In general, we recommend using `Docker` for an efficient user experience. Please refer to the [Docker Shell](../user/DockerShell.md) documentation. #### NOTE If you need a custom Docker image, you can build your own with the instructions provided at: [Build from sources using Docker](../user/BuildWithDocker.md). #### NOTE If you need to update an existing OpenROAD-flow-scripts installation: - For local installs follow instructions from [here](../user/FAQS.md#how-do-i-update-openroad-flow-scripts). - For Docker run `docker pull openroad/orfs:latest` to update the image. ## Configuring The Design This section shows how to set up the necessary platform and design configuration files to run the complete RTL-to-GDS flow using OpenROAD-flow-scripts for `ibex` design. ```shell cd flow ``` ### Platform Configuration View the platform configuration file setup for default variables for `sky130hd`. ```shell less ./platforms/sky130hd/config.mk ``` The `config.mk` file has all the required variables for the `sky130` platform and hence it is not recommended to change any variable definition here. You can view the `sky130hd` platform configuration [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/platforms/sky130hd/config.mk). Refer to the [Flow variables](../user/FlowVariables.md) document for details on how to use platform and design specific environment variables in OpenROAD-flow-scripts to customize and configure your design flow. ### Design Configuration View the default design configuration of `ibex` design: ```shell less ./designs/sky130hd/ibex/config.mk ``` You can view `ibex` design `config.mk` [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk). #### NOTE The following design-specific configuration variables are required to specify main design inputs such as platform, top-level design name and constraints. We will use default configuration variables for this tutorial. | Variable Name | Description | |--------------------|------------------------------------------------------------------------------------------------------------------------------------------| | `PLATFORM` | Specifies Process design kit. | | `DESIGN_NAME` | The name of the top-level module of the design | | `VERILOG_FILES` | The path to the design Verilog files or JSON files providing a description of modules (check `yosys -h write_json` for more details). | | `SDC_FILE` | The path to design `.sdc` file | | `CORE_UTILIZATION` | The core utilization percentage. | | `PLACE_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread | #### NOTE To add a new design to the `flow`, refer to the document [here](../user/AddingNewDesign.md). This step is for advanced users. If you are a beginner, first understand the flow by completing this tutorial and come back to this step later to add a new design. ### Timing Constraints View timing constraints specified in the `.sdc` file [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/constraint.sdc). ```shell less ./designs/sky130hd/ibex/constraint.sdc ``` For `ibex` design, we simply use the clock definition as follows as a minimum required timing constraint. ```tcl create_clock -name core_clock -period 17.4 [get_ports {clk_i}] ``` ### Design Input SystemVerilog The SystemVerilog input files are located in `./designs/src/ibex_sv/` The design is defined in `ibex_core.sv` available [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex_sv/ibex_core.sv). Refer to the `ibex` design `README.md` [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex_sv/README.md). ## Running The Automated RTL-to-GDS Flow This section describes the complete execution of the design flow from RTL-to-GDS. The OpenROAD application executes the entire autonomous flow using Tcl scripts that invoke open-sourced tools, from synthesis to the final `.gds` file creation, without requiring human intervention. However, in this tutorial, the user will learn both the automated and a few interactive ways to run Tcl commands for important flow stages. From the OpenROAD-flow-scripts directory, users can access individual flow stages, respective tools and the corresponding `README.md` for tool commands, configuration examples using the Tcl interface and other such details. - [Synthesis](https://github.com/The-OpenROAD-Project/yosys/blob/master/README.md) - [Database](https://openroad.readthedocs.io/en/latest/main/src/odb/README.html) - [Floorplanning](https://openroad.readthedocs.io/en/latest/main/src/ifp/README.html) - [Pin Placement](https://openroad.readthedocs.io/en/latest/main/src/ppl/README.html) - [Chip-level Connections](https://openroad.readthedocs.io/en/latest/main/src/pad/README.html) - [Macro Placement](https://openroad.readthedocs.io/en/latest/main/src/mpl/README.html) - [Tapcell insertion](https://openroad.readthedocs.io/en/latest/main/src/tap/README.html) - [PDN Analysis](https://openroad.readthedocs.io/en/latest/main/src/pdn/README.html) - [IR Drop Analysis](https://openroad.readthedocs.io/en/latest/main/src/psm/README.html) - [Global Placement](https://openroad.readthedocs.io/en/latest/main/src/gpl/README.html) - [Timing Analysis](https://openroad.readthedocs.io/en/latest/main/src/sta/README.html) - [Detailed Placement](https://openroad.readthedocs.io/en/latest/main/src/dpl/README.html) - [Timing Optimization using Resizer](https://openroad.readthedocs.io/en/latest/main/src/rsz/README.html) - [Clock Tree Synthesis](https://openroad.readthedocs.io/en/latest/main/src/cts/README.html) - [Global Routing](https://openroad.readthedocs.io/en/latest/main/src/grt/README.html) - [Antenna Rule Checker](https://openroad.readthedocs.io/en/latest/main/src/ant/README.html) - [Detail Routing](https://openroad.readthedocs.io/en/latest/main/src/drt/README.html) - [Metall Fill](https://openroad.readthedocs.io/en/latest/main/src/fin/README.html) - [Parasitics Extraction](https://openroad.readthedocs.io/en/latest/main/src/rcx/README.html) - [Layout Generation](https://www.klayout.de/) ### Design Goals Run the `ibex` design in OpenROAD-flow-scripts automated flow from RTL-to-GDS using `sky130hd`. Find `ibex` design details [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/src/ibex/README.md) and the design goals are: - Area ```default Minimum Required Die size: 0 0 798 800 (in micron) Core size: 2 2 796 798 (in micron) ``` - Timing ```default Clock period to meet timing: 17.4 (in ns) ``` `ibex` takes approximately 8 minutes on a machine with 8-cores and 16GB RAM. The runtime will vary based on your configuration. Change your current directory to the `flow` directory. ```shell cd flow ``` Run the complete flow with: ```shell make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk ``` As the flow executes, check out the OpenROAD-flow-scripts directory contents and their significance. OpenROAD-flow-scripts can generally restart from a previous partial run. If you have errors which prevent restarting the flow, you may try deleting all generated files and start a fresh run. Errors can occur if a tool crashes or is killed while writing a file. The files for `sky130hd/ibex` as an example can be deleted with: ```shell make clean_all DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk ``` You can also delete files related to individual stages of RTL to GDSII conversion like synthesis, floorplanning, macro placement, clock tree synthesis, routing and layout generation with `clean_synth`, `clean_floorplan`, `clean_place`, `clean_cts`, `clean_route`, and `clean_finish`, respectively. ### Viewing OpenROAD-flow-scripts Directory Structure And Results Open a new tab in the terminal and explore the directory structure in `flow` by typing `ls` command to view its contents: ```shell designs logs Makefile objects platforms reports results scripts test util ``` Navigate through each of the sub-directories above to understand how underlying files are organized. - `designs/sky130hd/ibex` Files include: designs make file and SDC file for the `sky130hd` platform and other files for autotuner and metrics. ```default autotuner.json config.mk constraint_doe.sdc constraint.sdc metadata-base-ok.json rules.json ``` - `platforms` Includes public PDKs supported by OpenROAD flow ```default asap7 nangate45 sky130hd sky130hs sky130io sky130ram ``` - `objects/sky130hd/ibex/base` Includes ABC constraints and all the temporary library files used for the completion flow ```default abc.constr klayout.lyt klayout_tech.lef lib ``` - `logs/sky130hd/ibex/base` Logs directory, which contains log files for each flow stage. | `logs` | | | |-----------------------------|------------------------|-----------------| | `1_1_yosys.log` | `3_1_place_gp.log` | `5_2_route.log` | | `2_1_floorplan.log` | `3_2_place_iop.log` | `6_1_merge.log` | | `2_2_floorplan_io.log` | `3_3_resizer.log` | `6_report.log` | | `2_3_tdms_place.log` | `3_4_opendp.log` | | | `2_4_floorplan_macro.log` | `4_1_cts.log` | | | `2_5_floorplan_tapcell.log` | `4_2_cts_fillcell.log` | | | `2_6_floorplan_pdn.log` | `5_1_grt.log` | | - `results/sky130hd/ibex/base` Results directory which contains `.v/.sdc/.odb/.def/.spef` files | `results` | | | |-----------------------------|-------------------------|--------------------| | `1_1_yosys.v` | `3_1_place_gp.odb` | `5_route.sdc` | | `1_synth.sdc` | `3_2_place_iop.odb` | `6_1_fill.odb` | | `1_synth.v` | `3_3_place_resized.odb` | `6_1_fill.sdc` | | `2_1_floorplan.odb` | `3_4_place_dp.odb` | `6_1_merged.gds` | | `2_2_floorplan_io.odb` | `3_place.odb` | `6_final.odb` | | `2_3_floorplan_tdms.odb` | `3_place.sdc` | `6_final.gds` | | `2_4_floorplan_macro.odb` | `4_1_cts.odb` | `6_final.sdc` | | `2_5_floorplan_tapcell.odb` | `4_2_cts_fillcell.odb` | `6_final.spef` | | `2_6_floorplan_pdn.odb` | `4_cts.odb` | `6_final.v` | | `2_floorplan.odb` | `4_cts.sdc` | `output_guide.mod` | | `2_floorplan.sdc` | `4_cts.v` | `route.guide` | | `2_floorplan.v` | `5_route.odb` | `updated_clks.sdc` | - `reports/sky130hd/ibex/base` Reports directory, which contains congestion report, DRC report, design statistics and antenna log for reference. | `reports` | | | |-------------------|---------------------|------------------------| | `congestion.rpt` | `VDD.rpt` | `VSS.rpt` | | `5_route_drc.rpt` | `final_clocks.webp` | `final_placement.webp` | | `antenna.log` | `final_clocks.webp` | `final.webp` | | `synth_stat.txt` | `synth_check.txt` | `final_resizer.webp` | The table below briefly describes the reports directory files. | File Name | Description | |------------------------|----------------------------------------------------------| | `congestion.rpt` | Global routing congestion if occurred. | | `5_route_drc.rpt` | DRC violations if occurred. | | `final_clocks.webp` | OR extracted image reference after clock tree synthesis. | | `final_resizer.webp` | OR extracted image reference after resizer. | | `synth_check.txt` | Synthesis warning/error messages. | | `antenna.log` | Antenna check log report. | | `final_placement.webp` | Extracted image after final placement. | | `final.webp` | Extracted image after routing. | | `synth_stat.txt` | Post synthesis design statistics log saved here. | The flow completes with the message below by creating a merged final GDS file. ```default [INFO] Writing out GDS/OAS 'results/sky130hd/ibex/base/6_1_merged.gds' cp results/sky130hd/ibex/base/6_1_merged.gds results/sky130hd/ibex/base/6_final.gds ``` ## Viewing Results And Logs OpenROAD-flow-scripts prepends a prefix to each flow stage, as shown below, to indicate the position in the RTL-GDS flow. This makes it easier to understand and debug each flow stage in case of failure. View `ibex` design logs: ```shell ls logs/sky130hd/ibex/base/ ``` The log structure is as follows: | `logs` | | | |-----------------------------|------------------------|-----------------| | `1_1_yosys.log` | `3_1_place_gp.log` | `5_2_route.log` | | `2_1_floorplan.log` | `3_2_place_iop.log` | `6_1_merge.log` | | `2_2_floorplan_io.log` | `3_3_resizer.log` | `6_report.log` | | `2_3_tdms_place.log` | `3_4_opendp.log` | | | `2_4_floorplan_macro.log` | `4_1_cts.log` | | | `2_5_floorplan_tapcell.log` | `4_2_cts_fillcell.log` | | | `2_6_floorplan_pdn.log` | `5_1_grt.log` | | ### Area View design area and its core utilization: ```shell make gui_final ``` In the `Tcl Commands` section: ```tcl report_design_area ``` View the resulting area as: ```default Design area 191262 u^2 30% utilization. ``` ### Timing Users can view flow results using the command interface from the shell or the OpenROAD GUI to visualize further and debug. Learn more about the [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui). ```shell make gui_final ``` Use the following commands in the `Tcl Commands` section of GUI: ```tcl report_worst_slack report_tns report_wns ``` Note the worst slack, total negative slack and worst negative slack: ```default worst slack -0.99 tns -1.29 wns -0.99 ``` Learn more about visualizing and tracing time paths across the design hierarchy refer to the OpenROAD [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui). ### Power Use the report command to view individual power components i.e. sequential, combinational, macro and power consumed by I/O pads. In the `Tcl Commands` section: ```tcl report_power ``` The power output is as follows: ```default -------------------------------------------------------------------------- Group Internal Switching Leakage Total Power Power Power Power ---------------------------------------------------------------- Sequential 5.58e-03 6.12e-04 1.67e-08 6.19e-03 19.0% Combinational 9.23e-03 1.71e-02 4.90e-08 2.63e-02 81.0% Macro 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.0% Pad 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.0% ---------------------------------------------------------------- Total 1.48e-02 1.77e-02 6.57e-08 3.25e-02 100.0% 45.6% 54.4% 0.0% ``` ## OpenROAD GUI The GUI allows users to select, control, highlight and navigate the design hierarchy and design objects (nets, pins, instances, paths, etc.) through detailed visualization and customization options. Find details on how to use the [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui). All the windows aside from the layout are docking windows that can be undocked. Also it can be closed and reopened from the Windows menu. Note: When you are using remote access, you will need to include -Y (or -X) option in your command to enable X11 applications to function properly over the network. By using the command “ssh -Y” followed by the remote servers’ address or hostname, you can establish a secure connection and activate X11 forwarding. This feature enables you to run graphical programs on the remote server and have their windows display on your local machines desktop environment. In this section, learn how to: 1. Visualize design hierarchy 2. Load ODB files for floorplan and layout visualization 3. Trace the synthesized clock tree to view hierarchy and buffers 4. Use heat maps to view congestion and observe the effect of placement 5. View and trace critical timing paths 6. Set display control options 7. Zoom to object from inspector If you have completed the RTL-GDS flow, then proceed to view the final GDS file under results directory `./results/sky130hd/ibex/base/` For the `ibex` design uncomment the `DESIGN_CONFIG` variable in the `Makefile` available [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/Makefile). ```default # DESIGN_CONFIG=./designs/sky130hd/gcd/config.mk DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk # DESIGN_CONFIG=./designs/sky130hd/aes/config.mk ``` ```shell make gui_final ``` ### Viewing Layout Results The `make gui_final` command target successively reads and loads the technology `.odb` files and the parasitics and invokes the GUI in these steps: - Reads and loads `.odb` files. - Loads `.spef` (parasitics). The figure below shows the post-routed DEF for the `ibex` design. ![ibex_final_db](tutorials/images/ibex_final_db.webp) ### Visualizing Design Objects And Connectivity Note the `Display Control` window on the LHS that shows buttons for color, visibility and selection options for various design objects: Layers, Nets, Instances, Blockages, Heatmaps, etc. The Inspector window on the RHS allows users to inspect details of selected design objects and the timing report. Try selectively displaying (show/hide) various design objects through the display control window and observing their impact on the display. ### Tracing The Clock Tree View the synthesized clock tree for `ibex` design: - From the top Toolbar Click `Windows` -> `Clock Tree Viewer` ![cts_viewer](tutorials/images/CTV_update.webp) On RHS, click `Clock Tree Viewer` and top right corner, click `Update` to view the synthesized clock tree of your design. View clock tree structure below, the user needs to disable the metal `Layers` section on LHS as shown below. ![ibex_clock_tree](tutorials/images/ibex_clock_tree.webp) From the top Toolbar, click on the `Windows` menu to select/hide different view options of Scripting, Display control, etc. ### Using Heat Maps From the Menu Bar, Click on `Tools` -> `Heat Maps` -> `Placement Density` to view congestion selectively on vertical and horizontal layers. Expand `Heat Maps` -> `Placement Density` from the Display Control window available on LHS of OpenROAD GUI. View congestion on all layers between 50-100%: In the `Placement density` setup pop-up window, Select `Minimum` -> `50.00%` `Maximum` -> `100.00%` ![placement_heat_map](tutorials/images/placement_heatmap.webp) From `Display Control`, select `Heat Maps` -> `Routing Congestion` as follows: ![routing_heat_map](tutorials/images/routing_heatmap.webp) From `Display Control`, select `Heat Maps` -> `Power Density` as follows: ![power_heat_map](tutorials/images/power_heatmap.webp) ### Viewing Timing Report Click `Timing` -> `Options` to view and traverse specific timing paths. From Toolbar, click on the `Timing` icon, View `Timing Report` window added at the right side (RHS) of GUI as shown below. ![Timing report option](tutorials/images/ibex_final_db.webp) In `Timing Report` Select `Paths` -> `Update`, `Paths` should be integer numbers. The number of timing paths should be displayed in the current window as follows: ![Clock Path Update](tutorials/images/clock_path_update.webp) Select `Setup` or `Hold` tabs and view required arrival times and slack for each timing path segment. For each `Setup` or `Hold` path group, path details have a specific `pin name, Time, Delay, Slew and Load` value with the clock to register, register to register and register to output data path. ### Using Rulers A ruler can measure the distance between any two objects in the design or metal layer length and width to be measured, etc. Example of how to measure the distance between VDD and VSS power grid click on: `Tools` -> `Ruler K` ![Ruler Tool](tutorials/images/ruler_tool.png) Distance between VDD and VSS layer is `11.970` ### DRC Viewer You can use the GUI to trace DRC violations and fix them. View DRC violations post routing: ```shell less ./reports/sky130hd/ibex/base/5_route_drc.rpt ``` Any DRC violations are logged in the `5_route_drc.rpt` file, which is empty otherwise. From OpenROAD GUI, Enable the menu options `Windows` -> `DRC Viewer`. A `DRC viewer` window is added on the right side (RHS) of the GUI. From `DRC Viewer` -> `Load` navigate to `5_route_drc.rpt` ![DRC Report Load](tutorials/images/drc_report_load.webp) By selecting DRC violation details, designers can analyze and fix them. Here user will learn how a DRC violation can be traced with the `gcd` design. Refer to the following OpenROAD test case for more details. ```shell cd ./flow/tutorials/scripts/drt/ openroad -gui ``` In the `Tcl Commands` section of GUI: ```tcl source drc_issue.tcl ``` Post detail routing in the log, you can find the number of violations left in the design: ```default [INFO DRT-0199] Number of violations = 7. ``` Based on `DRC Viewer` steps load `results/5_route_drc.rpt`. GUI as follows ![gcd DRC issue load](tutorials/images/gcd_drc_issue.webp) `X mark` in the design highlights DRC violations. From `DRC Viewer` on RHS `expand` -> `Short` This shows the number of `violations` in the design. Zoom the design for a clean view of the violation: ![View DRC Violation](tutorials/images/view_violation.webp) `output53` has overlaps and this causes the `short violation`. Open the input DEF file `drc_cts.def` to check the source of the overlap. Note the snippet of DEF file where `output51` and `output53` have the same placed coordinates and hence cause the placement violation. ```default - output51 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ; - output53 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ; ``` Use the test case provided in `4_cts.def` with the changes applied for updated coordinates as follows: ```default - output51 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 267260 136000 ) N ; - output53 sky130_fd_sc_hd__clkbuf_1 + PLACED ( 124660 266560 ) N ; ``` Close the current GUI and re-load the GUI with the updated DEF to see fixed DRC violation in the design: ```shell openroad -gui ``` In the `Tcl Commands` section: ```tcl source drc_fix.tcl ``` In the post detail routing log, the user can find the number of violations left in the design: ```default [INFO DRT-0199] Number of violations = 0. ``` Routing completed with 0 violations. ### Tcl Command Interface Execute OpenROAD-flow-scripts Tcl commands from the GUI. Type `help` to view Tcl Commands available. In OpenROAD GUI, at the bottom, `TCL commands` executable space is available to run the commands. For example View `design area` in the `Tcl Commands` section of the GUI: ```tcl report_design_area ``` Try the below timing report commands to view timing results interactively: ```tcl report_wns report_tns report_worst_slack ``` ### Customizing The GUI Customize the GUI by creating your own widgets such as menu bars, toolbar buttons, dialog boxes, etc. Refer to the [GUI](https://openroad.readthedocs.io/en/latest/main/README.html#gui). Create `Load_LEF` toolbar button in GUI to automatically load specified `.lef` files. ```shell openroad -gui ``` ![Default GUI](tutorials/images/default_gui.webp) To view `load_lef.tcl`, run the command: ```shell less ./flow/tutorials/scripts/gui/load_lef.tcl ``` ```tcl proc load_lef_sky130 {} { set FLOW_PATH [exec pwd] read_lef $FLOW_PATH/../../../platforms/sky130hd/lef/sky130_fd_sc_hd.tlef read_lef $FLOW_PATH/../../../platforms/sky130hd/lef/sky130_fd_sc_hd_merged.lef } create_toolbar_button -name "Load_LEF" -text "Load_LEF" -script {load_lef_sky130} -echo ``` From OpenROAD GUI `Tcl commands`: ```tcl cd ./flow/tutorials/scripts/gui/ source load_lef.tcl ``` `Load_LEF` toolbar button added as follows: ![Load LEF toolbar button](tutorials/images/Load_LEF_button.webp) From Toolbar menus, Click on `Load_LEF.` This loads the specified `sky130` technology `.tlef` and `merged.lef` file in the current OpenROAD GUI as follows: ![sky130 LEF file load](tutorials/images/sky130_lef_load.webp) ## Understanding and Analyzing OpenROAD Flow Stages and Results The OpenROAD flow is fully automated and yet the user can usefully intervene to explore, analyze and optimize your design flow for good PPA. In this section, you will learn specific details of flow stages and learn to explore various design configurations and optimizations to target specific design goals, i.e., PPA (area, timing, power). ### Synthesis Explorations #### Area And Timing Optimization Explore optimization options using synthesis options: `ABC_AREA` and `ABC_SPEED`. Set `ABC_AREA=1` for area optimization and `ABC_SPEED=1` for timing optimization. Update design `config.mk` for each case and re-run the flow to view impact. To view `ibex` design [config.mk](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk). ```default #Synthesis strategies export ABC_AREA = 1 ``` Run `make` command from `flow` directory as follows: ```shell make DESIGN_CONFIG=./designs/sky130hd/gcd/config.mk ``` The `gcd` design synthesis results for area and speed optimizations are shown below: | Synthesis Statistics | ABC_SPEED | ABC_AREA | |------------------------|--------------------------------------|--------------------------------------| | `Number of wires` | 224 | 224 | | `Number of wire bits` | 270 | 270 | | `Number of cells` | 234 | 234 | | `Chip area` | 2083.248000 | 2083.248000 | | `Final Design Area` | Design area 4295 u^2 6% utilization. | Design area 4074 u^2 6% utilization. | Note: Results for area optimization should be ideally checked after floorplanning to verify the final impact. First, relax the `.sdc` constraint and re-run to see area impact. Otherwise, the repair design command will increase the area to meet timing regardless of the netlist produced earlier. ### Floorplanning This section describes OpenROAD-flow-scripts floorplanning and placement functions using the GUI. #### Floorplan Initialization Based On Core And Die Area Refer to the following OpenROAD built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/init_floorplan1.tcl). Run the following commands in the terminal in OpenROAD tool root directory to build and view the created floorplan. ```shell cd ../tools/OpenROAD/src/ifp/test/ openroad -gui ``` In `Tcl Commands` section GUI: ```tcl source init_floorplan1.tcl ``` View the resulting die area “0 0 1000 1000” and core area “100 100 900 900” in microns shown below: ![Absolute Floorplan](tutorials/images/absolute_die.webp) #### Floorplan Based On Core Utilization Refer to the following OpenROAD built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/init_floorplan2.tcl). Run the following commands in the terminal in OpenROAD tool root directory to view how the floorplan initialized: ```shell cd ../tools/OpenROAD/src/ifp/test/ openroad -gui ``` In the `Tcl Commands` section of the GUI: ```tcl source init_floorplan2.tcl ``` View the resulting core utilization of 30 created following floorplan: ![Relative Floorplan](tutorials/images/core_util.webp) ### IO Pin Placement Place pins on the boundary of the die on the track grid to minimize net wirelengths. Pin placement also creates a metal shape for each pin using min-area rules. For designs with unplaced cells, the net wirelength is computed considering the center of the die area as the unplaced cells position. Find pin placement document [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ppl/README.md). Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/ppl/test). Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/ppl/test/ openroad -gui ``` Run [place_pin4.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ppl/test/place_pin4.tcl) script to view pin placement. From the GUI `Tcl commands` section: ```tcl source place_pin4.tcl ``` View the resulting pin placement in GUI: ![place_pin](tutorials/images/place_pin.webp) In OpenROAD GUI to enlarge `clk` pin placement, hold mouse right button as follows and draw sqaure box in specific location: ![pin_zoom](tutorials/images/pin_zoom_RC.webp) Now `clk` pin zoom to clear view as follows: ![pin_zoomed](tutorials/images/pin_zoomed.webp) ### Chip Level IO Pad Placement In this section, you will generate an I/O pad ring for the `coyote` design using a Tcl script. ICeWall is a utility to place IO cells around the periphery of a design, and associate the IO cells with those present in the netlist of the design. For I/O pad placement using ICeWall refer to the readme file [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pad/README.md). Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pad/test). Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/pad/test/ openroad -gui ``` Run [skywater130_coyote_tc.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pad/test/skywater130_coyote_tc.tcl) script to view IO pad placement. From the GUI `Tcl commands` section: ```tcl source skywater130_coyote_tc.tcl ``` View the resulting IO pad ring in GUI: ![coyote pad ring](tutorials/images/coyote_pad_ring.webp) ### Power Planning And Analysis In this section, you will use the design `gcd` to create a power grid and run power analysis. Pdngen is used for power planning. Find the document [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/README.md). Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pdn/test). Launch openroad GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/pdn/test openroad -gui ``` Run [core_grid_snap.tcl](.(https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/test/core_grid_snap.tcl) to generate power grid for `gcd` design. ```tcl source core_grid_snap.tcl ``` View the resulting power plan for `gcd` design: ![gcd PDN GUI](tutorials/images/gcd_pdn_gui.webp) #### IR Drop Analysis IR drop is the voltage drop in the metal wires constituting the power grid before it reaches the power pins of the standard cells. It becomes very important to limit the IR drop as it affects the speed of the cells and overall performance of the chip. PDNSim is an open-source static IR analyzer. Features: - Report worst IR drop. - Report worst current density over all nodes and wire segments in the power distribution network, given a placed and PDN-synthesized design. - Check for floating PDN stripes on the power and ground nets. - Spice netlist writer for power distribution network wire segments. Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/psm/test). Launch openroad by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/psm/test openroad ``` Run [gcd_test_vdd.tcl](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/psm/test/gcd_test_vdd.tcl) to generate IR drop report for `gcd` design. ```tcl source gcd_test_vdd.tcl ``` Find the IR drop report at the end of the log as follows: ```default ########## IR report ################# Worstcase voltage: 1.10e+00 V Average IR drop : 1.68e-04 V Worstcase IR drop: 2.98e-04 V ###################################### ``` ### Tapcell insertion Tap cells are non-functional cells that can have a well tie, substrate tie or both. They are typically used when most or all of the standard cells in the library contain no substrate or well taps. Tap cells help tie the VDD and GND levels and thereby prevent drift and latch-up. The end cap cell or boundary cell is placed at both the ends of each placement row to terminate the row. They protect the standard cell gate at the boundary from damage during manufacturing. Tap cells are placed after the macro placement and power rail creation. This stage is called the pre-placement stage. Tap cells are placed in a regular interval in each row of placement. The maximum distance between the tap cells must be as per the DRC rule of that particular technology library. The figures below show two examples of tapcell insertion. When only the `-tapcell_master` and `-endcap_master` masters are given, the tapcell placement is similar to Figure 1. When the remaining masters are give, the tapcell placement is similar to Figure 2. Refer to the GUI figures to highlight well tap and end cap cells. The image does not differentiate and just shows a bunch of rectangles. | ![image](tutorials/images/tapcell_example1.svg) | ![image](tutorials/images/tapcell_example2.svg) | |---------------------------------------------------|----------------------------------------------------------| | Figure 1: Tapcell insertion representation | Figure 2: Tapcell insertion around macro representation | Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/tap/test/gcd_nangate45.tcl) to learn about Tap/endcap cell insertion. To view this in OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/tap/test/ openroad -gui ``` In the `Tcl Commands` section of GUI ```tcl source gcd_nangate45.tcl ``` View the resulting tap cell insertion as follows: ![Tap_Cell_Insertion](tutorials/images/tapcell_insertion_view.webp) ### Tie Cells The tie cell is a standard cell, designed specially to provide the high or low signal to the input (gate terminal) of any logic gate. Where ever netlist is having any pin connected to 0 logic or 1 logic (like .A(1’b0) or .IN(1’b1), a tie cell gets inserted there. Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/tiecells.tcl) to learn about Tie cell insertion. To check this in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/ifp/test/ openroad ``` In the `Tcl Commands` section: ```tcl source tiecells.tcl ``` Refer the following verilog code which have tie high/low net. [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ifp/test/tiecells.v) ```default AND2_X1 u2 (.A1(r1q), .A2(1'b0), .ZN(u2z0)); AND2_X1 u3 (.A1(u1z), .A2(1'b1), .ZN(u2z1)); ``` With following `insert_tiecells` command: ```tcl insert_tiecells LOGIC0_X1/Z -prefix "TIE_ZERO_" insert_tiecells LOGIC1_X1/Z ``` During floorplan stage, those nets converted to tiecells as follows based on library(This is Nangate45 specific): ```default [INFO IFP-0030] Inserted 1 tiecells using LOGIC0_X1/Z. [INFO IFP-0030] Inserted 1 tiecells using LOGIC1_X1/Z. ``` ### Macro or Standard Cell Placement #### Macro Placement In this section, you will explore various placement options for macros and standard cells and study the impact on area and timing. Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/gpl/test/macro01.tcl) to learn about macro placement. Placement density impacts how widely standard cells are placed in the core area. To view this in OpenROAD GUI run the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/gpl/test/ openroad -gui ``` In the `Tcl Commands` section of GUI ```tcl source macro01.tcl ``` Read the resulting macro placement with a complete core view: | ![image](tutorials/images/macro_place_full_view.webp) | ![image](tutorials/images/macro_place_close_view.webp) | |---------------------------------------------------------|----------------------------------------------------------| | Figure 1: With density 0.7 | Figure 2: Zoomed view of macro and std cell placement | Reduce the placement density and observe the impact on placement, by running below command in `Tcl Commands` section of GUI: ```tcl global_placement -density 0.6 ``` Read the resulting macro placement with a complete core view: | ![image](tutorials/images/placement_density_06_full.webp) | ![image](tutorials/images/placement_density_06_zoomed.webp) | |-------------------------------------------------------------|---------------------------------------------------------------| | Figure 1: With density 0.6 | Figure 2: Zoomed view of macro and std cell placement | ##### Macro Placement With Halo Spacing Explore macro placement with halo spacing, refer to the example [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/mpl/test/). Launch GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/mpl/test openroad -gui ``` In the `Tcl Commands` section of GUI: ```tcl source helpers.tcl source level3.tcl global_placement ``` DEF file without halo spacing ![gcd without halo spacing](tutorials/images/without_halo.webp) Now increase the halo width for better routing resources. In the `Tcl Commands` section of GUI: ```tcl macro_placement -halo {0.5 0.5} ``` Overlapping macros placed `0.5` micron H/V halo around macros. ![gcd with halo spacing](tutorials/images/with_halo.webp) #### Defining Placement Density To learn on placement density strategies for `ibex` design, go to `OpenROAD-flow-scripts/flow`. Type: ```shell openroad -gui ``` Enter the following commands in the `Tcl Commands` section of GUI ```tcl read_lef ./platforms/sky130hd/lef/sky130_fd_sc_hd.tlef read_lef ./platforms/sky130hd/lef/sky130_fd_sc_hd_merged.lef read_def ./results/sky130hd/ibex/base/3_place.def ``` ![ibex placement density 60](tutorials/images/ibex_pl_60.webp) Change `CORE_UTILIZATION` and `PLACE_DENSITY` for the `ibex` design `config.mk` as follows. View `ibex` design `config.mk` [here](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/ibex/config.mk). ```tcl export CORE_UTILIZATION = 40 export PLACE_DENSITY_LB_ADDON = 0.1 ``` Re-run the `ibex` design with the below command: ```shell make DESIGN_CONFIG=./designs/sky130hd/ibex/config.mk ``` View the `ibex` design placement density heat map as shown below: ![ibex placement density 50](tutorials/images/ibex_pl_50.webp) So from above, GUI understood that change in `CORE_UTILIZATION` from 20 to 40 and placement density default 0.60 to 0.50 changes standard cell placement became widely spread. ### Timing Optimizations #### Timing Optimization Using repair_design The `repair_design` command inserts buffers on nets to repair `max slew, max capacitance and max fanout` violations and on long wires to reduce RC delay. It also resizes gates to normalize slews. Use `estimate_parasitics -placement` before `repair_design` to account for estimated post-placement parasitics. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_slew1.tcl). Launch GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/rsz/test/ openroad -gui ``` Copy and paste the below commands in the `Tcl Commands` section of GUI. ```tcl source "helpers.tcl" source "hi_fanout.tcl" read_liberty Nangate45/Nangate45_typ.lib read_lef Nangate45/Nangate45.lef set def_file [make_result_file "repair_slew1.def"] write_hi_fanout_def $def_file 30 read_def $def_file create_clock -period 1 clk1 set_wire_rc -layer metal3 estimate_parasitics -placement set_max_transition .05 [current_design] puts "Found [sta::max_slew_violation_count] violations" ``` The number of violations log as: ```default Found 31 violations ``` These violations were fixed by: ```tcl repair_design ``` The log is as follows: ```default [INFO RSZ-0058] Using max wire length 853um. [INFO RSZ-0039] Resized 1 instance. ``` To view violation counts again: ```tcl puts "Found [sta::max_slew_violation_count] violations" ``` The log follows: ```default Found 0 violations ``` `repair_design` fixed all 31 violations. #### Timing Optimization Using repair_timing The `repair_timing` command repairs setup and hold violations. It was run after clock tree synthesis with propagated clocks. While repairing hold violations, buffers are not inserted since that may cause setup violations unless ‘-allow_setup_violations’ is specified. Use `-slack_margin` to add additional slack margin. #### Timing Optimization Based On Multiple Corners OpenROAD supports multiple corner analysis to calculate worst-case setup and hold violations. Setup time optimization is based on the slow corner or the best case when the launch clock arrives later than the data clock. Hold time optimization is based on the fast corner or the best case when the launch clock arrives earlier than the capture clock. Refer to the following `gcd` design on `repair_timing` with fast and slow corners. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/test/gcd_sky130hd_fast_slow.tcl). Run the following commands in the terminal: ```shell cd ../../test/ openroad source gcd_sky130hd_fast_slow.tcl ``` The resulting `worst slack`, `TNS`: ```tcl report_worst_slack -min -digits 3 report_worst_slack -max -digits 3 report_tns -digits 3 ``` ```default worst slack 0.321 worst slack -16.005 tns -529.496 ``` #### Fixing Setup Violations To fix setup timing path violations, use `repair_timing -setup.` Refer to the following built-in example to learn more about fixing setup timing violations. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_setup4.tcl). Launch OpenROAD in an interactive mode by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/rsz/test/ openroad ``` Copy and paste the following Tcl commands. ```tcl define_corners fast slow read_liberty -corner slow Nangate45/Nangate45_slow.lib read_liberty -corner fast Nangate45/Nangate45_fast.lib read_lef Nangate45/Nangate45.lef read_def repair_setup1.def create_clock -period 0.3 clk set_wire_rc -layer metal3 estimate_parasitics -placement report_checks -fields input -digits 3 ``` View the generated timing report with the slack violation. ```default Startpoint: r1 (rising edge-triggered flip-flop clocked by clk) Endpoint: r2 (rising edge-triggered flip-flop clocked by clk) Path Group: clk Path Type: max Corner: slow Delay Time Description ----------------------------------------------------------- 0.000 0.000 clock clk (rise edge) 0.000 0.000 clock network delay (ideal) 0.000 0.000 ^ r1/CK (DFF_X1) 0.835 0.835 ^ r1/Q (DFF_X1) 0.001 0.836 ^ u1/A (BUF_X1) 0.196 1.032 ^ u1/Z (BUF_X1) 0.001 1.033 ^ u2/A (BUF_X1) 0.121 1.154 ^ u2/Z (BUF_X1) 0.001 1.155 ^ u3/A (BUF_X1) 0.118 1.273 ^ u3/Z (BUF_X1) 0.001 1.275 ^ u4/A (BUF_X1) 0.118 1.393 ^ u4/Z (BUF_X1) 0.001 1.394 ^ u5/A (BUF_X1) 0.367 1.761 ^ u5/Z (BUF_X1) 0.048 1.809 ^ r2/D (DFF_X1) 1.809 data arrival time 0.300 0.300 clock clk (rise edge) 0.000 0.300 clock network delay (ideal) 0.000 0.300 clock reconvergence pessimism 0.300 ^ r2/CK (DFF_X1) -0.155 0.145 library setup time 0.145 data required time ----------------------------------------------------------- 0.145 data required time -1.809 data arrival time ----------------------------------------------------------- -1.664 slack (VIOLATED) ``` Fix setup violation using: ```tcl repair_timing -setup ``` The log is as follows: ```default [INFO RSZ-0040] Inserted 4 buffers. [INFO RSZ-0041] Resized 16 instances. [WARNING RSZ-0062] Unable to repair all setup violations. ``` Reduce the clock frequency by increasing the clock period to `0.9` and re-run `repair_timing` to fix the setup violation warnings. Such timing violations are automatically fixed by the `resizer` `post CTS` and `global routing.` ```tcl create_clock -period 0.9 clk repair_timing -setup ``` To view timing logs post-repair timing, type: ```tcl report_checks -fields input -digits 3 ``` The log is as follows: ```default Startpoint: r1 (rising edge-triggered flip-flop clocked by clk) Endpoint: r2 (rising edge-triggered flip-flop clocked by clk) Path Group: clk Path Type: max Corner: slow Delay Time Description ----------------------------------------------------------- 0.000 0.000 clock clk (rise edge) 0.000 0.000 clock network delay (ideal) 0.000 0.000 ^ r1/CK (DFF_X1) 0.264 0.264 v r1/Q (DFF_X1) 0.002 0.266 v u1/A (BUF_X4) 0.090 0.356 v u1/Z (BUF_X4) 0.003 0.359 v u2/A (BUF_X8) 0.076 0.435 v u2/Z (BUF_X8) 0.003 0.438 v u3/A (BUF_X8) 0.074 0.512 v u3/Z (BUF_X8) 0.003 0.515 v u4/A (BUF_X8) 0.077 0.592 v u4/Z (BUF_X8) 0.005 0.597 v u5/A (BUF_X16) 0.077 0.674 v u5/Z (BUF_X16) 0.036 0.710 v r2/D (DFF_X1) 0.710 data arrival time 0.900 0.900 clock clk (rise edge) 0.000 0.900 clock network delay (ideal) 0.000 0.900 clock reconvergence pessimism 0.900 ^ r2/CK (DFF_X1) -0.172 0.728 library setup time 0.728 data required time ----------------------------------------------------------- 0.728 data required time -0.710 data arrival time ----------------------------------------------------------- 0.019 slack (MET) ``` #### Fixing Hold Violations To fix hold violation for the design, command to use `repair_timing -hold` Refer to the example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rsz/test/repair_hold10.tcl) to learn more about fixing hold violations. Check hold violation post-global routing using the following Tcl commands. Run below steps in terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/rsz/test/ openroad -gui ``` Copy and paste the below commands in the `Tcl Commands` section of GUI. ```tcl source helpers.tcl read_liberty sky130hd/sky130hd_tt.lib read_lef sky130hd/sky130hd.tlef read_lef sky130hd/sky130hd_std_cell.lef read_def repair_hold10.def create_clock -period 2 clk set_propagated_clock clk set_wire_rc -resistance 0.0001 -capacitance 0.00001 set_routing_layers -signal met1-met5 global_route estimate_parasitics -global_routing report_worst_slack -min ``` Read the resulting worst slack as: ```default worst slack -1.95 ``` The above worst slack was fixed with: ```tcl repair_timing -hold ``` The log is as follows: ```default [INFO RSZ-0046] Found 2 endpoints with hold violations. [INFO RSZ-0032] Inserted 5 hold buffers. ``` Re-check the slack value after repair_timing. Type: ```tcl report_worst_slack -min ``` The result worst slack value is as follows: ```default worst slack 0.16 ``` Note that the worst slack is now met and the hold violation was fixed by the resizer. ### Clock Tree Synthesis To perform clock tree synthesis `clock_tree_synthesis` flow command used. The OpenROAD-flow-scripts automatically generates a well-balanced clock tree post-placement. In this section, you will learn details about the building and visualize the clock tree. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/cts/test/simple_test.tcl). Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/cts/test/ openroad -gui ``` To build the clock tree, run the following commands in `Tcl Commands` of GUI: ```tcl read_lef Nangate45/Nangate45.lef read_liberty Nangate45/Nangate45_typ.lib read_def "16sinks.def" create_clock -period 5 clk set_wire_rc -clock -layer metal3 clock_tree_synthesis -root_buf CLKBUF_X3 \ -buf_list CLKBUF_X3 \ -wire_unit 20 ``` Layout view before CTS as follows: ![Layout before CTS](tutorials/images/Layout_before_CTS.webp) Layout view after CTS can be viewed with `Update` option. ![Layout after CTS](tutorials/images/Layout_after_CTS.webp) Here we explore how clock tree buffers are inserted to balance the clock tree structure. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/cts/test/balance_levels.tcl). Generate a clock- tree that is unbalanced first, then explore the creation of a well-balanced clock tree. Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/cts/test/ openroad -gui ``` Use the following commands in the `TCL commands` section of GUI: ```tcl source "helpers.tcl" source "cts-helpers.tcl" read_liberty Nangate45/Nangate45_typ.lib read_lef Nangate45/Nangate45.lef set block [make_array 300 200000 200000 150] sta::db_network_defined create_clock -period 5 clk set_wire_rc -clock -layer metal5 ``` The clock tree structure is as follows with unbalanced mode. ![Unbalanced Clock tree](tutorials/images/unbalanced_clock_tree.webp) Use the `clock_tree_synthesis` command to balance this clock tree structure with buffers. See the format as follows. ```tcl clock_tree_synthesis -root_buf CLKBUF_X3 \ -buf_list CLKBUF_X3 \ -wire_unit 20 \ -post_cts_disable \ -sink_clustering_enable \ -distance_between_buffers 100 \ -sink_clustering_size 10 \ -sink_clustering_max_diameter 60 \ -balance_levels \ -num_static_layers 1 ``` To view the balanced clock tree after CTS, in GUI Toolbar, select `Clock Tree Viewer` and click `Update` to view the resulting clock tree in GUI as follows: ![Balanced Clock Tree](tutorials/images/balanced_clock_tree.webp) #### Reporting Clock Skews The OpenROAD-flow-scripts flow automatically fixes any skew issues that could potentially cause hold violations downstream in the timing path. ```tcl report_clock_skew ``` For the `ibex` design, refer to the following logs to view clock skew reports. ```shell less logs/sky130hd/ibex/base/4_1_cts.log ``` ```default cts pre-repair report_clock_skew -------------------------------------------------------------------------- Clock core_clock Latency CRPR Skew _28453_/CLK ^ 5.92 _29312_/CLK ^ 1.41 0.00 4.51 ``` ```default cts post-repair report_clock_skew -------------------------------------------------------------------------- Clock core_clock Latency CRPR Skew _28453_/CLK ^ 5.92 _29312_/CLK ^ 1.41 0.00 4.51 ``` ```default cts final report_clock_skew -------------------------------------------------------------------------- Clock core_clock Latency CRPR Skew _27810_/CLK ^ 5.97 _29266_/CLK ^ 1.41 0.00 4.56 ``` #### Reporting CTS Metrics Run `report_cts` command to view useful metrics such as number of clock roots, number of buffers inserted, number of clock subnets and number of sinks. Refer to the built-in examples [here](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/cts/test). Run these Tcl commands in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/cts/test/ openroad source post_cts_opt.tcl report_cts ``` CTS metrics are as follows for the current design. ```default [INFO CTS-0003] Total number of Clock Roots: 1. [INFO CTS-0004] Total number of Buffers Inserted: 35. [INFO CTS-0005] Total number of Clock Subnets: 35. [INFO CTS-0006] Total number of Sinks: 301. ``` ### Adding Filler Cells Filler cells fills gaps between detail-placed instances to connect the power and ground rails in the rows. Filler cells have no logical connectivity. These cells are provided continuity in the rows for VDD and VSS nets and it also contains substrate nwell connection to improve substrate biasing. `filler_masters` is a list of master/macro names to use for filling the gaps. Refer to the following built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/dpl/test/fillers1.tcl) to learn about filler cell insertion. To view this in OpenROAD GUI run the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/grt/test/ openroad -gui ``` In the `Tcl Commands` section of GUI,run following commands: ```tcl source "helpers.tcl" read_lef "Nangate45/Nangate45.lef" read_def "gcd.def" ``` Loaded DEF view without filler insertion: ![Without_Fill_Cell_Insertion](tutorials/images/wo_fillcell_insertion.webp) Run following commands for filler cell insertion: ```default set filler_master [list FILLCELL_X1 FILLCELL_X2 FILLCELL_X4 FILLCELL_X8 FILLCELL_X16] filler_placement $filler_master ``` View the resulting fill cell insertion as follows: ![Fill_Cell_Insertion](tutorials/images/fillcell_insertion.webp) Filler cells removed with `remove_fillers` command. ### Global Routing The global router analyzes available routing resources and automatically allocates them to avoid any H/V overflow violations for optimal routing. It generates a congestion report for GCells showing total resources, demand, utilization, location and the H/V violation status. If there are no violations reported then the design can proceed to detail routing. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/grt/test/gcd.tcl). Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/grt/test/ openroad -gui ``` To run the global routing, run the following commands in `Tcl Commands` of GUI: ```tcl source gcd.tcl ``` Routing resource and congestion analysis done with below log: ```default [INFO GRT-0096] Final congestion report: Layer Resource Demand Usage (%) Max H / Max V / Total Overflow --------------------------------------------------------------------------------------- metal1 31235 1651 5.29% 0 / 0 / 0 metal2 24628 1652 6.71% 0 / 0 / 0 metal3 33120 40 0.12% 0 / 0 / 0 metal4 15698 0 0.00% 0 / 0 / 0 metal5 15404 0 0.00% 0 / 0 / 0 metal6 15642 0 0.00% 0 / 0 / 0 metal7 4416 0 0.00% 0 / 0 / 0 metal8 4512 0 0.00% 0 / 0 / 0 metal9 2208 0 0.00% 0 / 0 / 0 metal10 2256 0 0.00% 0 / 0 / 0 --------------------------------------------------------------------------------------- Total 149119 3343 2.24% 0 / 0 / 0 [INFO GRT-0018] Total wirelength: 10598 um [INFO GRT-0014] Routed nets: 563 ``` View the resulting global routing in GUI as follows: ![Global Route](tutorials/images/global_route_gcd.webp) ### Detail Routing TritonRoute is an open-source detailed router for modern industrial designs. The router consists of several main building blocks, including pin access analysis, track assignment, initial detailed routing, search and repair, and a DRC engine. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/drt/test/gcd_nangate45.tcl). Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/drt/test/ openroad -gui ``` To run the detail routing, run the following commands in `Tcl Commands` of GUI: ```tcl read_lef Nangate45/Nangate45_tech.lef read_lef Nangate45/Nangate45_stdcell.lef read_def gcd_nangate45_preroute.def read_guides gcd_nangate45.route_guide set_thread_count [expr [exec getconf _NPROCESSORS_ONLN] / 4] detailed_route -output_drc results/gcd_nangate45.output.drc.rpt \ -output_maze results/gcd_nangate45.output.maze.log \ -verbose 1 write_db gcd_nangate45.odb ``` For successful routing, DRT will end with 0 violations. Log as follows: ```default [INFO DRT-0199] Number of violations = 0. [INFO DRT-0267] cpu time = 00:00:00, elapsed time = 00:00:00, memory = 674.22 (MB), peak = 686.08 (MB) Total wire length = 5680 um. Total wire length on LAYER metal1 = 19 um. Total wire length on LAYER metal2 = 2798 um. Total wire length on LAYER metal3 = 2614 um. Total wire length on LAYER metal4 = 116 um. Total wire length on LAYER metal5 = 63 um. Total wire length on LAYER metal6 = 36 um. Total wire length on LAYER metal7 = 32 um. Total wire length on LAYER metal8 = 0 um. Total wire length on LAYER metal9 = 0 um. Total wire length on LAYER metal10 = 0 um. Total number of vias = 2223. Up-via summary (total 2223):. --------------- active 0 metal1 1151 metal2 1037 metal3 22 metal4 7 metal5 4 metal6 2 metal7 0 metal8 0 metal9 0 --------------- 2223 [INFO DRT-0198] Complete detail routing. ``` View the resulting detail routing in GUI as follows: ![Detail Routing](tutorials/images/sky130_gcd_route.webp) ### Antenna Checker Antenna Violation occurs when the antenna ratio exceeds a value specified in a Process Design Kit (PDK). The antenna ratio is the ratio of the gate area to the gate oxide area. The amount of charge collection is determined by the area/size of the conductor (gate area). This tool checks antenna violations and generates a report to indicate violated nets. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/ant/test/ant_check.tcl). Launch OpenROAD by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/ant/test/ openroad ``` To extract antenna violations, run the following commands: ```tcl read_lef ant_check.lef read_def ant_check.def check_antennas -verbose puts "violation count = [ant::antenna_violation_count]" # check if net50 has a violation set net "net50" puts "Net $net violations: [ant::check_net_violation $net]" ``` The log as follows: ```default [INFO ANT-0002] Found 1 net violations. [INFO ANT-0001] Found 2 pin violations. violation count = 1 Net net50 violations: 1 ``` ### Metal Fill Metal fill is a mandatory step at advanced nodes to ensure manufacturability and high yield. It involves filling the empty or white spaces near the design with metal polygons to ensure regular planarization of the wafer. This module inserts floating metal fill shapes to meet metal density design rules while obeying DRC constraints. It is driven by a json configuration file. Command used as follows: ```tcl density_fill -rules [-area ] ``` If -area is not specified, the core area will be used. To run metal fill post route, run the following: ```shell cd flow/tutorials/scripts/metal_fill openroad -gui ``` In the `Tcl Commands` section: ```tcl source "helpers.tcl" read_db ./5_route.odb ``` Layout before adding metal fill is as follows: ![Detail Routing](tutorials/images/sky130_gcd_route.webp) To add metal fill, run the command: ```tcl density_fill -rules ../../../platforms/sky130hd/fill.json ``` Layout after adding metal fill insertion is as follows: ![Metal Fill](tutorials/images/metal_fill_view.webp) Metal fill view can enabled with `Misc` and enable `Fills` check box. ### Parasitics Extraction OpenRCX is a Parasitic Extraction (PEX, or RCX) tool that works on OpenDB design APIs. It extracts routed designs based on the LEF/DEF layout model. OpenRCX stores resistance, coupling capacitance and ground (i.e., grounded) capacitance on OpenDB objects with direct pointers to the associated wire and via db objects. Optionally, OpenRCX can generate a `.spef` file. Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/rcx/test/45_gcd.tcl). Launch OpenROAD tool by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/rcx/test/ openroad ``` Run parasitics in the `Tcl Commands` section: ```tcl source 45_gcd.tcl ``` The log as follows: ```default [INFO ODB-0222] Reading LEF file: Nangate45/Nangate45.lef [INFO ODB-0223] Created 22 technology layers [INFO ODB-0224] Created 27 technology vias [INFO ODB-0225] Created 135 library cells [INFO ODB-0226] Finished LEF file: Nangate45/Nangate45.lef [INFO ODB-0127] Reading DEF file: 45_gcd.def [INFO ODB-0128] Design: gcd [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 1820 components and 4618 component-terminals. [INFO ODB-0132] Created 2 special nets and 3640 connections. [INFO ODB-0133] Created 350 nets and 978 connections. [INFO ODB-0134] Finished DEF file: 45_gcd.def [INFO RCX-0431] Defined process_corner X with ext_model_index 0 [INFO RCX-0029] Defined extraction corner X [INFO RCX-0008] extracting parasitics of gcd ... [INFO RCX-0435] Reading extraction model file 45_patterns.rules ... [INFO RCX-0436] RC segment generation gcd (max_merge_res 0.0) ... [INFO RCX-0040] Final 2656 rc segments [INFO RCX-0439] Coupling Cap extraction gcd ... [INFO RCX-0440] Coupling threshhold is 0.1000 fF, coupling capacitance less than 0.1000 fF will be grounded. [INFO RCX-0043] 1954 wires to be extracted [INFO RCX-0442] 48% completion -- 954 wires have been extracted [INFO RCX-0442] 100% completion -- 1954 wires have been extracted [INFO RCX-0045] Extract 350 nets, 2972 rsegs, 2972 caps, 2876 ccs [INFO RCX-0015] Finished extracting gcd. [INFO RCX-0016] Writing SPEF ... [INFO RCX-0443] 350 nets finished [INFO RCX-0017] Finished writing SPEF ... ``` `45_gcd.spef` viewed in `results` directory. ## Troubleshooting Problems This section shows you how to troubleshoot commonly occurring problems with the flow or any of the underlying application tools. ### Debugging Problems in Global Routing The global router has a few useful functionalities to understand high congestion issues in the designs. Congestion heatmap can be used on any design, whether it has congestion or not. Viewing congestion explained [here](). If the design has congestion issue, it ends with the error; ```default [ERROR GRT-0118] Routing congestion too high. ``` Refer to the built-in example [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/grt/test/congestion5.tcl). Launch OpenROAD GUI by running the following command(s) in the terminal in OpenROAD tool root directory: ```shell cd ../tools/OpenROAD/src/grt/test/ openroad -gui ``` To run the global routing, run the following commands in `Tcl Commands` of GUI: ```tcl source congestion5.tcl ``` The design fail with routing congestion error as follows: ![Routing_Congestion](tutorials/images/grt_congestion_error.webp) In the GUI, you can go under `Heat Maps` and mark the `Routing Congestion` checkbox to visualize the congestion map. ![congestion_heatmap](tutorials/images/congestion_heatmap_enable.webp) #### Dump congestion information to a text file You can create a text file with the congestion information of the GCells for further investigation on the GUI. To do that, add the `-congestion_report_file file_name` to the `global_route` command, as shown below: ```tcl global_route -guide_file out.guide -congestion_report_file congest.rpt ``` #### Visualization of overflowing GCells as markers With the file created with the command described above, you can see more details about the congested GCell, like the total resources, utilization, location, etc. You can load the file following these steps: - step 1: In the `DRC Viewer` window, click on `Load` and select the file with the congestion report. - step 2: A summary of the GCells with congestion is shown in the `DRC Viewer` window. Also, the markers are added to the GUI. ![GCell_marker](tutorials/images/gcell_marker.webp) - step 3: For details on the routing resources information, use the `Inspector` window. ![zoom_options](tutorials/images/zoom_options.webp) By Clicking `zoom_to` options, you can enlarge the view as follows: ![zoomto_gcell](tutorials/images/zoomto_gcell.webp) # FlowVariables.html.md # Variables for the OpenROAD Flow Scripts Variables are used in the OpenROAD flow to define various platform, design and tool specific variables to allow finer control and user overrides at various flow stages. These are normally defined in the `config.mk` file located in the platform and design-specific directories, but can also be defined on the command line or via environment variables. For example: - Command line: `make PLACE_DENSITY=0.5` - Environment variable: `export PLACE_DENSITY=0.5` This works provided that `config.mk` has defined it as a default value using the `export PLACE_DENSITY?=0.4` syntax. The actual value used is determined by the priority rules set by `make`: 1. **Makefile Definitions**: Variables defined in the `Makefile` or included files are used when they are defined using the no-override `=` operator, `export PLACE_DENSITY=0.4` syntax. The priority within the included files is the `DESIGN_CONFIG` file, then `Makefile` definitions and finally platform(PDK) defined variables. 2. **Command Line**: Variables defined on the command line take the highest priority in overriding defaults. 3. **Environment Variables**: Variables exported in the shell environment are used if not overridden by the command line. 4. **Default Values**: Variables defined with the `?=` operator in the `Makefile` are used only if the variable is not already defined elsewhere. ## Effects of variables The variables for ORFS are not fully independent and can interact in complex ways. Small changes to a combination of variables can have large consequences, such as on macro placement, which can lead to vastly different quality of results. Due to the large number of variables, some of which are continuous and require long runtimes, other discrete, it is not feasible to perform an exhaustive end-to-end search for the best combination of variables. Instead, the following approaches are used to determine reasonable values, up to a point of diminishing returns: - **Experience**: Leveraging domain expertise to set initial values. - **AI**: Using machine learning techniques to explore variable combinations. - **Parameter Sweeps**: Testing a smaller subset of variables to identify optimal ranges. These values are then set in configuration files and kept under source control alongside the RTL input. ## Types of variables Variables values are set in ORFS scripts or `config.mk` files and are kept in source control together with configuration files and RTL. It is an ongoing effort to move variables upwards in the categories below. | Category | Definition | User Involvement | Examples | Automation Potential | Notes | |-------------|-------------------------------------------------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|------------------------------------------------------------| | **Trivial** | Automatically determined by tool with near-optimal results. | None (unless debugging) | Buffer sizing, default layers | **High** – can be hidden | Best if invisible; surfaced only in debug or verbose mode. | | **Easy** | Requires input, but easy to tune using reports or visuals. | Moderate – copy/edit from reports | `PLACE_DENSITY` | **Medium–High** | Smooth response curves, intuitive tuning. | | **Complex** | Small changes in values may result in large effects. | High – requires multiple runs/sweeps | `CTS_DISTANCE_BUF`, small changes can have large effects on skew and quality of results. Small changes to independent inputs, such as RTL, can invalidate earlier “good values”. | **Low–Medium** | Needs scripted sweeps and statistical evaluation. | ## Platform These variables must be defined in the platform specific config file located in the OpenROAD-flow-scripts directory of `./flow/platforms//config.mk` Note: The variable `PLATFORM_DIR` is set by default based on the `PLATFORM` variable. For OpenROAD Flow Scripts we have the following public platforms: - `sky130hd` - `sky130hs` - `nangate45` - `asap7` ## Platform Specific Variables The table below lists the complete set of variables used in each of the public platforms supported by the OpenROAD flow. Note: - = indicates default definition assigned by the tool - ?= indicates that the variable value may be reassigned with design `config.mk` ## Design Specific Configuration Variables ### Required Variables Required variables must be defined in the design configuration file for each design located in the OpenROAD-flow-scripts directory of `./flow/designs///config.mk` ### Optional Variables These are optional variables that may be over-ridden/appended with default value from the platform `config.mk` by defining in the design configuration file. # Automatically generated tables from flow/scripts/variables.yaml ## Variables in alphabetic order | Variable | Description | Default | |-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------| | ABC_AREA | Strategies for Yosys ABC synthesis: Area/Speed. Default ABC_SPEED. | 0 | | ABC_CLOCK_PERIOD_IN_PS | Clock period to be used by STA during synthesis. Default value read from `constraint.sdc`. | | | ABC_DRIVER_CELL | Default driver cell used during ABC synthesis. | | | ABC_LOAD_IN_FF | During synthesis set_load value used. | | | ABSTRACT_SOURCE | Which .odb file to use to create abstract | | | ADDER_MAP_FILE | Optional mapping file supplied to Yosys to map adders | | | ADDITIONAL_FILES | Additional files to be added to `make issue` archive. | | | ADDITIONAL_GDS | Hardened macro GDS files listed here. | | | ADDITIONAL_LEFS | Hardened macro LEF view files listed here. The LEF information of the macros is immutable and used throughout all stages. Stored in the .odb file. | | | ADDITIONAL_LIBS | Hardened macro library files listed here. The library information is immutable and used throughout all stages. Not stored in the .odb file. | | | ADDITIONAL_SITES | Passed as -additional_sites to initialize_floorplan. | | | ASAP7_USE_VT | A space separated list of VT options to use with the ASAP7 standard cell library: RVT, LVT, SLVT. | RVT | | BALANCE_ROWS | Balance rows during placement. | 0 | | BLOCKS | Blocks used as hard macros in a hierarchical flow. Do note that you have to specify block-specific inputs file in the directory mentioned by Makefile. | | | BUFFER_PORTS_ARGS | Specify arguments to the buffer_ports call during placement. Only used if DONT_BUFFER_PORTS=0. | | | CACHED_REPORTS | List of pre-existing report files to copy into the reports directory before synthesis. Used when reusing prior synthesis results with SYNTH_NETLIST_FILES. | | | CAP_MARGIN | Specifies a capacitance margin when fixing max capacitance violations. This option allows you to overfix. | | | CDL_FILE | CDL master netlist file used as the -masters argument to write_cdl for generating Circuit Description Language output. | | | CDL_FILES | Insert additional Circuit Description Language (`.cdl`) netlist files. | | | CELL_PAD_IN_SITES_DETAIL_PLACEMENT | Cell padding on both sides in site widths to ease routability in detail placement. | 0 | | CELL_PAD_IN_SITES_GLOBAL_PLACEMENT | Cell padding on both sides in site widths to ease routability during global placement. | 0 | | CLKGATE_MAP_FILE | Optional mapping file supplied to Yosys to map clock gating cells | | | CLUSTER_FLOPS | Enable clustering of flip-flops into multi-bit flip-flops, if the platform PDK includes multi-bit flip-flops | 0 | | CLUSTER_FLOPS_ARGS | Additional arguments passed to the cluster_flops command. Only used when CLUSTER_FLOPS is set. | | | CORE_AREA | The core area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). | | | CORE_ASPECT_RATIO | The core aspect ratio (height / width). This variable is only used when `CORE_UTILIZATION` is set. | 1.0 | | CORE_MARGIN | The margin between the core area and die area, specified in microns. Allowed values are either one value for all margins or a set of four values, one for each margin. The order of the four values are: `{bottom top left right}`. This variable is only used when `CORE_UTILIZATION` is set. | 1.0 | | CORE_UTILIZATION | The core utilization percentage (0-100). | | | CORNER | PVT corner library selection. Only available for ASAP7 and GF180 PDKs. | | | CORNERS | List of timing corner names for multi-corner analysis (e.g. “slow fast”). When set, liberty files are loaded per corner using uppercase \_LIB_FILES environment variables (e.g. corner “slow” reads SLOW_LIB_FILES) and timing models are generated per corner. | | | CTS_ARGS | Override `clock_tree_synthesis` arguments. | | | CTS_BUF_DISTANCE | Distance (in microns) between buffers. | | | CTS_BUF_LIST | List of cells used to construct the clock tree. Overrides buffer inference. | | | CTS_CLUSTER_DIAMETER | Maximum diameter (in microns) of sink cluster. | | | CTS_CLUSTER_SIZE | Maximum number of sinks per cluster. | | | CTS_LIB_NAME | Name of the Liberty library to use in selecting the clock buffers. | | | CTS_SNAPSHOT | Creates ODB/SDC files prior to clock net and setup/hold repair. | | | CTS_SNAPSHOTS | Create ODB/SDC files at different stages of CTS. | 0 | | DESIGN_NAME | The name of the top-level module of the design. | | | DESIGN_NICKNAME | DESIGN_NICKNAME just changes the directory name that ORFS outputs to be DESIGN_NICKNAME instead of DESIGN_NAME in case DESIGN_NAME is unwieldy or conflicts with a different design. | | | DETAILED_METRICS | If set, then calls report_metrics prior to repair operations in the CTS and global route stages | 0 | | DETAILED_ROUTE_ARGS | Add additional arguments for debugging purposes during detail route. | | | DETAILED_ROUTE_END_ITERATION | Maximum number of iterations. | 64 | | DETAIL_PLACEMENT_ARGS | Specify arguments to the detailed_placement call during placement. | | | DFF_LIB_FILE | Single Liberty file for flip-flop technology mapping (dfflibmap) during synthesis. Takes precedence over DFF_MAP_FILE when set. | | | DFF_MAP_FILE | Optional mapping file supplied to Yosys to map D flip-flops | | | DIE_AREA | The die area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). | | | DISABLE_VIA_GEN | Passed as -disable_via_gen to detailed_route. | | | DONT_BUFFER_PORTS | Do not buffer input/output ports during floorplanning. | 0 | | DONT_USE_CELLS | Dont use cells eases pin access in detailed routing. | | | DPO_MAX_DISPLACEMENT | Specifies how far an instance can be moved when optimizing. | 5 1 | | EARLY_SIZING_CAP_RATIO | Ratio between the input pin capacitance and the output pin load during initial gate sizing. | | | ENABLE_DPO | Enable detail placement with improve_placement feature. | 1 | | ENABLE_RESISTANCE_AWARE | Passed as -resistance_aware to global_route. | | | FASTROUTE_TCL | Specifies a Tcl script with commands to run before FastRoute. | | | FILL_CELLS | Fill cells are used to fill empty sites. If not set or empty, fill cell insertion is skipped. | | | FILL_CONFIG | JSON rule file for metal fill during chip finishing. | | | FLOORPLAN_DEF | Use the DEF file to initialize floorplan. Mutually exclusive with FOOTPRINT or DIE_AREA/CORE_AREA or CORE_UTILIZATION. | | | FLOW_VARIANT | Flow variant to use, used in the flow variant directory name. | base | | FOOTPRINT | Custom footprint definition file for ICeWall-based floorplan initialization. Mutually exclusive with FLOORPLAN_DEF or DIE_AREA/CORE_AREA or CORE_UTILIZATION. | | | FOOTPRINT_TCL | Specifies a Tcl script with custom footprint-related commands for floorplan setup. | | | GDS_ALLOW_EMPTY | Single regular expression of module names of macros that have no .gds file | | | GDS_FILES | Path to platform GDS files. | | | GENERATE_ARTIFACTS_ON_FAILURE | For instance Bazel needs artifacts (.odb and .rpt files) on a failure to allow the user to save hours on re-running the failed step locally, but when working with a Makefile flow, it is more natural to fail the step and leave the user to manually inspect the logs and artifacts directly via the file system. Set to 1 to change the behavior to generate artifacts upon failure to e.g. do a global route. The exit code will still be non-zero on all other failures that aren’t covered by the “useful to inspect the artifacts on failure” use-case. Example: just like detailed routing, a global route that fails with congestion, is not a build failure(as in exit code non-zero), it is a successful(as in zero exit code) global route that produce reports detailing the problem. Detailed route will not proceed, if there is global routing congestion This allows build systems, such as bazel, to create artifacts for global and detailed route, even if the operation had problems, without having know about the semantics between global and detailed route. Considering that global and detailed route can run for a long time and use a lot of memory, this allows inspecting results on a laptop for a build that ran on a server. | 0 | | GLOBAL_PLACEMENT_ARGS | Use additional tuning parameters during global placement other than default args defined in global_place.tcl. | | | GLOBAL_ROUTE_ARGS | Replaces default arguments for global route. | -congestion_iterations 30 -congestion_report_iter_step 5 -verbose | | GND_NETS_VOLTAGES | Used for IR Drop calculation. | | | GPL_KEEP_OVERFLOW | Passed as -keep_resize_below_overflow to global_placement. Only used when GPL_TIMING_DRIVEN is enabled. | | | GPL_ROUTABILITY_DRIVEN | Specifies whether the placer should use routability driven placement. | 1 | | GPL_TIMING_DRIVEN | Specifies whether the placer should use timing driven placement. | 1 | | GUI_TIMING | Load timing information when opening GUI. For large designs, this can be quite time consuming. Useful to disable when investigating non-timing aspects like floorplan, placement, routing, etc. | 1 | | HOLD_SLACK_MARGIN | Specifies a time margin for the slack when fixing hold violations. This option allows you to overfix or underfix (negative value, terminate retiming before 0 or positive slack). floorplan.tcl uses min of HOLD_SLACK_MARGIN and 0 (default hold slack margin). This avoids overrepair in floorplan for hold by default, but allows skipping hold repair using a negative HOLD_SLACK_MARGIN. Exiting timing repair early is useful in exploration where the .sdc has a fixed clock period at the design’s target clock period and where HOLD/SETUP_SLACK_MARGIN is used to avoid overrepair (extremely long running times) when exploring different parameter settings. When an ideal clock is used, that is before CTS, a clock insertion delay of 0 is used in timing paths. This creates a mismatch between macros that have a .lib file from after CTS, when the clock is propagated. To mitigate this, OpenSTA will use subtract the clock insertion delay of macros when calculating timing with ideal clock. Provided that min_clock_tree_path and max_clock_tree_path are in the .lib file, which is the case for macros built with OpenROAD. This is less accurate than if OpenROAD had created a placeholder clock tree for timing estimation purposes prior to CTS. There will inevitably be inaccuracies in the timing calculation prior to CTS. Use a slack margin that is low enough, even negative, to avoid overrepair. Inaccuracies in the timing prior to CTS can also lead to underrepair, but there no obvious and simple way to avoid underrapir in these cases. Overrepair can lead to excessive runtimes in repair or too much buffering being added, which can present itself as congestion of hold cells or buffer cells. Another use of SETUP/HOLD_SLACK_MARGIN is design parameter exploration when trying to find the minimum clock period for a design. The SDC_FILE for a design can be quite complicated and instead of modifying the clock period in the SDC_FILE, which can be non-trivial, the clock period can be fixed at the target frequency and the SETUP/HOLD_SLACK_MARGIN can be swept to find a plausible current minimum clock period. | 0 | | IO_CONSTRAINTS | File path to the IO constraints .tcl file. Also used for manual placement. | | | IO_PLACER_H | A list of metal layers on which the I/O pins are placed horizontally (top and bottom of the die). | | | IO_PLACER_V | A list of metal layers on which the I/O pins are placed vertically (sides of the die). | | | IR_DROP_LAYER | Default metal layer to report IR drop. | | | KEEP_VARS | Feature toggle to keep intermediate variables during the flow. This is useful for the single-run flow, where all stages of the flow are run in a single OpenROAD instance. | 0 | | KLAYOUT_TECH_FILE | A mapping from LEF/DEF to GDS using the KLayout tool. | | | LATCH_MAP_FILE | Optional mapping file supplied to Yosys to map latches | | | LAYER_PARASITICS_FILE | Path to per layer parasitics file. Defaults to $(PLATFORM_DIR)/setRC.tcl. | | | LEC_AUX_VERILOG_FILES | Additional Verilog files (e.g. blackbox stubs) to include in LEC equivalence checks. Appended to the generated Verilog netlist before running the formal equivalence check. | | | LEC_CHECK | Perform a formal equivalence check between before and after netlists. If this fails, report an issue to OpenROAD. | 0 | | LIB_FILES | A Liberty file of the standard cell library with PVT characterization, input and output characteristics, timing and power definitions for each cell. | | | LIB_MODEL | Selects between NLDM and CCS timing models for the ASAP7 platform. Valid values: NLDM (default), CCS. Used in flow/platforms/asap7/config.mk to pick the LIB_DIR subdirectory and accumulate the corresponding $(CORNER)_$(LIB_MODEL)_LIB_FILES list, and in flow/scripts/load.tcl to gate CCS-specific Tcl branches. | NLDM | | MACRO_BLOCKAGE_HALO | Distance beyond the edges of a macro that will also be covered by the blockage generated for that macro. Note that the default macro blockage halo comes from the largest of the specified MACRO_PLACE_HALO x or y values. This variable overrides that calculation. | | | MACRO_EXTENSION | Sets the number of GCells added to the blockages boundaries from macros. | | | MACRO_PLACEMENT_TCL | Specifies the path of a TCL file on how to place macros manually. The user may choose to place just some of the macros in the design. The macro placer will handle the remaining unplaced macros. | | | MACRO_PLACE_HALO | Horizontal/vertical halo around macros (microns). Used by automatic macro placement. | | | MACRO_ROWS_HALO_X | Horizontal distance between the edge of the macro and the beginning of the rows created by tapcell. Only available for ASAP7 PDK and GF180/uart-blocks design. | | | MACRO_ROWS_HALO_Y | Vertical distance between the edge of the macro and the beginning of the rows created by tapcell. Only available for ASAP7 PDK and GF180/uart-blocks design. | | | MACRO_WRAPPERS | The wrapper file that replaces existing macros with their wrapped version. | | | MAKE_TRACKS | Tcl file that defines add routing tracks to a floorplan. | | | MATCH_CELL_FOOTPRINT | Enforce sizing operations to only swap cells that have the same layout boundary. | 0 | | MAX_PLACE_STEP_COEF | Sets the maximum phi coefficient (pcof_max / µ_k Upper Bound) for global placement optimization. This parameter controls the step size upper bound in the RePlAce Nesterov optimization algorithm. Higher values allow more aggressive optimization but may risk divergence. Valid range: 1.00-1.20 | 1.05 | | MAX_REPAIR_ANTENNAS_ITER_DRT | Defines the maximum number of iterations post-detailed routing repair antennas will run. | 5 | | MAX_REPAIR_ANTENNAS_ITER_GRT | Defines the maximum number of iterations post global routing repair antennas will run. | 5 | | MAX_REPAIR_TIMING_ITER | Maximum number of iterations for repair setup and repair hold. | | | MAX_ROUTING_LAYER | The highest metal layer name to be used in routing. | | | MIN_BUF_CELL_AND_PORTS | Used to insert a buffer cell to pass through wires. Used in synthesis. | | | MIN_CLK_ROUTING_LAYER | The lowest metal layer name to be used for clock-net routing in global routing. Used in flow/platforms/\*/fastroute.tcl as the lower bound of `set_routing_layers -clock`. Typically higher than MIN_ROUTING_LAYER so clock nets prefer the upper, lower-RC layers. No `stages:` list because floorplan.tcl also `source`s the platform fastroute.tcl. | | | MIN_PLACE_STEP_COEF | Sets the minimum phi coefficient (pcof_min / µ_k Lower Bound) for global placement optimization. This parameter controls the step size lower bound in the RePlAce Nesterov optimization algorithm. Lower values may improve convergence but can increase runtime. Valid range: 0.95-1.05 | 0.95 | | MIN_ROUTING_LAYER | The lowest metal layer name to be used in routing. | | | NUM_CORES | Passed to `openroad -threads $(NUM_CORES)`, defaults to numbers of cores in system as determined by system specific code in Makefile, `nproc` is tried first. OpenROAD does not limit itself to this number of cores across OpenROAD running instances, which can lead to overprovisioning in contexts such as bazel-orfs where there could be many routing, or place jobs running at the same time. | | | OPENROAD_HIERARCHICAL | Feature toggle to enable to run OpenROAD in hierarchical mode, otherwise considered flat. Will eventually be the default and this option will be retired. | 0 | | OR_K | Passed as -or_k to detailed routing. | | | OR_SEED | Passed as -or_seed to detailed routing. | | | PDN_TCL | File path which has a set of power grid policies used by pdn to be applied to the design, such as layers to use, stripe width and spacing to generate the actual metal straps. | | | PLACE_DENSITY | The desired average placement density of cells: 1.0 = dense, 0.0 = widely spread. The intended effort is also communicated by this parameter. Use a low value for faster builds and higher value for better quality of results. If a too low value is used, the placer will not be able to place all cells and a recommended minimum placement density can be found in the logs. A too high value can lead to excessive runtimes, even timeouts and subtle failures in the flow after placement, such as in CTS or global routing when timing repair fails. The default is platform specific. | | | PLACE_DENSITY_LB_ADDON | Check the lower boundary of the PLACE_DENSITY and add PLACE_DENSITY_LB_ADDON if it exists. | | | PLACE_PINS_ARGS | Arguments to place_pins | | | PLACE_SITE | Placement site for core cells defined in the technology LEF file. | | | PLATFORM | Specifies process design kit or technology node to be used. | | | PLATFORM_TCL | Specifies a Tcl script with commands to run before loading design. | | | POST_CTS_TCL | Specifies a Tcl script with commands to run after CTS is completed. | | | POST_DENSITY_FILL_TCL | Specifies a Tcl script with commands to run after density fill. | | | POST_DETAIL_PLACE_TCL | Specifies a Tcl script with commands to run after detailed placement. | | | POST_DETAIL_ROUTE_TCL | Specifies a Tcl script with commands to run after detailed route. | | | POST_FILLCELL_TCL | Specifies a Tcl script with commands to run after fillcell insertion. | | | POST_FINAL_REPORT_TCL | Specifies a Tcl script with commands to run after final report generation. | | | POST_FLOORPLAN_TCL | Specifies a Tcl script with commands to run after floorplan is completed. | | | POST_GLOBAL_PLACE_SKIP_IO_TCL | Specifies a Tcl script with commands to run after global placement (skip IO). | | | POST_GLOBAL_PLACE_TCL | Specifies a Tcl script with commands to run after global placement. | | | POST_GLOBAL_ROUTE_TCL | Specifies a Tcl script with commands to run after global route. | | | POST_IO_PLACEMENT_TCL | Specifies a Tcl script with commands to run after IO placement. | | | POST_MACRO_PLACE_TCL | Specifies a Tcl script with commands to run after macro placement. | | | POST_PDN_TCL | Specifies a Tcl script with commands to run after PDN generation. | | | POST_REPAIR_TIMING_POST_PLACE_TCL | Specifies a Tcl script with commands to run after post-place timing repair. | | | POST_RESIZE_TCL | Specifies a Tcl script with commands to run after resize. | | | POST_SYNTH_TCL | Specifies a Tcl script with commands to run after synthesis ODB generation. | | | POST_TAPCELL_TCL | Specifies a Tcl script with commands to run after tapcell. | | | PRE_CTS_TCL | Specifies a Tcl script with commands to run before CTS. | | | PRE_DENSITY_FILL_TCL | Specifies a Tcl script with commands to run before density fill. | | | PRE_DETAIL_PLACE_TCL | Specifies a Tcl script with commands to run before detailed placement. | | | PRE_DETAIL_ROUTE_TCL | Specifies a Tcl script with commands to run before detailed route. | | | PRE_FILLCELL_TCL | Specifies a Tcl script with commands to run before fillcell insertion. | | | PRE_FINAL_REPORT_TCL | Specifies a Tcl script with commands to run before final report generation. | | | PRE_FLOORPLAN_TCL | Specifies a Tcl script with commands to run before floorplan. | | | PRE_GLOBAL_PLACE_SKIP_IO_TCL | Specifies a Tcl script with commands to run before global placement (skip IO). | | | PRE_GLOBAL_PLACE_TCL | Specifies a Tcl script with commands to run before global placement. | | | PRE_GLOBAL_ROUTE_TCL | Specifies a Tcl script with commands to run before global route. | | | PRE_IO_PLACEMENT_TCL | Specifies a Tcl script with commands to run before IO placement. | | | PRE_MACRO_PLACE_TCL | Specifies a Tcl script with commands to run before macro placement. | | | PRE_PDN_TCL | Specifies a Tcl script with commands to run before PDN generation. | | | PRE_REPAIR_TIMING_POST_PLACE_TCL | Specifies a Tcl script with commands to run before post-place timing repair. | | | PRE_RESIZE_TCL | Specifies a Tcl script with commands to run before resize. | | | PRE_SYNTH_TCL | Specifies a Tcl script with commands to run before synthesis ODB generation. | | | PRE_TAPCELL_TCL | Specifies a Tcl script with commands to run before tapcell. | | | PROCESS | Technology node or process in use. | | | PWR_NETS_VOLTAGES | Used for IR Drop calculation. | | | RCX_RULES | RC Extraction rules file path. | | | RECOVER_POWER | Specifies how many percent of paths with positive slacks can be slowed for power savings [0-100]. | 0 | | REMOVE_ABC_BUFFERS (deprecated) | Remove abc buffers from the netlist. If timing repair in floorplanning is taking too long, use a SETUP/HOLD_SLACK_MARGIN to terminate timing repair early instead of using REMOVE_ABC_BUFFERS or set SKIP_LAST_GASP=1. | 0 | | REMOVE_CELLS_FOR_LEC | String patterns directly passed to write_verilog -remove_cells <> for lec checks. | | | REPAIR_PDN_VIA_LAYER | Remove power grid vias which generate DRC violations after detailed routing. | | | REPORT_CLOCK_SKEW | Report clock skew as part of reporting metrics, starting at CTS, before which there is no clock skew. This metric can be quite time-consuming, so it can be useful to disable. | 1 | | ROUTING_LAYER_ADJUSTMENT | Adjusts routing layer capacities to manage congestion and improve detailed routing. High values ease detailed routing but risk excessive detours and long global routing times, while low values reduce global routing failure but can complicate detailed routing. The global routing running time normally reduces dramatically (entirely design specific, but going from hours to minutes has been observed) when the value is low (such as 0.10). Sometimes, global routing will succeed with lower values and fail with higher values. Exploring results with different values can help shed light on the problem. Start with a too low value, such as 0.10, and bisect to value that works by doing multiple global routing runs. As a last resort, `make global_route_issue` and using the tools/OpenROAD/etc/whittle.py can be useful to debug global routing errors. If there is something specific that is impossible to route, such as a clock line over a macro, global routing will terminate with DRC errors routes that could have been routed were it not for the specific impossible routes. whittle.py should weed out the possible routes and leave a minimal failing case that pinpoints the problem. | 0.5 | | RTLMP_AREA_WT | Weight for the area of the current floorplan. | 0.1 | | RTLMP_ARGS | Overrides all other RTL macro placer arguments. | | | RTLMP_BOUNDARY_WT | Weight for the boundary or how far the hard macro clusters are from boundaries. | 50.0 | | RTLMP_FENCE_LX | Defines the lower left X coordinate for the global fence bounding box in microns. | 0.0 | | RTLMP_FENCE_LY | Defines the lower left Y coordinate for the global fence bounding box in microns. | 0.0 | | RTLMP_FENCE_UX | Defines the upper right X coordinate for the global fence bounding box in microns. | 0.0 | | RTLMP_FENCE_UY | Defines the upper right Y coordinate for the global fence bounding box in microns. | 0.0 | | RTLMP_MAX_INST | Maximum number of standard cells in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes. | | | RTLMP_MAX_LEVEL | Maximum depth of the physical hierarchy tree. | 2 | | RTLMP_MAX_MACRO | Maximum number of macros in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes. | | | RTLMP_MIN_AR | Specifies the minimum aspect ratio (height/width). | 0.33 | | RTLMP_MIN_INST | Minimum number of standard cells in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes. | | | RTLMP_MIN_MACRO | Minimum number of macros in a cluster. If unset, rtl_macro_placer will calculate a value based on the design attributes. | | | RTLMP_NOTCH_WT | Weight for the notch, or the existence of dead space that cannot be used for placement and routing. | 50.0 | | RTLMP_OUTLINE_WT | Weight for violating the fixed outline constraint, meaning that all clusters should be placed within the shape of their parent cluster. | 100.0 | | RTLMP_RPT_DIR | Path to the directory where reports are saved. | | | RTLMP_WIRELENGTH_WT | Weight for half-perimiter wirelength. | 100.0 | | RULES_JSON | json files with the metrics baseline regression rules. In the ORFS Makefile, this defaults to $DESIGN_DIR/rules-base.json, but ORFS does not mandate the users source directory layout and this can be placed elsewhere when the user sets up an ORFS config.mk or from bazel-orfs. | | | RUN_LOG_NAME_STEM | Stem of the log file name, the log file will be named `$(LOG_DIR)/$(RUN_LOG_NAME_STEM).log`. | run | | RUN_SCRIPT | Path to script to run from `make run`, python or tcl script detected by .py or .tcl extension. | | | SC_LEF | Path to technology standard cell LEF file. | | | SDC_FILE | The path to design constraint (SDC) file. | | | SDC_GUT | Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance. | | | SEAL_GDS | Seal macro to place around the design. | | | SETUP_MOVE_SEQUENCE | Passed as -sequence to repair_timing. This should be a string of move keywords separated by commas. | | | SETUP_SLACK_MARGIN | Specifies a time margin for the slack when fixing setup violations. This option allows you to overfix or underfix(negative value, terminate retiming before 0 or positive slack). See HOLD_SLACK_MARGIN for more details. | 0 | | SET_RC_TCL | Metal & Via RC definition file path. | | | SKIP_ANTENNA_REPAIR | Skips antenna repair entirely. | 0 | | SKIP_ANTENNA_REPAIR_POST_DRT | Skips antenna repair post-detailed routing. | 0 | | SKIP_ANTENNA_REPAIR_PRE_GRT | Skips antenna repair pre-global routing. | 0 | | SKIP_BUFFER_REMOVAL | Passed as -skip_buffer_removal to repair_timing. Do not remove buffers as a transform to fix timing violations (default: allow buffer removal). | | | SKIP_CRIT_VT_SWAP | Do not perform VT swap on critical cells to improve QoR (default: do critical VT swap). This is an additional VT swap on critical cells that remain near the end of setup fixing. If SKIP_VT_SWAP is set to 1, this also disables critical cell VT swap. | | | SKIP_CTS_REPAIR_TIMING | Skipping CTS repair, which can take a long time, can be useful in architectural exploration or when getting CI up and running. | 0 | | SKIP_DETAILED_ROUTE | Skips detailed route. | 0 | | SKIP_GATE_CLONING | Do not use gate cloning transform to fix timing violations (default: use gate cloning). | | | SKIP_INCREMENTAL_REPAIR | Skip incremental repair in global route. | 0 | | SKIP_LAST_GASP | Do not use last gasp optimization to fix timing violations (default: use gate last gasp). | | | SKIP_PIN_SWAP | Do not use pin swapping as a transform to fix timing violations (default: use pin swapping). | | | SKIP_REPAIR_TIE_FANOUT | Skip repair_tie_fanout at floorplan step. | 0 | | SKIP_REPORT_METRICS | If set to 1, then metrics, report_metrics does nothing. Useful to speed up builds. | 0 | | SKIP_VT_SWAP | Do not perform VT swap to improve QoR (default: do VT swap). | | | SLANG_PLUGIN_PATH | Path to the slang plugin for Yosys. This can be a full path to a custom-built plugin (e.g. for Bazel builds) or just the plugin name. | slang | | SLEW_MARGIN | Specifies a slew margin when fixing max slew violations. This option allows you to overfix. | | | SWAP_ARITH_OPERATORS | Improve timing QoR by swapping ALU and MULT arithmetic operators. | | | SYNTH_ARGS | Optional synthesis variables for yosys. | | | SYNTH_BLACKBOXES | List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design. Non-existant modules are ignored silently, useful when listing modules statically, even if modules come and go dynamically. | | | SYNTH_CANONICALIZE_TCL | Specifies a Tcl script with commands to run as part of the synth canonicalize step. | | | SYNTH_CHECKPOINT | Path to a Yosys RTLIL checkpoint to read in place of the default canonicalization checkpoint at the start of synth.tcl. Intended for parallel synthesis flows that reuse a checkpoint taken after coarse synthesis and `keep_hierarchy` have already been decided, so each partition skips that common prefix. Leave unset for the normal flow. | | | SYNTH_GUT | Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance. | 0 | | SYNTH_HDL_FRONTEND | Select an alternative language frontend to ingest the design. Available option is “slang”. If the variable is empty, design is read with the Yosys read_verilog command. | | | SYNTH_HIERARCHICAL | Enable to Synthesis hierarchically, otherwise considered flat synthesis. | 0 | | SYNTH_HIER_SEPARATOR | Separator used for the synthesis flatten stage. | . | | SYNTH_INSBUF | Insert input buffers on top-level input ports during synthesis. Useful to disable when doing parallel synthesis and concatenating netlists later as we’re generating netlists of submodules. | 1 | | SYNTH_KEEP_MOCKED_MEMORIES | When `SYNTH_MOCK_LARGE_MEMORIES=1`, setting this to 1, will keep mocked memories (not flattening them). This preserves some of the access logic complexity and avoids optimizations outside of the mocked memory. | 1 | | SYNTH_KEEP_MODULES | Mark modules to keep from getting removed in flattening. | | | SYNTH_MEMORY_MAX_BITS | Maximum number of bits for memory synthesis. Ideally, real RAM or realistic fakeram should be used for RAMs much larger than 1024 bits. To temporarily ignore the RAM concerns and investigate other aspects of the design, consider setting `SYNTH_MOCK_LARGE_MEMORIES=1`, or adjusting `SYNTH_MEMORY_MAX_BITS`. | 4096 | | SYNTH_MINIMUM_KEEP_SIZE | For hierarchical synthesis, we keep modules of larger area than given by this variable and flatten smaller modules. The area unit used is the size of a basic nand2 gate from the platform’s standard cell library. The default value is platform specific. | 0 | | SYNTH_MOCK_LARGE_MEMORIES | Reduce Yosys inferred memories larger than SYNTH_MEMORY_MAX_BITS to 1 row. Yosys will generally infer memories from behavioral Verilog code, whether the memories are in standalone modules or instantiated within some larger module. fakeram and empty Verilog memories(blackboxes) of memories will not be inferred memories by Yosys and are therefore not affected by this variable. This is useful and convenient to separate the concern of instantiating and placing memories from investigating other issues with a design, though it comes at the expense of the increased accuracy that using realistic fakemem would provide. Memories with a single 1 row will of course have unrealistically good timing and area characteristics, but timing will still correctly terminate in a register. Large port memories, typically register files, will still have the retain a lot of the port logic that can be useful to investigate issues. This can be especially useful during development of designs where the behavioral model comes first and suitable memories are matched up when the design RTL is stable. A typical use case would be Chisel which will generate a behavioral model for a memories with the required clocks, ports, etc. in addition to a computer readable file with the specification of the memories that is used to [automatically](https://chipyard.readthedocs.io/en/stable/Tools/Barstools.html/) match up suitable memory macros later in the flow. During an architectural screening study, a large range of memory configurations can be investigated quickly with this option, without getting bogged down in the concern of how to realize the memories in silicon for emphemral RTL configurations that exist only long enough to run through the ORFS flow to create a table of some characteristics of a design configuration. | 0 | | SYNTH_NETLIST_FILES | Skips synthesis and uses the supplied netlist files. If the netlist files contains duplicate modules, which can happen when using hierarchical synthesis on indvidual netlist files and combining here, subsequent modules are silently ignored and only the first module is used. | | | SYNTH_OPERATIONS_ARGS | Extra arguments appended to the Yosys synth command operations list. When set, replaces the default Kogge-Stone adder extra-map. | | | SYNTH_OPT_HIER | Optimize constants across hierarchical boundaries. | | | SYNTH_REPEATABLE_BUILD | License to prune anything that makes builds less repeatable, typically used with Bazel to ensure that builds are bit-for-bit identical so that caching works optimally. Removes debug information that encodes paths, timestamps, etc. | 0 | | SYNTH_RETIME_MODULES | *This is an experimental option and may cause adverse effects.* *No effort has been made to check if the retimed RTL is logically equivalent to the non-retimed RTL.* List of modules to apply automatic retiming to. These modules must not get dissolved and as such they should either be the top module or be included in SYNTH_KEEP_MODULES. The main use case is to quickly identify if performance can be improved by manually retiming the input RTL. Retiming will treat module ports like register endpoints/startpoints. The objective function of retiming isn’t informed by SDC, even the clock period is ignored. As such, retiming will optimize for best delay at potentially high register number cost. Automatic retiming can produce suboptimal results as its timing model is crude and it doesn’t find the optimal distribution of registers on long pipelines. See OR discussion # 8080. | | | SYNTH_SKIP_KEEP | Only meaningful together with SYNTH_CHECKPOINT. When set, signals that the supplied checkpoint is still canonical RTLIL (coarse synth and `keep_hierarchy` have not been run yet), so synth.tcl runs the full coarse+fine synthesis flattened. When unset and SYNTH_CHECKPOINT is used, synth.tcl assumes the checkpoint already has coarse synth + `keep_hierarchy` done and resumes from `coarse:fine`. | 0 | | SYNTH_SLANG_ARGS | Additional arguments passed to the slang frontend during synthesis. | | | SYNTH_WRAPPED_ADDERS | Specify the adder modules that can be used for synthesis, separated by commas. The default adder module is determined by the first element of this variable. | | | SYNTH_WRAPPED_MULTIPLIERS | Specify the multiplier modules that can be used for synthesis, separated by commas. The default multiplier module is determined by the first element of this variable. | | | SYNTH_WRAPPED_OPERATORS | Synthesize multiple architectural options for each arithmetic operator in the design. These options are available for switching among in later stages of the flow. | | | TAPCELL_TCL | Path to Endcap and Welltie cells file. | | | TAP_CELL_NAME | Name of the cell to use in tap cell insertion. | | | TECH_LEF | A technology LEF file of the PDK that includes all relevant information regarding metal layers, vias, and spacing requirements. | | | TIEHI_CELL_AND_PORT | Tie high cells used in Yosys synthesis to replace a logical 1 in the Netlist. | | | TIELO_CELL_AND_PORT | Tie low cells used in Yosys synthesis to replace a logical 0 in the Netlist. | | | TIE_SEPARATION | Distance separating tie high/low instances from the load. | 0 | | TNS_END_PERCENT | Default TNS_END_PERCENT value for post CTS timing repair. Try fixing all violating endpoints by default (reduce to 5% for runtime). Specifies how many percent of violating paths to fix [0-100]. Worst path will always be fixed. | 100 | | UNSET_ABC9_BOX_CELLS | List of cells to unset the abc9_box attribute on | | | USE_FILL | Whether to perform metal density filling. | 0 | | USE_NEGOTIATION | Enable using negotiation legalizer for detailed placement. | 0 | | VERILOG_DEFINES | Preprocessor defines passed to the language frontend. Example: `-D HPDCACHE_ASSERT_OFF` | | | VERILOG_FILES | The path to the design Verilog/SystemVerilog files providing a description of modules. | | | VERILOG_INCLUDE_DIRS | Specifies the include directories for the Verilog input files. | | | VERILOG_TOP_PARAMS | Apply toplevel params (if exist). Passed in as a list of key value pairs in tcl syntax; separated by spaces: PARAM1 VALUE1 PARAM2 VALUE2 | | | VIA_IN_PIN_MAX_LAYER | Passed as -via_in_pin_top_layer to pin_access and detailed_route. | | | VIA_IN_PIN_MIN_LAYER | Passed as -via_in_pin_bottom_layer to pin_access and detailed_route. | | | WRITE_ODB_AND_SDC_EACH_STAGE | Save out .sdc and .odb file after each stage, useful to disable when using a single OpenROAD instance to run all stages of the flow. | 1 | | YOSYS_FLAGS | Flags to pass to yosys. | -v 3 | ## synth variables - [ABC_AREA]() - [ABC_CLOCK_PERIOD_IN_PS]() - [ABC_DRIVER_CELL]() - [ABC_LOAD_IN_FF]() - [ADDER_MAP_FILE]() - [CACHED_REPORTS]() - [CLKGATE_MAP_FILE]() - [DFF_LIB_FILE]() - [DFF_MAP_FILE]() - [LATCH_MAP_FILE]() - [MIN_BUF_CELL_AND_PORTS]() - [POST_SYNTH_TCL]() - [PRE_SYNTH_TCL]() - [SDC_FILE]() - [SDC_GUT]() - [SLANG_PLUGIN_PATH]() - [SYNTH_ARGS]() - [SYNTH_BLACKBOXES]() - [SYNTH_CANONICALIZE_TCL]() - [SYNTH_CHECKPOINT]() - [SYNTH_GUT]() - [SYNTH_HDL_FRONTEND]() - [SYNTH_HIERARCHICAL]() - [SYNTH_HIER_SEPARATOR]() - [SYNTH_INSBUF]() - [SYNTH_KEEP_MOCKED_MEMORIES]() - [SYNTH_KEEP_MODULES]() - [SYNTH_MEMORY_MAX_BITS]() - [SYNTH_MINIMUM_KEEP_SIZE]() - [SYNTH_MOCK_LARGE_MEMORIES]() - [SYNTH_NETLIST_FILES]() - [SYNTH_OPERATIONS_ARGS]() - [SYNTH_OPT_HIER]() - [SYNTH_REPEATABLE_BUILD]() - [SYNTH_RETIME_MODULES]() - [SYNTH_SKIP_KEEP]() - [SYNTH_SLANG_ARGS]() - [SYNTH_WRAPPED_ADDERS]() - [SYNTH_WRAPPED_MULTIPLIERS]() - [TIEHI_CELL_AND_PORT]() - [TIELO_CELL_AND_PORT]() - [UNSET_ABC9_BOX_CELLS]() - [VERILOG_DEFINES]() - [VERILOG_FILES]() - [VERILOG_INCLUDE_DIRS]() - [VERILOG_TOP_PARAMS]() - [YOSYS_FLAGS]() ## floorplan variables - [ADDITIONAL_SITES]() - [CELL_PAD_IN_SITES_GLOBAL_PLACEMENT]() - [CORE_AREA]() - [CORE_ASPECT_RATIO]() - [CORE_MARGIN]() - [CORE_UTILIZATION]() - [DIE_AREA]() - [FLOORPLAN_DEF]() - [FOOTPRINT]() - [FOOTPRINT_TCL]() - [HOLD_SLACK_MARGIN]() - [IO_CONSTRAINTS]() - [MACRO_BLOCKAGE_HALO]() - [MACRO_PLACEMENT_TCL]() - [MACRO_PLACE_HALO]() - [MACRO_ROWS_HALO_X]() - [MACRO_ROWS_HALO_Y]() - [MACRO_WRAPPERS]() - [MAKE_TRACKS]() - [MATCH_CELL_FOOTPRINT]() - [MAX_REPAIR_TIMING_ITER]() - [MAX_ROUTING_LAYER]() - [MIN_ROUTING_LAYER]() - [PDN_TCL]() - [PLACE_DENSITY]() - [PLACE_DENSITY_LB_ADDON]() - [PLACE_SITE]() - [POST_FLOORPLAN_TCL]() - [POST_MACRO_PLACE_TCL]() - [POST_PDN_TCL]() - [POST_TAPCELL_TCL]() - [PRE_FLOORPLAN_TCL]() - [PRE_MACRO_PLACE_TCL]() - [PRE_PDN_TCL]() - [PRE_TAPCELL_TCL]() - [REMOVE_ABC_BUFFERS]() - [ROUTING_LAYER_ADJUSTMENT]() - [RTLMP_AREA_WT]() - [RTLMP_ARGS]() - [RTLMP_BOUNDARY_WT]() - [RTLMP_FENCE_LX]() - [RTLMP_FENCE_LY]() - [RTLMP_FENCE_UX]() - [RTLMP_FENCE_UY]() - [RTLMP_MAX_INST]() - [RTLMP_MAX_LEVEL]() - [RTLMP_MAX_MACRO]() - [RTLMP_MIN_AR]() - [RTLMP_MIN_INST]() - [RTLMP_MIN_MACRO]() - [RTLMP_NOTCH_WT]() - [RTLMP_OUTLINE_WT]() - [RTLMP_RPT_DIR]() - [RTLMP_WIRELENGTH_WT]() - [SETUP_MOVE_SEQUENCE]() - [SETUP_SLACK_MARGIN]() - [SKIP_BUFFER_REMOVAL]() - [SKIP_CRIT_VT_SWAP]() - [SKIP_GATE_CLONING]() - [SKIP_LAST_GASP]() - [SKIP_PIN_SWAP]() - [SKIP_REPAIR_TIE_FANOUT]() - [SKIP_REPORT_METRICS]() - [SKIP_VT_SWAP]() - [TAPCELL_TCL]() - [TIEHI_CELL_AND_PORT]() - [TIELO_CELL_AND_PORT]() - [TIE_SEPARATION]() - [TNS_END_PERCENT]() ## place variables - [BALANCE_ROWS]() - [BUFFER_PORTS_ARGS]() - [CELL_PAD_IN_SITES_DETAIL_PLACEMENT]() - [CELL_PAD_IN_SITES_GLOBAL_PLACEMENT]() - [CLUSTER_FLOPS]() - [CLUSTER_FLOPS_ARGS]() - [DETAIL_PLACEMENT_ARGS]() - [DONT_BUFFER_PORTS]() - [EARLY_SIZING_CAP_RATIO]() - [FLOORPLAN_DEF]() - [GLOBAL_PLACEMENT_ARGS]() - [GPL_KEEP_OVERFLOW]() - [GPL_ROUTABILITY_DRIVEN]() - [GPL_TIMING_DRIVEN]() - [IO_PLACER_H]() - [IO_PLACER_V]() - [MATCH_CELL_FOOTPRINT]() - [MAX_PLACE_STEP_COEF]() - [MAX_REPAIR_TIMING_ITER]() - [MAX_ROUTING_LAYER]() - [MIN_PLACE_STEP_COEF]() - [MIN_ROUTING_LAYER]() - [PLACE_DENSITY]() - [PLACE_DENSITY_LB_ADDON]() - [PLACE_PINS_ARGS]() - [POST_DETAIL_PLACE_TCL]() - [POST_GLOBAL_PLACE_SKIP_IO_TCL]() - [POST_GLOBAL_PLACE_TCL]() - [POST_IO_PLACEMENT_TCL]() - [POST_REPAIR_TIMING_POST_PLACE_TCL]() - [POST_RESIZE_TCL]() - [PRE_DETAIL_PLACE_TCL]() - [PRE_GLOBAL_PLACE_SKIP_IO_TCL]() - [PRE_GLOBAL_PLACE_TCL]() - [PRE_IO_PLACEMENT_TCL]() - [PRE_REPAIR_TIMING_POST_PLACE_TCL]() - [PRE_RESIZE_TCL]() - [ROUTING_LAYER_ADJUSTMENT]() - [SKIP_REPORT_METRICS]() - [TNS_END_PERCENT]() ## cts variables - [CELL_PAD_IN_SITES_DETAIL_PLACEMENT]() - [CTS_ARGS]() - [CTS_BUF_DISTANCE]() - [CTS_BUF_LIST]() - [CTS_CLUSTER_DIAMETER]() - [CTS_CLUSTER_SIZE]() - [CTS_LIB_NAME]() - [CTS_SNAPSHOT]() - [CTS_SNAPSHOTS]() - [DETAILED_METRICS]() - [HOLD_SLACK_MARGIN]() - [LEC_AUX_VERILOG_FILES]() - [LEC_CHECK]() - [MATCH_CELL_FOOTPRINT]() - [MAX_REPAIR_TIMING_ITER]() - [POST_CTS_TCL]() - [PRE_CTS_TCL]() - [REPORT_CLOCK_SKEW]() - [SETUP_MOVE_SEQUENCE]() - [SETUP_SLACK_MARGIN]() - [SKIP_BUFFER_REMOVAL]() - [SKIP_CRIT_VT_SWAP]() - [SKIP_CTS_REPAIR_TIMING]() - [SKIP_GATE_CLONING]() - [SKIP_LAST_GASP]() - [SKIP_PIN_SWAP]() - [SKIP_REPORT_METRICS]() - [SKIP_VT_SWAP]() - [TNS_END_PERCENT]() ## grt variables - [CELL_PAD_IN_SITES_DETAIL_PLACEMENT]() - [DETAILED_METRICS]() - [ENABLE_RESISTANCE_AWARE]() - [GLOBAL_ROUTE_ARGS]() - [HOLD_SLACK_MARGIN]() - [MAX_REPAIR_ANTENNAS_ITER_GRT]() - [MAX_REPAIR_TIMING_ITER]() - [MAX_ROUTING_LAYER]() - [MIN_ROUTING_LAYER]() - [POST_GLOBAL_ROUTE_TCL]() - [PRE_GLOBAL_ROUTE_TCL]() - [REPORT_CLOCK_SKEW]() - [ROUTING_LAYER_ADJUSTMENT]() - [SETUP_MOVE_SEQUENCE]() - [SETUP_SLACK_MARGIN]() - [SKIP_ANTENNA_REPAIR]() - [SKIP_ANTENNA_REPAIR_PRE_GRT]() - [SKIP_BUFFER_REMOVAL]() - [SKIP_CRIT_VT_SWAP]() - [SKIP_GATE_CLONING]() - [SKIP_INCREMENTAL_REPAIR]() - [SKIP_LAST_GASP]() - [SKIP_PIN_SWAP]() - [SKIP_REPORT_METRICS]() - [SKIP_VT_SWAP]() - [TNS_END_PERCENT]() - [VIA_IN_PIN_MAX_LAYER]() - [VIA_IN_PIN_MIN_LAYER]() ## route variables - [DETAILED_ROUTE_ARGS]() - [DETAILED_ROUTE_END_ITERATION]() - [DISABLE_VIA_GEN]() - [FILL_CELLS]() - [MATCH_CELL_FOOTPRINT]() - [MAX_REPAIR_ANTENNAS_ITER_DRT]() - [MAX_ROUTING_LAYER]() - [MIN_ROUTING_LAYER]() - [OR_K]() - [OR_SEED]() - [POST_DETAIL_ROUTE_TCL]() - [POST_FILLCELL_TCL]() - [PRE_DETAIL_ROUTE_TCL]() - [PRE_FILLCELL_TCL]() - [REPORT_CLOCK_SKEW]() - [ROUTING_LAYER_ADJUSTMENT]() - [SKIP_ANTENNA_REPAIR_POST_DRT]() - [SKIP_DETAILED_ROUTE]() - [SKIP_REPORT_METRICS]() - [VIA_IN_PIN_MAX_LAYER]() - [VIA_IN_PIN_MIN_LAYER]() ## final variables - [ADDITIONAL_GDS]() - [CDL_FILE]() - [GDS_ALLOW_EMPTY]() - [GND_NETS_VOLTAGES]() - [MAX_ROUTING_LAYER]() - [MIN_ROUTING_LAYER]() - [POST_DENSITY_FILL_TCL]() - [POST_FINAL_REPORT_TCL]() - [PRE_DENSITY_FILL_TCL]() - [PRE_FINAL_REPORT_TCL]() - [PWR_NETS_VOLTAGES]() - [REPORT_CLOCK_SKEW]() - [ROUTING_LAYER_ADJUSTMENT]() - [SKIP_DETAILED_ROUTE]() - [SKIP_REPORT_METRICS]() ## All stages variables - [ASAP7_USE_VT]() - [CORNERS]() - [KEEP_VARS]() - [NUM_CORES]() - [OPENROAD_HIERARCHICAL]() - [SWAP_ARITH_OPERATORS]() - [SYNTH_WRAPPED_OPERATORS]() - [WRITE_ODB_AND_SDC_EACH_STAGE]() ## generate_abstract variables - [ABSTRACT_SOURCE]() ## test variables - [RULES_JSON]() ## Uncategorized variables - [ADDITIONAL_FILES]() - [ADDITIONAL_LEFS]() - [ADDITIONAL_LIBS]() - [BLOCKS]() - [CAP_MARGIN]() - [CDL_FILES]() - [CORNER]() - [DESIGN_NAME]() - [DESIGN_NICKNAME]() - [DONT_USE_CELLS]() - [DPO_MAX_DISPLACEMENT]() - [ENABLE_DPO]() - [FASTROUTE_TCL]() - [FILL_CONFIG]() - [FLOW_VARIANT]() - [GDS_FILES]() - [GENERATE_ARTIFACTS_ON_FAILURE]() - [GUI_TIMING]() - [IR_DROP_LAYER]() - [KLAYOUT_TECH_FILE]() - [LAYER_PARASITICS_FILE]() - [LIB_FILES]() - [LIB_MODEL]() - [MACRO_EXTENSION]() - [MIN_CLK_ROUTING_LAYER]() - [PLATFORM]() - [PLATFORM_TCL]() - [PROCESS]() - [RCX_RULES]() - [RECOVER_POWER]() - [REMOVE_CELLS_FOR_LEC]() - [REPAIR_PDN_VIA_LAYER]() - [RUN_LOG_NAME_STEM]() - [RUN_SCRIPT]() - [SC_LEF]() - [SEAL_GDS]() - [SET_RC_TCL]() - [SLEW_MARGIN]() - [TAP_CELL_NAME]() - [TECH_LEF]() - [USE_FILL]() - [USE_NEGOTIATION]() # Flow_QoR_CI.html.md # OpenROAD QoR and CI Metrics ## OpenROAD Dashboard The [OpenROAD Dashboard](QoRDashboard.md) provides an easy way to explore Quality-of-Results (QoR) over time and describes flow-QoR metrics, such as timing, area, power, etc. ## Jenkins CI We use Jenkins as our continuous integration (CI) tool. You may use it to find out metrics regarding regression tests. See more about accessing and taking advantage of our CI [here](Jenkins.md). # GettingInvolved.html.md # Getting Involved Thank you for taking the time to read this document and to contribute. The OpenROAD project will not reach all of its objectives without help! Possible ways to contribute in the scope of OpenROAD Flow: - Open-source PDK information - Open-source Designs - Useful scripts - Star our project and repos so we can see the number of people who are interested ## Licensing Contributions As much as possible, all contributions should be licensed using the BSD3 license. You can propose another license if you must, but contributions made with BSD3 fit best with the spirit of OpenROAD’s permissive open-source philosophy. We do have exceptions in the project, but over time we hope that all contributions will be BSD3, or some other permissive license such as MIT or Apache2.0. ## Contributing Open Source PDK information and Designs If you have new design or PDK information to contribute, please add this to the repo [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/). In the [flow directory](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow) you will see a directory for [designs](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/designs) with Makefiles to run them, and one for PDK [platforms](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/platforms) used by the designs. If you add a new PDK platform, be sure to add at least one design that uses it. ## Contributing Scripts and Code We follow the [Google C++ style guide](https://google.github.io/styleguide/cppguide.html). If you find code in our project that does *not* follow this guide, then within each file that you edit, follow the style in that file. Please pay careful attention to the [tool checklist](https://openroad.readthedocs.io/en/latest/contrib/DeveloperGuide.html#tool-checklist) for all code. If you want to add or improve functionality in OpenROAD, please start with the top-level [app](https://github.com/The-OpenROAD-Project/OpenROAD/) repo. You can see in the `src` directory that submodules exist pointing to tested versions of the other relevant repos in the project. Please look at the tool workflow in the developer guide [document](DeveloperGuide.md) to work with the app and its submodule repos in an efficient way. Please run clang-format on all the C++ source files that you change, before committing. In the root directory of the OpenROAD repository there is the file `.clang-format` that defines all coding formatting rules. Please pay attention to the [test directory](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/test) and be sure to add tests for any code changes that you make, using open-source PDK and design information. We provide the `nangate45` PDK in the OpenROAD-flow-scripts repo to help with this. Pull requests with code changes are unlikely to be accepted without accompanying test cases. There are many [examples](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/test/gcd_nangate45.tcl) tests. Each repo has a test directory as well with tests you should run and add to if you modify something in one of the submodules. For changes that claim to improve QoR or PPA, please run many tests and ensure that the improvement is not design-specific. There are designs in the [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/) repo which can be used unless the improvement is technology-specific. Do not add runtime or build dependencies without serious thought. For a project like OpenROAD with many application subcomponents, the software architecture can quickly get out of control. Changes with lots of new dependencies which are not necessary are less likely to be integrated. If you want to add Tcl code to define a new tool command, look at [pdngen](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/pdn) as an example of how to do so. Take a look at the [CMakeLists file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/CMakeLists.txt) which automatically sources the Tcl code and the [Tcl file](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/src/pdn.tcl) itself. To accept contributions, we require each commit to be made with a DCO (Developer Certificate of Origin) attached. When you commit you add the `-s` flag to your commit. For example: ```shell git commit -s -m "test dco with -s" ``` This will append a statement to your commit comment that attests to the DCO. GitHub has built in the `-s` option to its command line since use of this is so pervasive. The promise is very basic, certifying that you know that you have the right to commit the code. Please read the [full statement here](https://developercertificate.org/). ## Questions Please refer to our [FAQs](../user/FAQS.md). # GitGuide.html.md # Git Quickstart This tutorial serves as a quickstart to Git and contributing to our repository. If you have not already set up OpenROAD-flow-scripts, please follow the instructions [here](). ## Forking You will need your own fork to work on the code. Go to the `OpenROAD-flow-scripts` project [page](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) and hit the `Fork` button. You will want to clone your fork to your machine: ```shell git clone https://github.com/your-user-name/OpenROAD-flow-scripts.git cd OpenROAD-flow-scripts git remote add upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git git fetch upstream ``` This creates the directory `OpenROAD-flow-scripts` and connects your repository to the upstream (master project) *OpenROAD-flow-scripts* repository. ## Creating a branch You want your master branch to reflect only production-ready code, so create a feature branch for making your changes. For example: ```shell git checkout master && git branch shiny-new-feature git checkout shiny-new-feature # Or equivalently, git checkout master && git checkout -b shiny-new-feature ``` This changes your working directory to the shiny-new-feature branch. Keep any changes in this branch specific to one bug or feature so it is clear what the branch brings to OpenROAD-flow-scripts. You can have many shiny-new-features and switch in between them using the git checkout command. When creating this branch, make sure your master branch is up to date with the latest upstream master version. To update your local master branch, you can do: ```shell git checkout master git pull upstream master ``` When you want to update the feature branch with changes in master after you created the branch, check the section on [updating a PR](). ## Committing your code Keep style fixes to a separate commit to make your pull request more readable. Once you’ve made changes, you can see them by typing: ```shell git status ``` If you have created a new file, it is not being tracked by git. Add it by typing: ```shell git add path/to/file-to-be-added.py ``` Doing `git status` again should give something like: ```shell # On branch shiny-new-feature # # modified: /relative/path/to/file-you-added.py # ``` Finally, commit your changes to your local repository with an explanatory commit message. Do note the `-s` option is needed for developer signoff. ```shell git commit -s -m "your commit message goes here" ``` ## Pushing your changes When you want your changes to appear publicly on your GitHub page, push your forked feature branch’s commits: ```shell git push origin shiny-new-feature ``` Here `origin` is the default name given to your remote repository on GitHub. You can see the remote repositories: ```shell git remote -v ``` If you added the upstream repository as described above you will see something like: ```shell origin https://github.com/your-user-name/OpenROAD-flow-scripts.git (fetch) origin https://github.com/your-user-name/OpenROAD-flow-scripts.git (push) upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git (fetch) upstream https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git (push) ``` Now your code is on GitHub, but it is not yet a part of the OpenROAD-flow-scripts project. For that to happen, a pull request needs to be submitted on GitHub. ## Review your code When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure that you have followed all the guidelines outlined in the [Developer’s Guide](DeveloperGuide.md) regarding code style, tests, performance tests, and documentation. You should also double check your branch changes against the branch it was based on: 1. Navigate to your repository on GitHub – https://github.com/your-user-name/OpenROAD-flow-scripts 2. Click on `Branches` 3. Click on the `Compare` button for your feature branch 4. Select the `base` and `compare` branches, if necessary. This will be `master` and `shiny-new-feature`, respectively. ## Submitting the pull request If everything looks good, you are ready to make a pull request. A pull request is how code from a local repository becomes available to the GitHub community and can be looked at and eventually merged into the master version. This pull request and its associated changes will eventually be committed to the master branch and available in the next release. To submit a pull request: 1. Navigate to your repository on GitHub 2. Click on the `Compare & pull request` button 3. You can then click on `Commits` and `Files Changed` to make sure everything looks okay one last time 4. Write a description of your changes in the `Preview Discussion` tab 5. Click `Send Pull Request`. This request then goes to the repository maintainers, and they will review the code. ## Updating your pull request Based on the review you get on your pull request, you will probably need to make some changes to the code. In that case, you can make them in your branch, add a new commit to that branch, push it to GitHub, and the pull request will be automatically updated. Pushing them to GitHub again is done by: ```shell git push origin shiny-new-feature ``` This will automatically update your pull request with the latest code and restart the [Continuous Integration](CI.md) tests. Another reason you might need to update your pull request is to solve conflicts with changes that have been merged into the master branch since you opened your pull request. To do this, you need to `merge upstream master` in your branch: ```shell git checkout shiny-new-feature git fetch upstream git merge upstream/master ``` If there are no conflicts (or they could be fixed automatically), a file with a default commit message will open, and you can simply save and quit this file. If there are merge conflicts, you need to solve those conflicts. See this [article](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/) for an explanation on how to do this. Once the conflicts are merged and the files where the conflicts were solved are added, you can run `git commit` to save those fixes. If you have uncommitted changes at the moment you want to update the branch with master, you will need to `stash` them prior to updating. #### SEE ALSO See the stash [docs](https://git-scm.com/book/en/v2/Git-Tools-Stashing-and-Cleaning). This will effectively store your changes and they can be reapplied after updating. After the feature branch has been updated locally, you can now update your pull request by pushing to the branch on GitHub: ```shell git push origin shiny-new-feature ``` ## Tips for a successful pull request If you have made it to the `Review your code` phase, one of the core contributors may take a look. Please note however that a handful of people are responsible for reviewing all of the contributions, which can often lead to bottlenecks. To improve the chances of your pull request being reviewed, you should: - **Reference an open issue** for non-trivial changes to clarify the PR’s purpose - **Ensure you have appropriate tests**. These should be the first part of any PR - **Keep your pull requests as simple as possible**. Larger PRs take longer to review - **Ensure that CI is in a green state**. Reviewers may not even look otherwise - **Keep updating your pull request**, either by request or every few days ## Acknowledgements This page has been adapted from [pandas Developer Guide](https://pandas.pydata.org/docs/development/contributing.html). # InstructionsForAutoTuner.html.md # Instructions for AutoTuner with Ray *AutoTuner* is a “no-human-in-loop” parameter tuning framework for commercial and academic RTL-to-GDS flows. AutoTuner provides a generic interface where users can define parameter configuration as JSON objects. This enables AutoTuner to easily support various tools and flows. AutoTuner also utilizes [METRICS2.1](https://github.com/ieee-ceda-datc/datc-rdf-Metrics4ML) to capture PPA of individual search trials. With the abundant features of METRICS2.1, users can explore various reward functions that steer the flow autotuning to different PPA goals. AutoTuner provides two main functionalities as follows. * Automatic hyperparameter tuning framework for OpenROAD-flow-script (ORFS) * Parametric sweeping experiments for ORFS AutoTuner contains top-level Python script for ORFS, each of which implements a different search algorithm. Current supported search algorithms are as follows. * Random/Grid Search * Population Based Training ([PBT](https://www.deepmind.com/blog/population-based-training-of-neural-networks)) * Tree Parzen Estimator ([HyperOpt](https://hyperopt.github.io/hyperopt)) * Bayesian + Multi-Armed Bandit ([AxSearch](https://ax.dev/)) * Tree Parzen Estimator + Covariance Matrix Adaptation Evolution Strategy ([Optuna](https://optuna.org/)) * Evolutionary Algorithm ([Nevergrad](https://github.com/facebookresearch/nevergrad)) User-defined coefficient values (`coeff_perform`, `coeff_power`, `coeff_area`) of three objectives to set the direction of tuning are written in the script. Each coefficient is expressed as a global variable at the `get_ppa` function in `PPAImprov` class in the script (`coeff_perform`, `coeff_power`, `coeff_area`). Efforts to optimize each of the objectives are proportional to the specified coefficients. ## Setting up AutoTuner We have provided two convenience scripts, `./installer.sh` and `./setup.sh` that works in Python3.8 for installation and configuration of AutoTuner, as shown below: ```shell # Install prerequisites ./tools/AutoTuner/installer.sh # Start virtual environment ./tools/AutoTuner/setup.sh ``` ## Input JSON structure Sample JSON [file](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/designs/sky130hd/aes/autotuner.json) for Sky130HD `aes` design: Alternatively, here is a minimal example to get started: ```json { "_SDC_FILE_PATH": "constraint.sdc", "_SDC_CLK_PERIOD": { "type": "float", "minmax": [ 1.0, 3.7439 ], "step": 0 }, "CORE_MARGIN": { "type": "int", "minmax": [ 2, 2 ], "step": 0 }, } ``` * `"_SDC_FILE_PATH"`, `"_SDC_CLK_PERIOD"`, `"CORE_MARGIN"`: Parameter names for sweeping/tuning. * `"type"`: Parameter type (“float” or “int”) for sweeping/tuning * `"minmax"`: Min-to-max range for sweeping/tuning. The unit follows the default value of each technology std cell library. * `"step"`: Parameter step within the minmax range. Step 0 for type “float” means continuous step for sweeping/tuning. Step 0 for type “int” means the constant parameter. ## Tunable / sweepable parameters Tables of parameters that can be swept/tuned in technology platforms supported by ORFS. Any variable that can be set from the command line can be used for tune or sweep. For SDC you can use: * `_SDC_FILE_PATH` - Path relative to the current JSON file to the SDC file. * `_SDC_CLK_PERIOD` - Design clock period. This will create a copy of `_SDC_FILE_PATH` and modify the clock period. * `_SDC_UNCERTAINTY` - Clock uncertainty. This will create a copy of `_SDC_FILE_PATH` and modify the clock uncertainty. * `_SDC_IO_DELAY` - I/O delay. This will create a copy of `_SDC_FILE_PATH` and modify the I/O delay. For Global Routing parameters that are set on `fastroute.tcl` you can use: * `_FR_FILE_PATH` - Path relative to the current JSON file to the `fastroute.tcl` file. * `_FR_LAYER_ADJUST` - Layer adjustment. This will create a copy of `_FR_FILE_PATH` and modify the layer adjustment for all routable layers, i.e., from `$MIN_ROUTING_LAYER` to `$MAX_ROUTING_LAYER`. * `_FR_LAYER_ADJUST_NAME` - Layer adjustment for layer NAME. This will create a copy of `_FR_FILE_PATH` and modify the layer adjustment only for the layer NAME. * `_FR_GR_SEED` - Global route random seed. This will create a copy of `_FR_FILE_PATH` and modify the global route random seed. ## How to use ### General Information The `autotuner.distributed` module uses [Ray’s](https://docs.ray.io/en/latest/index.html) job scheduling and management to fully utilize available hardware resources from a single server configuration, on-premise or over the cloud with multiple CPUs. The two modes of operation: - `sweep`, where every possible parameter combination in the search space is tested - `tune`, where we use Ray’s Tune feature to intelligently search the space and optimize hyperparameters using one of the algorithms listed above. The `sweep` mode is useful when we want to isolate or test a single or very few parameters. On the other hand, `tune` is more suitable for finding the best combination of a complex and large number of flow parameters. #### NOTE The order of the parameters matter. Arguments `--design`, `--platform` and `--config` are always required and should precede *mode*. #### NOTE The following commands should be run from `./tools/AutoTuner`. #### Tune only Example: ```shell python3 -m autotuner.distributed \ --design gcd \ --platform sky130hd \ --config ../../flow/designs/sky130hd/gcd/autotuner.json \ tune --samples 5 ``` #### Sweep only Example: ```shell python3 -m autotuner.distributed \ --design gcd \ --platform sky130hd \ --config src/autotuner/distributed-sweep-example.json \ sweep ``` #### Plot images After running an AutoTuner experiment, you can generate a graph to understand the results better. The graph will show the progression of one metric (see list below) over the execution of the experiment. - QoR - Runtime per trial - Clock Period - Worst slack ```shell python3 utils/plot.py --results_dir ``` #### Work Directory Use `--work-dir` to specify a writable directory for outputs. This is passed to ORFS as `WORK_HOME`. ```shell python3 -m autotuner.distributed \ --design gcd \ --platform sky130hd \ --config ../../flow/designs/sky130hd/gcd/autotuner.json \ --work-dir /tmp/autotuner123 \ tune --samples 5 ``` ### Google Cloud Platform (GCP) distribution with Ray GCP Setup Tutorial coming soon. ### List of input arguments | Argument | Description | Default | |----------------------|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------| | `--design` | Name of the design for Autotuning. | | | `--platform` | Name of the platform for Autotuning. | | | `--config` | Configuration file that sets which knobs to use for Autotuning. | | | `--experiment` | Experiment name. This parameter is used to prefix the FLOW_VARIANT and to set the Ray log destination. | test | | `--work-dir` | Work directory for outputs (passed to ORFS as WORK_HOME). | Installation directory | | `--git_clean` | Clean binaries and build files. **WARNING**: may lose previous data. | | | `--git_clone` | Force new git clone. **WARNING**: may lose previous data. | | | `--git_clone_args` | Additional git clone arguments. | | | `--git_latest` | Use latest version of OpenROAD app. | | | `--git_or_branch` | OpenROAD app branch to use. | | | `--git_orfs_branch` | OpenROAD-flow-scripts branch to use. | | | `--git_url` | OpenROAD-flow-scripts repo URL to use. | [ORFS GitHub repo](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) | | `--build_args` | Additional arguments given to ./build_openroad.sh | | | `--samples` | Number of samples for tuning. | 10 | | `--jobs` | Max number of concurrent jobs. | # of CPUs / 2 | | `--openroad_threads` | Max number of threads usable. | 16 | | `--server` | The address of Ray server to connect. | | | `--port` | The port of Ray server to connect. | 10001 | | `--timeout` | Time limit (in hours) for each trial run. | No limit | | `-v` or `--verbose` | Verbosity Level. [0: Only ray status, 1: print stderr, 2: print stdout on top of what is in level 0 and 1. ] | 0 | | | | | #### Input arguments specific to tune mode The following input arguments are applicable for tune mode only. | Argument | Description | Default | |-------------------------|---------------------------------------------------|-----------| | `--algorithm` | Search algorithm to use for Autotuning. | hyperopt | | `--eval` | Evaluate function to use with search algorithm. | | | `--iterations` | Number of iterations for tuning. | 1 | | `--resources_per_trial` | Number of CPUs to request for each tuning job. | 1 | | `--reference` | Reference file for use with PPAImprov. | | | `--perturbation` | Perturbation interval for PopulationBasedTraining | 25 | | `--seed` | Random seed. | 42 | | `--resume` | Resume previous run. | | | | | | ### GUI Basically, progress is displayed at the terminal where you run, and when all runs are finished, the results are displayed. You could find the “Best config found” on the screen. To use TensorBoard GUI, run `tensorboard --logdir=./`. While TensorBoard is running, you can open the webpage `http://localhost:6006/` to see the GUI. We show three different views possible at the end, namely: `Table View`, `Scatter Plot Matrix View` and `Parallel Coordinate View`. ![Table View](images/Autotuner_Table_view.webp)

Table View

![Scatter Plot Matrix View](images/Autotuner_scatter_plot_matrix_view.webp)

Scatter Plot Matrix View

![Parallel Coordinate View](images/Autotuner_best_parameter_view.webp)

Parallel Coordinate View (best run is in green)

## Testing framework Assuming the virtual environment is setup at `./tools/AutoTuner/autotuner_env`: ```default ./tools/AutoTuner/setup.sh python3 ./tools/AutoTuner/test/smoke_test_sweep.py python3 ./tools/AutoTuner/test/smoke_test_tune.py python3 ./tools/AutoTuner/test/smoke_test_sample_iteration.py ``` ## Citation Please cite the following paper. * J. Jung, A. B. Kahng, S. Kim and R. Varadarajan, “METRICS2.1 and Flow Tuning in the IEEE CEDA Robust Design Flow and OpenROAD”, [(.pdf)](https://vlsicad.ucsd.edu/Publications/Conferences/388/c388.pdf), [(.pptx)](https://vlsicad.ucsd.edu/Publications/Conferences/388/c388.pptx), [(.mp4)](https://vlsicad.ucsd.edu/Publications/Conferences/388/c388.mp4), Proc. ACM/IEEE International Conference on Computer-Aided Design, 2021. ## Acknowledgments AutoTuner has been developed by UCSD with the OpenROAD Project. # Jenkins.html.md # Jenkins Continuous Integration The Jenkins website is at [https://jenkins.openroad.tools/](https://jenkins.openroad.tools/). For an in-depth tutorial on how to access the CI metrics, please see the [link](https://docs.google.com/presentation/d/1kWHLjUBFcd0stnDaPNi_pt9WFrrsR7tQ95BGhT1yOvw/) #### NOTE This document is not static is constantly being updated due to changes in the functionality of Jenkins. # LargeDesigns.html.md # Tips on building large design Large designs can quickly result in unmanageable turnaround times for tweaking and fixing if the design contains behavioral memory models, because these memories are by default translated to flip flops. ORFS has a `SYNTH_MEMORY_MAX_BITS` that limits the size of inferred memories that are translated to flip flops to avoid doomed synthesis runs that will “running forever”, instead ORFS will error out early, normally within minutes. Behavioral models of memories are used in simulation and FPGA tools oftentimes automatically combine hard memory macros with some extra logic to match the behavioral model. OpenROAD does not do such automatic memory inference and matching against real memories or fakemem. ## Doing a screening build Before deciding how to set up a flow, it is useful to do a “screening build”. All we’re intersted in here is to know which modules we have and their relative sizes. This can help us identify memories that have not been successfully inferred by Yosys, which will manifest itself as very long synthesis times and appear in the OpenROAD hierarchical view with a large number of instances. The [minimal build configuration]() can be useful to do a screening build. Options useful for a screening build are, check out [config.mk](): - `SYNTH_HIERARCHICAL=1` and `SYNTH_MINIMUM_KEEP_SIZE=0`, to see all modules in the hierarchical OpenROAD view - `SYNTH_MEMORY_MAX_BITS=1024`, set a low threshold initially to get an error with list of memories in the system that will need to be dealt with in some way - `SYNTH_MOCK_LARGE_MEMORIES=1` enabled after first seeing the error report with memories. This sets the number of rows in memories larger than `SYNTH_MEMORY_MAX_BITS` to 1, so that synthesis will complete. ## Next steps on memories - If you’re taping out, write some wrapper Verilog for real memories. - fakemem can be a good option if available for your PDK. fakemem also needs manually written Verilog wrappers, just like real memories. - For architectural exploration, `SYNTH_MOCK_LARGE_MEMORIES=1` could give you adequate timing accuracy and is convenient. # Manpage.html.md # Utilities The utility module contains the `man` command. ## Commands #### NOTE - Parameters in square brackets `[-param param]` are optional. - Parameters without square brackets `-param2 param2` are required. ### Prometheus Metrics OpenROAD includes a metrics endpoint server that can track internal tool metrics over time. ![page](docs/images/grafana.png) To use this feature you need to do the following start the prometheus and grafana collectors [Detailed instructions](): ```shell $ cd etc/monitoring $ docker compose up -d ``` This will start a grafana endpoint ready to collect from the OpenROAD application you would like to track. By default it’s looking for an http server running on port 8080 on your localhost. To start the metrics endpoint in OpenROAD, run: ```tcl utl::startPrometheusEndpoint 8080 ``` This is all configurable in the docker compose file, and you should be able to access grafana by going to http://localhost:3000 username: admin, password: grafana. Go to the dashboard tab and click service, then OpenROAD to see the pre-made dashboard. ## Man installation The `man` command can be installed optionally as part of the OpenROAD binary. For more instructions, please refer to [here](). ### Man The `man` command in OpenROAD is similar in functionality to Unix (and Unix-like operating systems such as Linux) . It is used to display the manual pages for various applications, tools and error messages. These manual pages provide detailed information about how to use a particular command or function, along with its syntax and options. This can be used for a range of commands in different levels as follows: - Level 1: Top-level openroad command (e.g. `man openroad`) - Level 2: Individual module commands (e.g. `man clock_tree_synthesis`) - Level 3: Info, error, warning messages (e.g. `man CTS-0001`) ```tcl man name [-manpath manpath] [-no_pager] ``` #### Options | Switch Name | Description | |---------------|--------------------------------------------------------------------------------------------------------------------------------------| | `name` | Name of the command/message to query. | | `-manpath` | Include optional path to man pages (e.g. ~/OpenROAD/docs/cat). | | `-no_pager` | This flag determines whether you wish to see all of the man output at once. Default value is `False`, which shows a buffered output. | ## Example scripts You may run various commands or message IDs for man pages. ```default man openroad man clock_tree_synthesis man CTS-0005 ``` ### tee Redirect a commands output to a file and standard out. ```tcl tee (-file filename | -variable name) [-append] [-quiet] command ``` #### Options | Switch Name | Description | |------------------|-------------------------------------| | `-file filename` | File to redirect output into. | | `-variable name` | Direct output into a variable. | | `-append` | Append to file. | | `-quiet` | Do not send output to standard out. | | `command` | Command to execute. | ## Example scripts ```default tee -file output.rpt { report_design_area } tee -quiet -file output.rpt { report_floating_nets } ``` ## Regression tests There are a set of regression tests in `./test`. For more information, refer to this [section](). For information regarding the Man page test framework, refer to this [link](). You should also be aware of the [README]() and [Tcl]() format enforced to ensure accurate parsing of man pages. Simply run the following script: ```shell ./test/regression ``` ## Limitations ## FAQs Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+utl) about this tool. ## References ## Authors MAN command is written by Jack Luar with guidance from members of the OpenROAD team, including: Cho Moon, Matt Liberty. ## License BSD 3-Clause License. See [LICENSE]() file. # Metrics.html.md # Metrics The [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) repository contains source files (e.g., LEF/DEF, Verilog, SDC, Liberty, RC extraction) and configuration files (e.g. `config.mk`) that enable the user to run a small set of example designs through our complete RTL-to-GDS flow. To keep track of the quality of the results, we maintain inside each design folder two files: 1. `metadata-base-ok.json` which contains all the relevant information extracted from the “golden” execution of the flow (i.e., last known good result). 2. `rules.json` which holds a set of rules that we use to evaluate new executions when a change is made. ## Checking against golden The evaluation checks for key metrics (e.g., worst slack, number of DRCs) to ensure that changes do not degrade too much with respect to the “golden” values. After you make a significant change, e.g., fixing a bug in a piece of code, or changing some configuration variable (`PLACE_DENSITY`), you should review the results and compare them with the “golden”. To perform the check, you will need to run the following command: ```shell cd OpenROAD-flow-scripts/flow # the clean_metadata is only required if you need to re-run make [clean_metadata] metadata ``` If the command above yields any error message, please review to make sure the change in metrics is expected and justifiable. If so, proceed to the next section to update the “golden” reference. ## Update process Update of the reference files is mandatory if any metrics became worse than the values limited by the `rules.json` (see previous section on how to perform the check). Also, it is a good idea to update the “golden” files if your changes have improved a metric, to ensure that the improvement will not be lost in the future. To update all the reference files: ```shell cd OpenROAD-flow-scripts/flow make update_ok ``` In case you have a special reason to only update one of the files, you can do so with the following commands: ```shell # update metadata-base-ok.json file for the design make update_metadata # update rules.json file for the design # this will use the current (+ a padding) metadata-base-ok.json # the padding ensures that small changes do not break the flow make update_rules ``` # Notebooks.html.md # Colab Quickstart Notebook-based packaging offers three main benefits: 1. Colab is completely free to use and can be accessed from any web browser. 2. Colab notebooks can be easily shared with others, making it a great tool for teams to collaborate and manage OpenROAD design runs. 3. The notebook can easily be modified to be used for on-premise servers or notebook-based cloud providers such as LambdaLabs/Paperspace. We provide two notebooks for a quickstart to OpenROAD-flow-scripts functionality as follows: ## OpenROAD-flow-scripts Automated RTL-GDSII Flow The notebook for the automated flow for `gcd` design in `nangate45` technology node can be found [here](https://colab.research.google.com/drive/1bfcvqOnbw8q7FmSONLw8q7-yBVvKsQot). ## AutoTuner Flow The notebook for the OpenROAD-flow-scripts AutoTuner flow for `gcd` design in `sky130hd` technology node can be found [here](https://colab.research.google.com/drive/1wye0osn34YVWPvTrfBTftjOfGOtF3ABe). # PlatformBringUp.html.md # Guide to Integrate a New Platform into the OpenROAD Flow ## Overview This document is a guide for foundry and third party IP providers to easily integrate and test a new technology in to the OpenROAD RTL to GDS flow. OpenROAD allows you to integrate any PDK (Process Design Kit) for any feature size and implement a fully open-sourced RTL-GDSII flow (synthesizable Verilog to merged GDSII). The OpenROAD flow has been validated for feature sizes down to 7nm and used to design and tapeout over 600 ASIC and SoCs to date. ## Prerequisites To build and add a new platform for OpenROAD, key technology and library components must be provided based on the technology node. These are generally available as part of the standard design kit provided by a foundry or a third-party IP provider. They include : * A standard cell library * GDS files of all standard cells in the library (or a way to generate them from the layout files, e.g., Magic VLSI layout tool). * A technology LEF file of the PDK being used that includes all relevant information regarding metal layers, vias, and spacing requirements. * See `flow/platforms/nangate45/lef/NangateOpenCellLibrary.tech.lef` as an example tech LEF file. * A macro LEF file of the standard cell kit that includes MACRO definitions of every cell, pin designations (input/output/inout). * See `flow/platforms/nangate45/lef/NangateOpenCellLibrary.macro.lef` as an example macro LEF file. * A Liberty file of the standard cell library with PVT characterization, input and output characteristics, timing and power definitions for each cell. * See `flow/platforms/nangate45/lib/NangateOpenCellLibrary_typical.lib` as an example liberty file. * For KLayout: A mapping from LEF/DEF to GDS `layers:datatypes` Adding a new platform additionally requires the following: * A validated installation of the OpenROAD flow scripts is available. See instructions here. * A general knowledge of VLSI design and RTL to GDS flows. OpenROAD implements a fully-automated RTL-GDSII but it requires familiarity with the OpenROAD flow scripts to debug problems. ## Adding a New Platform to OpenROAD ### Setup This section describes the necessary files and directories needed to build the platform. All files and directories made/edited are independent of each other unless otherwise stated. ### Makefile Make the following edits to the Makefile (located in `flow/Makefile`) so that OpenROAD can run the flow on a design using the new platform. At the beginning of the Makefile, there is a block of `DESIGN_CONFIG` variables that are commented out. These variables tell OpenROAD which design to run and on what platform. `DESIGN_CONFIG` specifically points to a `config.mk` file located in the designs directory for the respective platform. It is not required to add a `DESIGN_CONFIG` variable for a design in the respective platform directly into the Makefile. It is merely a convenience to add a `DESIGN_CONFIG` variable in the `Makefile` and can instead be set when invoking make. OpenROAD has multiple Verilog designs already made which can be used with any platform (see `flow/designs/src` for a list of usable designs). For example, a `DESIGN_CONFIG` variable using the `gcd` design on a new platform would look as follows: ```Makefile DESIGN_CONFIG=./designs/MyNewPlatform/gcd/config.mk ``` The `config.mk` file will be generated later in the [Design Directory](#content-design-directory) section of this document. ### Platform Directory Create a directory for the new technology inside `flow/platforms` to contain the necessary files for the OpenROAD flow. ```shell mkdir flow/platforms/MyNewPlatform ``` ### Design Directory The design directory contains the configuration files for all the designs of a specific platform. Create a directory for the new platform in flow/designs to contain the relevant files and directories for all the designs for the flow in that specific platform. Each design requires its own `config.mk` and `constraint.sdc` files. ### Platform Configuration This section describes the necessary files in the platform directory needed for the OpenROAD flow. Specifically the `config.mk` file in the platform directory has all of the configuration variables that the flow uses. Refer to the OpenROAD-flow-scripts documentation for a full list of configuration variables that can be set. Refer to the [Flow variables](../user/FlowVariables.md) document for details on how to use environment variables in OpenROAD-flow-scripts to configure platform and design specific parameters. For an example of a platform `config.mk` file, refer to `flow/platforms/sky130hd/config.mk.` ### Design Configuration This section describes files in the design directory. ### `config.mk` The `config.mk` file describes design-specific variables. For Example: ```default DESIGN_NAME PLATFORM VERILOG_FILES SDC_FILE CORE_UTILIZATION CORE_ASPECT_RATIO CORE_MARGIN PLACE_DENSITY ``` Alternatively, `DIE_AREA` and `CORE_AREA` can be specified instead of `CORE_UTILIZATION`, `CORE_ASPECT_RATIO`, and `CORE_MARGIN`. For a complete descriptor of all variables see [here](../user/FlowVariables.md). Following is a sample `config.mk` file for the `gcd` design: ```shell export DESIGN_NAME = gcd export PLATFORM = sky130hd export VERILOG_FILES = $(sort $(wildcard ./designs/src/$(DESIGN_NAME)/*.v)) export SDC_FILE = ./designs/$(PLATFORM)/$(DESIGN_NAME)/constraint.sdc export CORE_UTILIZATION = 30 export CORE_ASPECT_RATIO = 1 export CORE_MARGIN = 2 export PLACE_DENSITY = 0.70 ``` ### `constraint.sdc` The `constraint.sdc` file defines timing constraints for the design. The `create_clock` command allows you to define clocks that are either connected to nets or are virtual and can be customized. The units for `create_clock` need to be consistent with the liberty time units. Here’s an example of a `constraint.sdc` file which defines a clock `clk` with a period of 8.4 nanoseconds (nanoseconds being consistent with the liberty time units). ```tcl create_clock [get_ports clk] -period 8.4 #Units are in nanoseconds ``` Refer to the [OpenSTA](https://github.com/The-OpenROAD-Project/OpenSTA/blob/master/doc/OpenSTA.pdf) User Guide for the full documentation of the `create_clock` command. ### Liberty, LEF, and GDS Files The liberty, LEF, and GDS files do not technically have to reside inside the platform directory of respective technology as long as the paths set in the `config.mk` file point to the correct files. However, it is good practice to have all relevant files in one localized directory. The `.lib`, `.lef`, and `.gds` reside in directories named respectively for the specific technology. For example: ```shell mdkir flow/platforms/MyNewPlatform/lib mdkir flow/platforms/MyNewPlatform/lef mdkir flow/platforms/MyNewPlatform/gds ``` A merged GDS file may be used instead of adding every individual `.gds` file from the standard cell library. Once the liberty file, tech and macro LEF files, and either the merged standard cell GDS or individual standard cell GDS files have been generated, place them in their respective directories and set the `lib`, `lef`, and `gds` variables in the platform `config.mk` file to the correct paths. ### Clock Gates Yosys cannot (currently) infer clock gates automatically. However, users can manually instantiate clock gates in their RTL using a generic interface. The purpose of this interface is to separate platform-specific RTL (also called “hardened” RTL) from platform-independent RTL (generic RTL). This file is only required if you want to instantiate clock gates in your design. To create this module, a gated clock standard cell is required. This standard cell is used to create the generic module `OPENROAD_CLKGATE`, as shown below. ```verilog module OPENROAD_CLKGATE (CK, E, GCK); input CK; input E; output GCK; latch (.CLK(CK), .GATE(E), .GCLK(GCK)); endmodule ``` An example instantiation of this module in a user design is shown below. ```verilog // This is not a platform file, this is an example user design module buffer (clk, enable, in, out); input clk, enable; input [7:0] in, output [7:0] out reg [15:0] buffer_reg; wire gck; // Gated clock OPENROAD_CLKGATE clkgate (.CK(clk), .E(enable), .GCK(gck)); // Buffer does not change if enable is low always @(posedge gck) begin buffer_reg[15:8] <= in; buffer_reg[ 7:0] <= buffer_reg[15:8]; end assign out = buffer_reg[ 7:0]; ``` ### Latches Yosys can automatically infer latches from RTL, however it requires a behavioral Verilog module. Example latch definitions are provided below. `DLATCH_P` is an active-high level-sensitive latch and `DLATCH_N` is an active-low level-sensitive latch. This file is only required if you want to infer latches for your design. ```verilog module $_DLATCH_P_(input E, input D, output Q); _TECHMAP_REPLACE_ ( .D (D), .G (E), .Q (Q) ); endmodule module $_DLATCH_N_(input E, input D, output Q); _TECHMAP_REPLACE_ ( .D (D), .GN (E), .Q (Q) ); endmodule ``` ### FastRoute Configuration FastRoute is the tool used to global-route the design. FastRoute requires a Tcl file to set which routing layers will be used for signals, adjust routing layer resources, set which routing heuristic to use when routing, etc. It’s recommended to use the default `fastroute.tcl` due to its simplicity and effectiveness. Following is the default FastRoute configuration file. ```tcl set_global_routing_layer_adjustment $::env(MIN_ROUTING_LAYER)-$::env(MAX_ROUTING_LAYER) 0.5 set_routing_layers -signal $::env(MIN_ROUTING_LAYER)-$::env(MAX_ROUTING_LAYER) ``` The first command, `set_global_routing_layer_adjustment`, adjusts the routing resources of the design. This effectively reduces the number of routing tracks that the global router assumes to exist. By setting it to the value of 0.5, this reduced the routing resources of all routing layers to 50% which can help with congestion and reduce the challenges for detail routing. The second command, `set_routing_layers`, sets the minimum and maximum routing layers for signal nets by using the `-signal` option. More customization can be done to increase the efficiency of global and detail route. Refer to the [FastRoute documentation](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/grt/README.md) ### Metal Tracks Configuration OpenROAD requires a metal track configuration file for use in floorplanning. For each metal layer, the x and y offset as well as the x and y pitch are defined. To find the pitch and offset for both x and y, refer to the `LAYER` definition section for each metal in the tech LEF. Following is a generalized metal tracks configuration file with five metal tracks defined. **Units are in microns**. ```tcl make_tracks metal1 -x_offset 0.24 -x_pitch 0.82 -y_offset 0.24 -y_pitch 0.82 make_tracks metal2 -x_offset 0.28 -x_pitch 0.82 -y_offset 0.28 -y_pitch 0.82 make_tracks metal3 -x_offset 0.28 -x_pitch 0.82 -y_offset 0.28 -y_pitch 0.82 make_tracks metal4 -x_offset 0.28 -x_pitch 0.82 -y_offset 0.28 -y_pitch 0.82 make_tracks metal5 -x_offset 0.28 -x_pitch 0.82 -y_offset 0.28 -y_pitch 0.82 ``` Following is the `LAYER` definition for `metal1` in the `sky130hd` tech LEF. ```default LAYER met1 TYPE ROUTING ; DIRECTION HORIZONTAL ; PITCH 0.34 ; OFFSET 0.17 ; WIDTH 0.14 ; # Met1 1 # SPACING 0.14 ; # Met1 2 # SPACING 0.28 RANGE 3.001 100 ; # Met1 3b SPACINGTABLE PARALLELRUNLENGTH 0 WIDTH 0 0.14 WIDTH 3 0.28 ; AREA 0.083 ; # Met1 6 THICKNESS 0.35 ; MINENCLOSEDAREA 0.14 ; ANTENNAMODEL OXIDE1 ; ANTENNADIFFSIDEAREARATIO PWL ( ( 0 400 ) ( 0.0125 400 ) ( 0.0225 2609 ) ( 22.5 11600 ) ) ; EDGECAPACITANCE 40.567E-6 ; CAPACITANCE CPERSQDIST 25.7784E-6 ; DCCURRENTDENSITY AVERAGE 2.8 ; # mA/um Iavg_max at Tj = 90oC ACCURRENTDENSITY RMS 6.1 ; # mA/um Irms_max at Tj = 90oC MAXIMUMDENSITY 70 ; DENSITYCHECKWINDOW 700 700 ; DENSITYCHECKSTEP 70 ; RESISTANCE RPERSQ 0.125 ; END met1 ``` In the example above, the x and y pitch for `met1` would be 0.34 and the x and y offset would be 0.17. ### PDN Configuration PDN is a utility that simplifies adding a power grid into the floorplan. With specifications given in the PDN configuration file, like which layer to use, stripe width and spacing, the utility can generate the metal straps used for the power grid. To create and configure a power grid, refer to the [PDN documentation](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/src/pdn/README.md). ### Tapcell Configuration The tapcell configuration file is used to insert tapcells and endcaps into the design. Refer to the [Tapcell](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/tap) documentation on how to construct this file. ### setRC Configuration `setRC` allows the user to define resistances and capacitances for layers and vias using the `set_layer_rc` command. There is also a command that allows you to set the resistance and capacitance of routing wires using the `set_wire_rc`. The units `set_wire_rc` is expecting are per-unit-length values. Often, per-unit-length values are available in the PDK user guide. For `set_layer_rc`, Liberty units need to be used. Following is a generic example of a `setRC` configuration file which sets the resistance and capacitance of five metal layers, four vias, one signal wire, and one clock wire. ```tcl set_layer_rc -layer M1 -capacitance 1.449e-04 -resistance 8.929e-04 set_layer_rc -layer M2 -capacitance 1.331e-04 -resistance 8.929e-04 set_layer_rc -layer M3 -capacitance 1.464e-04 -resistance 1.567e-04 set_layer_rc -layer M4 -capacitance 1.297e-04 -resistance 1.567e-04 set_layer_rc -layer M5 -capacitance 1.501e-04 -resistance 1.781e-05 set_layer_rc -via V1 -resistance 9.249146E-3 set_layer_rc -via V2 -resistance 4.5E-3 set_layer_rc -via V3 -resistance 3.368786E-3 set_layer_rc -via V4 -resistance 0.376635E-3 set_wire_rc -signal -layer M2 set_wire_rc -clock -layer M5 ``` ### KLayout KLayout is used in the OpenROAD flow to provide GDS merging, DRC, and LVS. Two files are required for KLayout and they are generated within the KLayout GUI. Install KLayout on the host machine since it is not included in the OpenROAD build process. Then create the properties and tech files as explained below. ### KLayout tech file Follow these steps to generate the KLayout tech file: 1. Open KLayout in a terminal. 2. Go to Tools -> Manage Technologies. 3. Click the + in the bottom left corner to create a new technology. 4. Set the name for the technology in the box that pops up. You should now see the technology name in the list on the left hand side. 5. Expand the technology by hitting the arrow and click on General. 6. Set the base path your platform directory and load the `.lyp` layer properties file that was generated earlier. 7. On the left hand side under your new technology click Reader Options and then click LEF/DEF on the top bar. 8. In the LEF+Macro Files section, you add the LEF files by clicking the + button on the right hand side of the box. 1. **Note**: Only add your original merged LEF file. Make sure it includes the full path to the LEF file. 9. In the Production section, scroll down and add the layer map file by hitting the Load File button. 1. **Note**: Make sure it includes the full path. 10. Above in the same section, change the layer name suffix and GDS data type to correspond with the layer map. 11. Generate the `.lyt` file by right clicking on the new technology name and click on Export Technology. 12. Save with the extension `.lyt`. ### KLayout properties file The properties file is not required to obtain a GDS and is merely used for styling purposes inside. Follow these steps to generate the KLayout properties file: 1. Open KLayout. 2. Install the `tf_import` package. 1. Inside KLayout, go to Tools. 2. Manage Packages. 3. Install New Packages. 4. Select `tf_import`. 1. If the source of the package is from GitHub, then the file “” needs to be edited to include “source stdio”. 3. Re-start KLayout. 4. File -> Import some LEF. Does not matter what LEF; you will just get an error message without one… 5. Once selected, go to Options at the bottom left. 6. Select your layer map file under the Production tab. 7. Go to the LEF+Macro Files tab, then add under Additional LEF files, the merged (original) LEF file in your platform directory. 8. Under Macro Layout Files, add the GDS file in your platform directory. 9. File -> Import Cadence tech file. 1. You have to select a tech file (found in the PDK, usually inside the Virtuoso folder). 2. KLayout also needs a `.drf` file which is automatically included if it resides in the same directory the cadence tech file was found in (found in the PDK’s Virtuoso folder)… 10. File -> Save Layer Properties. 11. Save as a `.lyp` file in your platform directory. ## Validating the New Platform To validate the new platform, simply run a design through the flow using the new platform. The Makefile should already include the `DESIGN_CONFIG` variables for the new platform which were generated in the Setup section of the document. Simply uncomment a `DESIGN_CONFIG` variable for the new platform in the Makefile, save, and then run `make` in the terminal to run the design through the flow. Try a small design first (i.e. `gcd`) so that run time is small and you can identify and fix errors faster. ## Authors/Contributors * James Stine - Oklahoma State University * Teo Ene - Oklahoma State University * Ricardo Hernandez - Oklahoma State University * Ryan Ridley - Oklahoma State University * Indira Iyer - OpenROAD Project Consultant # QoRDashboard.html.md # Using the OpenROAD Dashboard to track and analyze Quality of Results The metrics dashboard [(https://dashboard.theopenroadproject.org/)](https://dashboard.theopenroadproject.org/) is tailored for RTL-to-GDS flow stages, targeting different designs across various platforms. The dashboard comprises two main pages: the trends page and the comparison page. ## Trends The trends page allows users to visualize metric trends through interactive graphs, enabling the selection of platforms, designs, and metrics for each platform. This feature aids in tracking the fluctuations of metrics over time. ![Trends](images/trends.webp) ## Comparison The comparison page lets users compare metrics between branches or commits for a specific platform and its designs. The comparison is shown as a table showcasing the differences between the base source and the test source. This page also offers deeper insights, like the platform summary table that presents statistical trends for different designs within a platform and a summary table that provides insights for the set of selected designs, with added functionality for filtering. ![Comparison](images/comparison.webp) These pages combine to create a comprehensive dashboard facilitating data-driven decision-making and performance optimization in the design flow. # SupportedOS.html.md # Welcome to OpenROAD’s documentation! The OpenROAD (“Foundations and Realization of Open, Accessible Design”) project was launched in June 2018 within the DARPA IDEA program. OpenROAD aims to bring down the barriers of cost, expertise and unpredictability that currently block designers’ access to hardware implementation in advanced technologies. The project team (Qualcomm, Arm and multiple universities and partners, led by UC San Diego) is developing a fully autonomous, open-source tool chain for digital SoC layout generation, focusing on the RTL-to-GDSII phase of system-on-chip design. Thus, OpenROAD holistically attacks the multiple facets of today’s design cost crisis: engineering resources, design tool licenses, project schedule, and risk. The IDEA program targets no-human-in-loop (NHIL) design, with 24-hour turnaround time and zero loss of power-performance-area (PPA) design quality. The NHIL target requires tools to adapt and auto-tune successfully to flow completion, without (or, with minimal) human intervention. Machine intelligence augments human expertise through efficient modeling and prediction of flow and optimization outcomes throughout the synthesis, placement and routing process. This is complemented by development of metrics and machine learning infrastructure. The 24-hour runtime target implies that problems must be strategically decomposed throughout the design process, with clustered and partitioned subproblems being solved and recomposed through intelligent distribution and management of computational resources. This ensures that the NHIL design optimization is performed within its available `[threads * hours]` “box” of resources. Decomposition that enables parallel and distributed search over cloud resources incurs a quality-of-results loss, but this is subsequently recovered through improved flow predictability and enhanced optimization. For a technical description of the OpenROAD flow, please refer to our DAC-2019 paper: [Toward an Open-Source Digital Flow: First Learnings from the OpenROAD Project](https://vlsicad.ucsd.edu/Publications/Conferences/371/c371.pdf). The paper is also available from [ACM Digital Library](https://dl.acm.org/doi/10.1145/3316781.3326334). Other publications and presentations are linked [here](https://theopenroadproject.org/publications/). ## Documentation The OpenROAD Project has two releases: - Application ([github](https://github.com/The-OpenROAD-Project/OpenROAD)) ([docs]()): The application is a standalone binary for digital place and route that can be used by any other RTL-GDSII flow controller. - Flow ([github](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts)) ([docs](https://openroad-flow-scripts.readthedocs.io/en/latest/)): This is the native OpenROAD flow that consists of a set of integrated scripts for an autonomous RTL-GDSII flow using OpenROAD and other open-source tools. ## Supported Operating Systems Note that depending on the installation method, we have varying levels of support for various operating systems. Legend: - `Y` for supported. - `-` for unsupported. | Operating System | Local Installation | Prebuilt Binaries | Docker Installation | Windows Subsystem for Linux | |----------------------|----------------------|---------------------|-----------------------|-------------------------------| | Debian 12 | `Y` | `Y` | `Y` | `-` | | Debian 13 | `Y` | `Y` | `Y` | `-` | | Ubuntu 22.04 | `Y` | `Y` | `Y` | `-` | | Ubuntu 24.04 | `Y` | `Y` | `Y` | `-` | | Ubuntu 26.04 | `Y` | `Y` | `Y` | `-` | | RHEL 8/9 | `Y` | `-` | `Y` | `-` | | Rocky 8 | `Y` | `-` | `Y` | `-` | | Rocky 9 | `Y` | `-` | `Y` | `-` | | macOS | `Y` | `-` | `Y` | `-` | | Windows 10 and above | `-` | `-` | `Y` | `Y` | ## Code of conduct Please read our code of conduct [here](). ## How to contribute If you are willing to **contribute**, see the [Getting Involved](contrib/GettingInvolved.md) section. If you are a **developer** with EDA background, learn more about how you can use OpenROAD as the infrastructure for your tools in the [Developer Guide](contrib/DeveloperGuide.md) section. OpenROAD uses Git for version control and contributions. Get familiarised with a quickstart tutorial to contribution [here](contrib/GitGuide.md). ## How to get in touch We maintain the following channels for communication: - Project homepage and news: [https://theopenroadproject.org](https://theopenroadproject.org) - Twitter: [https://twitter.com/OpenROAD_EDA](https://twitter.com/OpenROAD_EDA) - Issues and bugs: - OpenROAD: [https://github.com/The-OpenROAD-Project/OpenROAD/issues](https://github.com/The-OpenROAD-Project/OpenROAD/issues) - Discussions: - OpenROAD: [https://github.com/The-OpenROAD-Project/OpenROAD/discussions](https://github.com/The-OpenROAD-Project/OpenROAD/discussions) - Inquiries: openroad@ucsd.edu See also our [FAQs](user/FAQS.md). ## Site Map # TutorialHome.html.md # OpenROAD-flow-scripts tutorial The links to the main flow tutorial, where we go through each step of the RTL-GDSII flow are as [follows](FlowTutorial.md). We have also provided Google Colab packaging for ease of experimentation [here](Notebooks.md). # UserGuide.html.md # User Guide The OpenROAD Project uses three tools to perform automated RTL-to-GDS layout generation: 1. [yosys](https://github.com/The-OpenROAD-Project/yosys): Logic Synthesis 2. [OpenROAD](https://github.com/The-OpenROAD-Project/OpenROAD): Floorplanning through Detailed Routing 3. [KLayout](https://www.klayout.de/): GDS merge, DRC and LVS (public PDKs) To automate RTL-to-GDS we provide [OpenROAD Flow](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts), which contains scripts that integrate the three tools. ## Code Organization The [OpenROAD Flow](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) repository serves as an example RTL-to-GDS flow using the OpenROAD tools. The script `build_openroad.sh` in the repository will automatically build the OpenROAD toolchain. The two main directories are: 1. `tools/`: contains the source code for the entire yosys and [OpenROAD App](https://github.com/The-OpenROAD-Project/OpenROAD) (both via submodules) as well as other tools required for the flow. 2. `flow/`: contains reference recipes and scripts to run designs through the flow. It also contains public platforms and test designs. ## Setup See Getting Started guide. ## Using the OpenROAD Flow See the documentation [here](../tutorials/FlowTutorial.md) for details about the flow and how to run designs through the flow. ## Using the OpenROAD App See the documentation [here](https://github.com/The-OpenROAD-Project/OpenROAD/blob/master/README.md) for details about the app and the available features and commands. # index2.html.md # Welcome to the OpenROAD Flow Scripts documentation! The OpenROAD (“Foundations and Realization of Open, Accessible Design”) project was launched in June 2018 within the DARPA IDEA program. OpenROAD aims to bring down the barriers of cost, expertise and unpredictability that currently block designers access to hardware implementation in advanced technologies. The project team (Qualcomm, Arm and multiple universities and partners, led by UC San Diego) is developing a fully autonomous, open-source tool chain for digital SoC layout generation, focusing on the RTL-to-GDSII phase of system-on-chip design. Thus, OpenROAD holistically attacks the multiple facets of today’s design cost crisis: engineering resources, design tool licenses, project schedule, and risk. The IDEA program targets no-human-in-loop (NHIL) design, with 24-hour turnaround time and zero loss of power-performance-area (PPA) design quality. The NHIL target requires tools to adapt and auto-tune successfully to flow completion, without (or, with minimal) human intervention. Machine intelligence augments human expertise through efficient modeling and prediction of flow and optimization outcomes throughout the synthesis, placement and routing process. This is complemented by development of metrics and machine learning infrastructure. The 24-hour runtime target implies that problems must be strategically decomposed throughout the design process, with clustered and partitioned subproblems being solved and recomposed through intelligent distribution and management of computational resources. This ensures that the NHIL design optimization is performed within its available `[threads * hours]` “box” of resources. Decomposition that enables parallel and distributed search over cloud resources incurs a quality-of-results loss, but this is subsequently recovered through improved flow predictability and enhanced optimization. Learn more about the project at our website and our resources page [here](https://theopenroadproject.org/resources/). ## Getting Started with OpenROAD Flow Scripts OpenROAD Flow is a full RTL-to-GDS flow built entirely on open-source tools. The project aims for automated, no-human-in-the-loop digital circuit design with 24-hour turnaround time. For more information, refer to our repository [README](mainREADME.md). ### Setup #### Supported Operating Systems Note that depending on the installation method, we have varying levels of support for various operating systems. Legend: - `Y` for supported. - `-` for unsupported. | Operating System | Local Installation | Prebuilt Binaries | Docker Installation | Windows Subsystem for Linux | |----------------------|----------------------|---------------------|-----------------------|-------------------------------| | Debian 12 | `Y` | `Y` | `Y` | `-` | | Debian 13 | `Y` | `Y` | `Y` | `-` | | Ubuntu 22.04 | `Y` | `Y` | `Y` | `-` | | Ubuntu 24.04 | `Y` | `Y` | `Y` | `-` | | Ubuntu 26.04 | `Y` | `Y` | `Y` | `-` | | RHEL 8/9 | `Y` | `-` | `Y` | `-` | | Rocky 8 | `Y` | `-` | `Y` | `-` | | Rocky 9 | `Y` | `-` | `Y` | `-` | | macOS | `Y` | `-` | `Y` | `-` | | Windows 10 and above | `-` | `-` | `Y` | `Y` | #### System Requirements To build the binaries and run `gcd` through the flow: - Minimum: 1 CPU core and 8GB RAM. - Recommended: 4 CPU cores and 16GB of RAM. #### NOTE `gcd` is a small design, and thus requires less computational power. Larger designs may require better hardware. #### Build or Installing ORFS Dependencies We support four major ways of installation: - [Docker](user/BuildWithDocker.md) - [Pre-built Binaries](user/BuildWithPrebuilt.md) - [Windows Subsystem for Linux (WSL)](user/BuildWithWSL.md) - [Local Installation](user/BuildLocally.md) You may also choose and use the build script to customise your build process. See more in the next section. ##### Build Command and options ```shell ./build_openroad.sh --help ``` Options for `./build_openroad.sh` script | Argument | Description | |-----------------------------|----------------------------------------------------------------------------------------------------------------------| | `-h` or `--help` | Print help message. | | `-o` or `--local` | Build locally instead of building a Docker image. | | `-l` or `--latest` | Use the head of branch –or_branch or ‘master’ by default for tools/OpenROAD. | | `--or_branch BRANCH_NAME` | Use the head of branch BRANCH for tools/OpenROAD. | | `--or_repo REPO_URL` | Use a fork at REPO-URL (https/ssh) for tools/OpenROAD. | | `--no_init` | Skip initializing submodules. | | `-t N` or `--threads N` | Use N cpus when compiling software. | | `-n` or `--nice` | Nice all jobs. Use all cpus unless `--threads` is also given, then use N threads. | | `--yosys-args-overwrite` | Do not use default flags set by this scrip during Yosys compilation. | | `--yosys-args STRING` | Aditional compilation flags for Yosys compilation. | | `--openroad-args-overwrite` | Do not use default flags set by this script during OpenROAD app compilation. | | `--openroad-args STRING` | Aditional compilation flags for OpenROAD app compilation. | | `--install-path PATH` | Path to install tools. Default is `${INSTALL_PATH}`. | | `--clean` | Call git clean interactively before compile. Useful to remove old build files. | | `--clean-force` | Call git clean before compile. WARNING: this option will not ask for confirmation. Useful to remove old build files. | | `-c` or `--copy-platforms` | Only applicable for docker builds. Copy platforms to inside docker image. | | `--docker-args-overwrite` | Only applicable for docker builds. Do not use default flags set by this script for Docker builds. | | `--docker-args STRING` | Only applicable for docker builds. Additional compilation flags for Docker build. | ### Running a Design Sample design configurations are available in the `designs` directory. You can select a design using either of the following methods: 1. The flow [Makefile](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/Makefile) contains a list of sample design configurations at the top of the file. Uncomment the respective line to select the design. 2. Specify the design using the shell environment. For example: ```shell # Make sure you are in ./flow make DESIGN_CONFIG=./designs/nangate45/swerv/config.mk # or export DESIGN_CONFIG=./designs/nangate45/swerv/config.mk make ``` By default, the `gcd` design is selected using the `nangate45` platform. The resulting GDS will be available at `flow/results/nangate45/gcd/6_final.gds`. The flow should take only a few minutes to produce a GDS for this design. We recommend implementing this design first to validate your flow and tool setup. ### Design exploration and automatic parameter tuning AutoTuner is an automatic parameter tuning framework capable of performing automatic parameter tuning framework for commercial and academic RTL-to-GDS flows. The two main functionalities that AutoTuner provides are: - Automatic hyperparameter tuning framework for OpenROAD-flow-scripts - Parametric sweeping experiments for OpenROAD-flow-scripts ### Adding a Design To add a new design to the `flow` directory, refer to the document [here](user/AddingNewDesign.md). ### Platforms OpenROAD-flow-scripts supports Verilog to GDS for the following open platforms: - ASAP7 - Nangate45 / FreePDK45 - SKY130 - GF180 - SG13G2 These platforms have a permissive license which allows us to redistribute the PDK and OpenROAD platform-specific files. The platform files and license(s) are located in `platforms/{platform}`. OpenROAD-flow-scripts also supports the following proprietary platforms: - GF55 - GF12 - Intel22 - Intel16 - TSMC65 The PDKs and platform-specific files for these kits cannot be provided due to NDA restrictions. However, if you are able to access these platforms, you can create the necessary platform-specific files yourself. Once the platform is set up, you can create a new design configuration with information about the design. See sample configurations in the `design` directory. Refer to the [Flow variables](user/FlowVariables.md) document for details on how to use environment variables in OpenROAD-flow-scripts to configure platform and design specific parameters. #### Adding a Platform Refer to the [platform bring up](contrib/PlatformBringUp.md) documentation to set up a new platform for OpenROAD-flow-scripts. ### Implement the Design Run `make` to perform Verilog to GDS. The final output will be located at `flow/results/{platform}/{design_name}/6_final.gds` ### Miscellaneous #### Smoke-test harness for top-level Verilog designs 1. Drop your Verilog files into `designs/src/harness` 2. Start the workflow: ```shell make DESIGN_NAME=TopLevelName DESIGN_CONFIG=$(pwd)/designs/harness.mk ``` ## How to contribute If you are willing to **contribute**, see the [Getting Involved](contrib/GettingInvolved.md) section. If you are a **developer** with EDA background, learn more about how you can use OpenROAD as the infrastructure for your tools in the [Developer Guide](contrib/DeveloperGuide.md) section. ## How to get in touch We maintain the following channels for communication: - Project homepage and news: [https://theopenroadproject.org](https://theopenroadproject.org) - Twitter: [https://twitter.com/OpenROAD_EDA](https://twitter.com/OpenROAD_EDA) - Issues and bugs: - OpenROAD Flow: [https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues) - OpenROAD with OpenROAD Flow Scripts: [https://github.com/The-OpenROAD-Project/OpenROAD/issues/](https://github.com/The-OpenROAD-Project/OpenROAD/issues/) - Discussions: - OpenROAD Flow: [https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/discussions](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/discussions) - Inquiries: openroad@ucsd.edu See also our [FAQs](user/FAQS.md). ## Code of conduct Please read our code of conduct [here](contrib/CODE_OF_CONDUCT.md). ## Site Map * [User Guide](user/UserGuide.md) * [Code Organization](user/UserGuide.md#code-organization) * [Setup](user/UserGuide.md#setup) * [Using the OpenROAD Flow](user/UserGuide.md#using-the-openroad-flow) * [Using the OpenROAD App](user/UserGuide.md#using-the-openroad-app) * [Manpages](Manpage.md) * [Commands](Manpage.md#commands) * [Prometheus Metrics](Manpage.md#prometheus-metrics) * [Man installation](Manpage.md#man-installation) * [Man](Manpage.md#man) * [Options](Manpage.md#options) * [Example scripts](Manpage.md#example-scripts) * [tee](Manpage.md#tee) * [Options](Manpage.md#id1) * [Example scripts](Manpage.md#id2) * [Regression tests](Manpage.md#regression-tests) * [Limitations](Manpage.md#limitations) * [FAQs](Manpage.md#faqs) * [References](Manpage.md#references) * [Authors](Manpage.md#authors) * [License](Manpage.md#license) * [Getting Involved](contrib/GettingInvolved.md) * [Licensing Contributions](contrib/GettingInvolved.md#licensing-contributions) * [Contributing Open Source PDK information and Designs](contrib/GettingInvolved.md#contributing-open-source-pdk-information-and-designs) * [Contributing Scripts and Code](contrib/GettingInvolved.md#contributing-scripts-and-code) * [Questions](contrib/GettingInvolved.md#questions) * [Developer's Guide](contrib/DeveloperGuide.md) * [Timing and Logging (`run_command.py`)](contrib/DeveloperGuide.md#timing-and-logging-run-command-py) * [What it does](contrib/DeveloperGuide.md#what-it-does) * [Usage](contrib/DeveloperGuide.md#usage) * [Monitoring long-running stages](contrib/DeveloperGuide.md#monitoring-long-running-stages) * [Cross-platform support](contrib/DeveloperGuide.md#cross-platform-support) * [Testing](contrib/DeveloperGuide.md#testing) * [Code of Conduct](contrib/CODE_OF_CONDUCT.md) * [Our Pledge](contrib/CODE_OF_CONDUCT.md#our-pledge) * [Our Standards](contrib/CODE_OF_CONDUCT.md#our-standards) * [Enforcement Responsibilities](contrib/CODE_OF_CONDUCT.md#enforcement-responsibilities) * [Scope](contrib/CODE_OF_CONDUCT.md#scope) * [Enforcement](contrib/CODE_OF_CONDUCT.md#enforcement) * [Enforcement Guidelines](contrib/CODE_OF_CONDUCT.md#enforcement-guidelines) * [1. Correction](contrib/CODE_OF_CONDUCT.md#correction) * [2. Warning](contrib/CODE_OF_CONDUCT.md#warning) * [3. Temporary Ban](contrib/CODE_OF_CONDUCT.md#temporary-ban) * [4. Permanent Ban](contrib/CODE_OF_CONDUCT.md#permanent-ban) * [Attribution](contrib/CODE_OF_CONDUCT.md#attribution) * [FAQs](user/FAQS.md) * [How can I contribute?](user/FAQS.md#how-can-i-contribute) * [How do I update OpenROAD-flow-scripts?](user/FAQS.md#how-do-i-update-openroad-flow-scripts) * [How do I update the design reference files?](user/FAQS.md#how-do-i-update-the-design-reference-files) * [How do I get better search results?](user/FAQS.md#how-do-i-get-better-search-results) * [Tutorials](tutorials/TutorialHome.md) * [Flow QoR and CI Metrics](user/Flow_QoR_CI.md) * [OpenROAD Dashboard](user/Flow_QoR_CI.md#openroad-dashboard) * [Jenkins CI](user/Flow_QoR_CI.md#jenkins-ci) # mainREADME.html.md # OpenROAD Flow [![Build Status](https://jenkins.openroad.tools/buildStatus/icon?job=OpenROAD-flow-scripts-Public%2Fpublic_tests_all%2Fmaster)](https://jenkins.openroad.tools/view/Public/job/OpenROAD-flow-scripts-Public/job/public_tests_all/job/master/) [![Docs](https://readthedocs.org/projects/openroad-flow-scripts/badge/?version=latest)](https://openroad-flow-scripts.readthedocs.io/en/latest/?badge=latest) OpenROAD-flow-scripts (ORFS) is a fully autonomous, RTL-GDSII flow for rapid architecture and design space exploration, early prediction of QoR and detailed physical design implementation. However, ORFS also enables manual intervention for finer user control of individual flow stages through Tcl commands and Python APIs. ## Tool Installation There are multiple ways to install and develop OpenROAD and ORFS. However, the best option depends on your use case, experience level, and personal preference. > **Recommendation for new users:**
> \\\\ > If you are new to OpenROAD-flow-scripts, Docker can be a reliable way to get started since it avoids most dependency and environment issues. > On supported platforms, using the pre-built binaries can be an even simpler option as it avoids building from source. > Alternatively, the Bazel-based flow also avoids manual dependency installation (aside from installing Bazelisk itself), similar to how Docker requires installing Docker. ### Use Bazel, avoid installing anything at all and adapt the flow to your needs in your own repository [bazel-orfs](https://github.com/The-OpenROAD-Project/bazel-orfs) provides a seamless, reproducible way to manage dependencies and adapt the flow without requiring manual installations(no Docker images, sudo bash scripts, etc.) By leveraging [Bazel](https://bazel.build/)’s robust build system, all dependencies are automatically resolved, versioned, and built in a consistent environment. This eliminates setup complexity, ensures fast incremental builds, and allows for easy customization of the flow, making it an efficient choice for both [beginners](https://github.com/The-OpenROAD-Project/RegFileStudy) and [advanced](https://github.com/The-OpenROAD-Project/megaboom) users. ### Docker Based Installation To ease dependency installation issues, ORFS uses docker images. Docker image includes ORFS binaries, applications as well as all required dependencies. All of the flow tools are encapsulated inside the container image. If `Docker` is not installed already, install latest docker tool based on OS from [here](https://docs.docker.com/engine/install/). To manage docker as non-root user and verify that you can run `docker` commands without `sudo` must complete steps from [here](https://docs.docker.com/engine/install/linux-postinstall/). #### Build ORFS with Docker Document for detailed steps on docker based installation found [here](). ### Pre-built Binaries You can download, set up and run ORFS easily with pre-built binaries, including OpenROAD, Yosys and Klayout. See instructions [here](). > **Thanks** to [Precision Innovations](https://precisioninno.com/) for > providing and supporting OpenROAD based binaries. > **Note** Only the latest version of OpenROAD is guaranteed to work with > the latest version of ORFS. > **Disclaimer** The versions of OpenROAD, Yosys and Klayout provided by > other third-party vendors are not guaranteed to work with ORFS. ### Build from sources locally Document for detailed local build from sources and installation steps found [here](). ## Using the Flow - For details about the OpenROAD and the available features and individual flows commands, see the documentation [here](https://openroad.readthedocs.io/en/latest/). - For details about automated flow setup, see ORFS docs [here](https://openroad-flow-scripts.readthedocs.io/en/latest/index2.html#getting-started-with-openroad-flow-scripts). - Flow tutorial to run the complete OpenROAD based flow from RTL-GDSII, see the tutorial [here](https://openroad-flow-scripts.readthedocs.io/en/latest/tutorials/FlowTutorial.html). - To watch ORFS flow tutorial videos, check [here](https://theopenroadproject.org/video). ## Building from your own git repository ORFS supports hosting projects in your own git repository without the need to fork ORFS. To build from your own git repository: ```none cd /home/me/myproject make --file=~/OpenROAD-flow-scripts/flow/Makefile DESIGN_CONFIG=somefolder/config.mk ... ``` ## Running a quick smoke-test of ORFS on your own Verilog You can [run ORFS on your own Verilog files]() without setting up a project or moving your Verilog files and even learn a thing or two about floorplan, placement and routing before you create an .sdc file and a config.mk file. ## Citing this Work If you use this software in any published work, we would appreciate a citation! Please use the following references: ```default @article{ajayi2019openroad, title={OpenROAD: Toward a Self-Driving, Open-Source Digital Layout Implementation Tool Chain}, author={Ajayi, T and Blaauw, D and Chan, TB and Cheng, CK and Chhabria, VA and Choo, DK and Coltella, M and Dobre, S and Dreslinski, R and Foga{\c{c}}a, M and others}, journal={Proc. GOMACTECH}, pages={1105--1110}, year={2019} } ``` A copy of this paper is available [here](http://people.ece.umn.edu/users/sachin/conf/gomactech19.pdf) (PDF). ```default @inproceedings{ajayi2019toward, title={Toward an open-source digital flow: First learnings from the openroad project}, author={Ajayi, Tutu and Chhabria, Vidya A and Foga{\c{c}}a, Mateus and Hashemi, Soheil and Hosny, Abdelrahman and Kahng, Andrew B and Kim, Minsoo and Lee, Jeongsup and Mallappa, Uday and Neseem, Marina and others}, booktitle={Proceedings of the 56th Annual Design Automation Conference 2019}, pages={1--4}, year={2019} } ``` A copy of this paper is available [here](https://vlsicad.ucsd.edu/Publications/Conferences/371/c371.pdf) (PDF). If you like the tools, please give us a star on our GitHub repos! ## License The OpenROAD-flow-scripts repository (build and run scripts) has a BSD 3-Clause License. The flow relies on several tools, platforms and designs that each have their own licenses: - Find the tool license at: `OpenROAD-flow-scripts/tools/{tool}/` or `OpenROAD-flow-scripts/tools/OpenROAD/src/{tool}/`. - Find the platform license at: `OpenROAD-flow-scripts/flow/platforms/{platform}/`. - Find the design license at: `OpenROAD-flow-scripts/flow/designs/src/{design}/`.