diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ef6e6b3e5..dae7fe2e6 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -27,6 +27,7 @@ jobs: path: "./docs/_build/html/" deploy-docs: needs: build-docs + if: ${{ github.ref == 'refs/heads/main' }} permissions: pages: write id-token: write @@ -39,4 +40,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7bdb9958..c30d9e893 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,12 +6,6 @@ repos: - id: trailing-whitespace - id: requirements-txt-fixer - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" - hooks: - - id: ruff - args: [ --fix, --exit-non-zero-on-fix ] - - id: ruff-format - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.10.0 hooks: @@ -22,3 +16,9 @@ repos: hooks: - id: nbstripout files: ".ipynb" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.4.4" + hooks: + - id: ruff + args: [ --fix, --exit-non-zero-on-fix ] + - id: ruff-format diff --git a/Makefile b/Makefile index 476ba644a..952a4243b 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ doc: python docs/write_components_doc.py update-pre: - pre-commit autoupdate --bleeding-edge + pre-commit autoupdate git-rm-merged: git branch -D `git branch --merged | grep -v \* | xargs` @@ -31,6 +31,8 @@ release: git push --tags build: + rm -rf sky130/src/sky130_fd_sc_hd/timing + find . -type d -name "tests" -exec rm -rf {} + rm -rf dist pip install build python -m build diff --git a/docs/notebooks b/docs/notebooks new file mode 120000 index 000000000..8f9a5b2e6 --- /dev/null +++ b/docs/notebooks @@ -0,0 +1 @@ +../notebooks \ No newline at end of file diff --git a/docs/notebooks/intro.ipynb b/notebooks/intro.ipynb similarity index 84% rename from docs/notebooks/intro.ipynb rename to notebooks/intro.ipynb index 4176ccfc9..f6fc8d167 100644 --- a/docs/notebooks/intro.ipynb +++ b/notebooks/intro.ipynb @@ -49,7 +49,7 @@ "metadata": {}, "outputs": [], "source": [ - "# sky130.cross_sections" + "dir(sc)" ] }, { @@ -60,21 +60,9 @@ "Let's explore the available layers:" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "6", - "metadata": {}, - "outputs": [], - "source": [ - "# help(gf.pdk)\n", - "# help(gf.get_active_pdk().get_layer_stack)\n", - "# gf.pdk.get_layer_stack()" - ] - }, { "cell_type": "markdown", - "id": "7", + "id": "6", "metadata": {}, "source": [ "You can also verify this is the active PDK on `gdsfactory`:" @@ -83,7 +71,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -92,7 +80,7 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "8", "metadata": {}, "source": [ "Now, let's explore available symbols for the components:" @@ -101,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -111,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "11", + "id": "10", "metadata": {}, "source": [ "Let's try exploring an example basic `nfet`:" @@ -120,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +118,7 @@ }, { "cell_type": "markdown", - "id": "13", + "id": "12", "metadata": {}, "source": [ "Explore it's ports:" @@ -139,16 +127,16 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "13", "metadata": {}, "outputs": [], "source": [ - "c.ports" + "c.pprint_ports()" ] }, { "cell_type": "markdown", - "id": "15", + "id": "14", "metadata": {}, "source": [ "We can also explore the digital cells:" @@ -157,7 +145,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -168,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -178,7 +166,7 @@ }, { "cell_type": "markdown", - "id": "18", + "id": "17", "metadata": {}, "source": [ "TODO: add Parametric cells natively into gdsfactory `sky130` pdk." @@ -187,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -201,25 +189,24 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "19", "metadata": {}, "outputs": [], "source": [ - "c = gf.Component(\"demo_connect\")\n", + "c = gf.Component()\n", "g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n", "g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n", "g2.dmove((15, 10))\n", "route = gf.routing.route_single_electrical(\n", - " g1.ports[\"VPWR\"], g2.ports[\"VPWR\"], cross_section=st.xs_metal1\n", + " c, g1.ports[\"VPWR\"], g2.ports[\"VPWR\"], cross_section=st.xs_metal1\n", ")\n", - "c.add(route.references)\n", "c" ] }, { "cell_type": "code", "execution_count": null, - "id": "21", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -229,30 +216,19 @@ }, { "cell_type": "markdown", - "id": "22", + "id": "21", "metadata": {}, "source": [ - "## Netlist driven flow\n", - "\n", - "For netlist driven flow you can define circuits for place and route. You have two options:\n", + "## Spice simulations\n", "\n", - "1. in python\n", - "2. in YAML" + "You can use hdl21 for running simulations.\n" ] }, { "cell_type": "markdown", - "id": "23", + "id": "22", "metadata": {}, - "source": [ - "## Spice simulations\n", - "\n", - "You can use `PySpice` for running simulations.\n", - "\n", - "gdsfactory can extract the netlist and simulate the circuit.\n", - "\n", - "TODO: add some relevant examples." - ] + "source": [] } ], "metadata": { diff --git a/pyproject.toml b/pyproject.toml index 36e27b63d..1ed52cc0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Operating System :: OS Independent" ] dependencies = [ - "gdsfactory~=8.3.1", + "gdsfactory~=8.4.0", "PySpice" ] description = "skywater130 pdk" @@ -88,7 +88,7 @@ select = [ "docs/notebooks/intro.py" = ['B018'] [tool.setuptools.package-data] -mypkg = ["*.csv", "*.yaml"] +mypkg = ["*.gds"] [tool.setuptools.packages] find = {} diff --git a/sky130/components.py b/sky130/components.py index 78bba31ae..e852b0e08 100644 --- a/sky130/components.py +++ b/sky130/components.py @@ -13454,7 +13454,8 @@ def sky130_fd_sc_hd__lpflow_clkbufkapwr_8() -> gf.Component: if __name__ == "__main__": - c = sky130_fd_pr__rf_nfet_01v8_lvt_cM04W1p65L0p18() + c = sky130_fd_sc_hd__a32oi_2() + # c = sky130_fd_pr__rf_nfet_01v8_lvt_cM04W1p65L0p18() # c = sky130_fd_pr__rf_nfet_01v8_lvt_aM02W5p00L0p18() # c = sky130_fd_sc_hd__inv_1() c.show() diff --git a/sky130/nmos.py b/sky130/nmos.py index 4c906c281..62b5f409e 100644 --- a/sky130/nmos.py +++ b/sky130/nmos.py @@ -53,7 +53,7 @@ def nmos( layer=diffusion_layer, ) - poly.ymin = -end_cap_length + poly.dymin = -end_cap_length poly.dxmin = 0 diff.dxmin = -sd_width @@ -76,10 +76,10 @@ def nmos( contact_array_right = c << contact_array contact_array_left.dxmin = -sd_width + contact_enclosure - contact_array_left.ymin = contact_enclosure + contact_array_left.dymin = contact_enclosure contact_array_right.dxmax = diff.dxmax - contact_enclosure - contact_array_right.ymin = contact_enclosure + contact_array_right.dymin = contact_enclosure return c diff --git a/sky130/pcells/nmos.py b/sky130/pcells/nmos.py index af3c51922..9e2cc317f 100644 --- a/sky130/pcells/nmos.py +++ b/sky130/pcells/nmos.py @@ -131,7 +131,7 @@ def nmos( li1 = c.add_ref(rect_lid, rows=1, columns=nc, spacing=con_sp) li2 = c.add_ref(rect_lid, rows=1, columns=nc, spacing=con_sp) - # rect_m1d = gf.components.rectangle(size= ( contact_size[0] + 2*mcon_enclosure[0], cont_arr1.dymax - cont_arr1.ymin + contact_size[1] + 2*mcon_enclosure[1]), layer= m1_layer) + # rect_m1d = gf.components.rectangle(size= ( contact_size[0] + 2*mcon_enclosure[0], cont_arr1.dymax - cont_arr1.dymin + contact_size[1] + 2*mcon_enclosure[1]), layer= m1_layer) rect_m1d = gf.components.rectangle( size=(contact_size[0] + 2 * mcon_enclosure[0], gate_width), layer=m1_layer ) @@ -398,7 +398,7 @@ def nmos( rect_dnw = gf.components.rectangle( size=( rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0], - rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1], + rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1], ), layer=dnwell_layer, ) diff --git a/sky130/pcells/nmos_5v.py b/sky130/pcells/nmos_5v.py index 4b42b9524..d26bd9625 100644 --- a/sky130/pcells/nmos_5v.py +++ b/sky130/pcells/nmos_5v.py @@ -358,7 +358,7 @@ def nmos_5v( rect_dnw = gf.components.rectangle( size=( rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0], - rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1], + rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1], ), layer=dnwell_layer, ) @@ -370,7 +370,7 @@ def nmos_5v( rect_hv = gf.components.rectangle( size=( rect_pw.dxmax - rect_pw.dxmin + 2 * dnwell_enclosure[0], - rect_pw.dymax - rect_pw.ymin + 2 * dnwell_enclosure[1], + rect_pw.dymax - rect_pw.dymin + 2 * dnwell_enclosure[1], ), layer=hvi_layer, ) diff --git a/sky130/pcells/npn_W1L1.py b/sky130/pcells/npn_W1L1.py index e104d4807..fc3ee240f 100644 --- a/sky130/pcells/npn_W1L1.py +++ b/sky130/pcells/npn_W1L1.py @@ -213,7 +213,7 @@ def npn_W1L1( # generate its contacts and local interconnects and mcon and metal1 - nr = ceil((B_in.dymax - B_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr = ceil((B_in.dymax - B_in.dymin) / (contact_size[1] + contact_spacing[1])) nc = ceil((B_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -222,7 +222,7 @@ def npn_W1L1( nc -= 1 if ( - (B_in.dymax - B_in.ymin - nr * contact_size[1] - (nr - 1) * contact_spacing[1]) + (B_in.dymax - B_in.dymin - nr * contact_size[1] - (nr - 1) * contact_spacing[1]) / 2 ) < contact_enclosure[1]: nr -= 1 @@ -312,7 +312,7 @@ def npn_W1L1( cont_B_arr1.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_b * contact_size[1] - (nr_b - 1) * contact_spacing[1] ) @@ -329,7 +329,7 @@ def npn_W1L1( cont_B_arr2.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_b * contact_size[1] - (nr_b - 1) * contact_spacing[1] ) @@ -490,7 +490,7 @@ def npn_W1L1( c.add_ref(gf.boolean(A=nmC_out, B=nmC_in, operation="not", layer=nsdm_layer)) # generate its contact and local interconnects - nr = ceil((C_in.dymax - C_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr = ceil((C_in.dymax - C_in.dymin) / (contact_size[1] + contact_spacing[1])) nc = ceil((C_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -499,7 +499,7 @@ def npn_W1L1( nc -= 1 if ( - (C_in.dymax - C_in.ymin - nr * contact_size[1] - (nr - 1) * contact_spacing[1]) + (C_in.dymax - C_in.dymin - nr * contact_size[1] - (nr - 1) * contact_spacing[1]) / 2 ) < contact_enclosure[1]: nr -= 1 @@ -609,7 +609,7 @@ def npn_W1L1( cont_C_arr2.dmovey( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_c * contact_size[1] - (nr_c - 1) * contact_spacing[1] ) @@ -724,7 +724,7 @@ def npn_W1L1( rect_pwell = gf.components.rectangle( size=( B_out.dxmax - B_out.dxmin + 2 * diff_enclosure[0], - B_out.dymax - B_out.ymin + 2 * diff_enclosure[1], + B_out.dymax - B_out.dymin + 2 * diff_enclosure[1], ), layer=pwell_layer, ) @@ -739,7 +739,7 @@ def npn_W1L1( rect_dnw = gf.components.rectangle( size=( C_out.dxmax - C_out.dxmin + 2 * diff_enclosure[0], - C_out.dymax - C_out.ymin + 2 * diff_enclosure[1], + C_out.dymax - C_out.dymin + 2 * diff_enclosure[1], ), layer=dnwell_layer, ) @@ -753,7 +753,7 @@ def npn_W1L1( npn = c.add_ref( gf.components.rectangle( - size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.ymin), layer=npn_layer + size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.dymin), layer=npn_layer ) ) npn.connect( diff --git a/sky130/pcells/npn_W1L2.py b/sky130/pcells/npn_W1L2.py index 7536a11e4..a6c206200 100644 --- a/sky130/pcells/npn_W1L2.py +++ b/sky130/pcells/npn_W1L2.py @@ -207,7 +207,7 @@ def npn_W1L2( # generate its contacts and local interconnects and mcon and metal1 - nr_v = ceil((B_in.dymax - B_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr_v = ceil((B_in.dymax - B_in.dymin) / (contact_size[1] + contact_spacing[1])) nc_v = ceil((B_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -218,7 +218,7 @@ def npn_W1L2( if ( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -327,7 +327,7 @@ def npn_W1L2( cont_B_arr1.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -344,7 +344,7 @@ def npn_W1L2( cont_B_arr2.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -496,7 +496,7 @@ def npn_W1L2( c.add_ref(gf.boolean(A=nmC_out, B=nmC_in, operation="A-B", layer=nsdm_layer)) # generate its contact and local interconnects - nr_v = ceil((C_in.dymax - C_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr_v = ceil((C_in.dymax - C_in.dymin) / (contact_size[1] + contact_spacing[1])) nc_v = ceil((C_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -507,7 +507,7 @@ def npn_W1L2( if ( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -614,7 +614,7 @@ def npn_W1L2( cont_C_arr1.dmovey( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -633,7 +633,7 @@ def npn_W1L2( cont_C_arr2.dmovey( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -747,7 +747,7 @@ def npn_W1L2( rect_pwell = gf.components.rectangle( size=( B_out.dxmax - B_out.dxmin + 2 * diff_enclosure[0], - B_out.dymax - B_out.ymin + 2 * diff_enclosure[1], + B_out.dymax - B_out.dymin + 2 * diff_enclosure[1], ), layer=pwell_layer, ) @@ -759,7 +759,7 @@ def npn_W1L2( rect_dnw = gf.components.rectangle( size=( C_out.dxmax - C_out.dxmin + 2 * diff_enclosure[0], - C_out.dymax - C_out.ymin + 2 * diff_enclosure[1], + C_out.dymax - C_out.dymin + 2 * diff_enclosure[1], ), layer=dnwell_layer, ) @@ -770,7 +770,7 @@ def npn_W1L2( # generating npn identifier npn = c.add_ref( gf.components.rectangle( - size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.ymin), layer=npn_layer + size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.dymin), layer=npn_layer ) ) npn.connect("e1", C_out.ports["e3"], allow_layer_mismatch=True) diff --git a/sky130/pcells/p_n_poly.py b/sky130/pcells/p_n_poly.py index 9e3d77eb4..2f0d769a8 100644 --- a/sky130/pcells/p_n_poly.py +++ b/sky130/pcells/p_n_poly.py @@ -129,11 +129,11 @@ def p_n_poly( rect_mc = gf.components.rectangle(size=contact_size, layer=mcon_layer) nr_m = ceil( - (rect_li_m1.dymax - rect_li_m1.ymin) / (contact_size[1] + contact_spacing[1]) + (rect_li_m1.dymax - rect_li_m1.dymin) / (contact_size[1] + contact_spacing[1]) ) if ( rect_li_m1.dymax - - rect_li_m1.ymin + - rect_li_m1.dymin - nr_m * contact_size[1] - (nr_m - 1) * contact_spacing[1] ) / 2 < contact_enclosure[1]: @@ -174,7 +174,7 @@ def p_n_poly( mcon_arr.dmovey( ( rect_li_m1.dymax - - rect_li_m1.ymin + - rect_li_m1.dymin - nr_m * contact_size[1] - (nr_m - 1) * contact_spacing[1] ) diff --git a/sky130/pcells/p_p_poly.py b/sky130/pcells/p_p_poly.py index 090add840..da34c35b3 100644 --- a/sky130/pcells/p_p_poly.py +++ b/sky130/pcells/p_p_poly.py @@ -134,11 +134,11 @@ def p_p_poly( rect_mc = gf.components.rectangle(size=contact_size, layer=mcon_layer) nr_m = ceil( - (rect_li_m1.dymax - rect_li_m1.ymin) / (contact_size[1] + contact_spacing[1]) + (rect_li_m1.dymax - rect_li_m1.dymin) / (contact_size[1] + contact_spacing[1]) ) if ( rect_li_m1.dymax - - rect_li_m1.ymin + - rect_li_m1.dymin - nr_m * contact_size[1] - (nr_m - 1) * contact_spacing[1] ) / 2 < contact_enclosure[1]: @@ -179,7 +179,7 @@ def p_p_poly( mcon_arr.dmovey( ( rect_li_m1.dymax - - rect_li_m1.ymin + - rect_li_m1.dymin - nr_m * contact_size[1] - (nr_m - 1) * contact_spacing[1] ) diff --git a/sky130/pcells/pmos.py b/sky130/pcells/pmos.py index ec8c4546e..aa1895665 100644 --- a/sky130/pcells/pmos.py +++ b/sky130/pcells/pmos.py @@ -392,7 +392,7 @@ def pmos( rect_dnw = gf.components.rectangle( size=( rect_nw.dxmax - rect_nw.dxmin + 2 * dnwell_enclosure[0], - rect_nw.dymax - rect_nw.ymin + 2 * dnwell_enclosure[1], + rect_nw.dymax - rect_nw.dymin + 2 * dnwell_enclosure[1], ), layer=dnwell_layer, ) diff --git a/sky130/pcells/pmos_5v.py b/sky130/pcells/pmos_5v.py index 13bc15086..66f98f2a6 100644 --- a/sky130/pcells/pmos_5v.py +++ b/sky130/pcells/pmos_5v.py @@ -349,7 +349,7 @@ def pmos_5v( rect_dnw = gf.components.rectangle( size=( rect_nw.dxmax - rect_nw.dxmin + 2 * dnwell_enclosure[0], - rect_nw.dymax - rect_nw.ymin + 2 * dnwell_enclosure[1], + rect_nw.dymax - rect_nw.dymin + 2 * dnwell_enclosure[1], ), layer=dnwell_layer, ) @@ -361,7 +361,7 @@ def pmos_5v( rect_hv = gf.components.rectangle( size=( rect_nw.dxmax - rect_nw.dxmin + 2 * dnwell_enclosure[0], - rect_nw.dymax - rect_nw.ymin + 2 * dnwell_enclosure[1], + rect_nw.dymax - rect_nw.dymin + 2 * dnwell_enclosure[1], ), layer=hvi_layer, ) diff --git a/sky130/pcells/pnp.py b/sky130/pcells/pnp.py index dd8ab9417..19bd5d212 100644 --- a/sky130/pcells/pnp.py +++ b/sky130/pcells/pnp.py @@ -181,7 +181,7 @@ def pnp( # generate its contacts and local interconnects and mcon and metal1 - nr_v = ceil((B_in.dymax - B_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr_v = ceil((B_in.dymax - B_in.dymin) / (contact_size[1] + contact_spacing[1])) nc_v = ceil((B_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -192,7 +192,7 @@ def pnp( if ( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -300,7 +300,7 @@ def pnp( cont_B_arr1.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -317,7 +317,7 @@ def pnp( cont_B_arr2.dmovey( ( B_in.dymax - - B_in.ymin + - B_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -469,7 +469,7 @@ def pnp( c.add_ref(gf.boolean(A=pmC_out, B=pmC_in, operation="A-B", layer=psdm_layer)) # generate its contact and local interconnects - nr_v = ceil((C_in.dymax - C_in.ymin) / (contact_size[1] + contact_spacing[1])) + nr_v = ceil((C_in.dymax - C_in.dymin) / (contact_size[1] + contact_spacing[1])) nc_v = ceil((C_width) / (contact_size[0] + contact_spacing[0])) if ( @@ -480,7 +480,7 @@ def pnp( if ( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -587,7 +587,7 @@ def pnp( cont_C_arr1.dmovey( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -606,7 +606,7 @@ def pnp( cont_C_arr2.dmovey( ( C_in.dymax - - C_in.ymin + - C_in.dymin - nr_v * contact_size[1] - (nr_v - 1) * contact_spacing[1] ) @@ -720,7 +720,7 @@ def pnp( rect_nwell = gf.components.rectangle( size=( B_out.dxmax - B_out.dxmin + 2 * diff_enclosure[0], - B_out.dymax - B_out.ymin + 2 * diff_enclosure[1], + B_out.dymax - B_out.dymin + 2 * diff_enclosure[1], ), layer=nwell_layer, ) @@ -731,7 +731,7 @@ def pnp( # generating pnp identifier npn = c.add_ref( gf.components.rectangle( - size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.ymin), layer=pnp_layer + size=(C_out.dxmax - C_out.dxmin, C_out.dymax - C_out.dymin), layer=pnp_layer ) ) npn.connect("e1", C_out.ports["e3"], allow_layer_mismatch=True)