Skip to content

Commit

Permalink
fix notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Jun 29, 2024
1 parent c7d3945 commit 749a33b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 55 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks
72 changes: 24 additions & 48 deletions docs/notebooks/intro.ipynb → notebooks/intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"metadata": {},
"outputs": [],
"source": [
"# sky130.cross_sections"
"dir(sc)"
]
},
{
Expand All @@ -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`:"
Expand All @@ -83,7 +71,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -92,7 +80,7 @@
},
{
"cell_type": "markdown",
"id": "9",
"id": "8",
"metadata": {},
"source": [
"Now, let's explore available symbols for the components:"
Expand All @@ -101,7 +89,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -111,7 +99,7 @@
},
{
"cell_type": "markdown",
"id": "11",
"id": "10",
"metadata": {},
"source": [
"Let's try exploring an example basic `nfet`:"
Expand All @@ -120,7 +108,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -130,7 +118,7 @@
},
{
"cell_type": "markdown",
"id": "13",
"id": "12",
"metadata": {},
"source": [
"Explore it's ports:"
Expand All @@ -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:"
Expand All @@ -157,7 +145,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -168,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -178,7 +166,7 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "17",
"metadata": {},
"source": [
"TODO: add Parametric cells natively into gdsfactory `sky130` pdk."
Expand All @@ -187,7 +175,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -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": [
Expand All @@ -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": {
Expand Down

0 comments on commit 749a33b

Please sign in to comment.