This is a squashed commit with the following changes:
- overwrite and update openlane, magic for pdk build and the pdk commit
ids
- update tags to 5c
- update the views of user project example and user project wrapper
- add 'setup' targets that runs the following targets; install install_mcw pdk openlane
- add 'dv-*-rtl' 'dv-*-gl' 'dv-*-sdf' seperating the dv simulations into
three targets
- add 'clean-*' for openlane blocks, which removes spef, def, gds...
- warn before deleting caravel upon rerunning install
- rename some variables inside the makefile (non functional change)
Squashed commit of the following:
commit ab9e5c1b77dd357c5514db37ff08ce2a399504ff
Merge: 0d9a413 9576383
Author: kareem <kareem.farid@efabless.com>
Date: Fri Feb 25 10:11:56 2022 -0800
Merge branch 'main' into makefile
commit 0d9a413e68d6ea7c393bc3db39dacb9ef885036b
Merge: aed8908 9545e45
Author: Marwan Abbas <marwan@ciic.c.catx-ext-efabless.internal>
Date: Thu Feb 24 14:23:49 2022 -0800
Merge branch 'makefile' of github.com:kareefardi/caravel_user_project into makefile
commit aed89086291632e36160a42aa0301cec3bffc4fc
Author: Marwan Abbas <marwan@ciic.c.catx-ext-efabless.internal>
Date: Thu Feb 24 14:23:06 2022 -0800
new OL runs
commit 9545e45223864da95a7945ba8024a2e6ac264400
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 24 14:11:07 2022 -0800
typo
commit 9593a1878c864d30476f6c3fb467efdb3ebb71d6
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 24 11:42:47 2022 -0800
fix folder not found check
commit 65fa1a2d9776a7c73dc246b555fdb64bb49847dd
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 24 10:51:39 2022 -0800
- update tags for caravel and caravel lite
- make install PHONY
commit 81f20739671af1ad26d14f3c81c39ae73fc865a6
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 24 05:09:33 2022 -0800
overwrite openpdks, magic and openlane commit ids
commit 1f8c07d2e1f6fdce723d9b567df7a8f2bc471e47
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 24 03:54:33 2022 -0800
- rename verify-all to verfiy
- add a sort of help target that lists other targets
- rm -rf instead of rm in clean to prevent failure if the deleted file
is note found
commit 958119ef2774e357f8e277cccf02861ba8bd462a
Merge: fdcd57e e07f662
Author: kareem <kareem.farid@efabless.com>
Date: Wed Feb 23 12:40:31 2022 -0800
Merge remote-tracking branch 'origin/dv-documentation-update' into makefile
commit fdcd57ea4c8351d7ea180cb9db158f11979a204d
Merge: a881030 0f93045
Author: kareem <kareem.farid@efabless.com>
Date: Wed Feb 23 12:37:04 2022 -0800
Merge remote-tracking branch 'origin/litex_integration_GL' into makefile
commit a881030267812b2928d56dce0b6cb421705b5d2d
Author: kareem <kareem.farid@efabless.com>
Date: Wed Feb 23 03:19:37 2022 -0800
derp
commit 17c181a89a54925bd6d81f3ab5e8bc0b21efbe7c
Author: kareem <kareem.farid@efabless.com>
Date: Wed Feb 23 03:07:17 2022 -0800
more changes
commit 3ef14130d29d8a8941c327115bb22efd3b79e897
Author: kareem <kareem.farid@efabless.com>
Date: Tue Feb 22 13:34:11 2022 -0800
more changes
commit 3922f3cf59cb8ae6b01b49075721030c14f570eb
Author: kareem <kareem.farid@efabless.com>
Date: Tue Feb 22 03:58:33 2022 -0800
more changes
commit 5d40f6feb6e7d66328d9d529898156da995f008b
Author: kareem <kareem.farid@efabless.com>
Date: Sun Feb 20 16:20:51 2022 -0800
more changes
commit c29d1e19394fdbe9314aa7890c929775841fe5b0
Author: kareem <kareem.farid@efabless.com>
Date: Thu Feb 17 11:57:23 2022 -0800
WIP actual usage of make targets
diff --git a/Makefile b/Makefile
index 4482176..f2f3282 100644
--- a/Makefile
+++ b/Makefile
@@ -13,52 +13,68 @@
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
+MAKEFLAGS+=--warn-undefined-variables
CARAVEL_ROOT?=$(PWD)/caravel
PRECHECK_ROOT?=${HOME}/mpw_precheck
MCW_ROOT?=$(PWD)/mgmt_core_wrapper
-SIM ?= RTL
+SIM?=RTL
+
+export SKYWATER_COMMIT=c094b6e83a4f9298e47f696ec5a7fd53535ec5eb
+export OPEN_PDKS_COMMIT=7519dfb04400f224f140749cda44ee7de6f5e095
+export PDK_MAGIC_COMMIT=7d601628e4e05fd17fcb80c3552dacb64e9f6e7b
+export OPENLANE_TAG=2022.02.23_02.50.41
# Install lite version of caravel, (1): caravel-lite, (0): caravel
CARAVEL_LITE?=1
-ifeq ($(CARAVEL_LITE),1)
+ifeq ($(CARAVEL_LITE),1)
CARAVEL_NAME := caravel-lite
- CARAVEL_REPO := https://github.com/efabless/caravel-lite
- CARAVEL_TAG := 'mpw-5b'
+ CARAVEL_REPO := https://github.com/efabless/caravel-lite
+ CARAVEL_TAG := mpw-5c
else
CARAVEL_NAME := caravel
- CARAVEL_REPO := https://github.com/efabless/caravel
- CARAVEL_TAG := 'mpw-5b'
+ CARAVEL_REPO := https://github.com/efabless/caravel
+ CARAVEL_TAG := mpw-5c
endif
-
# Include Caravel Makefile Targets
.PHONY: % : check-caravel
-%:
+%:
export CARAVEL_ROOT=$(CARAVEL_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@
-# Verify Target for running simulations
-.PHONY: verify
-verify:
- cd ./verilog/dv/ && \
- export SIM=${SIM} && \
- $(MAKE) -j$(THREADS)
+.PHONY: install
+install:
+ if [ -d "$(CARAVEL_ROOT)" ]; then\
+ echo "Deleting exisiting $(CARAVEL_ROOT)" && \
+ rm -rf $(CARAVEL_ROOT) && sleep 2;\
+ fi
+ echo "Installing $(CARAVEL_NAME).."
+ git clone -b $(CARAVEL_TAG) $(CARAVEL_REPO) $(CARAVEL_ROOT) --depth=1
# Install DV setup
.PHONY: simenv
simenv:
docker pull efabless/dv_setup:latest
-PATTERNS=$(shell cd verilog/dv && find * -maxdepth 0 -type d)
-DV_PATTERNS = $(foreach dv, $(PATTERNS), verify-$(dv))
+.PHONY: setup
+setup: install check-env install_mcw pdk openlane
+
+# Openlane
+blocks=$(shell cd openlane && find * -maxdepth 0 -type d)
+.PHONY: $(blocks)
+$(blocks):
+ export CARAVEL_ROOT=$(CARAVEL_ROOT) && cd openlane && $(MAKE) $*
+
+dv_patterns=$(shell cd verilog/dv && find * -maxdepth 0 -type d)
+dv-targets-rtl=$(dv_patterns:%=verify-%-rtl)
+dv-targets-gl=$(dv_patterns:%=verify-%-gl)
+dv-targets-gl-sdf=$(dv_patterns:%=verify-%-gl-sdf)
+
TARGET_PATH=$(shell pwd)
-VERIFY_COMMAND="cd ${TARGET_PATH}/verilog/dv/$* && export SIM=${SIM} && make"
-
-.PHONY: dv_all
-dv_all:$(DV_PATTERNS)
-
-$(DV_PATTERNS): verify-% : ./verilog/dv/% check-env simenv
+verify_command="cd ${TARGET_PATH}/verilog/dv/$* && export SIM=${SIM} && make"
+dv_base_dependencies=simenv
+docker_run_verify=\
docker run -v ${TARGET_PATH}:${TARGET_PATH} -v ${PDK_ROOT}:${PDK_ROOT} \
-v ${CARAVEL_ROOT}:${CARAVEL_ROOT} \
-e TARGET_PATH=${TARGET_PATH} -e PDK_ROOT=${PDK_ROOT} \
@@ -69,24 +85,54 @@
-e GCC_PREFIX=riscv32-unknown-elf \
-e MCW_ROOT=$(MCW_ROOT) \
-u $$(id -u $$USER):$$(id -g $$USER) efabless/dv_setup:latest \
- sh -c $(VERIFY_COMMAND)
-
-# Openlane Makefile Targets
-BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d)
-.PHONY: $(BLOCKS)
-$(BLOCKS): %:
- export CARAVEL_ROOT=$(CARAVEL_ROOT) && cd openlane && $(MAKE) $*
+ sh -c $(verify_command)
-# Install caravel
-.PHONY: install
-install:
- @echo "Installing $(CARAVEL_NAME).."
- @git clone -b $(CARAVEL_TAG) $(CARAVEL_REPO) $(CARAVEL_ROOT)
+.PHONY: harden
+harden: $(blocks)
+
+.PHONY: verify
+verify: $(dv-targets)
+
+$(dv-targets-rtl): SIM=RTL
+$(dv-targets-rtl): verify-%-rtl: $(dv_base_dependencies)
+ $(docker_run_verify)
+
+$(dv-targets-gl): SIM=GL
+$(dv-targets-gl): verify-%-gl: $(dv_base_dependencies)
+ $(docker_run_verify)
+
+$(dv-targets-gl-sdf): SIM=GL_SDF
+$(dv-targets-gl-sdf): verify-%-gl-sdf: $(dv_base_dependencies)
+ $(docker_run_verify)
+
+clean-targets=$(blocks:%=clean-%)
+.PHONY: $(clean-targets)
+$(clean-targets): clean-% :
+ rm -f ./verilog/gl/$*.v
+ rm -f ./spef/$*.spef
+ rm -f ./sdc/$*.sdc
+ rm -f ./sdf/$*.sdf
+ rm -f ./gds/$*.gds
+ rm -f ./mag/$*.mag
+ rm -f ./lef/$*.lef
+ rm -f ./maglef/*.maglef
+
+make_what=setup $(blocks) $(dv-targets-rtl) $(dv-targets-gl) $(dv-targets-gl-sdf) $(clean-targets)
+.PHONY: what
+what:
+ # $(make_what)
+
+# Install Openlane
+.PHONY: openlane
+openlane:
+ cd openlane && $(MAKE) openlane
+
+#### Not sure if the targets following are of any use
# Create symbolic links to caravel's main files
.PHONY: simlink
simlink: check-caravel
-### Symbolic links relative path to $CARAVEL_ROOT
+### Symbolic links relative path to $CARAVEL_ROOT
$(eval MAKEFILE_PATH := $(shell realpath --relative-to=openlane $(CARAVEL_ROOT)/openlane/Makefile))
$(eval PIN_CFG_PATH := $(shell realpath --relative-to=openlane/user_project_wrapper $(CARAVEL_ROOT)/openlane/user_project_wrapper_empty/pin_order.cfg))
mkdir -p openlane
@@ -103,13 +149,9 @@
# Uninstall Caravel
.PHONY: uninstall
-uninstall:
+uninstall:
rm -rf $(CARAVEL_ROOT)
-# Install Openlane
-.PHONY: openlane
-openlane:
- cd openlane && $(MAKE) openlane
# Install Pre-check
# Default installs to the user home directory, override by "export PRECHECK_ROOT=<precheck-installation-path>"
@@ -125,12 +167,14 @@
docker run -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) -v $(PDK_ROOT):$(PDK_ROOT) -e INPUT_DIRECTORY=$(INPUT_DIRECTORY) -e PDK_ROOT=$(PDK_ROOT) \
-u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --input_directory $(INPUT_DIRECTORY) --pdk_root $(PDK_ROOT)"
-# Clean
-.PHONY: clean
-clean:
- cd ./verilog/dv/ && \
- $(MAKE) -j$(THREADS) clean
+
+# Clean
+# .PHONY: clean
+# clean:
+# cd ./verilog/dv/ && \
+# $(MAKE) -j$(THREADS) clean
+#
check-caravel:
@if [ ! -d "$(CARAVEL_ROOT)" ]; then \
echo "Caravel Root: "$(CARAVEL_ROOT)" doesn't exists, please export the correct path before running make. "; \
@@ -151,5 +195,8 @@
.PHONY: help
help:
- cd $(CARAVEL_ROOT) && $(MAKE) 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 '^$@$$'
+
+
+