blob: 62739776aee20a30eae40040b410e2b9ed0a40ed [file] [log] [blame]
# Copyright 2022 GlobalFoundries PDK Authors
#
# 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.
# The top directory where environment will be created.
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
# A pip `requirements.txt` file.
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
REQUIREMENTS_FILE := requirements.txt
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
ENVIRONMENT_FILE := pdk_regression.yml
KLAYOUT_LVS_TESTS := klayout/lvs/testing/
include third_party/make-env/conda.mk
# Lint python code
lint_python: | $(CONDA_ENV_PYTHON)
@$(IN_CONDA_ENV) flake8 .
################################################################################
## DRC Regression section
################################################################################
#=================================
# ----- test-DRC_regression ------
#=================================
.ONESHELL:
test-DRC-main : | $(CONDA_ENV_PYTHON)
@$(IN_CONDA_ENV) python3 ./scripts/run_regression_drc.py
.ONESHELL:
test-DRC-BCDLite-% : | $(CONDA_ENV_PYTHON)
@which python3
@$(IN_CONDA_ENV) python3 ./scripts/run_regression_drc.py --variant=BCDLite --table=$*
.ONESHELL:
test-DRC-ULL-% : | $(CONDA_ENV_PYTHON)
@which python3
@$(IN_CONDA_ENV) python3 ./scripts/run_regression_drc.py --variant=ULL --table=$*
.ONESHELL:
test-DRC-IC-% : | $(CONDA_ENV_PYTHON)
@which python3
@$(IN_CONDA_ENV) python3 ./scripts/run_regression_drc.py --variant=IC --table=$*
#=================================
# -------- test-DRC-switch -------
#=================================
# LVS main testing
test-DRC-switch: | $(CONDA_ENV_PYTHON)
@$(IN_CONDA_ENV) klayout -v
################################################################################
## LVS Regression section
################################################################################
#=================================
# ----- test-LVS_regression ------
#=================================
# run regression on all variants` devices
.ONESHELL:
test-LVS-main: | $(CONDA_ENV_PYTHON)
@$(IN_CONDA_ENV) cd IC/$(KLAYOUT_LVS_TESTS) && make test-LVS-main
@$(IN_CONDA_ENV) cd ULL/$(KLAYOUT_LVS_TESTS) && make test-LVS-main
@$(IN_CONDA_ENV) cd BCDLite/$(KLAYOUT_LVS_TESTS) && make test-LVS-main
.ONESHELL:
test-LVS-% : | $(CONDA_ENV_PYTHON)
@which python3
ifeq ($(findstring ULL, $($*)), ULL)
cd ULL/$(KLAYOUT_LVS_TESTS) && make test-LVS-$(subst ULL-,,$($*))
endif
ifeq ($(findstring IC, $($*)), IC)
cd IC/$(KLAYOUT_LVS_TESTS) && make test-LVS-$(subst IC-,,$($*))
endif
ifeq ($(findstring BCDLite, $($*)), BCDLite)
cd BCDLite/$(KLAYOUT_LVS_TESTS) && make test-LVS-$(subst BCDLite-,,$($*))
endif