mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 03:21:34 +02:00
Merge branch 'master' into devel
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
|
||||
source($drc_test_source)
|
||||
target($drc_test_target)
|
||||
|
||||
verbose
|
||||
|
||||
ncpu = 4
|
||||
|
||||
chip = input(189, 4)
|
||||
chip.output(189, 4)
|
||||
|
||||
# NOTE: this must not happen in tiled mode as the sealring
|
||||
# is only visible as a whole in flat mode
|
||||
sealring = source.cell("sealring")
|
||||
|
||||
metal1_seal = sealring.input(8, 0)
|
||||
metal1_seal_inner = metal1_seal.holes
|
||||
# NOTE: metal1_seal_outer is empty if there is no sealring ->
|
||||
# the full chip will be filled
|
||||
metal1_seal_outer = chip.interacting(metal1_seal_inner) - metal1_seal_inner
|
||||
|
||||
# Everything else can be done in tiled mode
|
||||
|
||||
tiles(500)
|
||||
tile_borders(2.0)
|
||||
threads(ncpu)
|
||||
|
||||
metal1 = input(8, 0)
|
||||
metal1.output(8, 0)
|
||||
metal1_fill = input(8, 22)
|
||||
metal1_nofill = input(8, 23) + metal1_seal_outer
|
||||
|
||||
metal1_dist = 0.42
|
||||
min_space_to_fill = 1.0
|
||||
|
||||
pattern = fill_pattern("METAL1_FILL1")
|
||||
pattern.shape(8, 22, box(0.0, 0.0, 5.0, 5.0))
|
||||
pattern.dim(5.0, 5.0)
|
||||
pattern.margin(metal1_dist, metal1_dist)
|
||||
|
||||
to_fill = chip - metal1_nofill - metal1
|
||||
|
||||
to_fill = to_fill.fill_with_left(pattern, hstep(7.0, 0), vstep(1.5, 7.0), multi_origin)
|
||||
|
||||
pattern = fill_pattern("METAL1_FILL2")
|
||||
pattern.shape(8, 22, box(0.0, 0.0, 2.0, 2.0))
|
||||
pattern.dim(2.0, 2.0)
|
||||
pattern.margin(metal1_dist, metal1_dist)
|
||||
|
||||
to_fill = to_fill.fill_with_left(pattern, hstep(2.42, 0), vstep(0.65, 2.42), multi_origin)
|
||||
|
||||
pattern = fill_pattern("METAL1_FILL3")
|
||||
pattern.shape(8, 22, box(0.0, 0.0, 1.2, 1.2))
|
||||
pattern.dim(1.2, 1.2)
|
||||
pattern.margin(metal1_dist, metal1_dist)
|
||||
|
||||
to_fill = to_fill.fill_with_left(pattern, hstep(1.62, 0), vstep(0.3, 1.62), multi_origin)
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+4
@@ -14,18 +14,22 @@ f2 = extent - l1.sized(1.0)
|
||||
p1 = fill_pattern("PAT1").shape(100, 0, box(0, 0, 1.um, 1.um)).origin(-0.5.um, -0.5.um)
|
||||
p2 = fill_pattern("PAT2").shape(100, 1, box(0, 0, 1.um, 1.um)).origin(-0.5.um, -0.5.um)
|
||||
p3 = fill_pattern("PAT3").shape(100, 2, box(0, 0, 1.um, 1.um)).shape(1000, 0, box(-0.5.um, -0.5.um, 1.5.um, 1.5.um))
|
||||
p4 = fill_pattern("PAT4").shape(100, 3, box(0, 0, 1.um, 1.um)).dim(1.um, 1.um).margin(2.um, 4.um)
|
||||
|
||||
p11 = fill_pattern("PAT11").shape(101, 0, box(0, 0, 1.um, 1.um)).origin(-0.5.um, -0.5.um)
|
||||
p12 = fill_pattern("PAT12").shape(101, 1, box(0, 0, 1.um, 1.um)).origin(-0.5.um, -0.5.um)
|
||||
p13 = fill_pattern("PAT13").shape(101, 2, box(0, 0, 1.um, 1.um)).shape(1000, 0, box(-0.5.um, -0.5.um, 1.5.um, 1.5.um))
|
||||
p14 = fill_pattern("PAT14").shape(101, 3, box(0, 0, 1.um, 1.um)).dim(1.um, 1.um).margin(2.um, 4.um)
|
||||
|
||||
f1.fill(p1, hstep(2.0, 1.0), vstep(-1.0, 2.0))
|
||||
f1.fill(p2, hstep(2.0, 1.0), vstep(-1.0, 2.0), auto_origin)
|
||||
f1.fill(p3)
|
||||
f1.fill(p4, hstep(2.0, 0), vstep(0, 2.0))
|
||||
|
||||
f2.fill(p11, hstep(2.0, 1.0), vstep(-1.0, 2.0))
|
||||
f2.fill(p12, hstep(2.0, 1.0), vstep(-1.0, 2.0), auto_origin)
|
||||
f2.fill(p13)
|
||||
f2.fill(p14, hstep(2.0, 0), vstep(0, 2.0))
|
||||
|
||||
l1.output(1, 0)
|
||||
f1.output(10, 0)
|
||||
|
||||
Vendored
+5
-1
@@ -11,8 +11,12 @@ l1 = input(1, 0)
|
||||
f1 = l1
|
||||
|
||||
p1 = fill_pattern("PAT1").shape(100, 0, box(0, 0, 1.um, 1.um)).origin(-0.5.um, -0.5.um)
|
||||
p2 = fill_pattern("PAT1").shape(100, 1, box(0, 0, 1.um, 1.um)).dim(1.um, 1.um)
|
||||
p3 = fill_pattern("PAT1").shape(100, 2, box(0, 0, 1.um, 1.um)).dim(1.um, 1.um).margin(1.um, 2.um)
|
||||
|
||||
f1.fill_with_left(p1, hstep(2.0, 1.0), vstep(-1.0, 2.0)).output(100, 0)
|
||||
f1.fill_with_left(p1, hstep(2.0, 1.0), vstep(-1.0, 2.0)).output(101, 0)
|
||||
f1.fill_with_left(p2, hstep(2.0, 1.0), vstep(-1.0, 2.0)).output(101, 1)
|
||||
f1.fill_with_left(p3, hstep(2.0, 1.0), vstep(-1.0, 2.0)).output(101, 2)
|
||||
|
||||
l1.output(1, 0)
|
||||
f1.output(10, 0)
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
VERSION 5.8 ;
|
||||
|
||||
DESIGN test ;
|
||||
|
||||
UNITS DISTANCE MICRONS 2000 ;
|
||||
|
||||
DIEAREA ( 0 0 ) ( 6000 3000 ) ;
|
||||
|
||||
VIAS 1 ;
|
||||
END VIAS
|
||||
|
||||
NETS 1 ;
|
||||
- dummy + ROUTED M2 ( 1670 830 ) ( * * 300 ) ( 4950 * 300 ) ( * 2000 300 ) ;
|
||||
END NETS
|
||||
|
||||
END DESIGN
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
VERSION 5.8 ;
|
||||
|
||||
UNITS
|
||||
DATABASE MICRONS 2000 ;
|
||||
END UNITS
|
||||
|
||||
LAYER M2
|
||||
TYPE ROUTING ;
|
||||
WIDTH 0.2 ;
|
||||
END M2
|
||||
|
||||
END LIBRARY
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
DIEAREA ALL 108 0
|
||||
M2 NET 32 0
|
||||
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+175
@@ -1728,6 +1728,181 @@ class DBShapes_TestClass < TestBase
|
||||
|
||||
end
|
||||
|
||||
def test_15
|
||||
|
||||
# Various container insert methods
|
||||
|
||||
ly = RBA::Layout::new
|
||||
l1 = ly.layer(1, 0)
|
||||
top = ly.create_cell("TOP")
|
||||
top.shapes(l1).insert(RBA::Box::new(2000))
|
||||
|
||||
shapes2 = RBA::Shapes::new
|
||||
shapes2.insert(RBA::Box::new(4000))
|
||||
|
||||
shapes = RBA::Shapes::new
|
||||
shapes.insert(shapes2)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-2000,-2000;2000,2000)")
|
||||
|
||||
# self-insert
|
||||
shapes.insert(shapes)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-2000,-2000;2000,2000);box (-2000,-2000;2000,2000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(shapes2, RBA::Shapes::SBoxes)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-2000,-2000;2000,2000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(shapes2, RBA::Shapes::SPolygons)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(shapes2, RBA::ICplxTrans::new(RBA::Vector::new(100, 200)))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-1900,-1800;2100,2200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(shapes2, RBA::Shapes::SBoxes, RBA::ICplxTrans::new(RBA::Vector::new(100, 200)))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-1900,-1800;2100,2200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(shapes2, RBA::Shapes::SPolygons, RBA::ICplxTrans::new(RBA::Vector::new(100, 200)))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(top.begin_shapes_rec(l1))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-1000,-1000;1000,1000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
shapes.insert(top.begin_shapes_rec(l1), RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "box (-900,-800;1100,1200)")
|
||||
|
||||
top.shapes(l1).insert(top.begin_shapes_rec(l1))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "box (-1000,-1000;1000,1000);box (-1000,-1000;1000,1000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Region::new(RBA::Box::new(2000))
|
||||
shapes.insert(r)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "polygon (-1000,-1000;-1000,1000;1000,1000;1000,-1000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Region::new(RBA::Box::new(2000))
|
||||
shapes.insert(r, RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "polygon (-900,-800;-900,1200;1100,1200;1100,-800)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert(r, RBA::DCplxTrans::new(0.1, 0.2))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "polygon (-900,-800;-900,1200;1100,1200;1100,-800)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Edges::new(RBA::Edge::new(0, 0, 1000, 2000))
|
||||
shapes.insert(r)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge (0,0;1000,2000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Edges::new(RBA::Edge::new(0, 0, 1000, 2000))
|
||||
shapes.insert(r, RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge (100,200;1100,2200)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert(r, RBA::DCplxTrans::new(0.1, 0.2))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "edge (100,200;1100,2200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert_as_polygons(r, 10)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "simple_polygon (-10,-10;-10,2010;110,2010;110,-10)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert_as_polygons(r, RBA::ICplxTrans::new(100, 200), 10)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "simple_polygon (90,190;90,2210;210,2210;210,190)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert_as_polygons(r, RBA::DCplxTrans::new(0.1, 0.2), 0.01)
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "simple_polygon (90,190;90,2210;210,2210;210,190)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert_as_edges(r)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge (0,0;0,2000);edge (100,0;100,2000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert_as_edges(r, RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge (100,200;100,2200);edge (200,200;200,2200)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert_as_edges(r, RBA::DCplxTrans::new(0.1, 0.2))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "edge (100,200;100,2200);edge (200,200;200,2200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert(r)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge_pair (0,0;0,2000)/(100,0;100,2000)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::EdgePairs::new(RBA::EdgePair::new(RBA::Edge::new(0, 0, 0, 2000), RBA::Edge::new(100, 0, 100, 2000)))
|
||||
shapes.insert(r, RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "edge_pair (100,200;100,2200)/(200,200;200,2200)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert(r, RBA::DCplxTrans::new(0.1, 0.2))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "edge_pair (100,200;100,2200)/(200,200;200,2200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Texts::new(RBA::Text::new("Text", RBA::Trans::new(100, 200)))
|
||||
shapes.insert(r)
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "text ('Text',r0 100,200)")
|
||||
|
||||
shapes.clear
|
||||
|
||||
r = RBA::Texts::new(RBA::Text::new("Text", RBA::Trans::new(100, 200)))
|
||||
shapes.insert(r, RBA::ICplxTrans::new(100, 200))
|
||||
assert_equal(shapes.each.collect { |s| s.to_s }.join(";"), "text ('Text',r0 200,400)")
|
||||
|
||||
top.shapes(l1).clear
|
||||
top.shapes(l1).insert(r, RBA::DCplxTrans::new(0.1, 0.2))
|
||||
assert_equal(top.shapes(l1).each.collect { |s| s.to_s }.join(";"), "text ('Text',r0 200,400)")
|
||||
|
||||
end
|
||||
|
||||
def test_16
|
||||
|
||||
# issue #2094
|
||||
# speedy insert -> should not take more than a few seconds
|
||||
|
||||
ly = RBA::Layout::new
|
||||
l1 = ly.layer(1, 0)
|
||||
main = ly.create_cell("MAIN")
|
||||
|
||||
box = RBA::Region::new(RBA::Box::new(4000))
|
||||
|
||||
100000.times do
|
||||
main.shapes(l1).insert(box)
|
||||
end
|
||||
|
||||
assert_equal(main.shapes(l1).size, 100000)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
load("test_epilogue.rb")
|
||||
|
||||
Reference in New Issue
Block a user