Skip to content

Plot edb snippet #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ doc/source/api/_autosummary
target/

# Jupyter Notebook
.ipynb_checkpoints
notebooks/
#.ipynb_checkpoints
#notebooks/

# IPython
profile_default/
Expand Down
192 changes: 192 additions & 0 deletions notebooks/assign_ds_model.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "659acad1",
"metadata": {},
"source": [
"# Imports"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "de19eb7d",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from ansys.edb.database import Database\n",
"from ansys.edb.session import launch_session\n",
"import ansys.edb as edb\n",
"from ansys.edb.definition.djordjecvic_sarkar_model import DjordjecvicSarkarModel\n",
"import json"
]
},
{
"cell_type": "markdown",
"id": "d817c01f",
"metadata": {},
"source": [
"# Configs"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "67bf7709",
"metadata": {},
"outputs": [],
"source": [
"ROOT = os.getcwd()\n",
"EXE_ROOT = os.environ['ANSYSEM_ROOT232']\n",
"EDB_FILE = r'D:\\2023\\PYEDB\\Galileo.aedb'"
]
},
{
"cell_type": "markdown",
"id": "6e0aeed6",
"metadata": {},
"source": [
"# Launch session"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "bac4d383",
"metadata": {},
"outputs": [],
"source": [
"session = launch_session(EXE_ROOT, 50051)"
]
},
{
"cell_type": "markdown",
"id": "ae0454f7",
"metadata": {},
"source": [
"# Open DB"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "f88b342f",
"metadata": {},
"outputs": [],
"source": [
"db = Database.open(EDB_FILE,False)\n",
"cell = db.circuit_cells[0]\n",
"layout = cell.layout\n",
"layerStats = []\n",
"lc = layout.layer_collection\n",
"layers = lc.get_layers()\n",
"layer_names = [i.name for i in layers]"
]
},
{
"cell_type": "markdown",
"id": "71f27b0e",
"metadata": {},
"source": [
"# Extracting layer by layer information"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "4313b4ed",
"metadata": {},
"outputs": [],
"source": [
"layer_info = []\n",
"for i in layers:\n",
" if i.is_stackup_layer:\n",
" name = i.name\n",
" layer_type = i.type.name\n",
" material = i.get_material().value\n",
" thickness = i.thickness.value\n",
" lower_elevation = i.lower_elevation.value\n",
" full_material = i.get_fill_material().value\n",
" \n",
" if 'DIELECTRIC_LAYER' in str(layer_type):\n",
" matmodel = edb.definition.material_def.MaterialDef.find_by_name(db,i.get_material().value)\n",
" ds = DjordjecvicSarkarModel.create()\n",
" matmodel.dielectric_material_model=ds \n",
" \n",
"db.save_as(r'D:\\2023\\PYEDB\\Galileo_modified.aedb')"
]
},
{
"cell_type": "markdown",
"id": "fa9042db",
"metadata": {},
"source": [
"# Write layer information to json file"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "2e9c30af",
"metadata": {},
"outputs": [],
"source": [
"stackup_file = os.path.join(os.getcwd(),'stackup.json')\n",
"with open(stackup_file, 'w') as fp:\n",
" json.dump(layer_info, fp,indent=' ')"
]
},
{
"cell_type": "markdown",
"id": "0e7751ba",
"metadata": {},
"source": [
"# End the session"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "f0750fb4",
"metadata": {},
"outputs": [],
"source": [
"session.disconnect()"
]
},
{
"cell_type": "markdown",
"id": "c302735a",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.9 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
},
"vscode": {
"interpreter": {
"hash": "26de051ba29f2982a8de78e945f0abaf191376122a1563185a90213a26c5da77"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}
292 changes: 292 additions & 0 deletions notebooks/plot_nets.ipynb

Large diffs are not rendered by default.

Loading