Skip to content

Commit

Permalink
add cells
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Jul 18, 2023
1 parent f56cac8 commit e3ae612
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/write_cells.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from typing import Tuple
import inspect
from gvtt.config import PATH
from gvtt import cells


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

skip = {}

skip_plot: Tuple[str, ...] = ("add_fiber_array_siepic",)
skip_settings: Tuple[str, ...] = ("flatten", "safe_cell_names")


with open(filepath, "w+") as f:
f.write(
"""
Here are the components available in the PDK
Cells
=============================
"""
)

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:: gvtt.components.{name}
"""
)
else:
f.write(
f"""
{name}
----------------------------------------------------
.. autofunction:: gvtt.components.{name}
.. plot::
:include-source:
import gvtt
c = gvtt.components.{name}({kwargs})
c.plot_matplotlib()
"""
)
1 change: 1 addition & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
format: jb-book
root: index
chapters:
- file: cells
- file: changelog
126 changes: 126 additions & 0 deletions docs/cells.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@


Here are the components available in the PDK


Cells
=============================


bend_euler
----------------------------------------------------

.. autofunction:: gvtt.components.bend_euler

.. plot::
:include-source:

import gvtt

c = gvtt.components.bend_euler(angle=90.0, p=1.0, with_arc_floorplan=False, direction='ccw', with_bbox=True, cross_section='strip')
c.plot_matplotlib()



die
----------------------------------------------------

.. autofunction:: gvtt.components.die

.. plot::
:include-source:

import gvtt

c = gvtt.components.die(size=(5000.0, 9500.0), street_width=75.0, street_length=1000.0, die_name='chip99', text_size=100.0, text_location='SW', draw_corners=True, draw_dicing_lane=True)
c.plot_matplotlib()



edge_coupler_rib
----------------------------------------------------

.. autofunction:: gvtt.components.edge_coupler_rib

.. plot::
:include-source:

import gvtt

c = gvtt.components.edge_coupler_rib(edge_coupling_width=3.0, polishing_length=25.0, side='W', xpos=0.0, ypos=0.0)
c.plot_matplotlib()



mmi1x2
----------------------------------------------------

.. autofunction:: gvtt.components.mmi1x2

.. plot::
:include-source:

import gvtt

c = gvtt.components.mmi1x2(width_taper=1.875, length_taper=1.0, length_mmi=43.25, width_mmi=6.25, gap_mmi=1.25, with_bbox=True)
c.plot_matplotlib()



mmi2x2
----------------------------------------------------

.. autofunction:: gvtt.components.mmi2x2

.. plot::
:include-source:

import gvtt

c = gvtt.components.mmi2x2(width_taper=1.875, length_taper=1.0, length_mmi=112.0, width_mmi=5.0, gap_mmi=1.25, with_bbox=True)
c.plot_matplotlib()



rib_taper
----------------------------------------------------

.. autofunction:: gvtt.components.rib_taper

.. plot::
:include-source:

import gvtt

c = gvtt.components.rib_taper(width1=1, width2=1, taper_ratio=50.0)
c.plot_matplotlib()



rib_to_strip
----------------------------------------------------

.. autofunction:: gvtt.components.rib_to_strip

.. plot::
:include-source:

import gvtt

c = gvtt.components.rib_to_strip(length=200.0, width1=3.0, width2=3.0)
c.plot_matplotlib()



strip_taper
----------------------------------------------------

.. autofunction:: gvtt.components.strip_taper

.. plot::
:include-source:

import gvtt

c = gvtt.components.strip_taper(width1=1, width2=1, taper_ratio=25.0)
c.plot_matplotlib()

0 comments on commit e3ae612

Please sign in to comment.