Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make path to ORFS configurable #9

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Build sample stage targets
runs-on: ubuntu-22.04
container:
image: ghcr.io/antmicro/bazel-orfs@sha256:78b4c15830d75e026dc2294b280cb5ff1200f6ee7902a714dca71fd61b5b2e4e
image: ghcr.io/antmicro/bazel-orfs@sha256:555bd997a785b15a694687739a027b74ac4c3bdaee3bed1fb631ed48241c1b6f
defaults:
run:
shell: bash
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
name: Execute sample _make scripts
runs-on: ubuntu-22.04
container:
image: ghcr.io/antmicro/bazel-orfs@sha256:78b4c15830d75e026dc2294b280cb5ff1200f6ee7902a714dca71fd61b5b2e4e
image: ghcr.io/antmicro/bazel-orfs@sha256:555bd997a785b15a694687739a027b74ac4c3bdaee3bed1fb631ed48241c1b6f
defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update -y && \
mkdir -p $USER_HOME && \
cd $USER_HOME && \
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts && \
echo "export ORFS=$USER_HOME/OpenROAD-flow-scripts" > $USER_HOME/orfs_path.sh && \
cd $USER_HOME/OpenROAD-flow-scripts && \
git checkout $ORFS_REF && \
export SUDO_USER=$USERNAME && \
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ This repository contains [Bazel](https://bazel.build/) rules for wrapping Physic

## Requirements

* [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) - must reside under `~/OpenROAD-flow-scripts`. `bazel-orfs` intentionally does not treat OpenROAD-flow-scripts as a installable versioned tool, but prefers to rely on `~/OpenROAD-flow-scripts` such that it is easy to hack ORFS and OpenROAD.
* [OpenROAD-flow-scripts](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts) - fully autonomous, RTL-GDSII flow for rapid architecture and design space exploration, early prediction of QoR and detailed physical design implementation. Please refer to Local Build [instructions](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/docs/user/BuildLocally.md) for installing ORFS.
* `~/orfs_path.sh` - script that must export environment variable `ORFS` with path to `OpenROAD-flow-scripts`. `bazel-orfs` intentionally does not treat OpenROAD-flow-scripts as an installable versioned tool, but prefers to rely on `~/orfs_path.sh` script so that it is easy to hack ORFS and OpenROAD. **WARNING: OpenROAD-flow-scripts is not registered by this build system. Any change to OpenROAD, yosys or OpenROAD-flow-scripts WILL NOT invalidate previously built artifacts**.
* [Bazelisk](https://bazel.build/install/bazelisk) or [Bazel](https://bazel.build/install) - if using `bazel`, please refer to `.bazelversion` file for the recommended version of the tool.

## Usage

Core functionality is implemented as `build_openroad()` bazel macro in `openroad.bzl` file.
Assuming `OpenROAD-flow-scripts` is located in the home directory, the contents of `~/orfs_path.sh` should look like this:

```
export ORFS=~/OpenROAD-flow-scripts
```

The core functionality is implemented as `build_openroad()` bazel macro in `openroad.bzl` file.

In order to use `build_openroad()` macro in Bazel Workspace in other project it is required to pull `bazel-orfs` as external dependency through one of [Bazel Workspace Rules](https://bazel.build/reference/be/workspace). For example in project's WORKSPACE:

Expand Down
2 changes: 1 addition & 1 deletion orfs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ex
ORFS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export ORFS=~/OpenROAD-flow-scripts
source ~/orfs_path.sh
export FLOW_HOME=$ORFS/flow
export MAKEFILES=$FLOW_HOME/Makefile

Expand Down