From 9d49a369eac4fb0b351c6d60d9b54e7975e8b54b Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 2 Nov 2021 11:10:59 -0700 Subject: [PATCH 01/20] Initial docker setup --- Makefile | 62 ++++++------ docker/Dockerfile | 94 +++++++++++++++++++ docker/Makefile | 17 ++++ docker/set-paths.sh | 20 ++++ macros/Makefile | 72 ++++++++++++++ .../configs}/big_config_scn4m_subm.py | 0 .../example_config_1rw_1r_scn4m_subm.py | 0 .../example_config_1rw_1w_scn4m_subm.py | 0 .../example_config_1rw_2mux_scn4m_subm.py | 0 .../example_config_1w_1r_scn4m_subm.py | 0 .../configs}/example_config_2rw_scn4m_subm.py | 0 .../configs}/example_config_freepdk45.py | 0 .../configs}/example_config_scn4m_subm.py | 0 .../configs}/giant_config_scn4m_subm.py | 0 .../configs}/medium_config_scn4m_subm.py | 0 .../configs}/riscv_freepdk45_8kbyte.py | 0 .../riscv_scn4m_subm_16kbyte_1rw1r.py | 0 .../configs}/riscv_scn4m_subm_1kbyte_1rw1r.py | 0 .../configs}/riscv_scn4m_subm_2kbyte_1rw1r.py | 0 .../riscv_scn4m_subm_32kbyte_1rw1r.py | 0 .../configs}/riscv_scn4m_subm_4kbyte_1rw1r.py | 0 .../configs}/riscv_scn4m_subm_8kbyte_1rw1r.py | 0 .../configs}/riscv_sky130_1kbyte_1rw.py | 0 .../configs}/riscv_sky130_1kbyte_1rw1r.py | 0 .../configs}/riscv_sky130_2kbyte_1rw.py | 0 .../configs}/riscv_sky130_2kbyte_1rw1r.py | 0 .../configs}/riscv_sky130_4kbyte_1rw.py | 0 .../configs}/riscv_sky130_4kbyte_1rw1r.py | 0 .../sky130_sram_1kbyte_1r1w_8x1024_8.py | 0 .../sky130_sram_1kbyte_1rw1r_32x256_8.py | 0 .../sky130_sram_1kbyte_1rw1r_8x1024_8.py | 0 .../sky130_sram_1kbyte_1rw_32x256_8.py | 0 .../sky130_sram_2kbyte_1rw1r_32x512_8.py | 0 .../sky130_sram_2kbyte_1rw_32x512_8.py | 0 .../sky130_sram_4kbyte_1rw1r_32x1024_8.py | 0 .../sky130_sram_4kbyte_1rw_32x1024_8.py | 0 .../configs}/sky130_sram_common.py | 0 setpaths.sh | 4 +- 38 files changed, 239 insertions(+), 30 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 docker/Makefile create mode 100644 docker/set-paths.sh create mode 100644 macros/Makefile rename {compiler/example_configs => macros/configs}/big_config_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_1rw_1r_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_1rw_1w_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_1rw_2mux_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_1w_1r_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_2rw_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/example_config_freepdk45.py (100%) rename {compiler/example_configs => macros/configs}/example_config_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/giant_config_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/medium_config_scn4m_subm.py (100%) rename {compiler/example_configs => macros/configs}/riscv_freepdk45_8kbyte.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_16kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_1kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_2kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_32kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_4kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_scn4m_subm_8kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_1kbyte_1rw.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_1kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_2kbyte_1rw.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_2kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_4kbyte_1rw.py (100%) rename {compiler/example_configs => macros/configs}/riscv_sky130_4kbyte_1rw1r.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_1kbyte_1r1w_8x1024_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_1kbyte_1rw1r_32x256_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_1kbyte_1rw1r_8x1024_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_1kbyte_1rw_32x256_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_2kbyte_1rw1r_32x512_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_2kbyte_1rw_32x512_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_4kbyte_1rw1r_32x1024_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_4kbyte_1rw_32x1024_8.py (100%) rename {compiler/example_configs => macros/configs}/sky130_sram_common.py (100%) diff --git a/Makefile b/Makefile index d585d52a..cd09060a 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,11 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Regents of the University of California -# -# 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. -# -# SPDX-License-Identifier: Apache-2.0 - -# The top directory where environment will be created. TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +include $(TOP_DIR)/openram.mk -.DEFAULT_GOAL := all +.DEFAULT_GOAL := install # Skywater PDK SRAM library -#SRAM_LIBRARY ?= $(PDK_ROOT)/skywater-pdk/libraries/sky130_fd_bd_sram SRAM_GIT_REPO ?= https://github.com/google/skywater-pdk-libs-sky130_fd_bd_sram.git +SRAM_GIT_COMMIT ?= 9fa642baaf01110b59ac2783beba9a4fda03aeaf SRAM_LIBRARY ?= $(TOP_DIR)/sky130_fd_bd_sram # Open PDKs @@ -55,11 +37,6 @@ INSTALL_BASE := $(OPENRAM_HOME)/../technology/sky130 INSTALL_DIRS := $(addprefix $(INSTALL_BASE)/,$(INSTALL_BASE_DIRS)) -install: $(INSTALL_DIRS) - -$(SRAM_LIBRARY): - git clone $(SRAM_GIT_REPO) $(SRAM_LIBRARY) - $(OPEN_PDKS): git clone $(OPEN_PDKS_REPO) $(PDK_ROOT) cd $(PDK_ROOT) &&\ @@ -68,7 +45,7 @@ $(OPEN_PDKS): .PHONY: $(SRAM_LIBRARY) $(OPEN_PDKS) $(INSTALL_DIRS) install -all: $(SRAM_LIBRARY) $(OPEN_PDKS) +install: $(SRAM_LIBRARY) $(INSTALL_DIRS) $(OPEN_PDKS) @echo "Installing sky130 SRAM PDK..." @echo "PDK_ROOT='$(PDK_ROOT)'" @echo "SRAM_LIBRARY='$(SRAM_LIBRARY)'" @@ -76,6 +53,12 @@ all: $(SRAM_LIBRARY) $(OPEN_PDKS) make install @true +$(SRAM_LIBRARY): + git clone $(SRAM_GIT_REPO) $(SRAM_LIBRARY) + +.PHONY: $(SRAM_LIBRARY) $(INSTALL_DIRS) install + + $(INSTALL_BASE)/gds_lib: $(GDS_FILES) @echo @echo "Setting up GDS cell library for OpenRAM." @@ -149,7 +132,29 @@ $(INSTALL_BASE)/sp_lib: $(filter-out %.$(SPICE_LVS_SUFFIX) %.$(SPICE_CALIBRE_SUF @echo "==================================================================" @echo -clean: +macros: + cd macros && make + +.PHONY: macros + +tests: + docker run -v $(TOP_DIR):/openram \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + vlsida/openram-ubuntu:latest \ + sh -c "cd /openram/compiler/tests && ./regress.py -v -k" +.PHONY: tests + + +mount: + docker run -it -v $(TOP_DIR):/openram \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + vlsida/openram-ubuntu:latest +.PHONY: macros + + +uninstall: rm -rf $(SRAM_LIBRARY) rm -rf $(PDK_ROOT) rm -f $(INSTALL_BASE)/tech/.magicrc @@ -157,3 +162,4 @@ clean: rm -f $(INSTALL_BASE)/lef_lib/.magicrc rm -f $(INSTALL_BASE)/maglef_lib/.magicrc rm -rf $(INSTALL_DIRS) +.PHONY: uninstall diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..939b911b --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,94 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND noninteractive +RUN ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime +RUN echo "America/Los_Angeles" > /etc/timezone + +RUN apt-get update +RUN apt-get --no-install-recommends -y upgrade + +### Dependencies ### +# General tools for building etc. +RUN apt-get install --no-install-recommends -y build-essential git ssh vim gosu autoconf automake libtool bison flex +# Use bash instead of dash +RUN rm /bin/sh && ln -s /bin/bash /bin/sh +# Needed by OpenRAM +RUN apt-get install --no-install-recommends -y python3 python3-numpy python3-scipy python3-pip python3-matplotlib python3-venv python3-sklearn python3-subunit python3-coverage +# Needed by Netgen +RUN apt-get install --no-install-recommends -y m4 csh tk tk-dev tcl-dev +# Needed by ngspice +RUN apt-get install --no-install-recommends -y libxaw7-dev libreadline8 libreadline-dev +# X11 +RUN apt-get install --no-install-recommends -y libx11-dev libcairo2-dev +# Klayout +RUN apt-get install --no-install-recommends -y qt5-default qtcreator ruby-full ruby-dev python3-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5multimedia5-plugins libqt5multimedia5 libqt5svg5-dev libqt5designer5 libqt5designercomponents5 libqt5xmlpatterns5-dev qttools5-dev + +### Klayout ### +ARG KLAYOUT_COMMIT=ea1bf40a1ee1c1c934e47a0020417503ab3d7e7e +WORKDIR /root +RUN git clone https://github.com/KLayout/klayout +WORKDIR /root/klayout +RUN git checkout ${KLAYOUT_COMMIT} +RUN ./build.sh -qt5 \ + && cp -r bin-release /usr/local/klayout +RUN rm -rf /root/klayout + +### Magic ### +ARG MAGIC_COMMIT=8.3.221 +WORKDIR /root +RUN git clone git://opencircuitdesign.com/magic-8.3 magic +WORKDIR /root/magic +RUN git checkout ${MAGIC_COMMIT} +RUN ./configure \ + && make \ + && make install +RUN rm -rf /root/magic + +### Ngspice ### +ARG NGSPICE_COMIT=032b1c32c4dbad45ff132bcfac1dbecadbd8abb0 +WORKDIR /root +RUN git clone git://git.code.sf.net/p/ngspice/ngspice +WORKDIR /root/ngspice +RUN git checkout ${NGSPICE_COMMIT} +RUN ./autogen.sh \ + && ./configure --enable-openmp --with-readline \ + && make \ + && make install +RUN rm -rf /root/ngspice + +### Netgen ### +ARG NETGEN_COMMIT=1.5.194 +WORKDIR /root +RUN git clone git://opencircuitdesign.com/netgen-1.5 netgen +WORKDIR /root/netgen +RUN git checkout ${NETGEN_COMMIT} +RUN ./configure \ + && make -j$(nproc) \ + && make install +RUN rm -rf /root/netgen + +#ARG XYCE_COMMIT=b7bb12d81f11d8b50141262537299b09d64b5565 +#ARG TRILINOS_COMIT= + +# ### SET UP A GENERIC USER ### +# WORKDIR / +# RUN echo "cd ~" >> /etc/skel/.bashrc +# RUN echo "source /set-paths.sh" >> /etc/skel/.bashrc +# ADD set-paths.sh /set-paths.sh +# RUN chmod 755 /set-paths.sh + +### CLEAN UP ### + +# Remove development tools to save space +RUN apt-get remove -y build-essential autoconf automake libtool bison flex tcl-dev tk-dev +# Cleanup to save some space +RUN apt-get clean +RUN rm -rf /var/lib/apt/lists/* + +WORKDIR / + +### ADD ENTRY POINT ### +# COPY entrypoint.sh /usr/local/bin/entrypoint.sh +# RUN chmod 755 /usr/local/bin/entrypoint.sh +# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +# CMD ["/bin/bash"] diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 00000000..067cf49c --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,17 @@ + +TAG_DATE := $(shell date +%F) +all: build push + +.PHONY: build +build: + docker build -t vlsida/openram-ubuntu:${TAG_DATE} -f Dockerfile . | tee -i openram-ubuntu.log + docker tag vlsida/openram-ubuntu:${TAG_DATE} vlsida/openram-ubuntu:latest + +.PHONY: push +push: + docker login + docker push vlsida/openram-ubuntu:latest + +.PHONY: pull +pull: + docker pull vlsida/openram-ubuntu:latest diff --git a/docker/set-paths.sh b/docker/set-paths.sh new file mode 100644 index 00000000..96582dbd --- /dev/null +++ b/docker/set-paths.sh @@ -0,0 +1,20 @@ + +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + +export SWROOT=/software + +# Klayout +export PATH=$PATH:/usr/local/klayout/bin + +# Xyce +export XYCE_HOME=$SWROOT/Xyce/Parallel +export XYCE_PATH=$XYCE_HOME/bin +export PATH=$PATH:$XYCE_PATH +export XYCE_LIB=$XYCE_HOME/lib +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$XYCE_LIB +export XYCE_NO_TRACKING="anything at all" + +# PDKs +export FREEPDK45=/home/PDKs/FreePDK45 +# Set to the PDK you want to use +export PDK_DIR=$FREEPDK45 diff --git a/macros/Makefile b/macros/Makefile new file mode 100644 index 00000000..2e0ecc0f --- /dev/null +++ b/macros/Makefile @@ -0,0 +1,72 @@ +MACRO_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +TOP_DIR := $(realpath $(MACRO_DIR)/..) +include $(TOP_DIR)/openram.mk + +.DEFAULT_GOAL := all + +OPENRAM_OPTS := $(OPENRAM_OPTS) +# Define `OPENRAM_FULL` in your environment to run a full characterize +ifeq ($(OPENRAM_FULL),) +# Do not characterize (default) +else +# Characterize +OPTS += -c +endif +# Verbosity +OPENRAM_OPTS += -v --keeptemp + +CONFIG_DIR = configs +SRCS=$(filter-out disabled-% %_common.py,$(sort $(notdir $(wildcard $(CONFIG_DIR)/*.py)))) +DIRS=$(basename $(SRCS)) +STAMPS=$(addsuffix .ok,$(DIRS)) + +configs: + @echo + @echo "Using OpenRAM at $(OPENRAM_HOME)" + @echo " (which is version $$(cd $(OPENRAM_HOME); git describe --tags))" + @echo + @echo "Configurations:" + @for D in $(DIRS); do echo " - $$D"; done + @echo + +.PHONY: configs + +BROKEN := \ + sky130_sram_1kbyte_1r1w_8x1024_8 \ + sky130_sram_1kbyte_1rw_32x256_8 \ + sky130_sram_2kbyte_1rw_32x512_8 \ + sky130_sram_4kbyte_1rw_32x1024_8 \ + +WORKING_STAMPS=$(filter-out $(addsuffix .ok, (BROKEN)), $(STAMPS)) + +all: | configs + @echo + @echo "Building following working configs" + @for S in $(WORKING_STAMPS); do echo " - $$S"; done + @sleep 5 + $(MAKE) $(WORKING_STAMPS) + @echo "Built all macros." + +%.ok: configs/%.py + @echo "Building $*" + @mkdir -p $* + docker run -v $(TOP_DIR):/openram \ + -v $(PDK_ROOT)/share/sky130A:/sky130A \ + -e PDK_ROOT=/ \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + -e OPENRAM_TMP=/openram/macros/$*/tmp \ + vlsida/openram-ubuntu:latest \ + python3 -u /openram/compiler/openram.py $(OPENRAM_OPTS) -o $* -p /openram/macros/$* /openram/macros/$< && touch $@ + +.DELETE_ON_ERROR: $(STAMPS) + +$(DIRS): + @$(MAKE) --no-print-directory $@.ok + +.PHONY: $(DIRS) + +clean: + rm -rf $(STAMPS) + rm -rf $(DIRS) +.PHONY: clean diff --git a/compiler/example_configs/big_config_scn4m_subm.py b/macros/configs/big_config_scn4m_subm.py similarity index 100% rename from compiler/example_configs/big_config_scn4m_subm.py rename to macros/configs/big_config_scn4m_subm.py diff --git a/compiler/example_configs/example_config_1rw_1r_scn4m_subm.py b/macros/configs/example_config_1rw_1r_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_1rw_1r_scn4m_subm.py rename to macros/configs/example_config_1rw_1r_scn4m_subm.py diff --git a/compiler/example_configs/example_config_1rw_1w_scn4m_subm.py b/macros/configs/example_config_1rw_1w_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_1rw_1w_scn4m_subm.py rename to macros/configs/example_config_1rw_1w_scn4m_subm.py diff --git a/compiler/example_configs/example_config_1rw_2mux_scn4m_subm.py b/macros/configs/example_config_1rw_2mux_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_1rw_2mux_scn4m_subm.py rename to macros/configs/example_config_1rw_2mux_scn4m_subm.py diff --git a/compiler/example_configs/example_config_1w_1r_scn4m_subm.py b/macros/configs/example_config_1w_1r_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_1w_1r_scn4m_subm.py rename to macros/configs/example_config_1w_1r_scn4m_subm.py diff --git a/compiler/example_configs/example_config_2rw_scn4m_subm.py b/macros/configs/example_config_2rw_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_2rw_scn4m_subm.py rename to macros/configs/example_config_2rw_scn4m_subm.py diff --git a/compiler/example_configs/example_config_freepdk45.py b/macros/configs/example_config_freepdk45.py similarity index 100% rename from compiler/example_configs/example_config_freepdk45.py rename to macros/configs/example_config_freepdk45.py diff --git a/compiler/example_configs/example_config_scn4m_subm.py b/macros/configs/example_config_scn4m_subm.py similarity index 100% rename from compiler/example_configs/example_config_scn4m_subm.py rename to macros/configs/example_config_scn4m_subm.py diff --git a/compiler/example_configs/giant_config_scn4m_subm.py b/macros/configs/giant_config_scn4m_subm.py similarity index 100% rename from compiler/example_configs/giant_config_scn4m_subm.py rename to macros/configs/giant_config_scn4m_subm.py diff --git a/compiler/example_configs/medium_config_scn4m_subm.py b/macros/configs/medium_config_scn4m_subm.py similarity index 100% rename from compiler/example_configs/medium_config_scn4m_subm.py rename to macros/configs/medium_config_scn4m_subm.py diff --git a/compiler/example_configs/riscv_freepdk45_8kbyte.py b/macros/configs/riscv_freepdk45_8kbyte.py similarity index 100% rename from compiler/example_configs/riscv_freepdk45_8kbyte.py rename to macros/configs/riscv_freepdk45_8kbyte.py diff --git a/compiler/example_configs/riscv_scn4m_subm_16kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_16kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_16kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_16kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_scn4m_subm_1kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_1kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_1kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_1kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_scn4m_subm_2kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_2kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_2kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_2kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_scn4m_subm_32kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_32kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_32kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_32kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_scn4m_subm_4kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_4kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_4kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_4kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_scn4m_subm_8kbyte_1rw1r.py b/macros/configs/riscv_scn4m_subm_8kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_scn4m_subm_8kbyte_1rw1r.py rename to macros/configs/riscv_scn4m_subm_8kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_sky130_1kbyte_1rw.py b/macros/configs/riscv_sky130_1kbyte_1rw.py similarity index 100% rename from compiler/example_configs/riscv_sky130_1kbyte_1rw.py rename to macros/configs/riscv_sky130_1kbyte_1rw.py diff --git a/compiler/example_configs/riscv_sky130_1kbyte_1rw1r.py b/macros/configs/riscv_sky130_1kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_sky130_1kbyte_1rw1r.py rename to macros/configs/riscv_sky130_1kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_sky130_2kbyte_1rw.py b/macros/configs/riscv_sky130_2kbyte_1rw.py similarity index 100% rename from compiler/example_configs/riscv_sky130_2kbyte_1rw.py rename to macros/configs/riscv_sky130_2kbyte_1rw.py diff --git a/compiler/example_configs/riscv_sky130_2kbyte_1rw1r.py b/macros/configs/riscv_sky130_2kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_sky130_2kbyte_1rw1r.py rename to macros/configs/riscv_sky130_2kbyte_1rw1r.py diff --git a/compiler/example_configs/riscv_sky130_4kbyte_1rw.py b/macros/configs/riscv_sky130_4kbyte_1rw.py similarity index 100% rename from compiler/example_configs/riscv_sky130_4kbyte_1rw.py rename to macros/configs/riscv_sky130_4kbyte_1rw.py diff --git a/compiler/example_configs/riscv_sky130_4kbyte_1rw1r.py b/macros/configs/riscv_sky130_4kbyte_1rw1r.py similarity index 100% rename from compiler/example_configs/riscv_sky130_4kbyte_1rw1r.py rename to macros/configs/riscv_sky130_4kbyte_1rw1r.py diff --git a/compiler/example_configs/sky130_sram_1kbyte_1r1w_8x1024_8.py b/macros/configs/sky130_sram_1kbyte_1r1w_8x1024_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_1kbyte_1r1w_8x1024_8.py rename to macros/configs/sky130_sram_1kbyte_1r1w_8x1024_8.py diff --git a/compiler/example_configs/sky130_sram_1kbyte_1rw1r_32x256_8.py b/macros/configs/sky130_sram_1kbyte_1rw1r_32x256_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_1kbyte_1rw1r_32x256_8.py rename to macros/configs/sky130_sram_1kbyte_1rw1r_32x256_8.py diff --git a/compiler/example_configs/sky130_sram_1kbyte_1rw1r_8x1024_8.py b/macros/configs/sky130_sram_1kbyte_1rw1r_8x1024_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_1kbyte_1rw1r_8x1024_8.py rename to macros/configs/sky130_sram_1kbyte_1rw1r_8x1024_8.py diff --git a/compiler/example_configs/sky130_sram_1kbyte_1rw_32x256_8.py b/macros/configs/sky130_sram_1kbyte_1rw_32x256_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_1kbyte_1rw_32x256_8.py rename to macros/configs/sky130_sram_1kbyte_1rw_32x256_8.py diff --git a/compiler/example_configs/sky130_sram_2kbyte_1rw1r_32x512_8.py b/macros/configs/sky130_sram_2kbyte_1rw1r_32x512_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_2kbyte_1rw1r_32x512_8.py rename to macros/configs/sky130_sram_2kbyte_1rw1r_32x512_8.py diff --git a/compiler/example_configs/sky130_sram_2kbyte_1rw_32x512_8.py b/macros/configs/sky130_sram_2kbyte_1rw_32x512_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_2kbyte_1rw_32x512_8.py rename to macros/configs/sky130_sram_2kbyte_1rw_32x512_8.py diff --git a/compiler/example_configs/sky130_sram_4kbyte_1rw1r_32x1024_8.py b/macros/configs/sky130_sram_4kbyte_1rw1r_32x1024_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_4kbyte_1rw1r_32x1024_8.py rename to macros/configs/sky130_sram_4kbyte_1rw1r_32x1024_8.py diff --git a/compiler/example_configs/sky130_sram_4kbyte_1rw_32x1024_8.py b/macros/configs/sky130_sram_4kbyte_1rw_32x1024_8.py similarity index 100% rename from compiler/example_configs/sky130_sram_4kbyte_1rw_32x1024_8.py rename to macros/configs/sky130_sram_4kbyte_1rw_32x1024_8.py diff --git a/compiler/example_configs/sky130_sram_common.py b/macros/configs/sky130_sram_common.py similarity index 100% rename from compiler/example_configs/sky130_sram_common.py rename to macros/configs/sky130_sram_common.py diff --git a/setpaths.sh b/setpaths.sh index 44485f14..e4d0ff90 100755 --- a/setpaths.sh +++ b/setpaths.sh @@ -4,5 +4,5 @@ # like this: # source setpaths.sh -export OPENRAM_HOME="`pwd`/compiler" -export OPENRAM_TECH="`pwd`/technology" +export OPENRAM_HOME="/openram/compiler" +export OPENRAM_TECH="/openram/technology" From d7a20bc69bfe6b554ad6b7b7d862464ff2ed10f1 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 2 Nov 2021 15:07:18 -0700 Subject: [PATCH 02/20] Debug initial docker run scripts --- Makefile | 84 ++++++++++++++++-------------- macros/Makefile | 21 +++++++- macros/configs/sky130_sram_tiny.py | 21 ++++++++ openram.mk | 8 +++ technology/sky130/__init__.py | 2 +- 5 files changed, 93 insertions(+), 43 deletions(-) create mode 100644 macros/configs/sky130_sram_tiny.py create mode 100644 openram.mk diff --git a/Makefile b/Makefile index cd09060a..cdd7efe6 100644 --- a/Makefile +++ b/Makefile @@ -3,68 +3,76 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := install +# Keep it locally if they didn't specify +PDK_ROOT ?= $(TOP_DIR) + # Skywater PDK SRAM library -SRAM_GIT_REPO ?= https://github.com/google/skywater-pdk-libs-sky130_fd_bd_sram.git -SRAM_GIT_COMMIT ?= 9fa642baaf01110b59ac2783beba9a4fda03aeaf -SRAM_LIBRARY ?= $(TOP_DIR)/sky130_fd_bd_sram +SRAM_LIB_DIR ?= $(PDK_ROOT)/sky130_fd_bd_sram +SRAM_LIB_GIT_REPO ?= https://github.com/google/skywater-pdk-libs-sky130_fd_bd_sram.git +SRAM_LIB_GIT_COMMIT ?= main # Open PDKs -PDK_ROOT ?= $(TOP_DIR)/open_pdks -OPEN_PDKS_REPO ?= https://github.com/RTimothyEdwards/open_pdks.git -OPEN_PDKS ?= $(PDK_ROOT)/sky130/sky130A - +OPEN_PDKS_DIR ?= $(PDK_ROOT)/open_pdks +OPEN_PDKS_GIT_REPO ?= https://github.com/RTimothyEdwards/open_pdks.git +OPEN_PDKS_GIT_COMMIT ?= 1.0.156 +SKY130_PDK ?= $(PDK_ROOT)/share/pdk/sky130A # Create lists of all the files to copy/link -GDS_FILES := $(sort $(wildcard $(SRAM_LIBRARY)/cells/*/*.gds)) -MAG_FILES := $(sort $(wildcard $(SRAM_LIBRARY)/cells/*/*.mag)) +GDS_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.gds)) +MAG_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.mag)) SPICE_SUFFIX := spice SPICE_LVS_SUFFIX := lvs.$(SPICE_SUFFIX) SPICE_CALIBRE_SUFFIX := lvs.calibre.$(SPICE_SUFFIX) SPICE_BASE_SUFFIX := base.$(SPICE_SUFFIX) -ALL_SPICE_FILES := $(sort $(wildcard $(SRAM_LIBRARY)/cells/*/*.$(SPICE_SUFFIX))) +ALL_SPICE_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.$(SPICE_SUFFIX))) MAGLEF_SUFFIX := maglef -MAGLEF_FILES := $(sort $(wildcard $(SRAM_LIBRARY)/cells/*/*.$(MAGLEF_SUFFIX))) +MAGLEF_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.$(MAGLEF_SUFFIX))) -MAGICRC_FILE := $(OPEN_PDKS)/libs.tech/magic/sky130A.magicrc +MAGICRC_FILE := $(SKY130_PDK)/libs.tech/magic/sky130A.magicrc ALL_FILES := $(ALL_SPICE_FILES) $(GDS_FILES) $(MAG_FILES) $(MAGLEF_FILES) -INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib lef_lib maglef_lib +INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib maglef_lib INSTALL_BASE := $(OPENRAM_HOME)/../technology/sky130 INSTALL_DIRS := $(addprefix $(INSTALL_BASE)/,$(INSTALL_BASE_DIRS)) +$(OPEN_PDKS_DIR): + @echo "Cloning open_pdks..." + git clone $(OPEN_PDKS_GIT_REPO) $(OPEN_PDKS_DIR) + cd $(OPEN_PDKS_DIR) && git checkout $(OPEN_PDKS_GIT_COMMIT) -$(OPEN_PDKS): - git clone $(OPEN_PDKS_REPO) $(PDK_ROOT) - cd $(PDK_ROOT) &&\ - $(PDK_ROOT)/configure --enable-sky130-pdk - make -C $(PDK_ROOT) +$(SKY130_PDK): $(OPEN_PDKS_DIR) + @echo "Installing open_pdks..." + cd $(OPEN_PDKS_DIR) &&\ + ./configure --prefix=$(PDK_ROOT) --enable-sky130-pdk \ + --disable-openlane --disable-irsim --disable-xschem --disable-qflow + @sleep 5 + make -C $(OPEN_PDKS_DIR) install -.PHONY: $(SRAM_LIBRARY) $(OPEN_PDKS) $(INSTALL_DIRS) install - -install: $(SRAM_LIBRARY) $(INSTALL_DIRS) $(OPEN_PDKS) +install: $(SRAM_LIB_DIR) $(SKY130_PDK) $(INSTALL_DIRS) @echo "Installing sky130 SRAM PDK..." @echo "PDK_ROOT='$(PDK_ROOT)'" - @echo "SRAM_LIBRARY='$(SRAM_LIBRARY)'" - @echo "OPEN_PDKS='$(OPEN_PDKS)'" - make install + @echo "SRAM_LIB_DIR='$(SRAM_LIB_DIR)'" + @echo "SKY130_PDK='$(SKY130_PDK)'" @true +.PHONY: install -$(SRAM_LIBRARY): - git clone $(SRAM_GIT_REPO) $(SRAM_LIBRARY) - -.PHONY: $(SRAM_LIBRARY) $(INSTALL_DIRS) install +$(SRAM_LIB_DIR): + @echo "Cloning SRAM library..." + git clone $(SRAM_LIB_GIT_REPO) $(SRAM_LIB_DIR) + cd $(SRAM_LIB_DIR) && git checkout $(SRAM_LIB_GIT_COMMIT) +.PHONY: $(INSTALL_DIRS) $(INSTALL_BASE)/gds_lib: $(GDS_FILES) @echo @echo "Setting up GDS cell library for OpenRAM." @echo "==================================================================" mkdir -p $@ - @cp -va $? $@ + cp -va $? $@ @echo "==================================================================" @echo @@ -146,20 +154,16 @@ tests: .PHONY: tests -mount: - docker run -it -v $(TOP_DIR):/openram \ - -e OPENRAM_HOME=/openram/compiler \ - -e OPENRAM_TECH=/openram/technology \ - vlsida/openram-ubuntu:latest -.PHONY: macros - - -uninstall: - rm -rf $(SRAM_LIBRARY) - rm -rf $(PDK_ROOT) +clean: + rm -rf $(SKY130_PDK) rm -f $(INSTALL_BASE)/tech/.magicrc rm -f $(INSTALL_BASE)/mag_lib/.magicrc rm -f $(INSTALL_BASE)/lef_lib/.magicrc rm -f $(INSTALL_BASE)/maglef_lib/.magicrc rm -rf $(INSTALL_DIRS) +.PHONY: clean + +uninstall: clean + rm -rf $(SRAM_LIB_DIR) + rm -rf $(OPEN_PDKS_DIR) .PHONY: uninstall diff --git a/macros/Makefile b/macros/Makefile index 2e0ecc0f..f10ab19e 100644 --- a/macros/Makefile +++ b/macros/Makefile @@ -2,8 +2,13 @@ MACRO_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) TOP_DIR := $(realpath $(MACRO_DIR)/..) include $(TOP_DIR)/openram.mk +UID = $(shell id -u) +GID = $(shell id -g) + .DEFAULT_GOAL := all +SKY130_PDK ?= $(PDK_ROOT)/share/pdk/sky130A + OPENRAM_OPTS := $(OPENRAM_OPTS) # Define `OPENRAM_FULL` in your environment to run a full characterize ifeq ($(OPENRAM_FULL),) @@ -51,14 +56,26 @@ all: | configs @echo "Building $*" @mkdir -p $* docker run -v $(TOP_DIR):/openram \ - -v $(PDK_ROOT)/share/sky130A:/sky130A \ - -e PDK_ROOT=/ \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ -e OPENRAM_HOME=/openram/compiler \ -e OPENRAM_TECH=/openram/technology \ -e OPENRAM_TMP=/openram/macros/$*/tmp \ + --user $(UID):$(GID) \ vlsida/openram-ubuntu:latest \ python3 -u /openram/compiler/openram.py $(OPENRAM_OPTS) -o $* -p /openram/macros/$* /openram/macros/$< && touch $@ +mount: + docker run -it -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest +.PHONY: macros + + .DELETE_ON_ERROR: $(STAMPS) $(DIRS): diff --git a/macros/configs/sky130_sram_tiny.py b/macros/configs/sky130_sram_tiny.py new file mode 100644 index 00000000..95bfd61f --- /dev/null +++ b/macros/configs/sky130_sram_tiny.py @@ -0,0 +1,21 @@ +""" +Dual port (1 read/write + 1 read only) 1 kbytes SRAM with byte write. + +FIXME: What is this useful for? +FIXME: Why would you want byte write on this? +""" +word_size = 8 # Bits +num_words = 16 +human_byte_size = "{:.0f}kbytes".format((word_size * num_words)/1024/8) + +# Allow byte writes +write_size = 2 # Bits + +# Dual port +num_rw_ports = 1 +num_r_ports = 1 +num_w_ports = 0 +ports_human = '1rw1r' + +import os +exec(open(os.path.join(os.path.dirname(__file__), 'sky130_sram_common.py')).read()) diff --git a/openram.mk b/openram.mk new file mode 100644 index 00000000..1bd95897 --- /dev/null +++ b/openram.mk @@ -0,0 +1,8 @@ +OPENRAM_HOME := $(abspath $(TOP_DIR)/compiler) +OPENRAM_TECH := $(abspath $(TOP_DIR)/technology) +OPENRAM_COMPILER := $(OPENRAM_HOME)/openram.py +ifeq (,$(wildcard $(OPENRAM_COMPILER))) +$(error Did not find '$(OPENRAM_COMPILER)' in '$(OPENRAM_HOME)' (from $$OPENRAM_HOME)) +endif +export OPENRAM_HOME +export OPENRAM_TECH diff --git a/technology/sky130/__init__.py b/technology/sky130/__init__.py index 3df3f555..c17c62d8 100644 --- a/technology/sky130/__init__.py +++ b/technology/sky130/__init__.py @@ -21,7 +21,7 @@ os.environ["MGC_TMPDIR"] = "/tmp" # OpenPDK needed for magicrc, tech file and spice models of transistors if 'PDK_ROOT' in os.environ: - open_pdks = os.path.join(os.environ['PDK_ROOT'], 'sky130A', 'libs.tech') + open_pdks = os.path.join(os.environ['PDK_ROOT'], 'share', 'pdk', 'sky130A', 'libs.tech') else: raise SystemError("Unable to find open_pdks tech file. Set PDK_ROOT.") From 8d78bcc4dc6dc50db41ae7d088609e84500053a2 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 2 Nov 2021 15:12:26 -0700 Subject: [PATCH 03/20] Revert setpaths.sh --- setpaths.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setpaths.sh b/setpaths.sh index e4d0ff90..44485f14 100755 --- a/setpaths.sh +++ b/setpaths.sh @@ -4,5 +4,5 @@ # like this: # source setpaths.sh -export OPENRAM_HOME="/openram/compiler" -export OPENRAM_TECH="/openram/technology" +export OPENRAM_HOME="`pwd`/compiler" +export OPENRAM_TECH="`pwd`/technology" From eb310dbb6e834a68f6bf95af90ae2e988b1f860d Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:31:50 -0700 Subject: [PATCH 04/20] Run docker as user. Revert to working magic commit 8.3.197. --- docker/Dockerfile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 939b911b..9bcf031f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,7 +34,7 @@ RUN ./build.sh -qt5 \ RUN rm -rf /root/klayout ### Magic ### -ARG MAGIC_COMMIT=8.3.221 +ARG MAGIC_COMMIT=8.3.197 WORKDIR /root RUN git clone git://opencircuitdesign.com/magic-8.3 magic WORKDIR /root/magic @@ -57,7 +57,7 @@ RUN ./autogen.sh \ RUN rm -rf /root/ngspice ### Netgen ### -ARG NETGEN_COMMIT=1.5.194 +ARG NETGEN_COMMIT=e4a15f12fbdd3480b6adc0eeba09df269ed7b387 WORKDIR /root RUN git clone git://opencircuitdesign.com/netgen-1.5 netgen WORKDIR /root/netgen @@ -70,25 +70,30 @@ RUN rm -rf /root/netgen #ARG XYCE_COMMIT=b7bb12d81f11d8b50141262537299b09d64b5565 #ARG TRILINOS_COMIT= -# ### SET UP A GENERIC USER ### -# WORKDIR / -# RUN echo "cd ~" >> /etc/skel/.bashrc -# RUN echo "source /set-paths.sh" >> /etc/skel/.bashrc -# ADD set-paths.sh /set-paths.sh -# RUN chmod 755 /set-paths.sh - ### CLEAN UP ### - # Remove development tools to save space RUN apt-get remove -y build-essential autoconf automake libtool bison flex tcl-dev tk-dev # Cleanup to save some space RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* -WORKDIR / + +# ### SET UP A GENERIC USER ### +# WORKDIR /p +# RUN echo "cd ~" >> /etc/skel/.bashrc +# RUN echo "source /set-paths.sh" >> /etc/skel/.bashrc +# ADD set-paths.sh /set-paths.sh +# RUN chmod 755 /set-paths.sh ### ADD ENTRY POINT ### # COPY entrypoint.sh /usr/local/bin/entrypoint.sh # RUN chmod 755 /usr/local/bin/entrypoint.sh # ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] # CMD ["/bin/bash"] + +RUN mkdir /home/cad-user +RUN useradd cad-user +RUN chown -R cad-user /home/cad-user +RUN chgrp -R cad-user /home/cad-user +USER cad-user +WORKDIR /home/cad-user From f68ee76bc747b8cf1b1d1553066704d634632e5f Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:32:08 -0700 Subject: [PATCH 05/20] Add UID/GID to makefile config --- openram.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openram.mk b/openram.mk index 1bd95897..02a9ee12 100644 --- a/openram.mk +++ b/openram.mk @@ -6,3 +6,6 @@ $(error Did not find '$(OPENRAM_COMPILER)' in '$(OPENRAM_HOME)' (from $$OPENRAM_ endif export OPENRAM_HOME export OPENRAM_TECH + +UID = $(shell id -u) +GID = $(shell id -g) From af67b738af6b52b13ffa1d795901e63690313b1b Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:32:29 -0700 Subject: [PATCH 06/20] Add ability to run a single unit test in docker --- Makefile | 61 +++++++++++++++++++++++++++-- macros/Makefile | 7 +--- technology/scn4m_subm/tech/.magicrc | 1 + 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cdd7efe6..bd9aee94 100644 --- a/Makefile +++ b/Makefile @@ -145,14 +145,69 @@ macros: .PHONY: macros +TEST_DIR = $(TOP_DIR)/compiler/tests +TEST_SRCS=$(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) +TEST_DIRS=$(basename $(TEST_SRCS)) +TEST_STAMPS=$(addsuffix .ok,$(TEST_DIRS)) + +TEST_BROKEN := \ + sky130_sram_1kbyte_1r1w_8x1024_8 \ + sky130_sram_1kbyte_1rw_32x256_8 \ + sky130_sram_2kbyte_1rw_32x512_8 \ + sky130_sram_4kbyte_1rw_32x1024_8 \ + +WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS)) + +$(TEST_DIRS): + @$(MAKE) --no-print-directory $@.ok + tests: + @echo "Running the following tests" + @for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done + @sleep 5 + $(MAKE) $(WORKING_TEST_STAMPS) +.PHONY: tests + +%.ok: compiler/tests/%.py + @echo "Testing $*" + @mkdir -p $* + docker run -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + -e OPENRAM_TMP=/openram/$* \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest \ + python3 -u /openram/compiler/tests/$*.py -v -k && touch $@ + +.DELETE_ON_ERROR: $(TEST_STAMPS) + +regress: docker run -v $(TOP_DIR):/openram \ -e OPENRAM_HOME=/openram/compiler \ -e OPENRAM_TECH=/openram/technology \ - vlsida/openram-ubuntu:latest \ - sh -c "cd /openram/compiler/tests && ./regress.py -v -k" -.PHONY: tests + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest \ + sh -c "python3 -u /openram/compiler/tests/regress.py" +.PHONY: regress +mount: + docker run -it -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest +.PHONY: mount + + +testclean: + rm -rf $(TEST_STAMPS) + rm -rf $(TEST_DIRS) + rm *.zip +.PHONE: testclean clean: rm -rf $(SKY130_PDK) diff --git a/macros/Makefile b/macros/Makefile index f10ab19e..2014cb96 100644 --- a/macros/Makefile +++ b/macros/Makefile @@ -2,9 +2,6 @@ MACRO_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) TOP_DIR := $(realpath $(MACRO_DIR)/..) include $(TOP_DIR)/openram.mk -UID = $(shell id -u) -GID = $(shell id -g) - .DEFAULT_GOAL := all SKY130_PDK ?= $(PDK_ROOT)/share/pdk/sky130A @@ -42,7 +39,7 @@ BROKEN := \ sky130_sram_2kbyte_1rw_32x512_8 \ sky130_sram_4kbyte_1rw_32x1024_8 \ -WORKING_STAMPS=$(filter-out $(addsuffix .ok, (BROKEN)), $(STAMPS)) +WORKING_STAMPS=$(filter-out $(addsuffix .ok, $(BROKEN)), $(STAMPS)) all: | configs @echo @@ -73,7 +70,7 @@ mount: -e OPENRAM_TECH=/openram/technology \ --user $(UID):$(GID) \ vlsida/openram-ubuntu:latest -.PHONY: macros +.PHONY: mount .DELETE_ON_ERROR: $(STAMPS) diff --git a/technology/scn4m_subm/tech/.magicrc b/technology/scn4m_subm/tech/.magicrc index c85bb879..8fdad1b7 100644 --- a/technology/scn4m_subm/tech/.magicrc +++ b/technology/scn4m_subm/tech/.magicrc @@ -6,3 +6,4 @@ tech load SCN4M_SUBM.20 -noprompt scalegrid 1 4 set GND gnd set VDD vdd +set SUB gnd From 066e558b20df8131837abe743e68ab7d07c988bb Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:34:49 -0700 Subject: [PATCH 07/20] Add Makefile targets for clean, uninstall, and wipe --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bd9aee94..3f2cf7a5 100644 --- a/Makefile +++ b/Makefile @@ -202,23 +202,23 @@ mount: vlsida/openram-ubuntu:latest .PHONY: mount - -testclean: +clean: rm -rf $(TEST_STAMPS) rm -rf $(TEST_DIRS) - rm *.zip -.PHONE: testclean + rm -f *.zip +.PHONE: clean -clean: - rm -rf $(SKY130_PDK) +uninstall: clean rm -f $(INSTALL_BASE)/tech/.magicrc rm -f $(INSTALL_BASE)/mag_lib/.magicrc rm -f $(INSTALL_BASE)/lef_lib/.magicrc rm -f $(INSTALL_BASE)/maglef_lib/.magicrc rm -rf $(INSTALL_DIRS) -.PHONY: clean +.PHONY: uninstall -uninstall: clean +# wipe the entire repos +wipe: uninstall + rm -rf $(SKY130_PDK) rm -rf $(SRAM_LIB_DIR) rm -rf $(OPEN_PDKS_DIR) -.PHONY: uninstall +.PHONY: wipe From e31bab26aecaf6d2f3005f2a7b6e954945bcb31e Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:36:10 -0700 Subject: [PATCH 08/20] Warn for wiping repos --- Makefile | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 3f2cf7a5..ecd2a82b 100644 --- a/Makefile +++ b/Makefile @@ -203,22 +203,24 @@ mount: .PHONY: mount clean: - rm -rf $(TEST_STAMPS) - rm -rf $(TEST_DIRS) - rm -f *.zip + @rm -rf $(TEST_STAMPS) + @rm -rf $(TEST_DIRS) + @rm -f *.zip .PHONE: clean uninstall: clean - rm -f $(INSTALL_BASE)/tech/.magicrc - rm -f $(INSTALL_BASE)/mag_lib/.magicrc - rm -f $(INSTALL_BASE)/lef_lib/.magicrc - rm -f $(INSTALL_BASE)/maglef_lib/.magicrc - rm -rf $(INSTALL_DIRS) + @rm -f $(INSTALL_BASE)/tech/.magicrc + @rm -f $(INSTALL_BASE)/mag_lib/.magicrc + @rm -f $(INSTALL_BASE)/lef_lib/.magicrc + @rm -f $(INSTALL_BASE)/maglef_lib/.magicrc + @rm -rf $(INSTALL_DIRS) .PHONY: uninstall # wipe the entire repos wipe: uninstall - rm -rf $(SKY130_PDK) - rm -rf $(SRAM_LIB_DIR) - rm -rf $(OPEN_PDKS_DIR) + @echo "Wiping PDK repos in 5 sec... (ctrl-c to quit)" + @sleep 5 + @rm -rf $(SKY130_PDK) + @rm -rf $(SRAM_LIB_DIR) + @rm -rf $(OPEN_PDKS_DIR) .PHONY: wipe From 540711bcf275e4a5476545216aeafbc41b9186e8 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 08:42:00 -0700 Subject: [PATCH 09/20] Silence some makefile commands --- Makefile | 8 +++----- docker/Makefile | 13 +++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ecd2a82b..5c175302 100644 --- a/Makefile +++ b/Makefile @@ -164,14 +164,12 @@ $(TEST_DIRS): tests: @echo "Running the following tests" @for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done - @sleep 5 $(MAKE) $(WORKING_TEST_STAMPS) .PHONY: tests %.ok: compiler/tests/%.py - @echo "Testing $*" @mkdir -p $* - docker run -v $(TOP_DIR):/openram \ + @docker run -v $(TOP_DIR):/openram \ -v $(SKY130_PDK):$(SKY130_PDK) \ -e PDK_ROOT=$(PDK_ROOT) \ -e OPENRAM_HOME=/openram/compiler \ @@ -184,7 +182,7 @@ tests: .DELETE_ON_ERROR: $(TEST_STAMPS) regress: - docker run -v $(TOP_DIR):/openram \ + @docker run -v $(TOP_DIR):/openram \ -e OPENRAM_HOME=/openram/compiler \ -e OPENRAM_TECH=/openram/technology \ --user $(UID):$(GID) \ @@ -193,7 +191,7 @@ regress: .PHONY: regress mount: - docker run -it -v $(TOP_DIR):/openram \ + @docker run -it -v $(TOP_DIR):/openram \ -v $(SKY130_PDK):$(SKY130_PDK) \ -e PDK_ROOT=$(PDK_ROOT) \ -e OPENRAM_HOME=/openram/compiler \ diff --git a/docker/Makefile b/docker/Makefile index 067cf49c..5ef0d273 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,3 +1,6 @@ +DOCKER_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) +TOP_DIR := $(realpath $(DOCKER_DIR)/..) +include $(TOP_DIR)/openram.mk TAG_DATE := $(shell date +%F) all: build push @@ -15,3 +18,13 @@ push: .PHONY: pull pull: docker pull vlsida/openram-ubuntu:latest + +mount: + docker run -it -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest +.PHONY: mount From 6f33e8102fd2507a0ef9d10dbd33a42989a87b0d Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 10:08:21 -0700 Subject: [PATCH 10/20] Revert to version of netgen without proxy pin bug --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9bcf031f..d117456d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -57,7 +57,7 @@ RUN ./autogen.sh \ RUN rm -rf /root/ngspice ### Netgen ### -ARG NETGEN_COMMIT=e4a15f12fbdd3480b6adc0eeba09df269ed7b387 +ARG NETGEN_COMMIT=88d53fab15eb611cffc024eebf8743fae5cf8cb7 WORKDIR /root RUN git clone git://opencircuitdesign.com/netgen-1.5 netgen WORKDIR /root/netgen From c102ed728c7f1d539e9bed0f1e3b82ed1ddcbba2 Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 3 Nov 2021 11:36:19 -0700 Subject: [PATCH 11/20] Move tests to test Makefile --- Makefile | 47 ----------------------- compiler/Makefile | 13 +++---- compiler/tests/testutils.py | 22 +++++------ technology/freepdk45/tech/freepdk45.lylvs | 14 ++----- technology/freepdk45/tech/tech.py | 13 ++++--- 5 files changed, 29 insertions(+), 80 deletions(-) diff --git a/Makefile b/Makefile index 5c175302..b85f5336 100644 --- a/Makefile +++ b/Makefile @@ -145,51 +145,6 @@ macros: .PHONY: macros -TEST_DIR = $(TOP_DIR)/compiler/tests -TEST_SRCS=$(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) -TEST_DIRS=$(basename $(TEST_SRCS)) -TEST_STAMPS=$(addsuffix .ok,$(TEST_DIRS)) - -TEST_BROKEN := \ - sky130_sram_1kbyte_1r1w_8x1024_8 \ - sky130_sram_1kbyte_1rw_32x256_8 \ - sky130_sram_2kbyte_1rw_32x512_8 \ - sky130_sram_4kbyte_1rw_32x1024_8 \ - -WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS)) - -$(TEST_DIRS): - @$(MAKE) --no-print-directory $@.ok - -tests: - @echo "Running the following tests" - @for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done - $(MAKE) $(WORKING_TEST_STAMPS) -.PHONY: tests - -%.ok: compiler/tests/%.py - @mkdir -p $* - @docker run -v $(TOP_DIR):/openram \ - -v $(SKY130_PDK):$(SKY130_PDK) \ - -e PDK_ROOT=$(PDK_ROOT) \ - -e OPENRAM_HOME=/openram/compiler \ - -e OPENRAM_TECH=/openram/technology \ - -e OPENRAM_TMP=/openram/$* \ - --user $(UID):$(GID) \ - vlsida/openram-ubuntu:latest \ - python3 -u /openram/compiler/tests/$*.py -v -k && touch $@ - -.DELETE_ON_ERROR: $(TEST_STAMPS) - -regress: - @docker run -v $(TOP_DIR):/openram \ - -e OPENRAM_HOME=/openram/compiler \ - -e OPENRAM_TECH=/openram/technology \ - --user $(UID):$(GID) \ - vlsida/openram-ubuntu:latest \ - sh -c "python3 -u /openram/compiler/tests/regress.py" -.PHONY: regress - mount: @docker run -it -v $(TOP_DIR):/openram \ -v $(SKY130_PDK):$(SKY130_PDK) \ @@ -201,8 +156,6 @@ mount: .PHONY: mount clean: - @rm -rf $(TEST_STAMPS) - @rm -rf $(TEST_DIRS) @rm -f *.zip .PHONE: clean diff --git a/compiler/Makefile b/compiler/Makefile index 171c1a10..117e4bd2 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -35,7 +35,7 @@ ${CELL_TESTS} \ ${MODULE_TESTS} \ ${TOP_TESTS} \ ${CHAR_TESTS} \ -${USAGE_TESTS} +${USAGE_TESTS} .PHONY: ${ALL_TESTS} @@ -64,8 +64,8 @@ usage: ${USAGE_TESTS} $(ALL_TESTS): python3 $@ -t ${TECH} - - + + OPENRAM_TECHS = $(subst :, ,$(OPENRAM_TECH)) TECH_DIR := $(word 1, $(foreach dir,$(OPENRAM_TECHS),$(wildcard $(dir)/$(TECH)))) CONFIG_DIR = $(OPENRAM_HOME)/model_configs @@ -75,9 +75,9 @@ CSV_DIR = $(TECH_DIR)/sim_data # Creates names of technology specific okay files for the configs STAMPS=$(addprefix $(SIM_DIR)/, $(addsuffix .ok, $(notdir $(basename $(MODEL_CONFIGS))))) -OPTS = +OPTS = # Characterize and perform DRC/LVS -OPTS += -c +OPTS += -c # Do not characterize or perform DRC/LVS OPTS += -n # Verbosity @@ -100,8 +100,7 @@ model: $(STAMPS) clean_model: rm -f -r $(SIM_DIR)/*.ok - + clean: find . -name \*.pyc -exec rm {} \; find . -name \*~ -exec rm {} \; - diff --git a/compiler/tests/testutils.py b/compiler/tests/testutils.py index 928536a7..67c08d2e 100644 --- a/compiler/tests/testutils.py +++ b/compiler/tests/testutils.py @@ -24,24 +24,24 @@ class openram_test(unittest.TestCase): def tearDown(self): duration = time.time() - self.start_time print('%s: %.3fs' % (self.id(), duration)) - + def fail(self, msg): import inspect s = inspect.stack() base_filename = os.path.splitext(os.path.basename(s[2].filename))[0] - + try: OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME")) except: debug.error("$OPENRAM_HOME is not properly defined.", 1) - - import shutil - zip_file = "{0}/../{1}_{2}".format(OPENRAM_HOME, base_filename, os.getpid()) - debug.info(0, "Archiving failed temp files {0} to {1}".format(OPTS.openram_temp, zip_file)) - shutil.make_archive(zip_file, 'zip', OPTS.openram_temp) - + + # import shutil + # zip_file = "{0}/../{1}_{2}".format(OPENRAM_HOME, base_filename, os.getpid()) + # debug.info(0, "Archiving failed temp files {0} to {1}".format(OPTS.openram_temp, zip_file)) + # shutil.make_archive(zip_file, 'zip', OPTS.openram_temp) + super().fail(msg) - + def local_drc_check(self, w): self.reset() @@ -55,7 +55,7 @@ class openram_test(unittest.TestCase): self.fail("DRC failed: {}".format(w.name)) elif not OPTS.keep_temp: self.cleanup() - + def local_check(self, a, final_verification=False): self.reset() @@ -128,7 +128,7 @@ class openram_test(unittest.TestCase): def cleanup(self): """ Reset the duplicate checker and cleanup files. """ - + files = glob.glob(OPTS.openram_temp + '*') for f in files: # Only remove the files diff --git a/technology/freepdk45/tech/freepdk45.lylvs b/technology/freepdk45/tech/freepdk45.lylvs index 5d8e50b3..640454d6 100644 --- a/technology/freepdk45/tech/freepdk45.lylvs +++ b/technology/freepdk45/tech/freepdk45.lylvs @@ -209,16 +209,10 @@ connect_global(pwell, "PWELL") connect_global(nwell, "NWELL") connect_global(bulk, "BULK") -#for pat in %w(pnand*_0 and2_dec_0 port_address* replica_bitcell_array) -# connect_explicit(pat, [ "NWELL", "vdd" ]) -# connect_explicit(pat, [ "BULK", "PWELL", "gnd" ]) -#end - -#for pat in %w(XOR* XNOR* TLAT* TINV* TBUF* SDFF* OR* OAI* NOR* NAND* MUX* LOGIC* INV* HA* FILLCELL* -# FA* DLL* DLH* DFF* DFFS* DFFR* DFFRS* CLKGATE* CLKBUF* BUF* AOI* ANTENNA* AND*) -# connect_explicit(pat, [ "NWELL", "VDD" ]) -# connect_explicit(pat, [ "BULK", "VSS" ]) -#end +for pat in %w(pnand* and2_dec* port_address* replica_bitcell_array) + connect_explicit(pat, [ "NWELL", "vdd" ]) + connect_explicit(pat, [ "BULK", "PWELL", "gnd" ]) +end # Actually performs the extraction netlist # ... not really required diff --git a/technology/freepdk45/tech/tech.py b/technology/freepdk45/tech/tech.py index fd477077..3988a411 100644 --- a/technology/freepdk45/tech/tech.py +++ b/technology/freepdk45/tech/tech.py @@ -457,10 +457,10 @@ parameter["sa_inv_nmos_size"] = 0.27 # micro-meters parameter["bitcell_drain_cap"] = 0.1 # In Femto-Farad, approximation of drain capacitance # Spice Values uses to calculate analytical delay based on CACTI equations -spice["i_on_n"] = 0.0004463 # A/um +spice["i_on_n"] = 0.0004463 # A/um spice["i_on_p"] = 0.0000771 # A/um spice["tox"] = 0.00114 # microns -spice["eps_ox"] = 0.00245e-14 # F/um, calculated from CACTI 45nm data +spice["eps_ox"] = 0.00245e-14 # F/um, calculated from CACTI 45nm data spice["cox"] = spice["eps_ox"]/spice["tox"] # F/um^2 spice["c_g_ideal"] = spice["cox"]*drc["minlength_channel"] # F/um spice["c_overlap"] = 0.2*spice["c_g_ideal"] # F/um @@ -477,8 +477,11 @@ spice["sa_transconductance"] = (spice["mobility_n"])*spice["cox"]*(parameter["sa # Technology Tool Preferences ################################################### -drc_name = "calibre" -lvs_name = "calibre" -pex_name = "calibre" +#drc_name = "calibre" +#lvs_name = "calibre" +#pex_name = "calibre" +drc_name = "klayout" +lvs_name = "klayout" +pex_name = "klayout" blackbox_bitcell = False From 968a233b82c35e0f158844fb036e3830881c3d43 Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 8 Nov 2021 09:31:56 -0800 Subject: [PATCH 12/20] Don't install in share/pdk --- Makefile | 18 ++++++++++-------- technology/sky130/__init__.py | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index b85f5336..f13aadca 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SRAM_LIB_GIT_COMMIT ?= main OPEN_PDKS_DIR ?= $(PDK_ROOT)/open_pdks OPEN_PDKS_GIT_REPO ?= https://github.com/RTimothyEdwards/open_pdks.git OPEN_PDKS_GIT_COMMIT ?= 1.0.156 -SKY130_PDK ?= $(PDK_ROOT)/share/pdk/sky130A +SKY130_PDK ?= $(PDK_ROOT)/sky130A # Create lists of all the files to copy/link GDS_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.gds)) @@ -47,10 +47,12 @@ $(OPEN_PDKS_DIR): $(SKY130_PDK): $(OPEN_PDKS_DIR) @echo "Installing open_pdks..." cd $(OPEN_PDKS_DIR) &&\ - ./configure --prefix=$(PDK_ROOT) --enable-sky130-pdk \ - --disable-openlane --disable-irsim --disable-xschem --disable-qflow - @sleep 5 - make -C $(OPEN_PDKS_DIR) install + ./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries \ + --disable-openlane --disable-irsim --disable-xschem --disable-qflow &&\ + cd sky130 && \ + make veryclean && \ + make && \ + make SHARED_PDKS_PATH=$(PDK_ROOT) install install: $(SRAM_LIB_DIR) $(SKY130_PDK) $(INSTALL_DIRS) @echo "Installing sky130 SRAM PDK..." @@ -171,7 +173,7 @@ uninstall: clean wipe: uninstall @echo "Wiping PDK repos in 5 sec... (ctrl-c to quit)" @sleep 5 - @rm -rf $(SKY130_PDK) - @rm -rf $(SRAM_LIB_DIR) - @rm -rf $(OPEN_PDKS_DIR) + rm -rf $(SKY130_PDK) + rm -rf $(SRAM_LIB_DIR) + rm -rf $(OPEN_PDKS_DIR) .PHONY: wipe diff --git a/technology/sky130/__init__.py b/technology/sky130/__init__.py index c17c62d8..3df3f555 100644 --- a/technology/sky130/__init__.py +++ b/technology/sky130/__init__.py @@ -21,7 +21,7 @@ os.environ["MGC_TMPDIR"] = "/tmp" # OpenPDK needed for magicrc, tech file and spice models of transistors if 'PDK_ROOT' in os.environ: - open_pdks = os.path.join(os.environ['PDK_ROOT'], 'share', 'pdk', 'sky130A', 'libs.tech') + open_pdks = os.path.join(os.environ['PDK_ROOT'], 'sky130A', 'libs.tech') else: raise SystemError("Unable to find open_pdks tech file. Set PDK_ROOT.") From 3902cee003d44d2bdeb4950378993a9e9eebc0e4 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 16 Nov 2021 11:17:00 -0800 Subject: [PATCH 13/20] Update READMEs --- README.md | 61 ++++++++++++++++++++++-------------------------- docker/README.md | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 33 deletions(-) create mode 100644 docker/README.md diff --git a/README.md b/README.md index 820c52a0..7dafe0d1 100644 --- a/README.md +++ b/README.md @@ -26,21 +26,25 @@ things that need to be fixed. # Basic Setup +## Docker + +We have a [docker setup](./docker) to run OpenRAM. + ## Dependencies The OpenRAM compiler has very few dependencies: -+ [Ngspice] 26 (or later) or HSpice I-2013.12-1 (or later) or CustomSim 2017 (or later) or [Xyce] 7.2 (or later) -+ Python 3.5 or higher ++ [Ngspice] 34 (or later) or HSpice I-2013.12-1 (or later) or CustomSim 2017 (or later) or [Xyce] 7.4 (or later) ++ Python 3.6 or higher + Various Python packages (pip install -r requirements.txt) + [Git] If you want to perform DRC and LVS, you will need either: + Calibre (for [FreePDK45]) -+ [Magic] 8.3.130 or newer -+ [Netgen] 1.5.164 or newer ++ [Magic] 8.3.197 or newer ++ [Netgen] 1.5.195 or newer -You must set two environment variables: -+ OPENRAM\_HOME should point to the compiler source directory. +You must set two environment variables: ++ OPENRAM\_HOME should point to the compiler source directory. + OPENERAM\_TECH should point to one or more root technology directories (colon separated). ## Environment @@ -58,24 +62,15 @@ You may also wish to add OPENRAM\_HOME to your PYTHONPATH: export PYTHONPATH="$PYTHONPATH:$OPENRAM_HOME" ``` -We include the tech files necessary for [SCMOS] SCN4M_SUBM. The -[SCMOS] spice models, however, are generic and should be replaced with -foundry models. If you are using [FreePDK45], you should also have -that set up and have the environment variable point to the PDK. For -example add this to your .bashrc: - -``` - export FREEPDK45="/bsoe/software/design-kits/FreePDK45" -``` - -You may get the entire [FreePDK45 PDK here][FreePDK45]. -If you are using [SCMOS], you should install [Magic] and [Netgen]. -We have included the most recent SCN4M_SUBM design rules from [Qflow]. +We include the tech files necessary for [SCMOS] SCN4M_SUBM, +[FreePDK45], and [Sky130]. The [SCMOS] spice models, however, are +generic and should be replaced with foundry models. You may get the +entire [FreePDK45 PDK here][FreePDK45]. # Basic Usage -Once you have defined the environment, you can run OpenRAM from the command line -using a single configuration file written in Python. +Once you have defined the environment, you can run OpenRAM from the command line +using a single configuration file written in Python. For example, create a file called *myconfig.py* specifying the following parameters for your memory: @@ -119,7 +114,7 @@ $OPENRAM\_HOME/options.py # Unit Tests Regression testing performs a number of tests for all modules in OpenRAM. -From the unit test directory ($OPENRAM\_HOME/tests), +From the unit test directory ($OPENRAM\_HOME/tests), use the following command to run all regression tests: ``` @@ -127,16 +122,16 @@ use the following command to run all regression tests: ``` To run a specific test: ``` - python3 {unit test}.py + python3 {unit test}.py ``` -The unit tests take the same arguments as openram.py itself. +The unit tests take the same arguments as openram.py itself. To increase the verbosity of the test, add one (or more) -v options: ``` python3 tests/00_code_format_check_test.py -v -t freepdk45 ``` To specify a particular technology use "-t " such as -"-t freepdk45". The default for a unit test is scn4m_subm. +"-t freepdk45". The default for a unit test is scn4m_subm. The default for openram.py is specified in the configuration file. @@ -144,7 +139,7 @@ The default for openram.py is specified in the configuration file. If you want to support a new technology, you will need to create: + a setup script for each technology you want to use -+ a technology directory for each technology with the base cells ++ a technology directory for each technology with the base cells We provide two technology examples for [SCMOS] and [FreePDK45]. Each specific technology (e.g., [FreePDK45]) should be a subdirectory @@ -154,10 +149,10 @@ specific technology (e.g., [FreePDK45]) should be a subdirectory * sense_amp.gds * write_driver.gds * cell_1rw.gds - * replica\_cell\_1rw.gds - * dummy\_cell\_1rw.gds + * replica\_cell\_1rw.gds + * dummy\_cell\_1rw.gds * sp_lib folder with all the .sp (premade) library netlists for the above cells. -* layers.map +* layers.map * A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with: * References in tech.py to spice models * DRC/LVS rules needed for dynamic cells and routing @@ -169,7 +164,7 @@ specific technology (e.g., [FreePDK45]) should be a subdirectory + Report bugs by submitting [Github issues]. + Develop new features (see [how to contribute](./CONTRIBUTING.md)) -+ Submit code/fixes using a [Github pull request] ++ Submit code/fixes using a [Github pull request] + Follow our [project][Github project]. + Read and cite our [ICCAD paper][OpenRAMpaper] @@ -181,7 +176,7 @@ specific technology (e.g., [FreePDK45]) should be a subdirectory + [OpenRAM Users Group][user-group] ([subscribe here][user-group-subscribe]) + [OpenRAM Developers Group][dev-group] ([subscribe here][dev-group-subscribe]) -# License +# License OpenRAM is licensed under the [BSD 3-clause License](./LICENSE). @@ -203,7 +198,7 @@ If I forgot to add you, please let me know! [Github issues]: https://github.com/VLSIDA/OpenRAM/issues [Github pull request]: https://github.com/VLSIDA/OpenRAM/pulls -[Github project]: https://github.com/VLSIDA/OpenRAM +[Github project]: https://github.com/VLSIDA/OpenRAM [documentation]: https://docs.google.com/presentation/d/10InGB33N51I6oBHnqpU7_w9DXlx-qe9zdrlco2Yc5co/edit?usp=sharing [dev-group]: mailto:openram-dev-group@ucsc.edu @@ -218,8 +213,8 @@ If I forgot to add you, please let me know! [Xyce]: http://xyce.sandia.gov/ [Git]: https://git-scm.com/ -[OSUPDK]: https://vlsiarch.ecen.okstate.edu/flow/ [FreePDK45]: https://www.eda.ncsu.edu/wiki/FreePDK45:Contents [SCMOS]: https://www.mosis.com/files/scmos/scmos.pdf +[Sky130]: https://github.com/google/skywater-pdk-libs-sky130_fd_bd_sram.git [Slack]: https://join.slack.com/t/openram/shared_invite/enQtNDgxMjc3NzU5NTI1LWZiYWMwNjNkZThmYTdkODc3NDE1NDhjNzUxNDhmMDQ4ZTM3NDgwNWFlNjM5NWFiZDkyMzBlNzc1NTg3ZjllNTY diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..34b25ff9 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,47 @@ +# Docker images for OpenRAM # + +## Installing Docker ## + +There are a number of ways to install Docker. Pick your favorite. + +* On Mac from docker.com with .app: + https://docs.docker.com/docker-for-mac/install/ + +* On Windows from docker.com: + https://docs.docker.com/docker-for-windows/install/ + +* On Ubuntu: + https://docs.docker.com/install/linux/docker-ce/ubuntu/ + +NOTE: If you plan to use a VPN, do *NOT* use the Docker Toolbox for +Mac or the docker from [Macports](https://www.macports.org/ +"Macports") as these require a network socket that breaks when you +install some VPN software. To understand the difference, check out [this +page](https://docs.docker.com/docker-for-mac/docker-toolbox/). + +## Running Docker ## + +### Terminal only ### + +* To run as a generic user: +``` +make mount +``` + +## Updating the image ## + +If there are updates to the image, you can pull a new one from the hub with: +``` +make pull +``` +This is not automatically done, so if you have a problem, make sure you are up-to-date. + +## Building your own image ## + +You can run the build script to build a local image: + +``` +make build +``` + +If you want to change things, modify the openram-ubuntu/Dockerfile and let me know what should be fixed. From edf3a701e414d7fd706c5eddd10891588869550b Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 16 Nov 2021 14:33:35 -0800 Subject: [PATCH 14/20] Update options for arguments and readme. --- PORTING.md | 24 +++++++++++++ README.md | 51 +++++++++++---------------- compiler/tests/Makefile | 76 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 31 deletions(-) create mode 100644 PORTING.md create mode 100644 compiler/tests/Makefile diff --git a/PORTING.md b/PORTING.md new file mode 100644 index 00000000..e98871e9 --- /dev/null +++ b/PORTING.md @@ -0,0 +1,24 @@ +# Porting to a New Technology + +If you want to support a new technology, you will need to create: ++ a setup script for each technology you want to use ++ a technology directory for each technology with the base cells + +We provide two technology examples for [SCMOS] and [FreePDK45]. Each +specific technology (e.g., [FreePDK45]) should be a subdirectory +(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files: +* gds_lib folder with all the .gds (premade) library cells: + * dff.gds + * sense_amp.gds + * write_driver.gds + * cell_1rw.gds + * replica\_cell\_1rw.gds + * dummy\_cell\_1rw.gds +* sp_lib folder with all the .sp (premade) library netlists for the above cells. +* layers.map +* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with: + * References in tech.py to spice models + * DRC/LVS rules needed for dynamic cells and routing + * Layer information + * Spice and supply information + * etc. diff --git a/README.md b/README.md index 7dafe0d1..28c62a58 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,11 @@ We include the tech files necessary for [SCMOS] SCN4M_SUBM, generic and should be replaced with foundry models. You may get the entire [FreePDK45 PDK here][FreePDK45]. +To install [Sky130], simply run: +``` +make install +``` + # Basic Usage Once you have defined the environment, you can run OpenRAM from the command line @@ -111,6 +116,12 @@ python3 $OPENRAM_HOME/openram.py myconfig You can see all of the options for the configuration file in $OPENRAM\_HOME/options.py +To run designs in Docker, it is suggested to use, for example: +``` +cd openram/macros +make example_config_scn4m_subm +``` + # Unit Tests Regression testing performs a number of tests for all modules in OpenRAM. @@ -118,50 +129,28 @@ From the unit test directory ($OPENRAM\_HOME/tests), use the following command to run all regression tests: ``` - python3 regress.py +cd openram/compiler/tests +make regress ``` + To run a specific test: ``` - python3 {unit test}.py +ce openram/compiler/tests +make 05_bitcell_array_test ``` -The unit tests take the same arguments as openram.py itself. -To increase the verbosity of the test, add one (or more) -v options: +To increase the verbosity of the test, add one (or more) -v options and +pass it as an argument to OpenRAM: ``` - python3 tests/00_code_format_check_test.py -v -t freepdk45 +make 05_bitcell_array_test ARGS="-v -t scn4m_subm" ``` To specify a particular technology use "-t " such as "-t freepdk45". The default for a unit test is scn4m_subm. The default for openram.py is specified in the configuration file. - -# Porting to a New Technology - -If you want to support a new technology, you will need to create: -+ a setup script for each technology you want to use -+ a technology directory for each technology with the base cells - -We provide two technology examples for [SCMOS] and [FreePDK45]. Each -specific technology (e.g., [FreePDK45]) should be a subdirectory -(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files: -* gds_lib folder with all the .gds (premade) library cells: - * dff.gds - * sense_amp.gds - * write_driver.gds - * cell_1rw.gds - * replica\_cell\_1rw.gds - * dummy\_cell\_1rw.gds -* sp_lib folder with all the .sp (premade) library netlists for the above cells. -* layers.map -* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with: - * References in tech.py to spice models - * DRC/LVS rules needed for dynamic cells and routing - * Layer information - * Spice and supply information - * etc. - # Get Involved ++ [Port it](./PORTING.md) to a new technology. + Report bugs by submitting [Github issues]. + Develop new features (see [how to contribute](./CONTRIBUTING.md)) + Submit code/fixes using a [Github pull request] diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile new file mode 100644 index 00000000..460b7fcc --- /dev/null +++ b/compiler/tests/Makefile @@ -0,0 +1,76 @@ +TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..) +include $(TOP_DIR)/openram.mk + +.DEFAULT_GOAL := regress + +ARGS ?= "" + +TEST_DIR = $(TOP_DIR)/compiler/tests +TEST_SRCS=$(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) +TEST_DIRS=$(basename $(TEST_SRCS)) +TEST_STAMPS=$(addsuffix .ok,$(TEST_DIRS)) + +TEST_BROKEN := \ + 50_riscv_1k_1rw1r_func_test.py \ + 50_riscv_1k_1rw_func_test.py \ + 50_riscv_1rw1r_func_test.py \ + 50_riscv_1rw1r_phys_test.py \ + 50_riscv_1rw_func_test.py \ + 50_riscv_1rw_phys_test.py \ + 50_riscv_2k_1rw1r_func_test.py \ + 50_riscv_2k_1rw_func_test.py \ + 50_riscv_4k_1rw1r_func_test.py \ + 50_riscv_4k_1rw_func_test.py \ + 50_riscv_512b_1rw1r_func_test.py \ + 50_riscv_512b_1rw_func_test.py \ + 50_riscv_8k_1rw1r_func_test.py \ + 50_riscv_8k_1rw_func_test.py + + +WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS)) + +$(TEST_DIRS): + @$(MAKE) --no-print-directory $@.ok + +tests: + @echo "Running the following tests" + @for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done + @sleep 5 + @$(MAKE) $(WORKING_TEST_STAMPS) +.PHONY: + +%.ok: %.py + @echo "Running $*" + @mkdir -p $(TOP_DIR)/compiler/tests/results/$* + @docker run -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + -e OPENRAM_TMP=/openram/compiler/tests/results/$* \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest \ + python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@ + +.DELETE_ON_ERROR: $(TEST_STAMPS) + +TECHS := scn4m_subm freepdk45 +#sky130 + +$(TECHS): + @docker run -v $(TOP_DIR):/openram \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + --user $(UID):$(GID) \ + -e OPENRAM_TMP=/openram/compiler/tests/tmp_$@/$* \ + vlsida/openram-ubuntu:latest \ + sh -c "python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" +.PHONY: $(TECHS) + +regress: $(TECHS) +.PHONY: regress + +clean: + @rm -rf $(TEST_STAMPS) + @rm -rf $(TEST_DIRS) +.PHONE: clean From f764ac446c509679c63a205bfbbb1eacae59dffc Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 17 Nov 2021 13:19:23 -0800 Subject: [PATCH 15/20] Use Caravel-like sky130 install path with ngspice models. --- macros/Makefile | 2 +- technology/sky130/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/macros/Makefile b/macros/Makefile index 2014cb96..5da8d7ef 100644 --- a/macros/Makefile +++ b/macros/Makefile @@ -4,7 +4,7 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := all -SKY130_PDK ?= $(PDK_ROOT)/share/pdk/sky130A +SKY130_PDK ?= $(PDK_ROOT)/sky130A OPENRAM_OPTS := $(OPENRAM_OPTS) # Define `OPENRAM_FULL` in your environment to run a full characterize diff --git a/technology/sky130/__init__.py b/technology/sky130/__init__.py index 3df3f555..409f0032 100644 --- a/technology/sky130/__init__.py +++ b/technology/sky130/__init__.py @@ -25,9 +25,9 @@ if 'PDK_ROOT' in os.environ: else: raise SystemError("Unable to find open_pdks tech file. Set PDK_ROOT.") -spice_model_dir = os.path.join(open_pdks, "SIMULATOR",) +# The ngspice models work with Xyce too now +spice_model_dir = os.path.join(open_pdks, "ngspice") sky130_lib_ngspice = os.path.join(open_pdks, "ngspice", "sky130.lib.spice") -# We may end up using Xyce but check if at least ngspice exists if not os.path.exists(sky130_lib_ngspice): raise SystemError("Did not find {} under {}".format(sky130_lib_ngspice, open_pdks)) os.environ["SPICE_MODEL_DIR"] = spice_model_dir From 014bca919955b1adffa43c5b31576cf50bf00c8d Mon Sep 17 00:00:00 2001 From: mrg Date: Wed, 29 Dec 2021 14:41:55 -0800 Subject: [PATCH 16/20] Update Makefile with some pdk checks --- Makefile | 59 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index f13aadca..aa03a24a 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,11 @@ OPEN_PDKS_GIT_REPO ?= https://github.com/RTimothyEdwards/open_pdks.git OPEN_PDKS_GIT_COMMIT ?= 1.0.156 SKY130_PDK ?= $(PDK_ROOT)/sky130A +# Skywater PDK +SKY130_PDKS_DIR ?= $(PDK_ROOT)/skywater-pdk +SKY130_PDKS_GIT_REPO ?= https://github.com/google/skywater-pdk.git +SKY130_PDKS_GIT_COMMIT ?= main + # Create lists of all the files to copy/link GDS_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.gds)) MAG_FILES := $(sort $(wildcard $(SRAM_LIB_DIR)/cells/*/*.mag)) @@ -39,35 +44,52 @@ INSTALL_BASE_DIRS := gds_lib mag_lib sp_lib lvs_lib calibre_lvs_lib maglef_lib INSTALL_BASE := $(OPENRAM_HOME)/../technology/sky130 INSTALL_DIRS := $(addprefix $(INSTALL_BASE)/,$(INSTALL_BASE_DIRS)) -$(OPEN_PDKS_DIR): +check-pdk-root: +ifndef PDK_ROOT + $(error PDK_ROOT is undefined, please export it before running make) +endif + +$(SKY130_PDKS_DIR): check-pdk-root + git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk + cd $(SKY130_PDKS_DIR) && \ + git checkout main && git pull && \ + git checkout -qf $(SKY130_PDKS_GIT_COMMIT) && \ + git submodule update --init libraries/sky130_fd_pr/latest + +$(OPEN_PDKS_DIR): $(SKY130_PDKS_DIR) @echo "Cloning open_pdks..." git clone $(OPEN_PDKS_GIT_REPO) $(OPEN_PDKS_DIR) cd $(OPEN_PDKS_DIR) && git checkout $(OPEN_PDKS_GIT_COMMIT) $(SKY130_PDK): $(OPEN_PDKS_DIR) @echo "Installing open_pdks..." - cd $(OPEN_PDKS_DIR) &&\ - ./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries \ - --disable-openlane --disable-irsim --disable-xschem --disable-qflow &&\ + cd $(OPEN_PDKS_DIR) && \ + ./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) --enable-sram-sky130=$(INSTALL_SRAM) && \ cd sky130 && \ make veryclean && \ make && \ make SHARED_PDKS_PATH=$(PDK_ROOT) install -install: $(SRAM_LIB_DIR) $(SKY130_PDK) $(INSTALL_DIRS) +$(SRAM_LIB_DIR): check-pdk-root + @[ -d $(SRAM_LIB_DIR) ] || (\ + echo "Cloning SRAM library..." && git clone $(SRAM_LIB_GIT_REPO) $(SRAM_LIB_DIR) && \ + cd $(SRAM_LIB_DIR) && git checkout $(SRAM_LIB_GIT_COMMIT)) + +install: $(SRAM_LIB_DIR) + @[ -d $(PDK_ROOT)/sky130A ] || \ + (echo "Warning: $(PDK_ROOT)/sky130A not found!! Run make pdk first." && false) + @[ -d $(PDK_ROOT)/skywater-pdk ] || \ + (echo "Warning: $(PDK_ROOT)/skywater-pdk not found!! Run make pdk first." && false) @echo "Installing sky130 SRAM PDK..." @echo "PDK_ROOT='$(PDK_ROOT)'" @echo "SRAM_LIB_DIR='$(SRAM_LIB_DIR)'" @echo "SKY130_PDK='$(SKY130_PDK)'" - @true + @make $(INSTALL_DIRS) .PHONY: install -$(SRAM_LIB_DIR): - @echo "Cloning SRAM library..." - git clone $(SRAM_LIB_GIT_REPO) $(SRAM_LIB_DIR) - cd $(SRAM_LIB_DIR) && git checkout $(SRAM_LIB_GIT_COMMIT) - -.PHONY: $(INSTALL_DIRS) +pdk: $(SKY130_PDK) + @true +.PHONY: pdk $(INSTALL_BASE)/gds_lib: $(GDS_FILES) @echo @@ -171,9 +193,14 @@ uninstall: clean # wipe the entire repos wipe: uninstall - @echo "Wiping PDK repos in 5 sec... (ctrl-c to quit)" + @echo $(SKY130_PDK) + @echo $(SRAM_LIB_DIR) + @echo $(OPEN_PDKS_DIR) + @echo $(SKY130_PDKS_DIR) + @echo "Wiping above PDK repos in 5 sec... (ctrl-c to quit)" @sleep 5 - rm -rf $(SKY130_PDK) - rm -rf $(SRAM_LIB_DIR) - rm -rf $(OPEN_PDKS_DIR) + @rm -rf $(SKY130_PDK) + @rm -rf $(SRAM_LIB_DIR) + @rm -rf $(OPEN_PDKS_DIR) + @rm -rf $(SKY130_PDKS_DIR) .PHONY: wipe From e90ea4e737ed19be68f88080328c7268788f9172 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 13 Jan 2022 14:38:59 -0800 Subject: [PATCH 17/20] Remove label Q_bar from replica_cell_1rw due to Magic port bug --- .../scn4m_subm/gds_lib/replica_cell_1rw.gds | Bin 5948 -> 5906 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/technology/scn4m_subm/gds_lib/replica_cell_1rw.gds b/technology/scn4m_subm/gds_lib/replica_cell_1rw.gds index 7eee11792aa3f83da7b1176d744c52959d873781..53525453da5d3e71b9bc506b7936044fb6beeffb 100644 GIT binary patch delta 75 zcmdm^H%U*4fsKKQDS|HiHPtE{$OAb UeZasa$rc!&lvuRcQRE^M0Ll#!p#T5? From aeb9594877d16a2a5dc002fe3c9f553b0c7296b4 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 13 Jan 2022 14:39:34 -0800 Subject: [PATCH 18/20] Do not extract bb (bounding box) layer in SCN4M_SUBM tech file --- technology/scn4m_subm/tech/SCN4M_SUBM.20.tech | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/technology/scn4m_subm/tech/SCN4M_SUBM.20.tech b/technology/scn4m_subm/tech/SCN4M_SUBM.20.tech index 7207f681..3d83bb96 100644 --- a/technology/scn4m_subm/tech/SCN4M_SUBM.20.tech +++ b/technology/scn4m_subm/tech/SCN4M_SUBM.20.tech @@ -333,7 +333,7 @@ style lambda=0.20(p) templayer TCSB nwsd,nwsc grow 40 and-not TNWR - + layer CSB nwsd,nwsc,nwr grow 140 and-not TCSB @@ -375,7 +375,7 @@ style lambda=0.20(p) bloat-or pdiff,apres,rpd,pdc/a * 40 nsd,nsc/a 0 or TPS -#final pselect +#final pselect templayer FSP bloat-or pdiff,apres,rpd,pfet,psd,pdc/a,psc/a,pfet * 40 ndiff,anres,rnd,ndc/a,nsd,nsc/a,nfet 0 or XDP @@ -772,7 +772,7 @@ style lambda=0.20(cp) templayer TCSB nwsd,nwsc grow 40 and-not TNWR - + layer CSB nwsd,nwsc,nwr grow 140 and-not TCSB @@ -814,7 +814,7 @@ style lambda=0.20(cp) bloat-or pdiff,apres,rpd,pdc/a * 40 nsd,nsc/a 0 or TPS -#final pselect +#final pselect templayer FSP bloat-or pdiff,apres,rpd,pfet,psd,pdc/a,psc/a,pfet * 40 ndiff,anres,rnd,ndc/a,nsd,nsc/a,nfet 0 or XDP @@ -1119,7 +1119,7 @@ style lambda=0.20(c) templayer TCSB nwsd,nwsc grow 40 and-not TNWR - + layer CSB nwsd,nwsc,nwr grow 140 and-not TCSB @@ -1151,7 +1151,7 @@ style lambda=0.20(c) bloat-or pdiff,apres,rpd,pdc/a * 40 nsd,nsc/a 0 or TPS -#final pselect +#final pselect templayer FSP bloat-or pdiff,apres,rpd,pfet,psd,pdc/a,psc/a,pfet * 40 ndiff,anres,rnd,ndc/a,nsd,nsc/a,nfet 0 or XDP @@ -1456,7 +1456,7 @@ style lambda=0.20() templayer TCSB nwsd,nwsc grow 40 and-not TNWR - + layer CSB nwsd,nwsc,nwr grow 140 and-not TCSB @@ -1488,7 +1488,7 @@ style lambda=0.20() bloat-or pdiff,apres,rpd,pdc/a * 40 nsd,nsc/a 0 or TPS -#final pselect +#final pselect templayer FSP bloat-or pdiff,apres,rpd,pfet,psd,pdc/a,psc/a,pfet * 40 ndiff,anres,rnd,ndc/a,nsd,nsc/a,nfet 0 or XDP @@ -6471,7 +6471,7 @@ end mzrouter style irouter -# layer hCost vCost jogCost hintCost +# layer hCost vCost jogCost hintCost layer metal4 2 1 2 1 layer metal3 1 2 2 1 layer metal2 2 1 2 1 @@ -6944,7 +6944,7 @@ drc "Silicide-Block overlap of Silicide-Block polyR/activeR < 2 (Mosis #20.15)" edge4way sb,pres,anres,apres diff,ndiff,rnd,nfet,nsd,nwsd,pdiff,rpd,pfet,psd,ndc/a,nsc/a,nwsc/a,pdc/a,psc/a 3 diff,ndiff,rnd,nfet,nsd,nwsd,pdiff,rpd,pfet,psd,ndc/a,nsc/a,nwsc/a,pdc/a,psc/a 0 0 \ - "Diffusion overhang of Silicide-Block < 3 (Mosis #20.17) + "Diffusion overhang of Silicide-Block < 3 (Mosis #20.17) spacing gv3 gv3 3 touching_ok \ "GV3 via spacing < 3 (Mosis #21.2)" @@ -7145,7 +7145,7 @@ drc spacing m4p m4p 4 touching_ok \ "Metal4 PIN spacing < 4 (do_pins)" -#CC cifstyle lambda=0.20(p) +#CC cifstyle lambda=0.20(p) #CC cifwidth CWN 240 \ #CC "generated CIF layer CWN width will be < 12 (';cif see CWN')" #CC cifspacing CWN CWN 120 touching_ok \ @@ -7223,6 +7223,7 @@ extract resist (m2,fm2,rm2,m2c,m3c,m3c)/metal2 70 resist (m3,fm3,rm3,m3c,m4c,m4c)/metal3 80 resist (m4,fm4,rm4,m4c,pad)/metal4 40 + resist bb None contact ndc 4 4100 contact pdc 4 3400 @@ -7288,25 +7289,25 @@ extract sideoverlap (m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 ~space/w 2.226 ~space/a #rnw - overlap (m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 rnw,nwr/active 1.666 - sideoverlap (m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 rnw,nwr/active 2.226 + overlap (m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 rnw,nwr/active 1.666 + sideoverlap (m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,pdc,pc,m2c)/metal1 rnw,nwr/active 2.226 -#metal1-diff blocked by - overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (ndiff,anres,rnd,ndc)/active 1.640 - sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (ndiff,anres,rnd,ndc)/active 2.226 - overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (pdiff,apres,rpd,pdc)/active 1.640 - sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (pdiff,apres,rpd,pdc)/active 2.226 +#metal1-diff blocked by + overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (ndiff,anres,rnd,ndc)/active 1.640 + sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (ndiff,anres,rnd,ndc)/active 2.226 + overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (pdiff,apres,rpd,pdc)/active 1.640 + sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (pdiff,apres,rpd,pdc)/active 2.226 -#metal1-poly blocked by - overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (poly,fp,pres,rp,pc,nfet,pfet,fet)/active 1.687 - sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (poly,fp,pres,rp,pc,nfet,pfet,fet)/active 2.250 - sideoverlap (poly,fp,pres,rp,pc,nfet,pfet,fet)/active ~(poly,fp,pres,rp,pc,nfet,pfet,fet)/active (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 2.250 +#metal1-poly blocked by + overlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (poly,fp,pres,rp,pc,nfet,pfet,fet)/active 1.687 + sideoverlap (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 ~(m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 (poly,fp,pres,rp,pc,nfet,pfet,fet)/active 2.250 + sideoverlap (poly,fp,pres,rp,pc,nfet,pfet,fet)/active ~(poly,fp,pres,rp,pc,nfet,pfet,fet)/active (m1,fm1,rm1,ndc,nsc,nwsc,pdc,psc,pc,m2c)/metal1 2.250 #metal2 sidewall (m2,fm2,rm2,m2c,m3c)/metal2 ~(m2,fm2,rm2,m2c,m3c)/metal2 ~(m2,fm2,rm2,m2c,m3c)/metal2 (m2,fm2,rm2,m2c,m3c)/metal2 23.532 areacap (m2,fm2,rm2,m3c)/metal2 0.581 -#metal2-sub blocked by +#metal2-sub blocked by overlap (m2,fm2,rm2,m3c)/metal2 ~space/w 0.581 ~space/a,~space/m1 perimc (m2,fm2,rm2,m2c,m3c)/metal2 ~(m2,fm2,rm2,m2c,m3c)/metal2 0.836 sideoverlap (m2,fm2,rm2,m2c,m3c)/metal2 ~(m2,fm2,rm2,m2c,m3c)/metal2 ~space/w 0.836 ~space/a,~space/m1 @@ -7732,4 +7733,3 @@ style gremlin pc/a,ndc/a,pdc/a,psc/a,nsc/a,nwsc/a,gc,gc,gc,gv1 X end - From 663d57447aa1664773c6bfcd8e6f44f1b0d8fec4 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 13 Jan 2022 14:40:52 -0800 Subject: [PATCH 19/20] Update to newer Magic version --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d117456d..e36140e6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,7 +34,7 @@ RUN ./build.sh -qt5 \ RUN rm -rf /root/klayout ### Magic ### -ARG MAGIC_COMMIT=8.3.197 +ARG MAGIC_COMMIT=8.3.254 WORKDIR /root RUN git clone git://opencircuitdesign.com/magic-8.3 magic WORKDIR /root/magic From 06d391b3e365127628434b98044035232615f4b0 Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 13 Jan 2022 14:41:24 -0800 Subject: [PATCH 20/20] Keep files during runs in Makefile --- compiler/tests/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 460b7fcc..0e378d39 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -3,7 +3,7 @@ include $(TOP_DIR)/openram.mk .DEFAULT_GOAL := regress -ARGS ?= "" +ARGS ?= "-k" TEST_DIR = $(TOP_DIR)/compiler/tests TEST_SRCS=$(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py)))