Skip to content

Commit

Permalink
Integrate Volare for PDK Building and Mangement (#1048)
Browse files Browse the repository at this point in the history
* Initial work on integrating volare

* CI

* More CI fixes

* Update opdks

* Switch to Efabless open_pdks fork, update
  • Loading branch information
donn authored Apr 15, 2022
1 parent 6fb8992 commit 54ec01a
Show file tree
Hide file tree
Showing 15 changed files with 4,211 additions and 153 deletions.
5 changes: 4 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ exclude =
__pycache__,
scripts/klayout,
docker/tar,
install/
install/,
venv/,
pdks/,
dependencies/flatyaml.py
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ A clear and concise description of what the bug is.

### Environment
```
Please run the following command in the OpenLane folder:
Please run the following set of commands in the OpenLane folder:
python3 ./env.py issue-survey
make survey || python3 ./env.py issue-survey
And copy and paste the ENTIRE output between the triple-backticks. Please do not gzip and upload the output.
If there's no env.py, you are using an out of date version of OpenLane and should probably update.
If neither command succeeds, you are using an out of date version of OpenLane and should probably update.
```

### Reproduction Material
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/openlane_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ jobs:
fi
cd docker/ && make merge
- name: Build (or Get) PDK
run: |
sudo mkdir -p ${{ env.PDK_ROOT }}
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
python3 -m pip install --upgrade --no-cache-dir volare
export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)"
if [ "${{ secrets.VOLARE_REPO }}" != "" ]; then
volare enable_or_build\
--also-push\
--token ${{ secrets.MY_TOKEN }}\
--owner ${{ secrets.VOLARE_OWNER }}\
--repository ${{ secrets.VOLARE_REPO }}\
-j$(nproc)\
$OPDKS_VER
else
volare enable_or_build\
--token ${{ secrets.MY_TOKEN }}\
-j$(nproc)\
$OPDKS_VER
fi
- name: Export Docker Image
run: docker save -o /tmp/image.tar ${{ env.OPENLANE_IMAGE_NAME }}

Expand All @@ -68,12 +89,6 @@ jobs:
name: docker-image
path: /tmp/image.tar

- name: Build PDK
run: |
sudo mkdir -p ${{ env.PDK_ROOT }}
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
make -j 1 NPROC=1 pdk
- name: Tarball PDK
run: |
tar -cf /tmp/sky130A.tar -C $PDK_ROOT/sky130A .
Expand Down
38 changes: 23 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PDK_OPTS =
EXTERNAL_PDK_INSTALLATION ?= 1
ifeq ($(EXTERNAL_PDK_INSTALLATION), 1)
export PDK_ROOT ?= ./pdks
export PDK_ROOT := $(shell python3 -c "import os; print(os.path.realpath('$(PDK_ROOT)'), end='')")
export PDK_ROOT := $(shell $(PYTHON_BIN) -c "import os; print(os.path.realpath('$(PDK_ROOT)'), end='')")
PDK_OPTS = -v $(PDK_ROOT):$(PDK_ROOT) -e PDK_ROOT=$(PDK_ROOT)
endif

Expand All @@ -86,21 +86,29 @@ ENV_COMMAND = $(ENV_START) $(OPENLANE_IMAGE_NAME)
.DEFAULT_GOAL := all

.PHONY: all
all: openlane
all: get-openlane pdk

.PHONY: openlane
openlane:
$(MAKE) -C docker openlane

pull-openlane:
@echo "Pulling most recent OpenLane image relative to your commit..."
@echo "Pulling OpenLane image matching your commit..."
docker pull $(OPENLANE_IMAGE_NAME)

get-openlane:
@docker pull $(OPENLANE_IMAGE_NAME) || $(MAKE) -C docker openlane

.PHONY: mount
mount:
cd $(OPENLANE_DIR) && \
$(ENV_START) -ti $(OPENLANE_IMAGE_NAME)

venv/created:
$(PYTHON_BIN) -m venv ./venv
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir -r ./requirements.txt
touch $@

DLTAG=custom_design_List
.PHONY: test_design_list fastest_test_set extended_test_set
fastest_test_set: DESIGN_LIST=$(shell cat ./.github/test_sets/fastest_test_set)
Expand Down Expand Up @@ -143,24 +151,24 @@ quick_run:
cd $(OPENLANE_DIR) && \
$(ENV_COMMAND) sh -c "./flow.tcl -design $(QUICK_RUN_DESIGN)"

.PHONY: deps
deps:
python3 -m pip install -r ./requirements.txt
.PHONY: pdk
pdk: venv/created
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir volare
./venv/bin/volare enable

.PHONY: venv
venv:
python3 -m venv ./venv
./venv/bin/python3 -m pip install -r ./requirements.txt
.PHONY: survey
survey:
$(PYTHON_BIN) ./env.py issue-survey

# PDK build commands
include ./dependencies/pdk.mk

.PHONY: clean_all clean_runs clean_results
clean_all: clean_runs clean_results
.PHONY: clean_all clean_runs clean_results clean_venv
clean_all: clean_runs clean_results clean_venv

clean_runs:
@rm -rf ./designs/*/runs && rm -rf ./_build/it_tc_logs && echo "Runs cleaned successfully." || echo "Failed to delete runs."
@rm -rf ./tests/*/runs && echo "Test runs cleaned successfully." || echo "Failed to delete test runs."

clean_results:
@{ find regression_results -mindepth 1 -maxdepth 1 -type d | grep -v benchmark | xargs rm -rf ; } && echo "Results cleaned successfully." || echo "Failed to delete results."

