Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding GitHub Actions for LVS testing #12

Merged
merged 1 commit into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/lvs_gf180mcu_fd_sc_mcu7t5v0_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.

# This is a Github Actions for testing LVS rule deck of GF180MCU
name: Standard Cells gf180mcu_fd_sc_mcu7t5v0 LVS testing

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Defines environment variables
env:
PDK_ROOT: $GITHUB_WORKSPACE/rules/klayout
PDK: lvs

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "LVS_gf180mcu_fd_sc_mcu7t5v0_testing"
LVS_gf180mcu_fd_sc_mcu7t5v0_testing:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Gets python version with list of needed requirements
- uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

# Installs requirements
- run: pip install -r ./rules/klayout/requirements.test.txt

# Installs Klayout verison 0.27.8
- name: Installing Klayout 0.27.8
run: |
wget https://www.klayout.org/downloads/Ubuntu-20/klayout_0.27.8-1_amd64.deb
sudo apt-get install qt5-default qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev
sudo dpkg -i ./klayout_0.27.8-1_amd64.deb
sudo apt-get install -f -y

# Runs a set of commands using the runners shell
- name: Testing LVS for Standard Cells gf180mcu_fd_sc_mcu7t5v0
run: |
cd ./rules/klayout/lvs/testing
make test-LVS-gf180mcu_fd_sc_mcu7t5v0 -j$(nproc)
66 changes: 66 additions & 0 deletions .github/workflows/lvs_gf180mcu_fd_sc_mcu9t5v0_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.

# This is a Github Actions for testing LVS rule deck of GF180MCU
name: Standard Cells gf180mcu_fd_sc_mcu9t5v0 LVS testing

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Defines environment variables
env:
PDK_ROOT: $GITHUB_WORKSPACE/rules/klayout
PDK: lvs

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "LVS_gf180mcu_fd_sc_mcu9t5v0_testing"
LVS_gf180mcu_fd_sc_mcu9t5v0_testing:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Gets python version with list of needed requirements
- uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

# Installs requirements
- run: pip install -r ./rules/klayout/requirements.test.txt

# Installs Klayout verison 0.27.8
- name: Installing Klayout 0.27.8
run: |
wget https://www.klayout.org/downloads/Ubuntu-20/klayout_0.27.8-1_amd64.deb
sudo apt-get install qt5-default qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev
sudo dpkg -i ./klayout_0.27.8-1_amd64.deb
sudo apt-get install -f -y

# Runs a set of commands using the runners shell
- name: Testing LVS for Standard Cells gf180mcu_fd_sc_mcu9t5v0
run: |
cd ./rules/klayout/lvs/testing
make test-LVS-gf180mcu_fd_sc_mcu9t5v0 -j$(nproc)
66 changes: 66 additions & 0 deletions .github/workflows/lvs_regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.

# This is a Github Actions for testing LVS rule deck of GF180MCU
name: LVS Regression test

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Defines environment variables
env:
PDK_ROOT: $GITHUB_WORKSPACE/rules/klayout
PDK: lvs

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "LVS_Regression_testing"
LVS_Regression_testing:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Gets python version with list of needed requirements
- uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

# Installs requirements
- run: pip install -r ./rules/klayout/requirements.test.txt

# Installs Klayout verison 0.27.8
- name: Installing Klayout 0.27.8
run: |
wget https://www.klayout.org/downloads/Ubuntu-20/klayout_0.27.8-1_amd64.deb
sudo apt-get install qt5-default qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev
sudo dpkg -i ./klayout_0.27.8-1_amd64.deb
sudo apt-get install -f -y

# Runs a set of commands using the runners shell
- name: Testing LVS for Regression
run: |
cd ./rules/klayout/lvs/testing
make test-LVS_main -j$(nproc)
66 changes: 66 additions & 0 deletions .github/workflows/lvs_switch_checking_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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.

# This is a Github Actions for testing LVS rule deck of GF180MCU
name: LVS Switch Checking (Rule deck arguments) test

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Defines environment variables
env:
PDK_ROOT: $GITHUB_WORKSPACE/rules/klayout
PDK: lvs

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "LVS_Switch_checking_testing"
LVS_Switch_checking_testing:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Gets python version with list of needed requirements
- uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'

