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

add si500nm pdk #32

Merged
merged 2 commits into from
May 4, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/write_cells_si220.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
f.write(
"""

Cells Si220
Cells Si SOI 220nm
=============================
"""
)
Expand Down
65 changes: 65 additions & 0 deletions .github/write_cells_si500.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import inspect

from cspdk.si500 import _cells as cells
from cspdk.si500.config import PATH

filepath = PATH.repo / "docs" / "cells_si500.rst"

skip = {}

skip_plot: tuple[str, ...] = ("",)
skip_settings: tuple[str, ...] = ()


with open(filepath, "w+") as f:
f.write(
"""

Cells Si SOI 500nm
=============================
"""
)

for name in sorted(cells.keys()):
if name in skip or name.startswith("_"):
continue
print(name)
sig = inspect.signature(cells[name])
kwargs = ", ".join(
[
f"{p}={repr(sig.parameters[p].default)}"
for p in sig.parameters
if isinstance(sig.parameters[p].default, int | float | str | tuple)
and p not in skip_settings
]
)
if name in skip_plot:
f.write(
f"""

{name}
----------------------------------------------------

.. autofunction:: cspdk.si500.cells.{name}

"""
)
else:
f.write(
f"""

{name}
----------------------------------------------------

.. autofunction:: cspdk.si500.cells.{name}

.. plot::
:include-source:

import cspdk

c = cspdk.si500.cells.{name}({kwargs})
c.plot()

"""
)
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ notebooks:

docs:
python .github/write_cells_si220.py
python .github/write_cells_si500.py
python .github/write_cells_sin300.py
jb build docs

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pip install cspdk --upgrade

Then you need to restart Klayout to make sure the new technology installed appears.

You can download the [code](https://github.com/gdsfactory/cspdk/archive/refs/heads/main.zip) and examples.

### Installation for developers

For developers you need to `git clone` the GitHub repository, fork it, git add, git commit, git push and merge request your changes.
Expand Down
41 changes: 41 additions & 0 deletions cspdk/si500/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from gdsfactory.cross_section import get_cross_sections
from gdsfactory.get_factories import get_cells
from gdsfactory.pdk import Pdk

from cspdk.si500 import cells, config, tech
from cspdk.si500.cells import _bend, _straight, _taper
from cspdk.si500.config import PATH
from cspdk.si500.models import get_models
from cspdk.si500.tech import LAYER, LAYER_STACK, LAYER_VIEWS, routing_strategies

_models = get_models()
_cells = get_cells(cells)
_cells.update(
{
"_straight": _straight,
"_bend": _bend,
"_taper": _taper,
}
)
_cross_sections = get_cross_sections(tech)
PDK = Pdk(
name="cornerstone_si500",
cells=_cells,
cross_sections=_cross_sections,
layers=dict(LAYER),
layer_stack=LAYER_STACK,
layer_views=LAYER_VIEWS,
models=_models,
routing_strategies=routing_strategies,
)
PDK.activate()

__all__ = [
"LAYER",
"LAYER_STACK",
"LAYER_VIEWS",
"PATH",
"cells",
"config",
"tech",
]
Loading
Loading