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

Method test_2

testdata/ruby/extNetTracer.rb:73–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 end
72
73 def test_2
74
75 ly = RBA::Layout::new
76 ly.read(ENV["TESTSRC"] + "/testdata/net_tracer/t1.oas.gz")
77
78 tracer = RBA::NetTracer::new
79
80 tech = RBA::NetTracerConnectivity::new
81 tech.connection("1/0", "2/0", "3/0")
82
83 tracer.trace(tech, ly, ly.top_cell, RBA::Point::new(7000, 1500), ly.find_layer(1, 0), RBA::Point::new(6000, -6000), ly.find_layer(3, 0))
84
85 assert_equal(tracer.num_elements, 7)
86 assert_equal(tracer.incomplete?, false)
87
88 ref1 = [
89 "TOP: box (0,0;21550,3300) r0 *1 0,0 @1/0",
90 "TOP: box (13210,-17730;16930,-4790) r0 *1 0,0 @3/0",
91 "TOP: box (13300,-20030;35190,-15870) r0 *1 0,0 @3/0",
92 "TOP: box (26150,-18260;41090,-13030) r0 *1 0,0 @2/0",
93 "TOP: box (27920,-16660;31640,-1950) r0 *1 0,0 @1/0",
94 "TOP: box (3060,-9290;15710,-5710) r0 *1 0,0 @3/0",
95 "TOP: simple_polygon (29340,-4430;29340,1680;18440,1680;18440,11610;35990,11610;35990,-4430) r0 *1 0,0 @1/0",
96 ]
97
98 ref2 = [
99 "TOP: box (0,0;21550,3300) r0 *1 0,0 @1/0",
100 "TOP: box (13210,-17730;16930,-4790) r0 *1 0,0 @3/0",
101 "TOP: box (13300,-20030;35190,-15870) r0 *1 0,0 @3/0",
102 "TOP: box (26150,-18260;41090,-13030) r0 *1 0,0 @2/0",
103 "TOP: box (3060,-9290;15710,-5710) r0 *1 0,0 @3/0",
104 "TOP: box (34620,-16450;38340,-1740) r0 *1 0,0 @1/0",
105 "TOP: simple_polygon (29340,-4430;29340,1680;18440,1680;18440,11610;35990,11610;35990,-4430) r0 *1 0,0 @1/0",
106 ]
107
108 res = []
109 tracer.each_element do |e|
110 res << ly.cell(e.cell_index).name + ": " + e.shape.to_s + " " + e.trans.to_s + " @" + ly.get_info(e.layer).to_s
111 end
112 # NOTE: both paths (ref1 and ref2) are valid. Currently, the algorithm picks a "random" path
113 # (pointer values in maps?)
114 assert_equal(res.sort == ref1.sort || res.sort == ref2.sort, true)
115
116 end
117
118 def test_3
119

Callers

nothing calls this directly

Calls 11

find_layerMethod · 0.80
readMethod · 0.45
traceMethod · 0.45
nameMethod · 0.45
cellMethod · 0.45
cell_indexMethod · 0.45
to_sMethod · 0.45
shapeMethod · 0.45
transMethod · 0.45
layerMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected