Skip to content

Commit

Permalink
💄 Update examples to ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed May 22, 2024
1 parent 1176d9f commit 493def7
Show file tree
Hide file tree
Showing 6 changed files with 3,922 additions and 873 deletions.
14 changes: 0 additions & 14 deletions docs/notebooks/Makefile

This file was deleted.

282 changes: 282 additions & 0 deletions docs/notebooks/intro.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "e4abbd64",
"metadata": {},
"source": [
"# Layout\n",
"\n",
"## Layout driven flow\n",
"\n",
"You can import the PDK and layout any of the standard cells"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5a160bbd",
"metadata": {},
"outputs": [],
"source": [
"import gdsfactory as gf\n",
"from gdsfactory.config import rich_output\n",
"gf.config.rich_output()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5b4ea2e4",
"metadata": {},
"outputs": [],
"source": [
"import sky130\n",
"import sky130.components as sc\n",
"import sky130.tech as st"
]
},
{
"cell_type": "markdown",
"id": "2c622905",
"metadata": {},
"source": [
"If you want to see what are the cells available:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a9b61cd7",
"metadata": {},
"outputs": [],
"source": [
"# sky130.cells"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "19872424",
"metadata": {},
"outputs": [],
"source": [
"# sky130.cross_sections"
]
},
{
"cell_type": "markdown",
"id": "8ba69f30",
"metadata": {},
"source": [
"Let's explore the available layers:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ab318aea",
"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": "6414d6cb",
"metadata": {},
"source": [
"You can also verify this is the active PDK on `gdsfactory`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b7512a8b",
"metadata": {},
"outputs": [],
"source": [
"gf.pdk.get_active_pdk().name"
]
},
{
"cell_type": "markdown",
"id": "5747fd38",
"metadata": {},
"source": [
"Now, let's explore available symbols for the components:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6a0f3119",
"metadata": {},
"outputs": [],
"source": [
"# dir(sky130)\n",
"sky130"
]
},
{
"cell_type": "markdown",
"id": "f769dbb1",
"metadata": {},
"source": [
"Let's try exploring an example basic `nfet`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3e4a603c",
"metadata": {},
"outputs": [],
"source": [
"c = sc.sky130_fd_pr__rf_nfet_01v8_aM02W1p65L0p15()\n",
"c"
]
},
{
"cell_type": "markdown",
"id": "b03fd5c3",
"metadata": {},
"source": [
"Explore it's ports:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bbb8ef08",
"metadata": {},
"outputs": [],
"source": [
"c.ports"
]
},
{
"cell_type": "markdown",
"id": "af7e5375",
"metadata": {},
"source": [
"We can also explore the digital cells:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8946842c",
"metadata": {},
"outputs": [],
"source": [
"c = sc.sky130_fd_sc_hd__a2111o_1()\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d5d6f687",
"metadata": {},
"outputs": [],
"source": [
"scene = c.to_3d()\n",
"scene.show()"
]
},
{
"cell_type": "markdown",
"id": "19a86bd4",
"metadata": {},
"source": [
"TODO: add Parametric cells natively into gdsfactory `sky130` pdk."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5a72f996",
"metadata": {},
"outputs": [],
"source": [
"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.move((15, 10))\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "90789eb4",
"metadata": {},
"outputs": [],
"source": [
"c = gf.Component(\"demo_connect\")\n",
"g1 = c << sc.sky130_fd_sc_hd__a2111o_1()\n",
"g2 = c << sc.sky130_fd_sc_hd__a311oi_4()\n",
"g2.move((15, 10))\n",
"route = gf.routing.get_route_electrical(\n",
" 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": "da60090f",
"metadata": {},
"outputs": [],
"source": [
"scene = c.to_3d()\n",
"scene.show()"
]
},
{
"cell_type": "markdown",
"id": "018d097d",
"metadata": {},
"source": [
"## Netlist driven flow\n",
"\n",
"For netlist driven flow you can define circuits for place and route. You have two options:\n",
"\n",
"1. in python\n",
"2. in YAML"
]
},
{
"cell_type": "markdown",
"id": "e60fcf66",
"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."
]
}
],
"metadata": {
"jupytext": {
"custom_cell_magics": "kql"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 493def7

Please sign in to comment.