From d8dd010755f58e565e9fa460e4a7569d91821a42 Mon Sep 17 00:00:00 2001 From: manarabdelaty Date: Apr 30 2021 06:40:52 +0000 Subject: Makefile updates - added target for running help - added target for building the pdk with OL docker to avoid having magic installed --- diff --git a/Makefile b/Makefile index e180deb..3e6c335 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ # SPDX-License-Identifier: Apache-2.0 CARAVEL_ROOT?=$(PWD)/caravel -PRECHECK_ROOT?=${HOME}/precheck +PRECHECK_ROOT?=${HOME}/open_mpw_precheck SIM ?= RTL # Install lite version of caravel, (1): caravel-lite, (0): caravel @@ -56,7 +56,7 @@ DV_PATTERNS = $(foreach dv, $(PATTERNS), verify-$(dv)) TARGET_PATH=$(shell pwd) PDK_PATH=${PDK_ROOT}/sky130A VERIFY_COMMAND="cd ${TARGET_PATH}/verilog/dv/$* && export SIM=${SIM} && make" -$(DV_PATTERNS): verify-% : +$(DV_PATTERNS): verify-% : ./verilog/dv/% docker run -v ${TARGET_PATH}:${TARGET_PATH} -v ${PDK_PATH}:${PDK_PATH} \ -v ${CARAVEL_ROOT}:${CARAVEL_ROOT} \ -e TARGET_PATH=${TARGET_PATH} -e PDK_PATH=${PDK_PATH} \ @@ -145,7 +145,12 @@ run-precheck: check-precheck check-pdk check-caravel $(eval TARGET_PATH := $(shell pwd)) cd $(PRECHECK_ROOT) && \ docker run -v $(PRECHECK_ROOT):/usr/local/bin -v $(TARGET_PATH):$(TARGET_PATH) -v $(PDK_ROOT):$(PDK_ROOT) -v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \ - -u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py --pdk_root $(PDK_ROOT) --target_path $(TARGET_PATH) -c $(CARAVEL_ROOT)" + -u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py --pdk_root $(PDK_ROOT) --target_path $(TARGET_PATH) -rfc -c $(CARAVEL_ROOT) " + +# Install PDK using OL's Docker Image +.PHONY: pdk-nonnative +pdk-nonnative: skywater-pdk skywater-library skywater-timing open_pdks + docker run --rm -v $(PDK_ROOT):$(PDK_ROOT) -v $(pwd):/user_project -v $(CARAVEL_ROOT):$(CARAVEL_ROOT) -e CARAVEL_ROOT=$(CARAVEL_ROOT) -e PDK_ROOT=$(PDK_ROOT) -u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/openlane:current sh -c "cd $(CARAVEL_ROOT); make build-pdk; make gen-sources" # Clean .PHONY: clean @@ -169,4 +174,9 @@ check-pdk: @if [ ! -d "$(PDK_ROOT)" ]; then \ echo "PDK Root: "$(PDK_ROOT)" doesn't exists, please export the correct path before running make. "; \ exit 1; \ - fi \ No newline at end of file + fi + +.PHONY: help +help: + cd $(CARAVEL_ROOT) && $(MAKE) help + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' diff --git a/docs/source/index.rst b/docs/source/index.rst index 6a1f564..6e024e7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -50,6 +50,11 @@ utilities like IO pads, logic analyzer probes, and wishbone port. The repo also demonstrates the recommended structure for the open-mpw shuttle projects. +Prerequisites +============= + +- Docker + Install Caravel =============== @@ -147,18 +152,27 @@ for more information.

-Running Full Chip Simulation -============================ +Building the PDK +================ -First, you will need to install the simulation environment, by +You have two options for building the pdk: + +- Build the pdk natively. + +Make sure you have `Magic VLSI Layout Tool `__ installed on your machine before building the pdk. .. code:: bash - make simenv + # set PDK_ROOT to the path you wish to use for the pdk + export PDK_ROOT= -This will pull a docker image with the needed tools installed. + # you can optionally specify skywater-pdk and open-pdks commit used + # by setting and exporting SKYWATER_COMMIT and OPEN_PDKS_COMMIT + # if you do not set them, they default to the last verfied commits tested for this project -Then, you will need to build the pdk to obtain the verilog views. + make pdk + +- Build the pdk using openlane's docker image which has magic installed. .. code:: bash @@ -169,7 +183,18 @@ Then, you will need to build the pdk to obtain the verilog views. # by setting and exporting SKYWATER_COMMIT and OPEN_PDKS_COMMIT # if you do not set them, they default to the last verfied commits tested for this project - make pdk + make pdk-nonnative + +Running Full Chip Simulation +============================ + +First, you will need to install the simulation environment, by + +.. code:: bash + + make simenv + +This will pull a docker image with the needed tools installed. Then, run the RTL and GL simulation by @@ -190,20 +215,7 @@ project, refer to `README `__. Hardening the User Project Macro using Openlane =============================================== -First, you will need to install the pdk by - -.. code:: bash - - # set PDK_ROOT to the path you wish to use for the pdk - export PDK_ROOT= - - # you can optionally specify skywater-pdk and open-pdks commit used - # by setting and exporting SKYWATER_COMMIT and OPEN_PDKS_COMMIT - # if you do not set them, they default to the last verfied commits tested for this project - - make pdk - -Then, you will need to install openlane by +You will need to install openlane by running the following .. code:: bash @@ -248,7 +260,6 @@ To reproduce hardening this project, run the following: make user_project_wrapper - Running Open-MPW Precheck Locally ================================= @@ -264,9 +275,12 @@ This will clone the precheck repo and pull the latest precheck docker image. Then, you can run the precheck by running +Specify CARAVEL_ROOT before running any of the following, .. code:: bash + # export CARAVEL_ROOT=$(pwd)/caravel + export CARAVEL_ROOT= make run-precheck This will run all the precheck checks on your project and will produce the logs under the ``checks`` directory. @@ -282,7 +296,8 @@ Run ```make help`` to display available targets. Specify CARAVEL_ROOT before running any of the following, .. code:: bash - + + # export CARAVEL_ROOT=$(pwd)/caravel export CARAVEL_ROOT= Run lvs on spice,