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

Klayout PyCell integration #168

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Klayout PyCell integration #168

merged 2 commits into from
Jul 30, 2024

Conversation

ThomasZecha
Copy link
Contributor

-Re-implemented clone() for shapes using deepcopy
-Implemented tagging of shapes feature from SKILL Pcell counter-part
-Fixed npn13G2L/npn13G2V to be equal to SKILL Pcell counter-part
-Introduced library code/documentation as submodule from pycell4klayout-api repo

-Re-implemented clone() for shapes using deepcopy
-Implemented tagging of shapes feature from SKILL Pcell counter-part
-Fixed npn13G2L/npn13G2V to be equal to SKILL Pcell counter-part
-Introduced library code/documentation as submodule from pycell4klayout-api repo

Signed-off-by: ThomasZecha <zecha@ihp-microelectronics.com>
@WilliamOrl
Copy link

Good morning, one way I found to perform the integration is by going inside the folder "IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/tech/pymacros" and changing the Python code in the autorun.lym file to:

# This file only serves to bootstrap sg13g2_pycell_lib.
# Everything else is done inside this module's __init__.py.
import sys
sys.path.append('/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/python')
import sg13g2_pycell_lib

@KrzysztofHerman
Copy link
Contributor

@ThomasZecha definitely there is something wrong bootstrapping the submodule. I have got this when running klayout

ERROR: 
$PDK_ROOT/ihp-sg13g2/libs.tech/klayout/python/sg13g2_pycell_lib/__init__.py:23: ModuleNotFoundError: No module named 'cni.dlo'
$PDK_ROOT/ihp-sg13g2/libs.tech/klayout/python/sg13g2_pycell_lib/__init__.py:23
$PDK_ROOT/ihp-sg13g2/libs.tech/klayout/tech/pymacros/autorun.lym:4 (class ModuleNotFoundError)

@sergeiandreyev
Copy link
Contributor

is it possible to reference just a specific submodule folder in the OpenPDK repo?
so that there will be cni folder in klayout/python/ from the pycell4klayout-api repo

@ThomasZecha
Copy link
Contributor Author

Solution 1:
link klayout/python/cni -> klayout/python/pycell4klayout-api/source/python/cni/
Solution 2:
Add .../libs.tech/klayout/python/pycell4klayout-api/source to the KLAYOUT_PATH env

@sergeiandreyev
Copy link
Contributor

Good morning, one way I found to perform the integration is by going inside the folder "IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/tech/pymacros" and changing the Python code in the autorun.lym file to:

# This file only serves to bootstrap sg13g2_pycell_lib.
# Everything else is done inside this module's __init__.py.
import sys
sys.path.append('/IHP-Open-PDK/ihp-sg13g2/libs.tech/klayout/python')
import sg13g2_pycell_lib

with this code:

import sys
import os
sys.path.append(os.environ['KLAYOUT_HOME'] + '/python/pycell4klayout-api/source/python')
import sg13g2_pycell_lib

it is working on my side
I'm anyway using this env variable to set the location of PDK specific data before starting KLayout, but I'm not sure if everybody does it the same

-simplified referencing python modules by setting search path

Signed-off-by: ThomasZecha <zecha@ihp-microelectronics.com>
@sergeiandreyev sergeiandreyev merged commit c4efdf6 into IHP-GmbH:dev Jul 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants