From ce52efdeec62a99c67159ed2ee3a083f0da49512 Mon Sep 17 00:00:00 2001 From: FaragElsayed2 Date: Mon, 29 Apr 2024 10:35:24 +0300 Subject: [PATCH 1/4] Updating terminal order for diodes, support using w,l for some devices Signed-off-by: FaragElsayed2 --- .../tech/lvs/rule_decks/custom_reader.lvs | 10 +++++----- .../unit/diode_devices/layout/dantenna.gds | Bin 6090 -> 6090 bytes .../unit/diode_devices/netlist/dantenna.cdl | 10 +++++----- .../unit/diode_devices/netlist/dpantenna.cdl | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs index f6dde1e5..b83f039e 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs @@ -186,7 +186,7 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate %w[C E B] elsif model.downcase.include?('schottky') %w[E B C] - elsif model.downcase.include?('nmoscl') || model.downcase.include?('antenna') + elsif model.downcase.include?('nmoscl') %w[C A] else %w[A C] @@ -268,8 +268,8 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate if model.downcase.include?('diodev') || model.downcase.include?('schottky') || model.downcase.include?('nmoscl') device.set_parameter('m', params['M'] || 1.0) else - device.set_parameter('A', (params['A'] || 0.0) * 1e12) - device.set_parameter('P', (params['P'] || 0.0) * 1e6) + device.set_parameter('A', (params['A'] || ((params['W'] || 0.0) * (params['L'] || 0.0))) * 1e12) + device.set_parameter('P', (params['P'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6) device.set_parameter('m', params['M'] || 1.0) end end @@ -287,8 +287,8 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate # Map parameters for a resistor device. def map_resistor_params(device, model, params) if model.downcase.include?('tap') - device.set_parameter('A', (params['A'] || 0.0) * (params['M'] || 1.0) * 1e12) - device.set_parameter('P', (params['P'] || params['PERIM'] || 0.0) * (params['M'] || 1.0) * 1e6) + device.set_parameter('A', (params['A'] || ((params['W'] || 0.0) * (params['L'] || 0.0))) * 1e12) + device.set_parameter('P', (params['P'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6) elsif model.downcase.start_with?('res') device.set_parameter('w', (params['W'] || 0.0) * 1e6) device.set_parameter('l', (params['L'] || 0.0) * 1e6) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/layout/dantenna.gds b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/layout/dantenna.gds index 322316f80c46e58affe9eaf2b864be4d569fc7dc..36279ae29bdccfae72c5cb250012849ed5099189 100644 GIT binary patch delta 66 ucmX@5e@b78fsKKQDS|qLQjG7U7Li1>yimISF_G delta 66 ucmX@5e@b78fsKKQDS|yiR^$4H< diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dantenna.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dantenna.cdl index 9da20adb..e464e78f 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dantenna.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dantenna.cdl @@ -16,9 +16,9 @@ *========================================================================== .SUBCKT dantenna -D1 net1 GND dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 -D2 net2 GND dantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 -D3 net3 GND dantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 -D4 net4 GND dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 -D5 net5 GND dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=4 +D1 GND net1 dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 +D2 GND net2 dantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 +D3 GND net3 dantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 +D4 GND net4 dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 +D5 GND net5 dantenna w=780.00n l=780.00n a=608.400f p=3.12u m=4 .ENDS diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl index 87f1dc6e..cc1c3469 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl @@ -16,8 +16,8 @@ *========================================================================== .SUBCKT dpantenna -D1 net1 GND dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 -D2 net2 GND dpantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 -D3 net3 GND dpantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 -D4 net4 GND dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 +D1 GND net1 dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 +D2 GND net2 dpantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 +D3 GND net3 dpantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 +D4 GND net4 dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 .ENDS From e1bfe59994ff5ba2c218f86d8963bcae9c92ee92 Mon Sep 17 00:00:00 2001 From: FaragElsayed2 Date: Mon, 29 Apr 2024 14:39:42 +0300 Subject: [PATCH 2/4] Updating some derivations for FETs, updating docs Signed-off-by: FaragElsayed2 --- ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md | 3 +++ .../tech/lvs/rule_decks/rfmos_extraction.lvs | 16 ++++++++++++---- .../libs.tech/klayout/tech/lvs/testing/README.md | 10 ++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md b/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md index a2e73b2b..fc4e5a69 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md @@ -27,8 +27,11 @@ Explains how to use the SG13G2 LVS rule decks. ``` ## Prerequisites + You need the following set of tools installed to be able to run SG13G2 LVS: +At a minimum: + - Python 3.9+ - KLayout 0.28.14+ diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/rfmos_extraction.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/rfmos_extraction.lvs index f528a823..37a20a49 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/rfmos_extraction.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/rfmos_extraction.lvs @@ -35,7 +35,9 @@ extract_devices(mos4('rfnmos'), 'W' => pwell, 'tS' => nsd_fet, 'tD' => nsd_fet, - 'tG' => poly_con }) + 'tG' => poly_con, + 'tW' => ptap, + }) # rfnmos - HV logger.info('Extraction of RF-NMOS-HV transistor') @@ -45,7 +47,9 @@ extract_devices(mos4('rfnmoshv'), 'W' => pwell, 'tS' => nsd_fet, 'tD' => nsd_fet, - 'tG' => poly_con }) + 'tG' => poly_con, + 'tW' => ptap, + }) # =============== # --- RF-PMOS --- @@ -59,7 +63,9 @@ extract_devices(mos4('rfpmos'), 'tS' => psd_fet, 'tD' => psd_fet, 'tG' => poly_con, - 'W' => nwell_drw }) + 'W' => nwell_drw, + 'tW' => ntap, + }) # rfpmos - HV logger.info('Extraction of RF-PMOS-HV transistor') @@ -69,4 +75,6 @@ extract_devices(mos4('rfpmoshv'), 'tS' => psd_fet, 'tD' => psd_fet, 'tG' => poly_con, - 'W' => nwell_drw }) + 'W' => nwell_drw, + 'tW' => ntap, + }) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/README.md b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/README.md index 66720dd4..0168e9c7 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/README.md +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/README.md @@ -14,6 +14,8 @@ Explains how to test SG13G2 LVS rule decks. ## Prerequisites +At a minimum: + You need the following set of tools installed to be able to run the regression: - Python 3.9+ - KLayout 0.28.14+ @@ -22,6 +24,14 @@ We have tested this using the following setup: - Python 3.9.18 - KLayout 0.28.16 +## Installation + +To install the required Python packages, execute the following command: + +```bash +pip install -r ../../../../../../requirements.txt +``` + ## Usage ```bash From 11aae2101408af5e1868408ff737c2113882d00f Mon Sep 17 00:00:00 2001 From: FaragElsayed2 Date: Mon, 29 Apr 2024 19:24:34 +0300 Subject: [PATCH 3/4] Updating LVS devices like diodes, res, taps Signed-off-by: FaragElsayed2 --- .gitignore | 167 ++++++++++++++++++ .../libs.tech/klayout/tech/lvs/README.md | 6 +- .../tech/lvs/rule_decks/custom_extractor.lvs | 4 +- .../tech/lvs/rule_decks/custom_reader.lvs | 8 +- .../tech/lvs/rule_decks/diode_connections.lvs | 4 +- .../tech/lvs/rule_decks/diode_derivations.lvs | 18 +- .../klayout/tech/lvs/rule_decks/globals.lvs | 11 +- .../tech/lvs/rule_decks/res_connections.lvs | 6 +- .../tech/lvs/rule_decks/res_extraction.lvs | 6 +- .../unit/diode_devices/layout/dpantenna.gds | Bin 3430 -> 3494 bytes .../unit/diode_devices/netlist/dpantenna.cdl | 8 +- .../layout/{res_rhigh.gds => rhigh.gds} | Bin 9032 -> 9028 bytes .../layout/{res_rppd.gds => rppd.gds} | Bin 7684 -> 7680 bytes .../layout/{res_rsil.gds => rsil.gds} | Bin 11666 -> 11662 bytes .../netlist/{res_rppd.cdl => rhigh.cdl} | 12 +- .../netlist/{res_rhigh.cdl => rppd.cdl} | 12 +- .../netlist/{res_rsil.cdl => rsil.cdl} | 16 +- 17 files changed, 225 insertions(+), 53 deletions(-) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/{res_rhigh.gds => rhigh.gds} (97%) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/{res_rppd.gds => rppd.gds} (97%) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/{res_rsil.gds => rsil.gds} (90%) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/{res_rppd.cdl => rhigh.cdl} (76%) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/{res_rhigh.cdl => rppd.cdl} (75%) rename ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/{res_rsil.cdl => rsil.cdl} (70%) diff --git a/.gitignore b/.gitignore index 93d30cd7..82a4210e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,173 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + *.raw *.spice *.csv *.osdi .DS_Store *.pyc + +.vscode/ +*.lyrdb +*.lvsdb +unit_tests_* +lvs_run_* diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md b/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md index fc4e5a69..447fba22 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/README.md @@ -69,9 +69,9 @@ The following table explains the list of available SG13G2 devices we have suppor | dpantenna |:white_check_mark:| | schottky_nbl1 |:white_check_mark:| | **Resistors** | | -| res_rsil |:white_check_mark:| -| res_rppd |:white_check_mark:| -| res_rhigh |:white_check_mark:| +| rsil |:white_check_mark:| +| rppd |:white_check_mark:| +| rhigh |:white_check_mark:| | lvsres |:white_check_mark:| | **Capacitors** | | | SVaricap |:white_check_mark:| diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_extractor.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_extractor.lvs index 02f1e55c..6c7aee2a 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_extractor.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_extractor.lvs @@ -44,7 +44,7 @@ class GeneralNTerminalExtractor < RBA::GenericDeviceExtractor # Set up layers and register device class for extraction. define_layers # Register device class for extraction. - if name.downcase.start_with?('res') + if RES_DEV.any? { |res| name.downcase.start_with?(res) } @reg_dev = DeviceCustomRes.new(name, @num) elsif name.downcase.include?('varicap') @reg_dev = DeviceCustomVaractor.new(name, @num) @@ -133,7 +133,7 @@ class GeneralNTerminalExtractor < RBA::GenericDeviceExtractor # Returns: # None - if name.downcase.start_with?('res') + if RES_DEV.any? { |res| name.downcase.start_with?(res) } width, length, poly_sp, bends = calc_res_params(dev, ports, meas_mk) device.set_parameter('w', width * $unit) device.set_parameter('l', length * $unit) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs index b83f039e..a7e40e83 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_reader.lvs @@ -126,7 +126,7 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate # Create a resistor device class. def create_resistor(model, num_nets) - if model.downcase.start_with?('res') + if RES_DEV.any? { |res| model.downcase.start_with?(res) } DeviceCustomRes.new(model, num_nets) elsif num_nets == 2 && model.downcase.include?('tap') RBA::DeviceClassDiode.new @@ -172,7 +172,7 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate when 'C' model.downcase.include?('varicap') ? gen_term_with_sub(model, nets.size) : gen_mim_terms(model) when 'R' - if model.downcase.start_with?('res') + if RES_DEV.any? { |res| model.downcase.start_with?(res) } gen_term_names(model, nets.size) elsif model.downcase.include?('tap') %w[C A] @@ -288,8 +288,8 @@ class CustomReader < RBA::NetlistSpiceReaderDelegate def map_resistor_params(device, model, params) if model.downcase.include?('tap') device.set_parameter('A', (params['A'] || ((params['W'] || 0.0) * (params['L'] || 0.0))) * 1e12) - device.set_parameter('P', (params['P'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6) - elsif model.downcase.start_with?('res') + device.set_parameter('P', (params['P'] || params['PERIM'] || (((params['W'] || 0.0) + (params['L'] || 0.0)) * 2)) * 1e6) + elsif RES_DEV.any? { |res| model.downcase.start_with?(res) } device.set_parameter('w', (params['W'] || 0.0) * 1e6) device.set_parameter('l', (params['L'] || 0.0) * 1e6) device.set_parameter('ps', (params['PS'] || 0.0) * 1e6) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_connections.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_connections.lvs index 106a8b6c..ad39928f 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_connections.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_connections.lvs @@ -28,8 +28,8 @@ connect(dantenna_n, cont_drw) connect(dantenna_p, pwell) # dantenna diode -connect(dpantenna_n, cont_drw) -connect(dpantenna_p, pwell) +connect(dpantenna_n, nwell_drw) +connect(dpantenna_p, cont_drw) # dantenna diode connect(schottcky_p_1x1, schottcky_p) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_derivations.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_derivations.lvs index 64b44a42..e19a0137 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_derivations.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/diode_derivations.lvs @@ -23,12 +23,12 @@ logger.info('Starting DIODE DERIVATIONS') -diode_exclude = gatpoly_drw.join(nwell_drw).join(nsd_drw) - .join(heattrans_drw).join(trans_drw).join(emwind_drw) - .join(emwihv_drw).join(heatres_drw).join(polyres_drw) - .join(mim_drw).join(extblock_drw).join(res_drw) - .join(activ_mask).join(recog_esd).join(ind_drw) - .join(ind_pin).join(substrate_drw) +diode_exclude = gatpoly_drw.join(nsd_drw).join(heattrans_drw) + .join(trans_drw).join(emwind_drw).join(emwihv_drw) + .join(heatres_drw).join(polyres_drw).join(mim_drw) + .join(extblock_drw).join(res_drw).join(activ_mask) + .join(recog_esd).join(ind_drw).join(ind_pin) + .join(substrate_drw) antenna_d_exc = pwell_block.join(nbulay_drw).join(salblock_drw) .join(nsd_block).join(diode_exclude) @@ -36,12 +36,12 @@ antenna_d_exc = pwell_block.join(nbulay_drw).join(salblock_drw) antenna_d_mk = recog_diode.not(antenna_d_exc) # ==== dantenna diode ==== -dantenna_n = activ_drw.and(antenna_d_mk).not(psd_drw) +dantenna_n = activ_drw.and(antenna_d_mk).not(psd_drw).not(nwell_drw) dantenna_p = pwell.and(antenna_d_mk).covering(dantenna_n) # ==== dpantenna diode ==== -dpantenna_n = pactiv.and(antenna_d_mk) -dpantenna_p = pwell.and(antenna_d_mk).covering(dpantenna_n) +dpantenna_p = pactiv.and(antenna_d_mk) +dpantenna_n = nwell_drw.covering(dpantenna_p) # ==== schottky_nbl1 diode ==== schottky_mk = recog_diode.and(thickgateox_drw).not(diode_exclude) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/globals.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/globals.lvs index 647d03a8..2f49defc 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/globals.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/globals.lvs @@ -21,6 +21,7 @@ # --------------- Varaibles ---------------- #=========================================== +# Prefix for each device PREFIX_MAP = { 'sg13_lv_nmos' => 'M', 'sg13_hv_nmos' => 'M', @@ -37,9 +38,9 @@ PREFIX_MAP = { 'dantenna' => 'D', 'dpantenna' => 'D', 'schottky_nbl1' => 'D', - 'res_rsil' => 'R', - 'res_rppd' => 'R', - 'res_rhigh' => 'R', + 'rsil' => 'R', + 'rppd' => 'R', + 'rhigh' => 'R', 'lvsres' => 'R', 'SVaricap' => 'C', 'cap_cmim' => 'C', @@ -60,4 +61,8 @@ PREFIX_MAP = { 'inductor3' => 'L' }.freeze +# Prefix for devices will be customized CUSTOM_READER = %w[M C R Q L D].freeze + +# List of poly-resistors +RES_DEV = ['rsil', 'rppd', 'rhigh'] diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_connections.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_connections.lvs index 1d4aa1e7..a652884e 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_connections.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_connections.lvs @@ -23,13 +23,13 @@ logger.info('Starting RESISTOR CONNECTIONS') -# === res_rsil === +# === rsil === connect(rsil_ports, cont_drw) -# === res_rppd === +# === rppd === connect(rppd_ports, cont_drw) -# === res_rhigh === +# === rhigh === connect(rhigh_ports, cont_drw) # === lvsres === diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_extraction.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_extraction.lvs index d2760f92..104ca555 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_extraction.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/res_extraction.lvs @@ -29,7 +29,7 @@ logger.info('Starting RESISTOR EXTRACTION') # rsil logger.info('Extracting rsil resistor') -extract_devices(GeneralNTerminalExtractor.new('res_rsil', 2), { +extract_devices(GeneralNTerminalExtractor.new('rsil', 2), { 'core' => rsil_res, 'ports' => rsil_ports, 'meas_mk' => polyres_drw, @@ -38,7 +38,7 @@ extract_devices(GeneralNTerminalExtractor.new('res_rsil', 2), { }) # rppd logger.info('Extracting rppd resistor') -extract_devices(GeneralNTerminalExtractor.new('res_rppd', 2), { +extract_devices(GeneralNTerminalExtractor.new('rppd', 2), { 'core' => rppd_res, 'ports' => rppd_ports, 'meas_mk' => polyres_drw, @@ -48,7 +48,7 @@ extract_devices(GeneralNTerminalExtractor.new('res_rppd', 2), { # rhigh logger.info('Extracting rhigh resistor') -extract_devices(GeneralNTerminalExtractor.new('res_rhigh', 2), { +extract_devices(GeneralNTerminalExtractor.new('rhigh', 2), { 'core' => rhigh_res, 'ports' => rhigh_ports, 'meas_mk' => polyres_drw, diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/layout/dpantenna.gds b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/layout/dpantenna.gds index 75de55a8d2ff18e836e8449072630265ea1a116b..689e8b5cc81e0a62a370b79bf4fb05b50c5de124 100644 GIT binary patch delta 139 zcmaDRwM<%xfsKKQDS|V!Yobdnu%Nh_3l-$R_pppcmVd5Z~fklvkfrTB2Sr`BSn;~2P delta 75 zcmZ1`{Y*-UfsKKQDS|M- B2_ygj diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl index cc1c3469..c686b49a 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/diode_devices/netlist/dpantenna.cdl @@ -16,8 +16,8 @@ *========================================================================== .SUBCKT dpantenna -D1 GND net1 dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 -D2 GND net2 dpantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 -D3 GND net3 dpantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 -D4 GND net4 dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 +D1 net1 VDD dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=1 +D2 net2 VDD dpantenna w=800.00n l=780.00n a=624.000f p=3.16u m=1 +D3 net3 VDD dpantenna w=780.00n l=700.00n a=546.000f p=2.96u m=1 +D4 net4 VDD dpantenna w=780.00n l=780.00n a=608.400f p=3.12u m=2 .ENDS diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rhigh.gds b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rhigh.gds similarity index 97% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rhigh.gds rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rhigh.gds index 7a193a933f7126bee52fd55a73d5177838debe10..d03d8fb88ba9c12691e0d9de7713dc448bc96920 100644 GIT binary patch delta 72 ycmX@%cEnAIfsKKQDS|APUU@ delta 76 zcmX@&cEU}GfsKKQDS|13v=`gEcaHqLQ*KRtW|^HnyVF;`ohm&y)bM Catsy# diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rppd.gds b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rppd.gds similarity index 97% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rppd.gds rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rppd.gds index 1a47f910ba484268b74df11790db063dab29c3a8..85fab725a64e5cc4b7e55d0b0306b170cde4bf0d 100644 GIT binary patch delta 72 ycmZp%X|PdZU}IonieQjoWMY58z``KQAjBZRAc)MKsH7~3Rf2(ojcsGnB3S@UX9*Gj delta 76 zcmZp$X|YjaU}IonieQjoWMY58z|0`ez{g<4pn}YvsH7~5Rf2(sjjbrPIDTW?B3S^F ClMAN+ diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rsil.gds b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rsil.gds similarity index 90% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/res_rsil.gds rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/layout/rsil.gds index 9066498ac37eec831e9b9920d024dd2b87bd53cf..2af2bbd819bf5964b4844701c5d917ecc4cb0b92 100644 GIT binary patch delta 82 zcmbOf-50IIz{bGD6u}_F$i)7FfrUYqL5M+sfeV>EQAt%Ai!cKR8(UFvX3pdQCeg{Y LjH(+Ke9{2`->41O delta 74 zcmeB+o)oRbz{bGD6u}_F$i)7FfrUYofr~+d!5W!8QAt%Ai!cKZ8(UFoas0+O16=@` C9}9Z` diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rppd.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rhigh.cdl similarity index 76% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rppd.cdl rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rhigh.cdl index 96a0ad60..236bb3d3 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rppd.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rhigh.cdl @@ -15,10 +15,10 @@ * SPDX-License-Identifier: Apache-2.0 *========================================================================== -.SUBCKT res_rppd -Rp1 net1 net2 res_rppd m=1 l=0.5u w=0.5u -Rp2 net3 net4 res_rppd m=1 l=1u w=0.5u -Rp3 net5 net6 res_rppd m=1 l=1.2u w=0.7u -Rp4 net7 net8 res_rppd m=1 l=1u w=0.5u ps=0.2u b=1 -Rp5 net9 net10 res_rppd m=1 l=1.2u w=0.5u ps=0.2u b=2 +.SUBCKT rhigh +Rh1 net1 net2 rhigh m=1 l=0.96u w=0.5u +Rh2 net3 net4 rhigh m=1 l=1u w=0.5u +Rh3 net5 net6 rhigh m=1 l=1.2u w=0.7u +Rh4 net7 net8 rhigh m=1 l=1u w=0.5u ps=0.2u b=1 +Rh5 net9 net10 rhigh m=1 l=1.2u w=0.5u ps=0.2u b=2 .ENDS diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rhigh.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rppd.cdl similarity index 75% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rhigh.cdl rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rppd.cdl index 4eccc933..7e42fe2a 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rhigh.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rppd.cdl @@ -15,10 +15,10 @@ * SPDX-License-Identifier: Apache-2.0 *========================================================================== -.SUBCKT res_rhigh -Rh1 net1 net2 res_rhigh m=1 l=0.96u w=0.5u -Rh2 net3 net4 res_rhigh m=1 l=1u w=0.5u -Rh3 net5 net6 res_rhigh m=1 l=1.2u w=0.7u -Rh4 net7 net8 res_rhigh m=1 l=1u w=0.5u ps=0.2u b=1 -Rh5 net9 net10 res_rhigh m=1 l=1.2u w=0.5u ps=0.2u b=2 +.SUBCKT rppd +Rp1 net1 net2 rppd m=1 l=0.5u w=0.5u +Rp2 net3 net4 rppd m=1 l=1u w=0.5u +Rp3 net5 net6 rppd m=1 l=1.2u w=0.7u +Rp4 net7 net8 rppd m=1 l=1u w=0.5u ps=0.2u b=1 +Rp5 net9 net10 rppd m=1 l=1.2u w=0.5u ps=0.2u b=2 .ENDS diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rsil.cdl b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rsil.cdl similarity index 70% rename from ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rsil.cdl rename to ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rsil.cdl index 3b497c58..2d85c0dc 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/res_rsil.cdl +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/testing/testcases/unit/res_devices/netlist/rsil.cdl @@ -15,12 +15,12 @@ * SPDX-License-Identifier: Apache-2.0 *========================================================================== -.SUBCKT res_rsil -Rs1 net1 net2 res_rsil m=1 l=0.5u w=0.5u -Rs2 net3 net4 res_rsil m=1 l=1u w=0.5u -Rs3 net5 net6 res_rsil m=1 l=1.2u w=0.7u -Rs4 net7 net8 res_rsil m=1 l=1u w=0.5u ps=0.2u b=1 -Rs5 net9 net10 res_rsil m=1 l=1.2u w=0.5u ps=0.2u b=2 -Rs6 net11 net12 res_rsil m=2 l=0.5u w=0.5u -Rs7 net13 net14 res_rsil m=1 l=1u w=0.5u +.SUBCKT rsil +Rs1 net1 net2 rsil m=1 l=0.5u w=0.5u +Rs2 net3 net4 rsil m=1 l=1u w=0.5u +Rs3 net5 net6 rsil m=1 l=1.2u w=0.7u +Rs4 net7 net8 rsil m=1 l=1u w=0.5u ps=0.2u b=1 +Rs5 net9 net10 rsil m=1 l=1.2u w=0.5u ps=0.2u b=2 +Rs6 net11 net12 rsil m=2 l=0.5u w=0.5u +Rs7 net13 net14 rsil m=1 l=1u w=0.5u .ENDS From aae8628a5d02d9834f909c11560a78c4ff1d6b18 Mon Sep 17 00:00:00 2001 From: FaragElsayed2 Date: Tue, 30 Apr 2024 18:42:27 +0300 Subject: [PATCH 4/4] Fixing series connections for lvs-res dev Signed-off-by: FaragElsayed2 --- .../klayout/tech/lvs/rule_decks/custom_combiner.lvs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_combiner.lvs b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_combiner.lvs index 1b584415..b5564072 100644 --- a/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_combiner.lvs +++ b/ihp-sg13g2/libs.tech/klayout/tech/lvs/rule_decks/custom_combiner.lvs @@ -64,6 +64,18 @@ module DeviceCombinerMethods series_con2 = a_net1.cluster_id == b_net2.cluster_id || a_net2.cluster_id == b_net1.cluster_id series_con = series_con1 || series_con2 end + + # Reroute terminal connections based on cluster IDs + if a_net1.cluster_id == b_net1.cluster_id + a.connect_terminal(0, b_net2) + elsif a_net2.cluster_id == b_net2.cluster_id + a.connect_terminal(1, b_net1) + elsif a_net1.cluster_id == b_net2.cluster_id + a.connect_terminal(0, b_net1) + elsif a_net2.cluster_id == b_net1.cluster_id + a.connect_terminal(1, b_net2) + end + a_net1 && b_net1 && a_net2 && b_net2 && series_con end