forked from IHP-GmbH/IHP-Open-PDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (62 loc) · 2.62 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#==========================================================================
# Copyright 2024 IHP 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
#
# https://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))))
VENV_RUN_COMMAND = $(TOP_DIR)/actions_venv/bin/activate
# Path to regression
KLAYOUT_LVS_TESTS := ihp-sg13g2/libs.tech/klayout/tech/lvs/testing
# A pip `requirements.txt` file.
# https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
REQUIREMENTS_FILE := requirements.txt
# =======================
# ------ ENV SETUP ------
# =======================
$(TOP_DIR)/actions_venv:
@python3 -m venv $(TOP_DIR)/actions_venv
# Install requirements
env: $(TOP_DIR)/actions_venv
@. $(VENV_RUN_COMMAND); pip install -r $(REQUIREMENTS_FILE)
# ========================
# ----- LINTING TEST -----
# ========================
# Lint python code
lint_python: env
@echo "Running python linting for Klayout-LVS scripts"
@. $(VENV_RUN_COMMAND); flake8 ihp-sg13g2/libs.tech/klayout/tech/lvs
#=================================
# ----- test-LVS_regression ------
#=================================
.ONESHELL:
test-LVS-main: env
@. $(VENV_RUN_COMMAND); echo "Running Klayout-LVS regression for all devices"
@. $(VENV_RUN_COMMAND); cd $(KLAYOUT_LVS_TESTS) && make test-LVS-main
.ONESHELL:
test-LVS-% : env
@. $(VENV_RUN_COMMAND); echo "Running Klayout-LVS regression for $* device"
@. $(VENV_RUN_COMMAND); cd $(KLAYOUT_LVS_TESTS) && make test-LVS-$*
#=================================
# -------- test-LVS-cells --------
#=================================
test-LVS-cells: env
@. $(VENV_RUN_COMMAND); echo "Running Klayout-LVS for SG13G2 cells"
@. $(VENV_RUN_COMMAND); cd $(KLAYOUT_LVS_TESTS) && make test-LVS-cells
#=================================
# -------- test-LVS-switch -------
#=================================
test-LVS-switch: env
@. $(VENV_RUN_COMMAND); echo "Running Klayout-LVS switch test"
@. $(VENV_RUN_COMMAND); cd $(KLAYOUT_LVS_TESTS) && make test-LVS-switch