clean_venv:
@rm -rf ./venv
87 changes: 41 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OpenLane
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Documentation Status](https://readthedocs.org/projects/openlane/badge/?version=latest)](https://openlane.readthedocs.io/) [![CI](https://github.com/The-OpenROAD-Project/OpenLane/workflows/CI/badge.svg?branch=master)](#) [![Slack Invite](https://img.shields.io/badge/Community-Skywater%20PDK%20Slack-ff69b4?logo=slack)](https://invite.skywater.tools) [![Python code style: black](https://img.shields.io/badge/python%20code%20style-black-000000.svg)](https://github.com/psf/black)

OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, Fault, CVC, SPEF-Extractor, CU-GR, Klayout and a number of custom scripts for design exploration and optimization. The flow performs full ASIC implementation steps from RTL all the way down to GDSII.
OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, CVC, SPEF-Extractor, CU-GR, Klayout and a number of custom scripts for design exploration and optimization. The flow performs full ASIC implementation steps from RTL all the way down to GDSII.

You can find the latest release of OpenLane [here](https://github.com/The-OpenROAD-Project/OpenLane/releases).

Expand Down Expand Up @@ -34,58 +34,37 @@ This documentation is also available at [ReadTheDocs](https://openlane.readthedo
At a minimum:

- GNU Make
- Python 3.6 with PIP
- Click 7.0+, Pyyaml: `python3 -m pip install pyyaml click>=7`

To build the Sky130 PDK you also need:
- Python 3.6+ with pip and virtualenv
- Git 2.35+

## Using the Docker Image
- Docker 19.03.12+

## On Ubuntu, that's...
`apt install -y build-essential python3 python3-venv python3-pip`

* [Docker Installation Instructions](https://docs.docker.com/engine/install/ubuntu/)

## On macOS, that's...
Get [Homebrew](https://brew.sh/), then:

`brew install python make`
`brew install --cask docker`

## Containerless/Local Installations
Please see [here](./docs/source/local_installs.md).

# Setting Up OpenLane
You can start setting up the Sky130 PDK and OpenLane by running:
You can set up the Sky130 PDK and OpenLane by running:

```bash
git clone https://github.com/The-OpenROAD-Project/OpenLane.git
cd OpenLane/
make pull-openlane
```

---

```bash
<configuration variables: see notes below>
make pdk
```
* The default pdk installation directory is $PWD/pdks. If you want to install the PDK at a different location, you'll need add this configuration variable:
* `export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>`
* Be sure to add this to your shell's profile for future use.
* If you want to include the precompiled OpenRAM SRAM modules, try `make pdk-with-sram`.
* The default SCL to be installed is `sky130_fd_sc_hd`.
* To change that, you can add this configuration variable: `export STD_CELL_LIBRARY=<Library name, i.e. sky130_fd_sc_ls>`, where the library name is one of:
- sky130_fd_sc_hd
- sky130_fd_sc_hs
- sky130_fd_sc_ms
- sky130_fd_sc_ls
- sky130_fd_sc_hdll
* You can install all Sky130 SCLs by invoking `FULL_PDK=1 make pdk`.
* You can install the PDK manually, outside of the Makefile, by following the instructions provided [here][30].
* Refer to [this][24] for more details on OpenLane-compatible PDK structures.

---

```bash
make
make test # This a ~5 minute test that verifies that the flow and the pdk were properly installed
```

- The Makefile should do the following when you run the above:
- Clone Skywater PDK and the specified STD_CELL_LIBRARY, SPECIAL_VOLTAGE_LIBRARY, and IO_LIBRARY and build it.
- Clone open_pdks and set up the pdk for OpenLane use.
- Pull the OpenLane Docker image.
- Pulls the OpenLane Docker image.
- Pulls and updates the PDK
- Test the whole setup with a complete run on a small design, `spm`.

This should produce a clean run for the spm. The final layout will be generated at this path: `./designs/spm/runs/openlane_test/results/magic/spm.gds`.
Expand All @@ -94,26 +73,42 @@ If everything is okay, you can skip forward to [running OpenLane](#running-openl

## Updating OpenLane

If you already have the repo locally, then no need to re-clone it. You can directly run the following:
If you already have the repo locally, then there is no need to re-clone it. You can run the following:

```bash
cd openlane/
cd OpenLane/
git checkout master
git pull
export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>
make pull-openlane
make pdk
make test # This is to test that the flow and the pdk were properly installed
make
make test # This is to test that the flow and the pdk were properly updated
```

This should install the latest openlane docker container, and re-install the pdk for the latest used version.

## Pulling or Building the OpenLane Docker Container

**DISCLAIMER: This sub-section is to give you an understanding of what happens under the hood in the Makefile. You don't need to run the instructions here, if you already ran `make pull-openlane`.**

For curious users: For more details about the docker container and its process, the [following instructions][1] walk you through the process of using docker containers to build the needed tools then integrate them into OpenLane flow. **You Don't Need To Re-Build It.**

## Building the PDK Manually
You don't have to build the PDK yourself anymore. But, if you insist, or require SCLs that are not installed by default, you can try the follow

```bash
<configuration variables: see notes below>
make build-pdk-conda
```
* The default pdk installation directory is $PWD/pdks. If you want to install the PDK at a different location, you'll need add this configuration variable:
* `export PDK_ROOT=<absolute path to where skywater-pdk and open_pdks will reside>`
* Be sure to add this to your shell's profile for future use.
* The default SCL to be installed is `sky130_fd_sc_hd`.
* To change that, you can add this configuration variable: `export STD_CELL_LIBRARY=<Library name, i.e. sky130_fd_sc_ls>`, where the library name is one of:
- sky130_fd_sc_hd
- sky130_fd_sc_hs
- sky130_fd_sc_ms
- sky130_fd_sc_ls
- sky130_fd_sc_hdll
* You can install all Sky130 SCLs by invoking `FULL_PDK=1 make build-pdk-conda`.
* You can install the PDK manually, outside of the Makefile, by following the instructions provided [here][30].
* Refer to [this][24] for more details on OpenLane-compatible PDK structures.

# Running OpenLane
You need to start the Docker container with proper paths mounted. There are two ways to do this.
Expand Down
Loading

0 comments on commit 54ec01a

Please sign in to comment.