Skip to content

Commit

Permalink
improved error checking in connect_pins_with_waveguide()
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasc-ubc committed Nov 23, 2022
1 parent 1aac5b6 commit b63b373
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion klayout_dot_config/grain.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<salt-grain>
<name>siepic_tools</name>
<version>0.3.94</version>
<version>0.3.95</version>
<api-version>0.27</api-version>
<title>SiEPIC Tools</title>
<doc>Tools for designing Silicon Photonic Integrated Circuits, including waveguides, component simulations, functional verification, Calibre DRC verification, netlist extraction, circuit simulations. Framework and examples for creating layouts using scripts. Includes a generic PDK (GSiP). Other PDKs are installed separately, and depend on SiEPIC-Tools.</doc>
Expand Down
2 changes: 1 addition & 1 deletion klayout_dot_config/python/SiEPIC/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.3.94'
__version__ = '0.3.95'
#from . import install, extend, _globals, core, examples, github, lumerical, scripts, utils, setup
# from . import install, extend, _globals, core, examples, github, scripts, utils, setup
from . import extend, _globals, core, examples, github, scripts, utils, setup, install
Expand Down
10 changes: 7 additions & 3 deletions klayout_dot_config/python/SiEPIC/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,20 @@ def connect_pins_with_waveguide(instanceA, pinA, instanceB, pinB, waveguide = No
# Find pinA and pinB
cpinA = [p for p in componentA.pins if p.pin_name == pinA]
cpinB = [p for p in componentB.pins if p.pin_name == pinB]

# relaxed_pinnames: scan for only the number
if relaxed_pinnames==True:
import re
try:
if cpinA==[]:
cpinA = [p for p in componentA.pins if re.findall(r'\d+', pinA)[0] in p.pin_name]
if re.findall(r'\d+', pinA):
cpinA = [p for p in componentA.pins if re.findall(r'\d+', pinA)[0] in p.pin_name]
if cpinB==[]:
cpinB = [p for p in componentB.pins if re.findall(r'\d+', pinB)[0] in p.pin_name]
if re.findall(r'\d+', pinB):
cpinB = [p for p in componentB.pins if re.findall(r'\d+', pinB)[0] in p.pin_name]
except:
print('error in siepic.scripts.connect_cell')
print('error in siepic.scripts.connect_cell, relaxed_pinnames')


if cpinA==[]:
try:
Expand Down

0 comments on commit b63b373

Please sign in to comment.