snapshot 2022-03-30 23:17:32.485991
This commit is contained in:
parent
dc8f33da20
commit
d90f162469
11 changed files with 331 additions and 36 deletions
35
examples/check.py
Normal file
35
examples/check.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"""
|
||||
Example code for checking connectivity in a layout by using
|
||||
`snarl` and `masque`.
|
||||
"""
|
||||
from pprint import pformat
|
||||
|
||||
from masque.file import gdsii, oasis
|
||||
|
||||
import snarl
|
||||
import snarl.interfaces.masque
|
||||
|
||||
|
||||
connectivity = {
|
||||
((1, 0), (1, 2), (2, 0)), #M1 to M2 (via V12)
|
||||
((1, 0), (1, 3), (3, 0)), #M1 to M3 (via V13)
|
||||
((2, 0), (2, 3), (3, 0)), #M2 to M3 (via V23)
|
||||
}
|
||||
|
||||
|
||||
#cells, props = gdsii.readfile('connectivity.gds')
|
||||
cells, props = oasis.readfile('connectivity.oas')
|
||||
topcell = cells['top']
|
||||
|
||||
polys, labels = snarl.interfaces.masque.read_cell(topcell, connectivity)
|
||||
nets_info = snarl.trace_connectivity(polys, labels, connectivity)
|
||||
|
||||
print('\nFinal nets:')
|
||||
print([kk for kk in nets_info.nets if isinstance(kk.name, str)])
|
||||
|
||||
print('\nShorted net sets:')
|
||||
for short in nets_info.get_shorted_nets():
|
||||
print('(' + ','.join([repr(nn) for nn in sorted(list(short))]) + ')')
|
||||
|
||||
print('\nOpen nets:')
|
||||
print(pformat(dict(nets_info.get_open_nets())))
|
||||
Loading…
Add table
Add a link
Reference in a new issue