# Installs requirements
- run: pip install -r ./rules/klayout/requirements.test.txt

# Installs Klayout verison 0.27.8
- name: Installing Klayout 0.27.8
run: |
wget https://www.klayout.org/downloads/Ubuntu-20/klayout_0.27.8-1_amd64.deb
sudo apt-get install qt5-default qttools5-dev libqt5xmlpatterns5-dev qtmultimedia5-dev libqt5multimediawidgets5 libqt5svg5-dev
sudo dpkg -i ./klayout_0.27.8-1_amd64.deb
sudo apt-get install -f -y

# Runs a set of commands using the runners shell
- name: Testing LVS for Switch Checking
run: |
cd ./rules/klayout/lvs/testing
make test-LVS_switch -j$(nproc)
12 changes: 7 additions & 5 deletions rules/klayout/lvs/gf180mcu.lvs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ end
#=== NET NAMES OPTION ===
# true: use net names instead of numbers
# false: use numbers for nets
if $spice_net_names
spice_with_net_names = $spice_net_names
if $spice_net_names == "true"
spice_with_net_names = true
logger.info("Extracted netlist with net names: #{$spice_net_names}")
else
spice_with_net_names = true
Expand All @@ -83,8 +83,8 @@ end
#=== COMMENTS OPTION ===
# true: put in comments with details
# false: no comments
if $spice_comments
spice_with_comments = $spice_comments
if $spice_comments == "true"
spice_with_comments = true
logger.info("Extracted netlist with comments in details: #{$spice_comments}")
else
spice_with_comments = false
Expand All @@ -100,9 +100,11 @@ else
end

#=== EXTRACTION SCALE ===
if $scale
if $scale == "true"
device_scaling(1000000)
logger.info("device_scaling: true")
else
logger.info("device_scaling: false")
end

#=== PRINT DETAILS ===
Expand Down
42 changes: 25 additions & 17 deletions rules/klayout/lvs/testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ run_folder := $(shell date +'run_%Y_%m_%d_%H_%M')

all: test-LVS

test-LVS: Add_run-dir test-LVS_switch test-LVS_SC test-LVS_main
test-LVS: Add_run-dir test-LVS_switch test-LVS-gf180mcu_fd_sc test-LVS_main

#=================================
# --------- RUN FOLDER ----------
Expand All @@ -33,16 +33,24 @@ test-LVS: Add_run-dir test-LVS_switch test-LVS_SC test-LVS_main
.ONESHELL:
Add_run-dir:
@cd $(Testing_DIR)
@ mkdir -p $(run_folder)/switch_checking $(run_folder)/main $(run_folder)/std_cells
@ mkdir -p $(run_folder)/switch_checking $(run_folder)/main $(run_folder)/gf180mcu_fd_sc_mcu7t5v0 $(run_folder)/gf180mcu_fd_sc_mcu9t5v0

#=================================
# --------- test-LVS_SC ----------
#=================================

.ONESHELL:
test-LVS_SC: Add_run-dir
test-LVS-gf180mcu_fd_sc: test-LVS-gf180mcu_fd_sc_mcu7t5v0 test-LVS-gf180mcu_fd_sc_mcu9t5v0

.ONESHELL:
test-LVS-gf180mcu_fd_sc_mcu7t5v0: Add_run-dir
@cd $(Testing_DIR)
@ python3 run_sc_regression.py --cell_lib=gf180mcu_fd_sc_mcu7t5v0 --run_dir=$(run_folder)/gf180mcu_fd_sc_mcu7t5v0 |& tee $(run_folder)/gf180mcu_fd_sc_mcu7t5v0/results.log

.ONESHELL:
test-LVS-gf180mcu_fd_sc_mcu9t5v0: Add_run-dir
@cd $(Testing_DIR)
@ python3 run_sc_regression.py --run_dir=$(run_folder)/std_cells |& tee $(run_folder)/std_cells/results.log
@ python3 run_sc_regression.py --cell_lib=gf180mcu_fd_sc_mcu9t5v0 --run_dir=$(run_folder)/gf180mcu_fd_sc_mcu9t5v0 |& tee $(run_folder)/gf180mcu_fd_sc_mcu9t5v0/results.log

