Merge pull request #37 from Manarabdelaty/update_makefile

Update makefile to work with the latest precheck
diff --git a/.github/scripts/precheck/precheckBuild.sh b/.github/scripts/precheck/precheckBuild.sh
index d618190..7754922 100644
--- a/.github/scripts/precheck/precheckBuild.sh
+++ b/.github/scripts/precheck/precheckBuild.sh
@@ -18,16 +18,16 @@
 export SKIP_PDK_BUILD=${1:-0}
 
 export TARGET_PATH=$(pwd)
-git clone https://github.com/efabless/open_mpw_precheck.git
+git clone https://github.com/efabless/mpw_precheck.git
 
-docker pull efabless/open_mpw_precheck:latest
+docker pull efabless/mpw_precheck:latest
 
 
 if [ $SKIP_PDK_BUILD -eq 0 ]; then
     cd $TARGET_PATH/..
     export PDK_ROOT=$(pwd)/precheck_pdks
     mkdir $PDK_ROOT
-    cd $TARGET_PATH/open_mpw_precheck/dependencies
+    cd $TARGET_PATH/mpw_precheck/dependencies
     sh build-pdk.sh
     cd $TARGET_DIR
 
diff --git a/.github/scripts/precheck/run-precheck-drc.sh b/.github/scripts/precheck/run-precheck-drc.sh
index 489b314..b13d0ec 100644
--- a/.github/scripts/precheck/run-precheck-drc.sh
+++ b/.github/scripts/precheck/run-precheck-drc.sh
@@ -17,9 +17,9 @@
 export CARAVEL_ROOT=$(pwd)/caravel
 cd ..
 export PDK_ROOT=$(pwd)/precheck_pdks
-cd $TARGET_PATH/open_mpw_precheck/
+cd $TARGET_PATH/mpw_precheck/
 
-docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT  -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py --drc_only -p $PDK_ROOT -t $TARGET_PATH -c $CARAVEL_ROOT"
+docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $CARAVEL_ROOT:$CARAVEL_ROOT  -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "python3 mpw_precheck.py check magic_drc klayout_offgrid klayout_feol klayout_zeroarea klayout_pin_label_purposes_overlapping_drawing --pdk_root $PDK_ROOT --input_direcoty $TARGET_PATH --caravel_root $CARAVEL_ROOT"
 output=$TARGET_PATH/checks/full_log.log
 
 gzipped_file=$TARGET_PATH/checks/full_log.log.gz
diff --git a/.github/scripts/precheck/run-precheck.sh b/.github/scripts/precheck/run-precheck.sh
index b248a79..e46a175 100644
--- a/.github/scripts/precheck/run-precheck.sh
+++ b/.github/scripts/precheck/run-precheck.sh
@@ -17,9 +17,9 @@
 export CARAVEL_ROOT=$(pwd)/caravel
 cd ..
 export PDK_ROOT=$(pwd)/precheck_pdks
-cd $TARGET_PATH/open_mpw_precheck/
+cd $TARGET_PATH/mpw_precheck/
 
-docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -v $CARAVEL_ROOT:$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py --skip_drc -p $PDK_ROOT -t $TARGET_PATH -c $CARAVEL_ROOT"
+docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -v $CARAVEL_ROOT:$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) efabless/mpw_precheck:latest bash -c "python3 mpw_precheck.py --pdk_root $PDK_ROOT --input_directory $TARGET_PATH --caravel_root $CARAVEL_ROOT"
 output=$TARGET_PATH/checks/full_log.log
 
 gzipped_file=$TARGET_PATH/checks/full_log.log.gz
diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml
index a8d1b17..4723ed5 100644
--- a/.github/workflows/user_project_ci.yml
+++ b/.github/workflows/user_project_ci.yml
@@ -62,7 +62,7 @@
          uses: docker/setup-buildx-action@v1
         
        - name: Install The PDK
-         run:  bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
+         run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
          env: 
           OPENLANE_TAG: v0.12
           
diff --git a/Makefile b/Makefile
index 25a5e72..dc9be17 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@
 # SPDX-License-Identifier: Apache-2.0
 
 CARAVEL_ROOT?=$(PWD)/caravel
-PRECHECK_ROOT?=${HOME}/open_mpw_precheck
+PRECHECK_ROOT?=${HOME}/mpw_precheck
 SIM ?= RTL
 
 # Install lite version of caravel, (1): caravel-lite, (0): caravel
@@ -35,9 +35,9 @@
 SUBMODULE?=1
 
 # Include Caravel Makefile Targets
-.PHONY: %
+.PHONY: % : check-caravel
 %: 
-	$(MAKE) -f $(CARAVEL_ROOT)/Makefile $@
+	export CARAVEL_ROOT=$(CARAVEL_ROOT) && $(MAKE) -f $(CARAVEL_ROOT)/Makefile $@
 
 # Verify Target for running simulations
 .PHONY: verify
@@ -54,12 +54,11 @@
 PATTERNS=$(shell cd verilog/dv && find * -maxdepth 0 -type d)
 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-% : ./verilog/dv/% 
-	docker run -v ${TARGET_PATH}:${TARGET_PATH} -v ${PDK_PATH}:${PDK_PATH} \
+	docker run -v ${TARGET_PATH}:${TARGET_PATH} -v ${PDK_ROOT}:${PDK_ROOT} \
                 -v ${CARAVEL_ROOT}:${CARAVEL_ROOT} \
-                -e TARGET_PATH=${TARGET_PATH} -e PDK_PATH=${PDK_PATH} \
+                -e TARGET_PATH=${TARGET_PATH} -e PDK_ROOT=${PDK_ROOT} \
                 -e CARAVEL_ROOT=${CARAVEL_ROOT} \
                 -u $(id -u $$USER):$(id -g $$USER) efabless/dv_setup:latest \
                 sh -c $(VERIFY_COMMAND)
@@ -137,15 +136,15 @@
 # Default installs to the user home directory, override by "export PRECHECK_ROOT=<precheck-installation-path>"
 .PHONY: precheck
 precheck:
-	@git clone https://github.com/efabless/open_mpw_precheck.git --depth=1 $(PRECHECK_ROOT)
-	@docker pull efabless/open_mpw_precheck:latest
+	@git clone https://github.com/efabless/mpw_precheck.git --depth=1 $(PRECHECK_ROOT)
+	@docker pull efabless/mpw_precheck:latest
 
 .PHONY: run-precheck
 run-precheck: check-precheck check-pdk check-caravel
-	$(eval TARGET_PATH := $(shell pwd))
+	$(eval INPUT_DIRECTORY := $(shell pwd))
 	cd $(PRECHECK_ROOT) && \
-	docker run -e TARGET_PATH=$(TARGET_PATH) -e PDK_ROOT=$(PDK_ROOT) -e CARAVEL_ROOT=$(CARAVEL_ROOT) -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) -rfc -c $(CARAVEL_ROOT) "
+	docker run -e INPUT_DIRECTORY=$(INPUT_DIRECTORY) -e PDK_ROOT=$(PDK_ROOT) -e CARAVEL_ROOT=$(CARAVEL_ROOT) -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) -v $(PDK_ROOT):$(PDK_ROOT) -v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
+	-u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --pdk_root $(PDK_ROOT) --input_directory $(INPUT_DIRECTORY) --caravel_root $(CARAVEL_ROOT)"
 
 # Install PDK using OL's Docker Image
 .PHONY: pdk-nonnative