Skip to content

Commit

Permalink
Verification output using KLayout's rdb & Marker Database Browser
Browse files Browse the repository at this point in the history
and bug fix for lists being updated function calls.

and fix for wg-to-path when ROUND_SHAPE selected.


Former-commit-id: e17a34c
  • Loading branch information
lukasc-ubc committed Nov 22, 2015
1 parent 8369f3a commit 5c436f0
Show file tree
Hide file tree
Showing 9 changed files with 646 additions and 328 deletions.
Binary file modified SiEPIC_EBeam_PDK_Verification_Check.gds
Binary file not shown.
Binary file modified klayout_dot_config/libraries/SiEPIC-EBeam.gds
Binary file not shown.
18 changes: 12 additions & 6 deletions klayout_dot_config/pymacros/INTERCONNECT.lym
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ version = sys.version

import string


"""
def netlist_extraction(topcell):
# Collection of functions to extract the circuit netlist from the physical layout

Expand All @@ -66,7 +66,7 @@ def netlist_extraction(topcell):
identify_all_nets(optical_pins, optical_waveguides, optical_components)

return optical_waveguides, optical_components

"""



Expand Down Expand Up @@ -94,10 +94,10 @@ LayerINTERCONNECTN = layout.layer(LayerINTERCONNECT)


# extract the circuit netlist from the physical layout:
optical_waveguides, optical_components = netlist_extraction(topcell)
optical_waveguides, optical_components = netlist_extraction(topcell)[:2]

# Output the Spice netlist:
text_Spice = generate_Spice_file(topcell, optical_waveguides, optical_components)
text_Spice, num_detectors = generate_Spice_file(topcell, optical_waveguides, optical_components)
print text_Spice

filename = '/tmp/%s.spi' % topcell.name
Expand All @@ -112,11 +112,17 @@ text_lsf = 'switchtolayout;\n'
text_lsf += 'deleteall;\n'
text_lsf += 'importnetlist("%s");\n' % filename
text_lsf += 'run;\n'
text_lsf += 't1 = getresult("ONA_1", "input 1/mode 1/gain");\n'
text_lsf += 'visualize(t1);\n'
for i in range(0, num_detectors):
text_lsf += 't%s = getresult("ONA_1", "input %s/mode 1/gain");\n' % (i+1, i+1)
text_lsf += 'visualize(t1'
for i in range(1, num_detectors):
text_lsf += ', t%s' % (i+1)
text_lsf += ');\n'

file.write (text_lsf)
file.close()

print(text_lsf)

if sys.platform.startswith('freebsd'):
# FreeBSD-specific code here...
Expand Down
63 changes: 63 additions & 0 deletions klayout_dot_config/pymacros/ResultsMarker_tests.lym
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<klayout-macro>
<description/>
<version/>
<category>pymacros</category>
<prolog/>
<epilog/>
<doc/>
<autorun>false</autorun>
<autorun-early>false</autorun-early>
<shortcut/>
<show-in-menu>false</show-in-menu>
<group-name/>
<menu-path/>
<interpreter>python</interpreter>
<dsl-interpreter-name/>
<text>import pya

# Experimenting with the Results database Rdb.



# Configure variables to draw structures in the presently selected cell:
lv = pya.Application.instance().main_window().current_view()
if lv == None:
raise Exception("No view selected")
# Find the currently selected layout.
ly = pya.Application.instance().main_window().current_view().active_cellview().layout()
if ly == None:
raise Exception("No layout")
cv = pya.Application.instance().main_window().current_view().active_cellview()
# find the currently selected cell:
cell = pya.Application.instance().main_window().current_view().active_cellview().cell
if cell == None:
raise Exception("No cell")
# fetch the database parameters
dbu = ly.dbu


rdb_i = lv.create_rdb("SiEPIC_Verification")
rdb = lv.rdb(rdb_i)

rdb_cat_id_wg = rdb.create_category("Waveguide errors")
rdb_cat_id_wg_disc = rdb.create_category(rdb_cat_id_wg, "Disconnected Waveguides")
rdb_cat_id_wg_disc.description = "Disconnected waveguides"

rdb.top_cell_name = cell.name
rdb_cell = rdb.create_cell(cell.name)

rdb_item = rdb.create_item(rdb_cell.rdb_id(),rdb_cat_id_wg_disc.rdb_id())
rdb_item.add_value(pya.RdbItemValue(pya.DBox.new(0.0, 0.0, 100.0, 200.0)))

#rdb_item.add_value(pya.RdbItemValue(DPath))



#marker = pya.Marker.new(lv)
#marker.set(pya.DBox.new(0.0, 0.0, 100.0, 200.0))
# to hide the marker:


lv.show_rdb(rdb_i, cv.cell_index)</text>
</klayout-macro>
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ for o in object_selection:
print ("Selected object is a shape")
if o.shape.is_path():
c = o.shape.cell
if c.name == "ROUND_PATH" and c.is_pcell_variant() and c.pcell_parameters_by_name()['layer'] == LayerSi:
print (c.basic_name())
if c.basic_name() == "ROUND_PATH" and c.is_pcell_variant() and c.pcell_parameters_by_name()['layer'] == LayerSi:
# we have a waveguide GUIDING_LAYER selected
print ("GUIDING_LAYER in ROUND_PATH on LayerSi. We will not convert this to waveguide!")
else:
Expand Down
Loading

0 comments on commit 5c436f0

Please sign in to comment.