#=================================
# ----- test-LVS_regression ------
Expand Down Expand Up @@ -114,16 +122,16 @@ test-LVS_switch: Add_run-dir
# Help Target
help:
@echo "\n ==== The following are some of the valid targets for this Makefile ====\n"
@echo "... all (the default if no target is provided )"
@echo "... Add_run-dir (Create output directory of all runs )"
@echo "... test-LVS (To run LVS full regression )"
@echo "... test-LVS_switch (To run switch checking regression )"
@echo "... test-LVS_SC (To run standard cells LVS regression )"
@echo "... test-LVS_main (To run main LVS regression for all devices )"
@echo "... test-LVS_MOS (To run main LVS regression for MOS devices )"
@echo "... test-LVS_BJT (To run main LVS regression for BJT devices )"
@echo "... test-LVS_DIODE (To run main LVS regression for diode devices )"
@echo "... test-LVS_RES (To run main LVS regression for diode devices )"
@echo "... test-LVS_MIMCAP (To run main LVS regression for diode devices )"
@echo "... test-LVS_MOSCAP (To run main LVS regression for diode devices )"
@echo "... test-LVS_MOS-SAB (To run main LVS regression for SAB MOS devices)"
@echo "... all (the default if no target is provided )"
@echo "... Add_run-dir (Create output directory of all runs )"
@echo "... test-LVS (To run LVS full regression )"
@echo "... test-LVS_switch (To run switch checking regression )"
@echo "... test-LVS-gf180mcu_fd_sc (To run standard cells LVS regression )"
@echo "... test-LVS_main (To run main LVS regression for all devices )"
@echo "... test-LVS_MOS (To run main LVS regression for MOS devices )"
@echo "... test-LVS_BJT (To run main LVS regression for BJT devices )"
@echo "... test-LVS_DIODE (To run main LVS regression for diode devices )"
@echo "... test-LVS_RES (To run main LVS regression for diode devices )"
@echo "... test-LVS_MIMCAP (To run main LVS regression for diode devices )"
@echo "... test-LVS_MOSCAP (To run main LVS regression for diode devices )"
@echo "... test-LVS_MOS-SAB (To run main LVS regression for SAB MOS devices)"
4 changes: 2 additions & 2 deletions rules/klayout/lvs/testing/run_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def lvs_check(table,files):
with open(f'testcases/{layout}_generated.cdl', 'w') as file:
file.write(spice_netlist)

result = os.popen(f"klayout -b -r ../gf180mcu.lvs -rd input=testcases/{layout}.gds -rd report={layout}.lvsdb -rd schematic={layout}_generated.cdl -rd target_netlist={layout}_extracted.cir -rd thr={workers_count} {switches}").read()
result = os.popen(f"klayout -b -r ../gf180mcu.lvs -rd input=testcases/{layout}.gds -rd report={layout}.lvsdb -rd schematic={layout}_generated.cdl -rd target_netlist={layout}_extracted.cir -rd thr={workers_count} {switches} -rd lvs_sub='vdd!'").read()

# moving all reports to run dir
out_dir = arguments["--run_dir"]
Expand All @@ -100,7 +100,7 @@ def lvs_check(table,files):
for file in man_testing:
file_clean = file.split("/")[-1].replace(".gds","")
if layout == file_clean:
result = os.popen(f"klayout -b -r ../gf180mcu.lvs -rd input={file} -rd report={layout}.lvsdb -rd schematic={layout}.cdl -rd target_netlist={layout}_extracted.cir -rd thr={workers_count} {switches}").read()
result = os.popen(f"klayout -b -r ../gf180mcu.lvs -rd input={file} -rd report={layout}.lvsdb -rd schematic={layout}.cdl -rd target_netlist={layout}_extracted.cir -rd thr={workers_count} {switches} -rd lvs_sub='vdd!'").read()

dir_clean = file.replace(".gds","")
os.system(f"mv -f {dir_clean}.lvsdb {dir_clean}_extracted.cir {out_dir}/LVS_{device_dir}/")
Expand Down