Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Sep 5, 2024
2 parents a8a6e84 + e56eac0 commit 6bb0411
Show file tree
Hide file tree
Showing 28 changed files with 191 additions and 143 deletions.
22 changes: 0 additions & 22 deletions .github/actions/build_nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ inputs:
description: "The nix platform string to build for"
required: true
default: "x86_64-linux"
local_cache_key:
description: Key to use for the cache
required: false
default: ""
run_tests:
description: Whether to run unit tests and the smoke test
required: false
Expand All @@ -32,28 +28,17 @@ inputs:
runs:
using: "composite"
steps:
- id: cache
name: Cache Derivation
uses: actions/cache@v3
with:
key: ${{ inputs.local_cache_key }}-${{ inputs.nix_system }}
path: /tmp/${{ inputs.local_cache_key }}
- id: Build
name: Build
shell: ${{ inputs.shell }}
run: |
substituters='https://${{ inputs.cachix_cache }}.cachix.org https://cache.nixos.org'
if [ '${{ inputs.local_cache_key }}' = '' ]; then
substituters="file:///tmp/${{ inputs.local_cache_key }} $substituters"
fi
echo "#################################################################"
outPath=$(nix build\
--print-out-paths\
--no-link\
--accept-flake-config\
--option system ${{ inputs.nix_system }}\
--extra-platforms ${{ inputs.nix_system }}\
--option substituters "$substituters"\
.#devShells.${{ inputs.nix_system }}.default)
echo "out-path=$outPath" >> $GITHUB_OUTPUT
sudo du -hs /nix/store/* | sort -h | tail -n 20
Expand All @@ -78,13 +63,6 @@ runs:
--accept-flake-config\
.#devShells.${{ inputs.nix_system }}.dev --command\
pytest --step-rx '.' --pdk-root="${{ inputs.pdk_root }}" -n auto
- name: Push to local cache
shell: ${{ inputs.shell }}
if: inputs.local_cache_key != '' && steps.cache.outputs.cache-hit != 'true'
run: |
nix copy\
--to 'file:///tmp/${{ inputs.local_cache_key }}?compression=zstd&parallel-compression=true'\
${{ steps.build.outputs.out-path }}
- name: Install + Push to Cachix
shell: ${{ inputs.shell }}
if: ${{ inputs.cachix_token != '' }}
Expand Down
52 changes: 23 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,17 @@ jobs:
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install Nix
run: |
sh <(curl -L https://nixos.org/nix/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
extra-experimental-features = nix-command flakes
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
EXTRA_NIX_CONF
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
echo "PATH=$PATH" >> $GITHUB_ENV
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
access-tokens = github.com=${{ env.GITHUB_TOKEN }}
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
nix_system: x86_64-linux
local_cache_key: derivation-${{ github.run_id }}
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
run_tests: "true"
Expand All @@ -149,12 +145,17 @@ jobs:
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- uses: DeterminateSystems/nix-installer-action@main # Using the DS Nix installer because it also sets up binfmt
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
access-tokens = github.com=${{ env.GITHUB_TOKEN }}
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
nix_system: aarch64-linux
local_cache_key: derivation-${{ github.run_id }}
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
run_tests: "true"
Expand All @@ -178,17 +179,13 @@ jobs:
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install Nix
run: |
sh <(curl -L https://nixos.org/nix/install) --yes --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
extra-experimental-features = nix-command flakes
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
access-tokens = github.com=${{ env.GITHUB_TOKEN }}
EXTRA_NIX_CONF
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
echo "PATH=$PATH" >> $GITHUB_ENV
- uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
access-tokens = github.com=${{ env.GITHUB_TOKEN }}
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
- uses: DeterminateSystems/magic-nix-cache-action@main
# For some reason, GHA Macs are far more aggressively rate-limited with
# Volare than Linux
- name: Cache sky130 PDK
Expand All @@ -201,7 +198,6 @@ jobs:
uses: ./.github/actions/build_nix
with:
nix_system: ${{ matrix.system.nix }}
local_cache_key: derivation-${{ github.run_id }}
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
shell: "zsh {0}"
Expand Down Expand Up @@ -236,11 +232,11 @@ jobs:
fi
echo "NIX_SYSTEM=$nix_system" >> $GITHUB_ENV
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
nix_system: ${{ env.NIX_SYSTEM }}
local_cache_key: derivation-${{ github.run_id }}
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}

- name: Build Docker Image
Expand Down Expand Up @@ -304,14 +300,12 @@ jobs:
run: |
git status || true
tree .git || true
- uses: DeterminateSystems/nix-installer-action@main

- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
nix_system: x86_64-linux
local_cache_key: derivation-${{ github.run_id }}
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}

- name: Check Nix
Expand Down
32 changes: 32 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,38 @@
## Documentation
-->

# 2.1.3

## Tool Updates

* Bundled an downgraded OpenSTA bundled with OpenLane to work around critical
bug for hierarchical static timing analysis:
https://github.com/parallaxsw/OpenSTA/issues/82
* Version of OpenSTA linked against OpenROAD unchanged.

## Testing

* CI now uses DeterminateSystems Nix Installer for all Nix installations as well
as the Magic Nix Cache Action instead of the nonfunctional attempt at local
file-based substituters

## Documentation

* Installation documents now use the less-brittle Determinate Systems Nix
installer, as well as adding warnings about the `apt` version of Nix.

* Added an OpenROAD Flow Scripts-inspired Diagram to the Readme.

# 2.1.2

## Steps

* `OpenROAD.*`

* Fixed an issue where the validation for `PDN_MACRO_CONNECTIONS` would
partially match net names, unlike OpenROAD itself
* Internal string escaping consistency

# 2.1.1

## Steps
Expand Down
74 changes: 53 additions & 21 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,52 @@ started. You can discuss OpenLane 2 in the
channel of the
[Efabless Open Source Silicon Slack](https://invite.skywater.tools).

```python
from openlane.flows import Flow

Classic = Flow.factory.get("Classic")

flow = Classic(
{
"PDK": "sky130A",
"DESIGN_NAME": "spm",
"VERILOG_FILES": ["./src/spm.v"],
"CLOCK_PORT": "clk",
"CLOCK_PERIOD": 10,
},
design_dir=".",
)

flow.start()
```mermaid
timeline
title The OpenLane Infrastructure
RTL to Netlist
: Linting / Verilator
: Power Distribution Network Hierarchy / Yosys
: Synthesis / Yosys
: Synthesis / Design Compiler (with proprietary plugin)
: Multi-corner Netlist STA / OpenSTA
Floorplanning
: Floorplan Initialization / OpenROAD
: Manual Macro Placement / OpenDB
: Tap/Endcap Insertion / OpenROAD
: PDN Generation / OpenROAD
Placement
: Pin Placement (from config file) / OpenROAD, OpenDB
: Pin Placement (Random/Matching/Annealing) / OpenROAD
: Pin Placement (from template DEF) / OpenDB
: Global Placement / OpenROAD
: Resizer Design Repair (Post-GPL) / OpenROAD
: Detailed Placement / OpenROAD
Clock Tree Synthesis
: Clock-Tree Synthesis / OpenROAD
: Resizer Timing Repair (Post-CTS) / OpenROAD
Routing
: Global Routing / OpenROAD
: Resizer Design Repair (Post-GRT) / OpenROAD
: Diode Insertion on Ports / OpenDB
: Heuristic Diode Insertion / OpenDB
: Antenna Repair / OpenROAD
: Resizer Timing Repair (Post-GRT) / OpenROAD
: Detailed Routing / OpenROAD
: Row Filling / OpenROAD
Signoff (Timing)
: Parasitics Extraction / OpenROAD
: Multi-corner Static Timing Analysis / OpenSTA
: SI-Enabled Multi-corner Static Timing Analysis / PrimeTime (with proprietary plugin)
Signoff (Physical)
: GDSII Stream-Out / Magic
: GDSII Stream-Out / KLayout
: Magic vs. KLayout Stream XOR / KLayout
: Design Rule Checks / Magic
: Design Rule Checks / KLayout
: Spice Extraction / Magic
: Layout vs. Schematic / Netgen
: Equivalence Check (Alpha) / Yosys EQY
```

## Try it out
Expand Down Expand Up @@ -83,15 +112,18 @@ in the docs for more info.
Do note you'll need to add `--dockerized` right after `openlane` in most CLI
invocations.

### Python-only Installation (Advanced)
### Python-only Installation (Advanced, Not Recommended)

You'll need to bring your own compiled utilities, but otherwise, simply install
OpenLane as follows:
**You'll need to bring your own compiled utilities**, but otherwise, simply
install OpenLane as follows:

```sh
python3 -m pip install --upgrade openlane
```

Python-only installations are presently unsupported and entirely at your own
risk.

## Usage

In the root folder of the repository, you may invoke:
Expand Down Expand Up @@ -127,7 +159,7 @@ If you use OpenLane in your research, please cite the following paper.
doi={}}
```

## License
## License and Information

[The Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt).

Expand Down
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
libparse,
magic-vlsi,
netgen,
opensta,
opensta-stable,
openroad,
ruby,
surelog,
Expand Down Expand Up @@ -77,7 +77,7 @@
yosys-f4pga-sdc
]
++ lib.optionals (system == "x86_64-linux") [yosys-ghdl]))
opensta
opensta-stable
openroad
klayout
netgen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ If you're looking to build a virtual machine, we recommend [Ubuntu 22.04](https:

## Installing Nix

```{warning}
Do **not** install Nix using `apt`. The version of Nix offered by `apt` is more
often than not severely out-of-date and may cause issues.
```

You will need `curl` to install Nix.

To install curl on Ubuntu, simply type in the following in your terminal:
Expand All @@ -25,11 +30,10 @@ $ sudo apt-get install -y curl
After that, simply run this command:

```console
$ sh <(curl -L https://nixos.org/nix/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
extra-experimental-features = nix-command flakes
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
EXTRA_NIX_CONF
$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf "
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
"
```

Enter your password if prompted. This should take around 5 minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
Simply run this (entire) command in `Terminal.app`:

```console
$ sh <(curl -L https://nixos.org/nix/install) --yes --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
extra-experimental-features = nix-command flakes
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
EXTRA_NIX_CONF
$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf "
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
"
```

Enter your password if prompted. This should take around 5 minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Windows 10 is up-to-date.

## Installing Nix

```{warning}
Do **not** install Nix using `apt`. The version of Nix offered by `apt` is more
often than not severely out-of-date and may cause issues.
```

To install Nix, you first need to install `curl`:

```console
Expand All @@ -54,11 +59,10 @@ $ sudo apt-get install -y curl
Then install Nix by running the following command:

```console
$ sh <(curl -L https://nixos.org/nix/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
extra-experimental-features = nix-command flakes
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
EXTRA_NIX_CONF
$ curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf "
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
"
```

Enter your password if prompted. This should take around 5 minutes.
Expand Down
Loading

0 comments on commit 6bb0411

Please sign in to comment.