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

misc: add openlane #246

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -719,3 +719,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./ci

#64
openlane-linux:
needs: ["magic-linux", "netgen-linux", "openroad-linux", "yosys-linux-py37", "yosys-linux-py38"]
runs-on: "ubuntu-20.04"
env:
PACKAGE: "misc/openlane"
OS_NAME: "linux"
steps:
- uses: actions/checkout@v3
- uses: ./ci
29 changes: 29 additions & 0 deletions misc/openlane/1439.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From e57dc500ef22047e2d57c1c4bcae83260f6d3672 Mon Sep 17 00:00:00 2001
From: Johan Euphrosine <proppy@google.com>
Date: Tue, 18 Oct 2022 22:29:37 +0900
Subject: [PATCH] flow: skip mounted version for local install

Signed-off-by: Johan Euphrosine <proppy@google.com>
---
flow.tcl | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/flow.tcl b/flow.tcl
index 2ec16863a..6a9eec912 100755
--- a/flow.tcl
+++ b/flow.tcl
@@ -386,9 +386,11 @@ if {[catch {exec cat $::env(OPENLANE_ROOT)/install/installed_version} ::env(OPEN
}
}

-if {![catch {exec git --git-dir $::env(OPENLANE_ROOT)/.git rev-parse HEAD} ::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)]} {
- if { $::env(OPENLANE_VERSION) == $::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)} {
- unset ::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)
+if { ! [info exists ::env(OPENLANE_LOCAL_INSTALL)] || ! $::env(OPENLANE_LOCAL_INSTALL)} {
+ if {![catch {exec git --git-dir $::env(OPENLANE_ROOT)/.git rev-parse HEAD} ::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)]} {
+ if { $::env(OPENLANE_VERSION) == $::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)} {
+ unset ::env(OPENLANE_MOUNTED_SCRIPTS_VERSION)
+ }
}
}

46 changes: 46 additions & 0 deletions misc/openlane/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -ex

# Identify OS
UNAME_OUT="$(uname -s)"
case "${UNAME_OUT}" in
Linux*) OS=Linux;;
*) OS="${UNAME_OUT}"
echo "Unknown OS: ${OS}"
exit;;
esac

mkdir -p $PREFIX/share/openlane
git archive HEAD | tar -xv -C $PREFIX/share/openlane
# define system and pdk variables
mkdir -p $PREFIX/share/openlane/install
echo $PKG_VERSION-conda > $PREFIX/share/openlane/install/installed_version
cp -a $RECIPE_DIR/env.tcl $PREFIX/share/openlane/install/
mkdir -p $PREFIX/share/openlane/install/build/versions
touch $PREFIX/share/openlane/install/build/versions/keep-directory
# override default configuration to disable missing tools
cp -a $RECIPE_DIR/disable-missing-tools.tcl $PREFIX/share/openlane/configuration/disable-missing-tools.tcl
echo -n ' disable-missing-tools.tcl' >> $PREFIX/share/openlane/configuration/load_order.txt
# add flow.tcl shortcut
mkdir -p $PREFIX/bin
cat > $PREFIX/bin/flow.tcl <<EOF
#!/usr/bin/env tclsh
lappend argv "-ignore_mismatches"
source "$::env(CONDA_PREFIX)/share/openlane/flow.tcl"
EOF
chmod +x $PREFIX/bin/flow.tcl
21 changes: 21 additions & 0 deletions misc/openlane/disable-missing-tools.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://github.com/hdl/conda-eda/issues/174
set ::env(RUN_CVC) 0
# https://github.com/The-OpenROAD-Project/OpenLane/issues/1380
set ::env(RUN_LVS) 0
# https://github.com/hdl/conda-eda/issues/175
set ::env(RUN_KLAYOUT) 0
set ::env(RUN_KLAYOUT_XOR) 0
22 changes: 22 additions & 0 deletions misc/openlane/env.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# define system variables
set ::env(OPENLANE_ROOT) "$::env(CONDA_PREFIX)/share/openlane"
set ::env(OL_INSTALL_DIR) "$::env(CONDA_PREFIX)/share/openlane/install"
set ::env(OPENLANE_LOCAL_INSTALL) 1
set ::env(TCLLIBPATH) [glob -type d "$::env(CONDA_PREFIX)/lib/tcllib*"]
lappend ::auto_path $::env(TCLLIBPATH)
# default to conda-install PDKs
set ::env(PDK_ROOT) "$::env(CONDA_PREFIX)/share/pdk"
53 changes: 53 additions & 0 deletions misc/openlane/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Use `conda-build-prepare` before building for a better version string.
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG, GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}

package:
name: openlane
version: {{ version }}

source:
git_url: https://github.com/The-OpenROAD-Project/OpenLane
git_rev: master
patches:
- 1439.patch

build:
# number: 201803050325
number: {{ environ.get('DATE_NUM') }}
# string: 20180305_0325
string: {{ environ.get('DATE_STR') }}
script_env:
- CI
- CONDA_OUT
- TEST_PACKAGE

requirements:
run:
- openroad
- magic
- netgen
- yosys
- click
- pyyaml
- tcllib

test:
requires:
- open_pdks.sky130a
commands:
- PDK=sky130A STD_CELL_LIBRARY=sky130_fd_sc_hd STD_CELL_LIBRARY_OPT=sky130_fd_sc_hd flow.tcl -design inverter

about:
home: https://github.com/The-OpenROAD-Project/OpenLane
license: Apache-2.0
license_family: Apache
license_file: LICENSE
summary: 'OpenLane is an automated RTL to GDSII flow.'
description: |
OpenLane is an automated RTL to GDSII flow based on several
components including OpenROAD, Yosys, Magic, Netgen, CVC,
SPEF-Extractor, KLayout and a number of custom scripts for design
exploration and optimization. It also provides a number of custom
scripts for design exploration, optimization and ECO.
doc_url: https://openlane.readthedocs.io/
dev_url: https://github.com/The-OpenROAD-Project/OpenLane