Coverage for tests/rcx25/rcx25_CC_gf180mcuD_test.py: 100%
22 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-02 23:32 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-02 23:32 +0000
1#
2# --------------------------------------------------------------------------------
3# SPDX-FileCopyrightText: 2024-2026 Martin Jan Köhler and Harald Pretl
4# Johannes Kepler University, Institute for Integrated Circuits.
5#
6# This file is part of KPEX
7# (see https://github.com/iic-jku/klayout-pex).
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21# SPDX-License-Identifier: GPL-3.0-or-later
22# --------------------------------------------------------------------------------
23#
25import allure
26import pytest
28from rcx25_test_helpers import *
30parent_suite = "kpex/2.5D Extraction Tests [PDK gf180mcuD | mode CC]"
31tags = ("PEX", "2.5D")
34pex_whiteboxed = RCX25Extraction(pdk=PDKTestConfig(PDKName.GF180MCUD), pex_mode=PEXMode.CC, blackbox=False)
35pex_blackboxed = RCX25Extraction(pdk=PDKTestConfig(PDKName.GF180MCUD), pex_mode=PEXMode.CC, blackbox=True)
38@allure.parent_suite(parent_suite)
39@allure.tag(*tags)
40@pytest.mark.slow
41def test_mim_cap__whiteboxed():
42 # The device model cap_mim_2f0_m4m5_noshield gives c_cox 1.99 fF/µm² * A + c_capsw 0.2383 fF/µm * P:
43 # 5 µm x 5 µm: 49.75 fF + 4.77 fF = 54.52 fF (TOP1 - BOT1)
44 # 20 µm x 10 µm: 398.0 fF + 14.30 fF = 412.30 fF (TOP2 - BOT2)
45 pex_whiteboxed.assert_expected_matches_obtained(
46 'test_patterns', 'cap_mim_m4m5.gds.gz',
47 expected_csv_content="""Device;Net1;Net2;Capacitance [fF];Resistance [Ω]
48C1;BOT1;BOT2;0.132;
49C2;BOT1;TOP1;54.685;
50C3;BOT1;TOP2;0.034;
51C4;BOT1;VSUBS;0.836;
52C5;BOT2;TOP1;0.024;
53C6;BOT2;TOP2;412.805;
54C7;BOT2;VSUBS;3.474;
55C8;TOP1;TOP2;0.183;
56C9;TOP1;VSUBS;0.449;
57C10;TOP2;VSUBS;1.603;"""
58 )
61@allure.parent_suite(parent_suite)
62@allure.tag(*tags)
63@pytest.mark.slow
64def test_mim_cap__blackboxed():
65 # The black-box extraction leaves the MIM caps to the device model, with both of their plates,
66 # FuseTop and the Metal4 under it (LVS layer metal4_cap), so there's no Metal5 over Metal4 under the top plates,
67 # which added 8.758 fF to TOP2 - BOT2 (2 % of the device) and 1.28 fF to TOP1 - BOT1.
68 # Between the plates, the fringe between Metal5 and the Metal4 around the bottom plates is left.
69 pex_blackboxed.assert_expected_matches_obtained(
70 'test_patterns', 'cap_mim_m4m5.gds.gz',
71 expected_csv_content="""Device;Net1;Net2;Capacitance [fF];Resistance [Ω]
72C1;BOT1;BOT2;0.15;
73C2;BOT1;TOP1;0.884;
74C3;BOT1;TOP2;0.031;
75C4;BOT1;VSUBS;0.879;
76C5;BOT2;TOP1;0.021;
77C6;BOT2;TOP2;2.844;
78C7;BOT2;VSUBS;3.112;
79C8;TOP1;TOP2;0.118;
80C9;TOP1;VSUBS;0.594;
81C10;TOP2;VSUBS;2.763;"""
82 )
85@allure.parent_suite(parent_suite)
86@allure.tag(*tags)
87@pytest.mark.slow
88def test_well_diodes__blackboxed():
89 # The well diodes of the PDK's KLayout pcells (2 µm x 4 µm, 3.3V), their models are diode_pw2dw, diode_dw2ps
90 assert pex_blackboxed.written_device_lines('test_patterns', 'diode_pw2dw_dw2ps_03v3_w2_l4.gds.gz') == [
91 'D$1 PW2DW_P PW2DW_N diode_pw2dw area=8e-12 pj=1.2e-05',
92 'D$2 SUB DW2PS_N diode_dw2ps area=8e-12 pj=1.2e-05',
93 ]