Skip to content

Commit

Permalink
Merge pull request #173 from gdsfactory/move_verification_into_klayout
Browse files Browse the repository at this point in the history
Move verification into klayout
  • Loading branch information
joamatab authored Oct 9, 2023
2 parents db2a3ed + 20adba2 commit cc961ca
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/notebooks/11_get_netlist_spice.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

from gdsfactory.samples.demo.lvs import pads_correct, pads_shorted

from gplugins.verification.get_netlist import get_l2n, get_netlist
from gplugins.verification.plot_nets import plot_nets
from gplugins.klayout.get_netlist import get_l2n, get_netlist
from gplugins.klayout.plot_nets import plot_nets

c = pads_correct()
gdspath = c.write_gds()
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/vlsir_netlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from gdsfactory.samples.demo.lvs import pads_correct

import gplugins.vlsir as gs
from gplugins.verification.get_netlist import get_netlist
from gplugins.klayout.get_netlist import get_netlist

# %%
c = pads_correct()
Expand All @@ -55,7 +55,7 @@
kdbnetlist = get_netlist(gdspath)

# convert it to a VLSIR Package
pkg = gs.kdb_vlsir(kdbnetlist, domain="gplugins.verification.example")
pkg = gs.kdb_vlsir(kdbnetlist, domain="gplugins.klayout.example")

# %% [markdown]
# ## Spectre RF
Expand Down
10 changes: 5 additions & 5 deletions gplugins/klayout/dataprep/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RegionCollection:
"""

def __init__(self, gdspath, cell_name: str | None = None) -> None:
lib = kf.kcell.KCLayout()
lib = kf.kcell.KCLayout(str(gdspath))
lib.read(filename=str(gdspath))
self.layout = lib.cell_by_name(cell_name) if cell_name else lib.top_cell()
self.lib = lib
Expand Down Expand Up @@ -189,7 +189,7 @@ def get_fill(
fill_cell = kf.KCell(fill_cellname)
for layer in fill_layers:
layer = kf.kcl.layer(*layer)
fill_cell << kf.cells.straight.straight(
_ = fill_cell << kf.cells.straight.straight(
width=size[0], length=size[1], layer=layer
)

Expand Down Expand Up @@ -220,7 +220,7 @@ def get_fill(

d = RegionCollection(gdspath)
d[LAYER.N] = d[LAYER.WG].copy()
d[LAYER.WG].clear()
# d[LAYER.WG].clear()

# d[LAYER.SLAB90] += 2 # grow slab by 2um
# d[LAYER.SLAB90] -= 2 # shrink slab by 2um
Expand All @@ -237,8 +237,8 @@ def get_fill(
d[LAYER.FLOORPLAN] - d[LAYER.WG],
size=(0.1, 0.1),
spacing=(0.1, 0.1),
fill_layers=(d[LAYER.WG],),
fill_layers=(LAYER.WG,),
)
c = d.get_kcell()
_ = c << fill_cell
fill_cell.write("fill.gds")
c.write("fill.gds")
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_l2n(gdspath, klayout_tech_path: PathType | None = None) -> kdb.LayoutToN
klayout_tech_path: Path to the klayout technology file.
"""
lib = kf.kcell.KCLayout()
lib = kf.kcell.KCLayout(str(gdspath))
lib.read(filename=str(gdspath))
c = lib[0]

Expand Down
File renamed without changes.
Empty file removed gplugins/verification/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions gplugins/vlsir/export_netlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def export_netlist(pkg: Package, fmt: str = "spice", dest=None) -> str:
if __name__ == "__main__":
from gdsfactory.samples.demo.lvs import pads_correct

from gplugins.verification.get_netlist import get_netlist
from gplugins.klayout.get_netlist import get_netlist

format_to_suffix = {
"spice": ".sp",
Expand All @@ -201,7 +201,7 @@ def export_netlist(pkg: Package, fmt: str = "spice", dest=None) -> str:
kdbnetlist = get_netlist(gdspath)

# convert it to a VLSIR Package
pkg = kdb_vlsir(kdbnetlist, domain="gplugins.verification.example")
pkg = kdb_vlsir(kdbnetlist, domain="gplugins.klayout.example")

# export the netlist to the specified format
out = StringIO()
Expand Down
2 changes: 1 addition & 1 deletion gplugins/vlsir/tests/resources/pads_correct.cir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; `circuit.Package` `gplugins.verification.example`
; `circuit.Package` `gplugins.klayout.example`
; Generated by `vlsirtools.XyceNetlister`
;

Expand Down
2 changes: 1 addition & 1 deletion gplugins/vlsir/tests/resources/pads_correct.scs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// `circuit.Package` `gplugins.verification.example`
// `circuit.Package` `gplugins.klayout.example`
// Generated by `vlsirtools.SpectreNetlister`
//

Expand Down
2 changes: 1 addition & 1 deletion gplugins/vlsir/tests/resources/pads_correct.sp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* `circuit.Package` `gplugins.verification.example`
* `circuit.Package` `gplugins.klayout.example`
* Generated by `vlsirtools.SpiceNetlister`
*

Expand Down
6 changes: 3 additions & 3 deletions gplugins/vlsir/tests/test_vlsir.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from gdsfactory.samples.demo.lvs import pads_correct

from gplugins.common.config import PATH
from gplugins.verification.get_netlist import get_netlist
from gplugins.klayout.get_netlist import get_netlist
from gplugins.vlsir import export_netlist, kdb_vlsir


Expand All @@ -12,7 +12,7 @@ def test_kdb_vlsir() -> None:
c = pads_correct()
gdspath = c.write_gds()
kdbnet = get_netlist(gdspath)
pkg = kdb_vlsir(kdbnet, domain="gplugins.verification.example")
pkg = kdb_vlsir(kdbnet, domain="gplugins.klayout.example")
assert pkg is not None
assert len(pkg.modules) == 7
assert len(pkg.modules[6].instances) == 10
Expand All @@ -25,7 +25,7 @@ def test_export_netlist() -> None:
c = pads_correct()
gdspath = c.write_gds()
kdbnet = get_netlist(gdspath)
pkg = kdb_vlsir(kdbnet, domain="gplugins.verification.example")
pkg = kdb_vlsir(kdbnet, domain="gplugins.klayout.example")
outfile = PATH.module / "vlsir" / "tests" / "resources" / "pads_correct"
format_to_suffix = {
"spice": ".sp",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ gmsh = [
"meshwell>=1.0.0,<1.1.0"
]
klayout = [
"kfactory[git,ipy]>=0.8.4,<0.9"
"kfactory[git,ipy]>=0.9.3,<0.10"
]
meow = [
"jaxlib",
Expand Down

0 comments on commit cc961ca

Please sign in to comment.