From b819c30a01aa40da2a7737007e284e55ce5b037d Mon Sep 17 00:00:00 2001 From: ota2 Date: Thu, 24 Mar 2022 01:35:18 -0400 Subject: [PATCH 01/11] Generate hspice models --- scripts/configure | 31 +++++-- scripts/tools.txt | 1 + sky130/Makefile.in | 19 ++++ sky130/custom/scripts/convert_hspice.py | 112 ++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 5 deletions(-) create mode 100755 sky130/custom/scripts/convert_hspice.py diff --git a/scripts/configure b/scripts/configure index 29224d0d..8ef7c750 100755 --- a/scripts/configure +++ b/scripts/configure @@ -598,6 +598,7 @@ XSCHEM_SKY130_PATH SKY130_ML_XX_HD_PATH PATCH MAGIC +HSPICE_DISABLED XSCHEM_DISABLED QFLOW_DISABLED OPENLANE_DISABLED @@ -670,6 +671,7 @@ enable_irsim enable_openlane enable_qflow enable_xschem +enable_hspice enable_alpha_sky130 enable_xschem_sky130 enable_sram_sky130 @@ -1323,6 +1325,10 @@ Optional Features: Enable or disable xschem setup [default=enabled] + --enable-hspice + Enable or disable hspice setup [default=enabled] + + --enable-alpha-sky130[=path] Install sky130_ml_xx_hd. If path is omitted, the repository will be downloaded. [default=enabled] @@ -1834,7 +1840,7 @@ if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else - for am_cv_pathless_PYTHON in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do + for am_cv_pathless_PYTHON in python python2 python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros @@ -2295,8 +2301,8 @@ ALL_TECHS="sky130" # Set variables for tool setups -{ $as_echo "$as_me:${as_lineno-$LINENO}: Found tools: klayout magic netgen irsim openlane qflow xschem" >&5 -$as_echo "$as_me: Found tools: klayout magic netgen irsim openlane qflow xschem" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Found tools: klayout magic netgen irsim openlane qflow xschem hspice" >&5 +$as_echo "$as_me: Found tools: klayout magic netgen irsim openlane qflow xschem hspice" >&6;} @@ -2407,6 +2413,21 @@ fi + HSPICE_DISABLED=0 + # Check whether --enable-hspice was given. +if test "${enable_hspice+set}" = set; then : + enableval=$enable_hspice; + if test "$enableval" == "no" -o "$enableval" == "NO"; then + HSPICE_DISABLED=1 + fi + + +fi + + + + + # Magic # Extract the first word of "magic", so it can be a program name with args. set dummy magic; ac_word=$2 @@ -2753,8 +2774,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: Tools enabled for PDK setup installation: klayout magic netgen irsim openlane qflow xschem" >&5 -$as_echo "$as_me: Tools enabled for PDK setup installation: klayout magic netgen irsim openlane qflow xschem" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Tools enabled for PDK setup installation: klayout magic netgen irsim openlane qflow xschem hspice" >&5 +$as_echo "$as_me: Tools enabled for PDK setup installation: klayout magic netgen irsim openlane qflow xschem hspice" >&6;} # Check for "--with-ef-style" EF_STYLE=0 diff --git a/scripts/tools.txt b/scripts/tools.txt index 648b3dc2..e0e25139 100644 --- a/scripts/tools.txt +++ b/scripts/tools.txt @@ -5,3 +5,4 @@ irsim openlane qflow xschem +hspice diff --git a/sky130/Makefile.in b/sky130/Makefile.in index 07ca4c45..450a05de 100644 --- a/sky130/Makefile.in +++ b/sky130/Makefile.in @@ -521,6 +521,9 @@ ifneq (${XCIRCUIT_DISABLED}, 1) TOOLS += xcircuit endif + +HSPICE_DISABLED=@HSPICE_DISABLED@ + # These definitions depend on the setting of EF_STYLE ifeq (${EF_STYLE}, 1) IO_VERILOG = verilog/sky130_fd_io @@ -1169,6 +1172,22 @@ primitive-%: # Custom: Add "spinit" file cat ./custom/models/spinit >> \ ${STAGING_PATH}/${SKY130$*}/libs.tech/ngspice/spinit + +ifneq (${HSPICE_DISABLED}, 1) + make hspice-build-$*; +endif + +hspice-build-%: + # Convert sky130$* ngspice models files to hspice format + ${STAGE} -source ${STAGING_PATH}/${SKY130$*} -target ${STAGING_PATH}/${SKY130$*} \ + -hspice libs.tech/ngspice/* \ + filter=custom/scripts/convert_hspice.py \ + 2>&1 | tee -a ${SKY130$*}_make.log + # Copy libs.ref spice to hspice + ${STAGE} -source ${STAGING_PATH}/${SKY130$*}/libs.ref -target ${STAGING_PATH}/${SKY130$*} \ + -hspice/spi ${PR_SPICE}/* \ + filter=custom/scripts/convert_hspice.py \ + 2>&1 | tee -a ${SKY130$*}_make.log io-%: # Install custom additions to I/O pad library diff --git a/sky130/custom/scripts/convert_hspice.py b/sky130/custom/scripts/convert_hspice.py new file mode 100755 index 00000000..da43d7ae --- /dev/null +++ b/sky130/custom/scripts/convert_hspice.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# +# -------------------------------------------------------------------- +# Convert ngspice models to hspice format +# -------------------------------------------------------------------- + +import argparse +import os +import re +import sys + +NUMERIC_REGEX = r'0-9\.e\-\+' +NUMERIC_ONLY_REGEX = re.compile(f'^[{NUMERIC_REGEX}]+[munpfa]?$', re.MULTILINE) + +REGEX_EXPRESSION = r'a-zA-Z,\_\*\+\-\/\(\)\.0-9\?><:' +PARAMS_PATTERN = re.compile(rf'(\S+)\s+=\s+\{{"?([{REGEX_EXPRESSION}]+)"?\}}') +PARAMS_NO_BRACE_PATTERN = re.compile(rf'(\S+)\s+=\s+"?([{REGEX_EXPRESSION}]+)"?') +PARAMS_REPLACE = r"\1 = '\2'" + +MULTILINE_PARAMS = re.compile(rf'(\S+)\s+=\s+\{{"?([\s{REGEX_EXPRESSION}]+)"?\}}', + re.MULTILINE) + +SEMICOLON_PATTERN = re.compile(r"(.+);(.+)") +SEMICOLON_REPLACE = r"*\2\n\1" + + +def quote_params_with_braces(content, *args, **kwargs): + """Add quotes to param definitions which are enclosed between curly braces""" + if "{" not in content: + return content + return PARAMS_PATTERN.sub(PARAMS_REPLACE, content) + + +def quote_non_numeric_params(content, *args, **kwargs): + """Add quotes around parameter definitions which aren't just numbers""" + res = [] + for line in content.split("\n"): + for param_name, param_value in PARAMS_NO_BRACE_PATTERN.findall(line): + if not NUMERIC_ONLY_REGEX.match(param_value.strip()): + line = line.replace(param_value, f"'{param_value}'") + res.append(line) + return "\n".join(res) + + +def quote_multiline_params(content, *args, **kwargs): + """Add quotes to param definitions spanning multiple lines""" + return MULTILINE_PARAMS.sub(PARAMS_REPLACE, content) + + +def remove_semicolons(content, *args, **kwargs): + """Replace comments delineated with ; by * and new line""" + return SEMICOLON_PATTERN.sub(SEMICOLON_REPLACE, content) + + +def replace_libs_tech(content, *args, **kwargs): + """Replace references to libs.tech to newly copied hspice""" + source_path = "../../libs.tech/ngspice" + dest_path = "" + if source_path in content: + content = content.replace(source_path, dest_path) + return content + + +def replace_spi_path(content, *args, **kwargs): + """Replace references to libs.ref to newly copied spi directory""" + if options.ef_format: + lib_path = 'spi/sky130_fd_pr/' + else: + lib_path = 'sky130_fd_pr/spice/' + source_path = f'../../libs.ref/{lib_path}' + dest_path = 'spi/' + content = content.replace(source_path, dest_path) + return content + + +def generic_filter(input_file_name, output_file_name, filters=None): + filters = filters or [] + with open(input_file_name, "r") as in_file: + content = in_file.read() + with open(output_file_name, "w") as out_file: + _, extension = os.path.splitext(input_file_name) + if extension == ".spice": + for filter_func in filters: + content = filter_func(content, input_file_name=input_file_name, output_file_name=output_file_name) + out_file.write(content) + + +def hspice_filter(input_file_name, out_file_name, _): + filters = [quote_params_with_braces, quote_non_numeric_params, + quote_multiline_params, remove_semicolons] + if "hspice/spi" in input_file_name: + filters.append(replace_libs_tech) + else: + filters.append(replace_spi_path) + generic_filter(input_file_name, out_file_name, filters=filters) + return 0 + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument("-ef_format", action="store_true") + options, other_args = parser.parse_known_args() + if not len(other_args) > 1: + print('Usage: convert_hspice.py [] [-ef_format]') + sys.exit(1) + else: + input_file_name_ = output_file_name_ = other_args[0] + if len(other_args) > 1: + output_file_name_ = other_args[1] + + result = hspice_filter(input_file_name_, output_file_name_, options.ef_format) + sys.exit(result) From b6f7b5a0956f8055fa63bad974f81853888890be Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 12:27:43 -0400 Subject: [PATCH 02/11] Only build hspice files --- .github/Makefile | 23 ++--------------------- .github/build.sh | 22 ---------------------- .github/capture.sh | 10 +++++----- .github/test.sh | 38 -------------------------------------- .github/workflows/ci.yml | 14 ++++---------- 5 files changed, 11 insertions(+), 96 deletions(-) delete mode 100755 .github/test.sh diff --git a/.github/Makefile b/.github/Makefile index fcb0bc1c..feee7735 100644 --- a/.github/Makefile +++ b/.github/Makefile @@ -16,7 +16,6 @@ OPEN_PDKS_ROOT ?= $(shell pwd)/.. THREADS ?= $(shell nproc) -STD_CELL_LIBRARY ?= sky130_fd_sc_hd SKYWATER_COMMIT ?= b5ff6174d9aa921f670f12a2893969fe4a516f6c .DEFAULT_GOAL := all @@ -25,7 +24,7 @@ SKYWATER_COMMIT ?= b5ff6174d9aa921f670f12a2893969fe4a516f6c all: pdk .PHONY: pdk -pdk: skywater-pdk skywater-library build-pdk +pdk: skywater-pdk build-pdk $(PDK_ROOT)/skywater-pdk: git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk @@ -35,23 +34,6 @@ skywater-pdk: $(PDK_ROOT)/skywater-pdk cd $(PDK_ROOT)/skywater-pdk && \ git checkout -qf $(SKYWATER_COMMIT) -.PHONY: skywater-library -skywater-library: $(PDK_ROOT)/skywater-pdk - cd $(PDK_ROOT)/skywater-pdk && \ - git submodule update --init libraries/$(STD_CELL_LIBRARY)/latest && \ - $(MAKE) -j$(THREADS) $(STD_CELL_LIBRARY) - -.PHONY: all-skywater-libraries -all-skywater-libraries: skywater-pdk - cd $(PDK_ROOT)/skywater-pdk && \ - git submodule update --init libraries/sky130_fd_sc_hd/latest && \ - git submodule update --init libraries/sky130_fd_sc_hs/latest && \ - git submodule update --init libraries/sky130_fd_sc_hdll/latest && \ - git submodule update --init libraries/sky130_fd_sc_ms/latest && \ - git submodule update --init libraries/sky130_fd_sc_ls/latest && \ - git submodule update --init libraries/sky130_fd_sc_hvl/latest && \ - $(MAKE) -j$(THREADS) timing - .PHONY: build-pdk build-pdk: $(PDK_ROOT)/skywater-pdk [[ -d $(PDK_ROOT)/sky130A ]] && \ @@ -67,5 +49,4 @@ build-pdk: $(PDK_ROOT)/skywater-pdk && \ cd sky130 && \ $(MAKE) veryclean && \ - $(MAKE) && \ - $(MAKE) install-local + $(MAKE) primitive-A \ No newline at end of file diff --git a/.github/build.sh b/.github/build.sh index 8f08cb3f..bd567313 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -29,28 +29,6 @@ echo ::group::make skywater-pdk make skywater-pdk echo ::endgroup:: -if [ x"$STD_CELL_LIBRARY" = xall ]; then - cnt=0 - until make all-skywater-libraries; do - cnt=$((cnt+1)) - if [ $cnt -eq 5 ]; then - exit 2 - fi - rm -rf $PDK_ROOT/skywater-pdk - make skywater-pdk - done -else - cnt=0 - until make skywater-library; do - cnt=$((cnt+1)) - if [ $cnt -eq 5 ]; then - exit 2 - fi - rm -rf $PDK_ROOT/skywater-pdk - make skywater-pdk - done -fi - cd .. docker run \ diff --git a/.github/capture.sh b/.github/capture.sh index 559b2fcb..83fc2034 100644 --- a/.github/capture.sh +++ b/.github/capture.sh @@ -29,15 +29,15 @@ cp .github/magic.tar.gz ${GITHUB_WORKSPACE}/output/ # Try to create a deterministic tar file # https://reproducible-builds.org/docs/archives/ ( - SKY130_DIR="$(pwd)/pdks/pdk/sky130A" - if ! [[ -d $SKY130_DIR ]]; then - echo "Missing $SKY130_DIR" + HSPICE_DIR="$(pwd)/pdks/pdk/sky130A/libs.tech/hspice" + if ! [[ -d $HSPICE_DIR ]]; then + echo "Missing $HSPICE_DIR" exit -1 fi echo ::group::PDK tarball - cd ${SKY130_DIR} + cd ${HSPICE_DIR} tar \ --create \ --bzip2 \ @@ -50,7 +50,7 @@ cp .github/magic.tar.gz ${GITHUB_WORKSPACE}/output/ --numeric-owner \ --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ \ - --file ${GITHUB_WORKSPACE}/output/pdk-SKY130A-${STD_CELL_LIBRARY}.tar.bz2 . + --file ${GITHUB_WORKSPACE}/output/pdk-hspice-${STD_CELL_LIBRARY}.tar.bz2 . echo ::endgroup:: ) diff --git a/.github/test.sh b/.github/test.sh deleted file mode 100755 index b0ef3600..00000000 --- a/.github/test.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Copyright 2020 Efabless Corporation -# -# 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 -# -# http://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. - -SKY130_DIR="$(pwd)/pdks/pdk/sky130A" -if ! [[ -d $SKY130_DIR ]]; then - echo "Missing $SKY130_DIR" - exit -1 -fi - -du -h $SKY130_DIR - -echo ::group::Output files -echo -find $SKY130_DIR | sort -echo -echo ::endgroup:: - -SIZE=$(du -sb $SKY130_DIR | cut -f1) -# 250MB = 131,072,000 bytes; a fair estimate of the size of one library, I guess. -if [[ $SIZE -lt 131072000 ]]; then - echo 'size is less than 125MB' - exit -1 -fi -echo 'Built without fatal errors' -echo "sky130A size is $SIZE bytes" -exit 0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44869a84..71221c85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,11 @@ name: CI on: push: + branches: + - hspice pull_request: + branches: + - hspice workflow_dispatch: @@ -13,12 +17,6 @@ jobs: fail-fast: false matrix: library: - - sky130_fd_sc_hd - - sky130_fd_sc_hdll - - sky130_fd_sc_hs - - sky130_fd_sc_ms - - sky130_fd_sc_ls - - sky130_fd_sc_hvl - all env: STD_CELL_LIBRARY: ${{ matrix.library }} @@ -35,10 +33,6 @@ jobs: run: | bash .github/build.sh - - name: Test - run: | - bash .github/test.sh - - name: Capture if: ${{ always() }} run: | From 8864742d12c0d0276de02f8ee8dbde900052acdf Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 12:42:59 -0400 Subject: [PATCH 03/11] Use vault.centos.org for yum installs --- .github/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/Dockerfile b/.github/Dockerfile index 44334c7f..b8bf0a08 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -15,6 +15,9 @@ # syntax = docker/dockerfile:1.0-experimental FROM centos:centos8 as build +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* + # Common development tools and libraries (kitchen sink approach) RUN yum groupinstall -y "Development Tools" # "Development Libraries" From 8c4f46b050c12e598a19bde48fa8b87e92af3935 Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 14:42:32 -0400 Subject: [PATCH 04/11] Replace agauss with parameters --- sky130/custom/scripts/convert_hspice.py | 29 ++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sky130/custom/scripts/convert_hspice.py b/sky130/custom/scripts/convert_hspice.py index da43d7ae..48855912 100755 --- a/sky130/custom/scripts/convert_hspice.py +++ b/sky130/custom/scripts/convert_hspice.py @@ -23,6 +23,8 @@ SEMICOLON_PATTERN = re.compile(r"(.+);(.+)") SEMICOLON_REPLACE = r"*\2\n\1" +AGAUSS_PATTERN = re.compile(f"(agauss\s*\(([{NUMERIC_REGEX},]+)\))", re.IGNORECASE) + def quote_params_with_braces(content, *args, **kwargs): """Add quotes to param definitions which are enclosed between curly braces""" @@ -72,6 +74,31 @@ def replace_spi_path(content, *args, **kwargs): content = content.replace(source_path, dest_path) return content +def replace_agauss(content, *args, **kwargs): + file_name = os.path.basename(kwargs["input_file_name"]) + + param_prefix = re.sub(r"[^a-zA-Z0-9_]", "", file_name) + all_agauss = set() + + suffix_pattern = re.compile(r"[\.,a-zA-Z]") + + res = [] + for line in content.split("\n"): + gauss_patterns = AGAUSS_PATTERN.findall(line) + if gauss_patterns: + for full_text, gauss_pattern in gauss_patterns: + param_suffix = suffix_pattern.sub("", gauss_pattern) + param_name = f"{param_prefix}_{param_suffix}" + all_agauss.add((full_text, param_name)) + line = line.replace(full_text, param_name) + res.append(line) + + for agauss in all_agauss: + res.append(f".param {agauss[1]}={agauss[0]}") + print(f"Replaced {agauss[0]} with {agauss[1]} in {file_name}") + + return "\n".join(res) + def generic_filter(input_file_name, output_file_name, filters=None): filters = filters or [] @@ -87,7 +114,7 @@ def generic_filter(input_file_name, output_file_name, filters=None): def hspice_filter(input_file_name, out_file_name, _): filters = [quote_params_with_braces, quote_non_numeric_params, - quote_multiline_params, remove_semicolons] + quote_multiline_params, remove_semicolons, replace_agauss] if "hspice/spi" in input_file_name: filters.append(replace_libs_tech) else: From ef913cb75c6e41ca4bc8b10558dc047e69f82acf Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 14:43:15 -0400 Subject: [PATCH 05/11] Initialize sky130_fd_pr --- .github/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/Makefile b/.github/Makefile index feee7735..93e7f480 100644 --- a/.github/Makefile +++ b/.github/Makefile @@ -24,7 +24,7 @@ SKYWATER_COMMIT ?= b5ff6174d9aa921f670f12a2893969fe4a516f6c all: pdk .PHONY: pdk -pdk: skywater-pdk build-pdk +pdk: skywater-pdk skywater-library build-pdk $(PDK_ROOT)/skywater-pdk: git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk @@ -34,6 +34,11 @@ skywater-pdk: $(PDK_ROOT)/skywater-pdk cd $(PDK_ROOT)/skywater-pdk && \ git checkout -qf $(SKYWATER_COMMIT) +.PHONY: skywater-library +skywater-library: $(PDK_ROOT)/skywater-pdk + cd $(PDK_ROOT)/skywater-pdk && \ + git submodule update --init libraries/sky130_fd_pr/latest + .PHONY: build-pdk build-pdk: $(PDK_ROOT)/skywater-pdk [[ -d $(PDK_ROOT)/sky130A ]] && \ @@ -49,4 +54,4 @@ build-pdk: $(PDK_ROOT)/skywater-pdk && \ cd sky130 && \ $(MAKE) veryclean && \ - $(MAKE) primitive-A \ No newline at end of file + $(MAKE) primitive-A From 0c32bbe1c4e7a5164b4eded924caa7ffacdb57fd Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 14:52:51 -0400 Subject: [PATCH 06/11] build skywater-library --- .github/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/build.sh b/.github/build.sh index bd567313..13e697a4 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -27,6 +27,7 @@ echo ::endgroup:: echo ::group::make skywater-pdk make skywater-pdk +make skywater-library echo ::endgroup:: cd .. From be99690bce4d560ddecc554dc92a8ca7687b344d Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 16:17:03 -0400 Subject: [PATCH 07/11] Create release action --- .github/capture.sh | 26 ++------------------------ .github/workflows/ci.yml | 6 ++++++ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/capture.sh b/.github/capture.sh index 83fc2034..f5dd09e1 100644 --- a/.github/capture.sh +++ b/.github/capture.sh @@ -15,9 +15,6 @@ mkdir -p ${GITHUB_WORKSPACE}/output/ -# Copy build log. -cp ./sky130/sky130A_install.log ${GITHUB_WORKSPACE}/output/ - # Copy any core dupmps into the output directory. find . -name core -not \( -path '*/skywater-pdk/*' -prune \) | \ awk -v ln=1 '{print "cp " $0 " ${GITHUB_WORKSPACE}/output/core." ln++ }' | \ @@ -29,7 +26,7 @@ cp .github/magic.tar.gz ${GITHUB_WORKSPACE}/output/ # Try to create a deterministic tar file # https://reproducible-builds.org/docs/archives/ ( - HSPICE_DIR="$(pwd)/pdks/pdk/sky130A/libs.tech/hspice" + HSPICE_DIR="$(pwd)/sky130/sky130A/libs.tech/hspice" if ! [[ -d $HSPICE_DIR ]]; then echo "Missing $HSPICE_DIR" exit -1 @@ -50,30 +47,11 @@ cp .github/magic.tar.gz ${GITHUB_WORKSPACE}/output/ --numeric-owner \ --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \ \ - --file ${GITHUB_WORKSPACE}/output/pdk-hspice-${STD_CELL_LIBRARY}.tar.bz2 . + --file ${GITHUB_WORKSPACE}/output/hspice-model.tar.bz2 . echo ::endgroup:: ) -# Free up disk space so the GitHub Action runner doesn't die when collecting -# the artifacts. -echo ::group::Freeup space - -df -h - -for DIR in ${GITHUB_WORKSPACE}/*; do - if [ x$DIR = x"${GITHUB_WORKSPACE}/output" ]; then - continue - fi - echo - echo "Removing $DIR" - rm -rvf $DIR -done - -df -h - -echo ::endgroup:: - # Output which files are being saved. echo ::group::Output files du -h ${GITHUB_WORKSPACE}/output/* diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71221c85..0742f465 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,9 @@ jobs: with: name: ${{ matrix.library }} path: ${{ github.workspace }}/output/** + - name: Release + uses: softprops/action-gh-release@v1 + id: create_release + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{ github.workspace }}/output/hspice-model.tar.bz2 From 36261220192e596374d08bf236aaa518b1a901e9 Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 18:16:44 -0400 Subject: [PATCH 08/11] Create Release for all commits --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0742f465..5552ff04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,5 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 id: create_release - if: startsWith(github.ref, 'refs/tags/') with: files: ${{ github.workspace }}/output/hspice-model.tar.bz2 From 1d0482bd0aa3aa774a56c98d12f2cb1a986efb42 Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 18:28:46 -0400 Subject: [PATCH 09/11] Add token --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5552ff04..dd5e3f6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,5 @@ jobs: id: create_release with: files: ${{ github.workspace }}/output/hspice-model.tar.bz2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8b30fe931dc32254e6ca9170453cea036d987ff4 Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 18:32:34 -0400 Subject: [PATCH 10/11] only run for tags --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd5e3f6d..5437381d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 id: create_release + if: startsWith(github.ref, 'refs/tags/') with: files: ${{ github.workspace }}/output/hspice-model.tar.bz2 env: From 92099e766d9b89d432c7bb1c47bff5fb84175a89 Mon Sep 17 00:00:00 2001 From: ota2 Date: Wed, 6 Apr 2022 19:02:24 -0400 Subject: [PATCH 11/11] Run for push to hspice and tags --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5437381d..584ba05a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - hspice + tags: + - 1.* pull_request: branches: - hspice