MCPcopy Create free account
hub / github.com/KLayout/klayout / test_1_Basic

Method test_1_Basic

testdata/python/dbLayoutToNetlist.py:27–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25class DBLayoutToNetlistTests(unittest.TestCase):
26
27 def test_1_Basic(self):
28
29 ut_testsrc = os.getenv("TESTSRC")
30
31 ly = pya.Layout()
32 ly.read(os.path.join(ut_testsrc, "testdata", "algo", "device_extract_l1.gds"))
33
34 l2n = pya.LayoutToNetlist(pya.RecursiveShapeIterator(ly, ly.top_cell(), []))
35
36 l2n.threads = 17
37 l2n.max_vertex_count = 42
38 l2n.area_ratio = 7.5
39 self.assertEqual(l2n.threads, 17)
40 self.assertEqual(l2n.max_vertex_count, 42)
41 self.assertEqual(l2n.area_ratio, 7.5)
42
43 r = l2n.make_layer(ly.layer(6, 0))
44
45 self.assertNotEqual(l2n.internal_layout() is ly, True)
46 self.assertEqual(l2n.internal_layout().top_cell().name, ly.top_cell().name)
47 self.assertEqual(l2n.internal_top_cell().name, ly.top_cell().name)
48
49 self.assertNotEqual(l2n.layer_of(r), ly.layer(6, 0)) # would be a strange coincidence ...
50
51 cm = l2n.const_cell_mapping_into(ly, ly.top_cell())
52 for ci in range(0, l2n.internal_layout().cells()):
53 self.assertEqual(l2n.internal_layout().cell(ci).name, ly.cell(cm.cell_mapping(ci)).name)
54
55 ly2 = pya.Layout()
56 ly2.create_cell(ly.top_cell().name)
57
58 cm = l2n.cell_mapping_into(ly2, ly2.top_cell())
59 self.assertEqual(ly2.cells(), ly.cells())
60 for ci in range(0, l2n.internal_layout().cells()):
61 self.assertEqual(l2n.internal_layout().cell(ci).name, ly2.cell(cm.cell_mapping(ci)).name)
62
63 rmetal1 = l2n.make_polygon_layer(ly.layer(6, 0), "metal1")
64 bulk_id = l2n.connect_global(rmetal1, "BULK")
65 self.assertEqual(l2n.global_net_name(bulk_id), "BULK")
66
67 def test_2_ShapesFromNet(self):
68

Callers

nothing calls this directly

Calls 15

make_layerMethod · 0.95
internal_layoutMethod · 0.95
internal_top_cellMethod · 0.95
cell_mapping_intoMethod · 0.95
make_polygon_layerMethod · 0.95
rangeFunction · 0.85
LayoutMethod · 0.80
LayoutToNetlistMethod · 0.80
readMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected