2022-03-31 00:02:14 -07:00
|
|
|
"""
|
2023-06-21 19:44:38 -07:00
|
|
|
Example code for checking connectivity in a layout by using `snarled`
|
2022-03-31 00:02:14 -07:00
|
|
|
"""
|
2022-04-07 16:15:12 -07:00
|
|
|
import logging
|
2022-03-29 21:23:27 -07:00
|
|
|
|
2022-03-31 00:43:54 -07:00
|
|
|
import snarled
|
2023-06-09 00:38:19 -07:00
|
|
|
from snarled.types import layer_t
|
2022-03-27 23:43:52 -07:00
|
|
|
|
|
|
|
|
2022-04-07 16:15:12 -07:00
|
|
|
logging.basicConfig()
|
|
|
|
logging.getLogger('snarled').setLevel(logging.INFO)
|
|
|
|
|
2023-06-21 19:44:38 -07:00
|
|
|
# How are the conductors connected to each other?
|
2022-04-04 23:05:13 -07:00
|
|
|
connectivity = [
|
2023-06-09 00:38:19 -07:00
|
|
|
((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)
|
2022-04-04 23:05:13 -07:00
|
|
|
]
|
2022-03-27 23:43:52 -07:00
|
|
|
|
2023-06-21 19:44:38 -07:00
|
|
|
# What labels should be loaded, and which geometry layers should they apply to?
|
2023-06-09 00:38:19 -07:00
|
|
|
labels_map: dict[layer_t, layer_t] = {
|
2023-06-08 01:02:43 -07:00
|
|
|
(1, 0): (1, 0),
|
|
|
|
(2, 0): (2, 0),
|
|
|
|
(3, 0): (3, 0),
|
|
|
|
}
|
2022-03-27 23:43:52 -07:00
|
|
|
|
2023-06-08 01:02:43 -07:00
|
|
|
filename = 'connectivity.oas'
|
2022-03-29 21:23:27 -07:00
|
|
|
|
2023-06-09 00:38:19 -07:00
|
|
|
nets = snarled.trace_layout(filename, connectivity, topcell='top', labels_map=labels_map)
|
|
|
|
result = snarled.TraceAnalysis(nets)
|
2022-03-29 21:23:27 -07:00
|
|
|
|
2023-06-09 00:40:51 -07:00
|
|
|
print('\n')
|
|
|
|
print(result)
|