Merge pull request #563 from KLayout/issue-487

Fix #487 (True text object support for DRC/LVS)
This commit is contained in:
Matthias Köfferlein
2020-05-26 22:44:53 +02:00
committed by GitHub
300 changed files with 10218 additions and 1101 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+334
View File
@@ -0,0 +1,334 @@
#%l2n-klayout
top(RINGO)
unit(0.001)
# Layer section
# This section lists the mask layers (drawing or derived) and their connections.
# Mask layers
layer(poly '3/0')
layer(poly_lbl '3/1')
layer(diff_cont '4/0')
layer(poly_cont '5/0')
layer(metal1 '6/0')
layer(metal1_lbl '6/1')
layer(via1 '7/0')
layer(metal2 '8/0')
layer(metal2_lbl '8/1')
layer(psd)
layer(nsd)
# Mask layer connectivity
connect(poly poly poly_lbl poly_cont)
connect(poly_lbl poly)
connect(diff_cont diff_cont metal1 psd nsd)
connect(poly_cont poly poly_cont metal1)
connect(metal1 diff_cont poly_cont metal1 metal1_lbl via1)
connect(metal1_lbl metal1)
connect(via1 metal1 via1 metal2)
connect(metal2 via1 metal2 metal2_lbl)
connect(metal2_lbl metal2)
connect(psd diff_cont psd)
connect(nsd diff_cont nsd)
# Device class section
class(PMOS MOS3)
class(NMOS MOS3)
# Device abstracts section
# Device abstracts list the pin shapes of the devices.
device(D$PMOS PMOS
terminal(S
rect(psd (-650 -475) (525 950))
)
terminal(G
rect(poly (-125 -475) (250 950))
)
terminal(D
rect(psd (125 -475) (550 950))
)
)
device(D$PMOS$1 PMOS
terminal(S
rect(psd (-675 -475) (550 950))
)
terminal(G
rect(poly (-125 -475) (250 950))
)
terminal(D
rect(psd (125 -475) (525 950))
)
)
device(D$NMOS NMOS
terminal(S
rect(nsd (-650 -475) (525 950))
)
terminal(G
rect(poly (-125 -475) (250 950))
)
terminal(D
rect(nsd (125 -475) (550 950))
)
)
device(D$NMOS$1 NMOS
terminal(S
rect(nsd (-675 -475) (550 950))
)
terminal(G
rect(poly (-125 -475) (250 950))
)
terminal(D
rect(nsd (125 -475) (525 950))
)
)
# Circuit section
# Circuits are the hierarchical building blocks of the netlist.
circuit(INV2
# Circuit boundary
rect((-1700 -800) (3100 4600))
# Nets with their geometries
net(1 name(IN)
rect(poly (-525 -250) (250 2500))
rect(poly (-1425 -630) (1300 360))
rect(poly (-125 -2780) (250 1600))
rect(poly (-250 1200) (250 1600))
text(poly_lbl IN (-525 -1800))
rect(poly_cont (-830 -110) (220 220))
)
net(2
rect(poly (275 -250) (250 2500))
rect(poly (-305 -1430) (360 360))
rect(poly (-305 820) (250 1600))
rect(poly (-250 -4400) (250 1600))
rect(diff_cont (-1435 1690) (220 220))
rect(diff_cont (-220 180) (220 220))
rect(diff_cont (-220 -3420) (220 220))
rect(diff_cont (-220 180) (220 220))
rect(poly_cont (980 580) (220 220))
rect(metal1 (-1310 -290) (1380 360))
rect(metal1 (-1560 -1600) (360 2840))
rect(metal1 (-360 0) (360 760))
rect(metal1 (-360 -3560) (360 760))
rect(psd (-430 1945) (525 950))
rect(nsd (-525 -3750) (525 950))
)
net(3 name(OUT)
rect(diff_cont (690 2890) (220 220))
rect(diff_cont (-220 -620) (220 220))
rect(diff_cont (-220 -2620) (220 220))
rect(diff_cont (-220 -620) (220 220))
polygon(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
rect(metal1 (-680 2400) (360 760))
rect(metal1 (-360 -3560) (360 760))
text(metal1_lbl OUT (-180 1420))
rect(psd (-275 525) (525 950))
rect(nsd (-525 -3750) (525 950))
)
net(4
rect(diff_cont (-110 -310) (220 220))
rect(diff_cont (-220 180) (220 220))
rect(diff_cont (-220 -220) (220 220))
rect(diff_cont (-220 -620) (220 220))
rect(metal1 (-290 -290) (360 760))
rect(metal1 (-360 -760) (360 760))
rect(via1 (-305 -705) (250 250))
rect(via1 (-250 150) (250 250))
rect(metal2 (-1525 -775) (2800 900))
rect(nsd (-1675 -925) (550 950))
)
net(5
rect(diff_cont (-110 2490) (220 220))
rect(diff_cont (-220 180) (220 220))
rect(diff_cont (-220 -220) (220 220))
rect(diff_cont (-220 -620) (220 220))
rect(metal1 (-290 -290) (360 760))
rect(metal1 (-360 -760) (360 760))
rect(via1 (-305 -705) (250 250))
rect(via1 (-250 150) (250 250))
rect(metal2 (-1525 -775) (2800 900))
rect(psd (-1675 -925) (550 950))
)
# Outgoing pins and their connections to nets
pin(1 name(IN))
pin(2)
pin(3 name(OUT))
pin(4)
pin(5)
# Devices and their connections
device(1 D$PMOS
location(-400 2800)
param(L 0.25)
param(W 0.95)
param(AS 0.49875)
param(AD 0.26125)
param(PS 2.95)
param(PD 1.5)
terminal(S 2)
terminal(G 1)
terminal(D 5)
)
device(2 D$PMOS$1
location(400 2800)
param(L 0.25)
param(W 0.95)
param(AS 0.26125)
param(AD 0.49875)
param(PS 1.5)
param(PD 2.95)
terminal(S 5)
terminal(G 2)
terminal(D 3)
)
device(3 D$NMOS
location(-400 0)
param(L 0.25)
param(W 0.95)
param(AS 0.49875)
param(AD 0.26125)
param(PS 2.95)
param(PD 1.5)
terminal(S 2)
terminal(G 1)
terminal(D 4)
)
device(4 D$NMOS$1
location(400 0)
param(L 0.25)
param(W 0.95)
param(AS 0.26125)
param(AD 0.49875)
param(PS 1.5)
param(PD 2.95)
terminal(S 4)
terminal(G 2)
terminal(D 3)
)
)
circuit(RINGO
# Circuit boundary
rect((-1720 -800) (26880 4600))
# Nets with their geometries
net(1 name(FB)
rect(metal1 (-1700 1620) (360 360))
rect(via1 (-305 -305) (250 250))
rect(via1 (24230 -250) (250 250))
rect(metal2 (-24805 -325) (24880 400))
text(metal2_lbl FB (-23160 -200))
)
net(2 name(OSC)
rect(via1 (24435 1675) (250 250))
rect(metal2 (-325 -325) (400 400))
text(metal2_lbl OSC (-200 -200))
)
net(3 name(VSS)
text(metal2_lbl VSS (0 0))
)
net(4 name(VDD)
text(metal2_lbl VDD (0 2800))
)
net(5)
net(6)
net(7)
net(8)
net(9)
net(10)
net(11)
net(12)
net(13)
net(14)
net(15)
net(16)
net(17)
net(18)
net(19)
net(20)
net(21)
net(22)
# Outgoing pins and their connections to nets
pin(1 name(FB))
pin(2 name(OSC))
pin(3 name(VSS))
pin(4 name(VDD))
# Subcircuits and their connections
circuit(1 INV2 location(23760 0)
pin(0 15)
pin(1 1)
pin(2 2)
pin(3 3)
pin(4 4)
)
circuit(2 INV2 location(0 0)
pin(0 1)
pin(1 13)
pin(2 14)
pin(3 3)
pin(4 4)
)
circuit(3 INV2 location(2640 0)
pin(0 14)
pin(1 12)
pin(2 22)
pin(3 3)
pin(4 4)
)
circuit(4 INV2 location(5280 0)
pin(0 22)
pin(1 11)
pin(2 21)
pin(3 3)
pin(4 4)
)
circuit(5 INV2 location(7920 0)
pin(0 21)
pin(1 10)
pin(2 20)
pin(3 3)
pin(4 4)
)
circuit(6 INV2 location(10560 0)
pin(0 20)
pin(1 9)
pin(2 19)
pin(3 3)
pin(4 4)
)
circuit(7 INV2 location(13200 0)
pin(0 19)
pin(1 8)
pin(2 18)
pin(3 3)
pin(4 4)
)
circuit(8 INV2 location(15840 0)
pin(0 18)
pin(1 7)
pin(2 17)
pin(3 3)
pin(4 4)
)
circuit(9 INV2 location(18480 0)
pin(0 17)
pin(1 6)
pin(2 16)
pin(3 3)
pin(4 4)
)
circuit(10 INV2 location(21120 0)
pin(0 16)
pin(1 5)
pin(2 15)
pin(3 3)
pin(4 4)
)
)
+313
View File
@@ -0,0 +1,313 @@
#%l2n-klayout
W(RINGO)
U(0.001)
L(poly '3/0')
L(poly_lbl '3/1')
L(diff_cont '4/0')
L(poly_cont '5/0')
L(metal1 '6/0')
L(metal1_lbl '6/1')
L(via1 '7/0')
L(metal2 '8/0')
L(metal2_lbl '8/1')
L(psd)
L(nsd)
C(poly poly poly_lbl poly_cont)
C(poly_lbl poly)
C(diff_cont diff_cont metal1 psd nsd)
C(poly_cont poly poly_cont metal1)
C(metal1 diff_cont poly_cont metal1 metal1_lbl via1)
C(metal1_lbl metal1)
C(via1 metal1 via1 metal2)
C(metal2 via1 metal2 metal2_lbl)
C(metal2_lbl metal2)
C(psd diff_cont psd)
C(nsd diff_cont nsd)
K(PMOS MOS3)
K(NMOS MOS3)
D(D$PMOS PMOS
T(S
R(psd (-650 -475) (525 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(psd (125 -475) (550 950))
)
)
D(D$PMOS$1 PMOS
T(S
R(psd (-675 -475) (550 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(psd (125 -475) (525 950))
)
)
D(D$NMOS NMOS
T(S
R(nsd (-650 -475) (525 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(nsd (125 -475) (550 950))
)
)
D(D$NMOS$1 NMOS
T(S
R(nsd (-675 -475) (550 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(nsd (125 -475) (525 950))
)
)
X(INV2
R((-1700 -800) (3100 4600))
N(1 I(IN)
R(poly (-525 -250) (250 2500))
R(poly (-1425 -630) (1300 360))
R(poly (-125 -2780) (250 1600))
R(poly (-250 1200) (250 1600))
J(poly_lbl IN (-525 -1800))
R(poly_cont (-830 -110) (220 220))
)
N(2
R(poly (275 -250) (250 2500))
R(poly (-305 -1430) (360 360))
R(poly (-305 820) (250 1600))
R(poly (-250 -4400) (250 1600))
R(diff_cont (-1435 1690) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -3420) (220 220))
R(diff_cont (-220 180) (220 220))
R(poly_cont (980 580) (220 220))
R(metal1 (-1310 -290) (1380 360))
R(metal1 (-1560 -1600) (360 2840))
R(metal1 (-360 0) (360 760))
R(metal1 (-360 -3560) (360 760))
R(psd (-430 1945) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(3 I(OUT)
R(diff_cont (690 2890) (220 220))
R(diff_cont (-220 -620) (220 220))
R(diff_cont (-220 -2620) (220 220))
R(diff_cont (-220 -620) (220 220))
Q(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
R(metal1 (-680 2400) (360 760))
R(metal1 (-360 -3560) (360 760))
J(metal1_lbl OUT (-180 1420))
R(psd (-275 525) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(4
R(diff_cont (-110 -310) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -220) (220 220))
R(diff_cont (-220 -620) (220 220))
R(metal1 (-290 -290) (360 760))
R(metal1 (-360 -760) (360 760))
R(via1 (-305 -705) (250 250))
R(via1 (-250 150) (250 250))
R(metal2 (-1525 -775) (2800 900))
R(nsd (-1675 -925) (550 950))
)
N(5
R(diff_cont (-110 2490) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -220) (220 220))
R(diff_cont (-220 -620) (220 220))
R(metal1 (-290 -290) (360 760))
R(metal1 (-360 -760) (360 760))
R(via1 (-305 -705) (250 250))
R(via1 (-250 150) (250 250))
R(metal2 (-1525 -775) (2800 900))
R(psd (-1675 -925) (550 950))
)
P(1 I(IN))
P(2)
P(3 I(OUT))
P(4)
P(5)
D(1 D$PMOS
Y(-400 2800)
F(#17 #242)
F('a_"non_quoted"_string' '2s')
F('a_float' ##20.5)
E(L 0.25)
E(W 0.95)
E(AS 0.49875)
E(AD 0.26125)
E(PS 2.95)
E(PD 1.5)
T(S 2)
T(G 1)
T(D 5)
)
D(2 D$PMOS$1
Y(400 2800)
E(L 0.25)
E(W 0.95)
E(AS 0.26125)
E(AD 0.49875)
E(PS 1.5)
E(PD 2.95)
T(S 5)
T(G 2)
T(D 3)
)
D(3 D$NMOS
Y(-400 0)
E(L 0.25)
E(W 0.95)
E(AS 0.49875)
E(AD 0.26125)
E(PS 2.95)
E(PD 1.5)
T(S 2)
T(G 1)
T(D 4)
)
D(4 D$NMOS$1
Y(400 0)
E(L 0.25)
E(W 0.95)
E(AS 0.26125)
E(AD 0.49875)
E(PS 1.5)
E(PD 2.95)
T(S 4)
T(G 2)
T(D 3)
)
)
X(RINGO
R((-1720 -800) (26880 4600))
F(#17 #42)
F('a_"non_quoted"_string' 's')
F('a_float' ##0.5)
N(1 I(FB)
F(#17 #142)
F('a_"non_quoted"_string' '1s')
F('a_float' ##10.5)
R(metal1 (-1700 1620) (360 360))
R(via1 (-305 -305) (250 250))
R(via1 (24230 -250) (250 250))
R(metal2 (-24805 -325) (24880 400))
J(metal2_lbl FB (-23160 -200))
)
N(2 I(OSC)
R(via1 (24435 1675) (250 250))
R(metal2 (-325 -325) (400 400))
J(metal2_lbl OSC (-200 -200))
)
N(3 I(VSS)
J(metal2_lbl VSS (0 0))
)
N(4 I(VDD)
J(metal2_lbl VDD (0 2800))
)
N(5)
N(6)
N(7)
N(8)
N(9)
N(10)
N(11)
N(12)
N(13)
N(14)
N(15)
N(16)
N(17)
N(18)
N(19)
N(20)
N(21)
N(22)
P(1 I(FB))
P(2 I(OSC))
P(3 I(VSS))
P(4 I(VDD))
X(1 INV2 Y(23760 0)
F(#17 #342)
F('a_"non_quoted"_string' '3s')
F('a_float' ##30.5)
P(0 15)
P(1 1)
P(2 2)
P(3 3)
P(4 4)
)
X(2 INV2 Y(0 0)
P(0 1)
P(1 13)
P(2 14)
P(3 3)
P(4 4)
)
X(3 INV2 Y(2640 0)
P(0 14)
P(1 12)
P(2 22)
P(3 3)
P(4 4)
)
X(4 INV2 Y(5280 0)
P(0 22)
P(1 11)
P(2 21)
P(3 3)
P(4 4)
)
X(5 INV2 Y(7920 0)
P(0 21)
P(1 10)
P(2 20)
P(3 3)
P(4 4)
)
X(6 INV2 Y(10560 0)
P(0 20)
P(1 9)
P(2 19)
P(3 3)
P(4 4)
)
X(7 INV2 Y(13200 0)
P(0 19)
P(1 8)
P(2 18)
P(3 3)
P(4 4)
)
X(8 INV2 Y(15840 0)
P(0 18)
P(1 7)
P(2 17)
P(3 3)
P(4 4)
)
X(9 INV2 Y(18480 0)
P(0 17)
P(1 6)
P(2 16)
P(3 3)
P(4 4)
)
X(10 INV2 Y(21120 0)
P(0 16)
P(1 5)
P(2 15)
P(3 3)
P(4 4)
)
)
+301
View File
@@ -0,0 +1,301 @@
#%l2n-klayout
W(RINGO)
U(0.001)
L(poly '3/0')
L(poly_lbl '3/1')
L(diff_cont '4/0')
L(poly_cont '5/0')
L(metal1 '6/0')
L(metal1_lbl '6/1')
L(via1 '7/0')
L(metal2 '8/0')
L(metal2_lbl '8/1')
L(psd)
L(nsd)
C(poly poly poly_lbl poly_cont)
C(poly_lbl poly)
C(diff_cont diff_cont metal1 psd nsd)
C(poly_cont poly poly_cont metal1)
C(metal1 diff_cont poly_cont metal1 metal1_lbl via1)
C(metal1_lbl metal1)
C(via1 metal1 via1 metal2)
C(metal2 via1 metal2 metal2_lbl)
C(metal2_lbl metal2)
C(psd diff_cont psd)
C(nsd diff_cont nsd)
K(PMOS MOS3)
K(NMOS MOS3)
D(D$PMOS PMOS
T(S
R(psd (-650 -475) (525 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(psd (125 -475) (550 950))
)
)
D(D$PMOS$1 PMOS
T(S
R(psd (-675 -475) (550 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(psd (125 -475) (525 950))
)
)
D(D$NMOS NMOS
T(S
R(nsd (-650 -475) (525 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(nsd (125 -475) (550 950))
)
)
D(D$NMOS$1 NMOS
T(S
R(nsd (-675 -475) (550 950))
)
T(G
R(poly (-125 -475) (250 950))
)
T(D
R(nsd (125 -475) (525 950))
)
)
X(INV2
R((-1700 -800) (3100 4600))
N(1 I(IN)
R(poly (-525 -250) (250 2500))
R(poly (-1425 -630) (1300 360))
R(poly (-125 -2780) (250 1600))
R(poly (-250 1200) (250 1600))
J(poly_lbl IN (-525 -1800))
R(poly_cont (-830 -110) (220 220))
)
N(2
R(poly (275 -250) (250 2500))
R(poly (-305 -1430) (360 360))
R(poly (-305 820) (250 1600))
R(poly (-250 -4400) (250 1600))
R(diff_cont (-1435 1690) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -3420) (220 220))
R(diff_cont (-220 180) (220 220))
R(poly_cont (980 580) (220 220))
R(metal1 (-1310 -290) (1380 360))
R(metal1 (-1560 -1600) (360 2840))
R(metal1 (-360 0) (360 760))
R(metal1 (-360 -3560) (360 760))
R(psd (-430 1945) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(3 I(OUT)
R(diff_cont (690 2890) (220 220))
R(diff_cont (-220 -620) (220 220))
R(diff_cont (-220 -2620) (220 220))
R(diff_cont (-220 -620) (220 220))
Q(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
R(metal1 (-680 2400) (360 760))
R(metal1 (-360 -3560) (360 760))
J(metal1_lbl OUT (-180 1420))
R(psd (-275 525) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(4
R(diff_cont (-110 -310) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -220) (220 220))
R(diff_cont (-220 -620) (220 220))
R(metal1 (-290 -290) (360 760))
R(metal1 (-360 -760) (360 760))
R(via1 (-305 -705) (250 250))
R(via1 (-250 150) (250 250))
R(metal2 (-1525 -775) (2800 900))
R(nsd (-1675 -925) (550 950))
)
N(5
R(diff_cont (-110 2490) (220 220))
R(diff_cont (-220 180) (220 220))
R(diff_cont (-220 -220) (220 220))
R(diff_cont (-220 -620) (220 220))
R(metal1 (-290 -290) (360 760))
R(metal1 (-360 -760) (360 760))
R(via1 (-305 -705) (250 250))
R(via1 (-250 150) (250 250))
R(metal2 (-1525 -775) (2800 900))
R(psd (-1675 -925) (550 950))
)
P(1 I(IN))
P(2)
P(3 I(OUT))
P(4)
P(5)
D(1 D$PMOS
Y(-400 2800)
E(L 0.25)
E(W 0.95)
E(AS 0.49875)
E(AD 0.26125)
E(PS 2.95)
E(PD 1.5)
T(S 2)
T(G 1)
T(D 5)
)
D(2 D$PMOS$1
Y(400 2800)
E(L 0.25)
E(W 0.95)
E(AS 0.26125)
E(AD 0.49875)
E(PS 1.5)
E(PD 2.95)
T(S 5)
T(G 2)
T(D 3)
)
D(3 D$NMOS
Y(-400 0)
E(L 0.25)
E(W 0.95)
E(AS 0.49875)
E(AD 0.26125)
E(PS 2.95)
E(PD 1.5)
T(S 2)
T(G 1)
T(D 4)
)
D(4 D$NMOS$1
Y(400 0)
E(L 0.25)
E(W 0.95)
E(AS 0.26125)
E(AD 0.49875)
E(PS 1.5)
E(PD 2.95)
T(S 4)
T(G 2)
T(D 3)
)
)
X(RINGO
R((-1720 -800) (26880 4600))
N(1 I(FB)
R(metal1 (-1700 1620) (360 360))
R(via1 (-305 -305) (250 250))
R(via1 (24230 -250) (250 250))
R(metal2 (-24805 -325) (24880 400))
J(metal2_lbl FB (-23160 -200))
)
N(2 I(OSC)
R(via1 (24435 1675) (250 250))
R(metal2 (-325 -325) (400 400))
J(metal2_lbl OSC (-200 -200))
)
N(3 I(VSS)
J(metal2_lbl VSS (0 0))
)
N(4 I(VDD)
J(metal2_lbl VDD (0 2800))
)
N(5)
N(6)
N(7)
N(8)
N(9)
N(10)
N(11)
N(12)
N(13)
N(14)
N(15)
N(16)
N(17)
N(18)
N(19)
N(20)
N(21)
N(22)
P(1 I(FB))
P(2 I(OSC))
P(3 I(VSS))
P(4 I(VDD))
X(1 INV2 Y(23760 0)
P(0 15)
P(1 1)
P(2 2)
P(3 3)
P(4 4)
)
X(2 INV2 Y(0 0)
P(0 1)
P(1 13)
P(2 14)
P(3 3)
P(4 4)
)
X(3 INV2 Y(2640 0)
P(0 14)
P(1 12)
P(2 22)
P(3 3)
P(4 4)
)
X(4 INV2 Y(5280 0)
P(0 22)
P(1 11)
P(2 21)
P(3 3)
P(4 4)
)
X(5 INV2 Y(7920 0)
P(0 21)
P(1 10)
P(2 20)
P(3 3)
P(4 4)
)
X(6 INV2 Y(10560 0)
P(0 20)
P(1 9)
P(2 19)
P(3 3)
P(4 4)
)
X(7 INV2 Y(13200 0)
P(0 19)
P(1 8)
P(2 18)
P(3 3)
P(4 4)
)
X(8 INV2 Y(15840 0)
P(0 18)
P(1 7)
P(2 17)
P(3 3)
P(4 4)
)
X(9 INV2 Y(18480 0)
P(0 17)
P(1 6)
P(2 16)
P(3 3)
P(4 4)
)
X(10 INV2 Y(21120 0)
P(0 16)
P(1 5)
P(2 15)
P(3 3)
P(4 4)
)
)
+8 -8
View File
@@ -95,8 +95,8 @@ circuit(INV2
rect(poly (-1425 -630) (1300 360))
rect(poly (-125 -2780) (250 1600))
rect(poly (-250 1200) (250 1600))
rect(poly_lbl (-526 -1801) (2 2))
rect(poly_cont (-831 -111) (220 220))
text(poly_lbl IN (-525 -1800))
rect(poly_cont (-830 -110) (220 220))
)
net(2
rect(poly (275 -250) (250 2500))
@@ -123,8 +123,8 @@ circuit(INV2
polygon(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
rect(metal1 (-680 2400) (360 760))
rect(metal1 (-360 -3560) (360 760))
rect(metal1_lbl (-181 1419) (2 2))
rect(psd (-276 524) (525 950))
text(metal1_lbl OUT (-180 1420))
rect(psd (-275 525) (525 950))
rect(nsd (-525 -3750) (525 950))
)
net(4
@@ -221,18 +221,18 @@ circuit(RINGO
rect(via1 (-305 -305) (250 250))
rect(via1 (24230 -250) (250 250))
rect(metal2 (-24805 -325) (24880 400))
rect(metal2_lbl (-23161 -201) (2 2))
text(metal2_lbl FB (-23160 -200))
)
net(2 name(OSC)
rect(via1 (24435 1675) (250 250))
rect(metal2 (-325 -325) (400 400))
rect(metal2_lbl (-201 -201) (2 2))
text(metal2_lbl OSC (-200 -200))
)
net(3 name(VSS)
rect(metal2_lbl (-1 -1) (2 2))
text(metal2_lbl VSS (0 0))
)
net(4 name(VDD)
rect(metal2_lbl (-1 2799) (2 2))
text(metal2_lbl VDD (0 2800))
)
net(5)
net(6)
+8 -8
View File
@@ -76,8 +76,8 @@ X(INV2
R(poly (-1425 -630) (1300 360))
R(poly (-125 -2780) (250 1600))
R(poly (-250 1200) (250 1600))
R(poly_lbl (-526 -1801) (2 2))
R(poly_cont (-831 -111) (220 220))
J(poly_lbl IN (-525 -1800))
R(poly_cont (-830 -110) (220 220))
)
N(2
R(poly (275 -250) (250 2500))
@@ -104,8 +104,8 @@ X(INV2
Q(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
R(metal1 (-680 2400) (360 760))
R(metal1 (-360 -3560) (360 760))
R(metal1_lbl (-181 1419) (2 2))
R(psd (-276 524) (525 950))
J(metal1_lbl OUT (-180 1420))
R(psd (-275 525) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(4
@@ -202,18 +202,18 @@ X(RINGO
R(via1 (-305 -305) (250 250))
R(via1 (24230 -250) (250 250))
R(metal2 (-24805 -325) (24880 400))
R(metal2_lbl (-23161 -201) (2 2))
J(metal2_lbl FB (-23160 -200))
)
N(2 I(OSC)
R(via1 (24435 1675) (250 250))
R(metal2 (-325 -325) (400 400))
R(metal2_lbl (-201 -201) (2 2))
J(metal2_lbl OSC (-200 -200))
)
N(3 I(VSS)
R(metal2_lbl (-1 -1) (2 2))
J(metal2_lbl VSS (0 0))
)
N(4 I(VDD)
R(metal2_lbl (-1 2799) (2 2))
J(metal2_lbl VDD (0 2800))
)
N(5)
N(6)
+8 -8
View File
@@ -76,8 +76,8 @@ X(INV2
R(poly (-1425 -630) (1300 360))
R(poly (-125 -2780) (250 1600))
R(poly (-250 1200) (250 1600))
R(poly_lbl (-526 -1801) (2 2))
R(poly_cont (-831 -111) (220 220))
J(poly_lbl IN (-525 -1800))
R(poly_cont (-830 -110) (220 220))
)
N(2
R(poly (275 -250) (250 2500))
@@ -104,8 +104,8 @@ X(INV2
Q(metal1 (-110 110) (0 360) (140 0) (0 1240) (-320 0) (0 800) (360 0) (0 -440) (320 0) (0 -1960))
R(metal1 (-680 2400) (360 760))
R(metal1 (-360 -3560) (360 760))
R(metal1_lbl (-181 1419) (2 2))
R(psd (-276 524) (525 950))
J(metal1_lbl OUT (-180 1420))
R(psd (-275 525) (525 950))
R(nsd (-525 -3750) (525 950))
)
N(4
@@ -193,18 +193,18 @@ X(RINGO
R(via1 (-305 -305) (250 250))
R(via1 (24230 -250) (250 250))
R(metal2 (-24805 -325) (24880 400))
R(metal2_lbl (-23161 -201) (2 2))
J(metal2_lbl FB (-23160 -200))
)
N(2 I(OSC)
R(via1 (24435 1675) (250 250))
R(metal2 (-325 -325) (400 400))
R(metal2_lbl (-201 -201) (2 2))
J(metal2_lbl OSC (-200 -200))
)
N(3 I(VSS)
R(metal2_lbl (-1 -1) (2 2))
J(metal2_lbl VSS (0 0))
)
N(4 I(VDD)
R(metal2_lbl (-1 2799) (2 2))
J(metal2_lbl VDD (0 2800))
)
N(5)
N(6)
+3 -2
View File
@@ -17,8 +17,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
if !$:.member?(File::dirname($0))
$:.push(File::dirname($0))
ruby_dir = File.join(File::dirname($0), "..", "ruby")
if !$:.member?(ruby_dir)
$:.push(ruby_dir)
end
load("test_prologue.rb")
-36
View File
@@ -1,36 +0,0 @@
# In the test environment, we cannot make sure that we destroy the ruby interpreter before the RBA
# environment is shut down. Therefore we must release all RBA objects by explicitly calling the GC
# and start the test suite manually.
err = 0
any = nil
repeat = (ENV["TESTREPEAT"] || "1").to_i
class MyTestRunner < Test::Unit::UI::Console::TestRunner
def initialize(suite, *args)
super(suite, *args)
end
def test_started(name)
super
end
end
Object.constants.each do |c|
if c.to_s =~ /_TestClass$/
repeat.times do
r = MyTestRunner::new(Object.const_get(c)).start
err += r.error_count + r.failure_count
end
any = true
end
end
if !any
raise("No test class defined (any ending with _TestClass)")
end
if err > 0
raise("Tests failed (#{err} Errors + Failures)")
end
-37
View File
@@ -1,37 +0,0 @@
# in MSVC environment:
if ENV["RUBY"]
ruby_libs = "#{ENV["RUBY"]}/lib/ruby/#{RUBY_VERSION}"
if !$:.member?(ruby_libs)
$:.push(ruby_libs)
end
end
# Set this to true to disable some tests involving exceptions
$leak_check = ENV["TEST_LEAK_CHECK"]
# Fetch location of source files and the temp files
$ut_testsrc = ENV["TESTSRC"] || raise("Environment variable $TESTSRC not set")
$ut_testtmp = ENV["TESTTMP_WITH_NAME"] || ENV["TESTTMP"] || raise("Environment variable $TESTTMP not set")
# Pull packages from vendor drop-in
vendor = File.join($ut_testsrc, "testdata", "vendor", "ruby")
if !$:.member?(vendor)
$:.unshift(vendor)
end
# Require Test::Unit
require 'test/unit/ui/console/testrunner'
# TestBase is an alias for "TestCase"
Object.const_defined?(:TestBase) && Object.send(:remove_const, :TestBase)
TestBase = Test::Unit::TestCase
# undefine existing classes
Object.constants.each do |c|
if c.to_s =~ /_TestClass$/
Object.send(:remove_const, c)
end
end
+19 -3
View File
@@ -1,17 +1,21 @@
# Hierarchical antenna check
# Text handling - mixed mode and pure texts
source($drc_test_source, "TOP")
target($drc_test_target)
# Flat mode
flat_labels = labels(1, 0)
flat_labels = input(1, 1) # mixed mode, labels only
flat_texts = labels(1, 0) # text objects
flat_all = input(1, 0)
flat_poly = polygons(1, 0)
flat_texts_from_labels1 = flat_labels.texts(text("XYZ"))
flat_texts_from_labels2 = flat_labels.texts("*")
flat_texts_from_texts1 = flat_texts.texts(text("XYZ"))
flat_texts_from_texts2 = flat_texts.texts("*")
flat_texts_from_texts3 = flat_texts.texts_not("U*")
flat_texts_from_all1 = flat_all.texts(text("XYZ"))
flat_texts_from_all2 = flat_all.texts("*")
flat_texts_from_poly1 = flat_poly.texts(text("XYZ"))
@@ -20,23 +24,31 @@ flat_texts_from_poly2 = flat_poly.texts("*")
flat_labels.output(100, 0)
flat_all.output(101, 0)
flat_poly.output(102, 0)
flat_texts.output(103, 0)
flat_texts_from_labels1.output(110, 0)
flat_texts_from_labels2.output(111, 0)
flat_texts_from_all1.output(112, 0)
flat_texts_from_all2.output(113, 0)
flat_texts_from_poly1.output(114, 0)
flat_texts_from_poly2.output(115, 0)
flat_texts_from_texts1.output(116, 0)
flat_texts_from_texts2.output(117, 0)
flat_texts_from_texts3.output(118, 0)
# Deep mode
deep
deep_labels = labels(1, 0)
deep_labels = input(1, 1) # mixed mode, labels only
deep_texts = labels(1, 1) # text objects
deep_all = input(1, 0)
deep_poly = polygons(1, 0)
deep_texts_from_labels1 = deep_labels.texts(text("XYZ"))
deep_texts_from_labels2 = deep_labels.texts("*")
deep_texts_from_texts1 = deep_texts.texts(text("XYZ"))
deep_texts_from_texts2 = deep_texts.texts("*")
deep_texts_from_texts3 = deep_texts.texts_not("U*")
deep_texts_from_all1 = deep_all.texts(text("XYZ"))
deep_texts_from_all2 = deep_all.texts("*")
deep_texts_from_poly1 = deep_poly.texts(text("XYZ"))
@@ -45,10 +57,14 @@ deep_texts_from_poly2 = deep_poly.texts("*")
deep_labels.output(200, 0)
deep_all.output(201, 0)
deep_poly.output(202, 0)
deep_texts.output(203, 0)
deep_texts_from_labels1.output(210, 0)
deep_texts_from_labels2.output(211, 0)
deep_texts_from_all1.output(212, 0)
deep_texts_from_all2.output(213, 0)
deep_texts_from_poly1.output(214, 0)
deep_texts_from_poly2.output(215, 0)
deep_texts_from_texts1.output(216, 0)
deep_texts_from_texts2.output(217, 0)
deep_texts_from_texts3.output(218, 0)
Binary file not shown.
+66
View File
@@ -15,8 +15,10 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
lb = 100
a = polygons(RBA::LayerInfo::new(1, 0))
at = labels(1)
b = polygons(2)
c = polygons(3)
d = polygons(4)
x = polygons(10)
y = polygons(11)
empty = polygons(1000)
@@ -605,6 +607,70 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
p = b.edges.intersections(c.edges)
p.output(lb + 5, dm)
lb += 10 #450
message "--- texts and filters #{lb}"
p = at
p.output(lb, dm)
p = at.texts
p.output(lb + 1, dm)
p = at.texts("A*")
p.output(lb + 2, dm)
p = at.texts(pattern("A*"))
p.output(lb + 3, dm)
p = at.texts(pattern("A*"), as_dots)
p.output(lb + 4, dm)
p = at.texts(text("A*"), as_boxes)
p.output(lb + 5, dm)
p = at.texts_not("A*")
p.output(lb + 6, dm)
p = at.texts_not(pattern("A*"))
p.output(lb + 7, dm)
p = at.texts_not(pattern("A*"), as_dots)
p.output(lb + 8, dm)
p = at.texts_not(text("A*"), as_boxes)
p.output(lb + 9, dm)
lb += 10 #460
message "--- texts and polygon booleans and interactions #{lb}"
p = at & d
p.output(lb, dm)
p = d.interacting(at)
p.output(lb + 1, dm)
ddup = d.dup
ddup.select_interacting(at)
ddup.output(lb + 1, dm + 1)
p = at.interacting(d)
p.output(lb + 2, dm)
atdup = at.dup
atdup.select_interacting(d)
atdup.output(lb + 2, dm + 1)
p = d.pull_interacting(at)
p.output(lb + 3, dm)
p = at.pull_interacting(d)
p.output(lb + 4, dm)
p = at - d
p.output(lb + 5, dm)
p = d.not_interacting(at)
p.output(lb + 6, dm)
ddup = d.dup
ddup.select_not_interacting(at)
ddup.output(lb + 6, dm + 1)
p = at.not_interacting(d)
p.output(lb + 7, dm)
atdup = at.dup
atdup.select_not_interacting(d)
atdup.output(lb + 7, dm + 1)
p = d.interacting(at)
p.output(lb + 8, dm)
p = d.not_interacting(at)
p.output(lb + 8, dm + 1)
p = d.pull_interacting(at)
p.output(lb + 9, dm)
p = at.pull_interacting(d)
p.output(lb + 9, dm + 1)
end
if $drc_test_mode == 1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
* Extracted by KLayout
.SUBCKT INVCHAIN ANY R ANY$1 PWR GND
X$1 ANY R R ANY$1 PWR GND INV2
.ENDS INVCHAIN
.SUBCKT INV2 A1 A2 Q1 Q2 R VSS
X$1 VSS R A1 Q1 INV
X$2 VSS R A2 Q2 INV
.ENDS INV2
.SUBCKT INV \$1 \$2 \$3 \$4
M$1 \$4 \$3 \$2 \$4 PMOS L=0.25U W=0.95U AS=0.73625P AD=0.73625P PS=3.45U
+ PD=3.45U
M$2 \$4 \$3 \$1 \$4 NMOS L=0.25U W=0.95U AS=0.73625P AD=0.73625P PS=3.45U
+ PD=3.45U
.ENDS INV
+135
View File
@@ -0,0 +1,135 @@
source($lvs_test_source)
report_lvs($lvs_test_target_lvsdb)
writer = write_spice(true, false)
target_netlist($lvs_test_target_cir, writer, "Extracted by KLayout")
# needs this delegate because we use MOS3 which is not available in Spice
class SpiceReaderDelegate < RBA::NetlistSpiceReaderDelegate
# says we want to catch these subcircuits as devices
def wants_subcircuit(name)
name == "HVNMOS" || name == "HVPMOS"
end
# translate the element
def element(circuit, el, name, model, value, nets, params)
if el != "M"
# all other elements are left to the standard implementation
return super
end
if nets.size != 4
error("Device #{model} needs four nodes")
end
# provide a device class
cls = circuit.netlist.device_class_by_name(model)
if ! cls
cls = RBA::DeviceClassMOS3Transistor::new
cls.name = model
circuit.netlist.add(cls)
end
# create a device
device = circuit.create_device(cls, name)
# and configure the device
[ "S", "G", "D" ].each_with_index do |t,index|
device.connect_terminal(t, nets[index])
end
device.set_parameter("W", params["W"] * 1e6)
device.set_parameter("L", params["L"] * 1e6)
device
end
end
reader = RBA::NetlistSpiceReader::new(SpiceReaderDelegate::new)
schematic("double_height_inv.cir", reader)
deep
# Drawing layers
nwell = input(1, 0)
active = input(2, 0)
poly = input(3, 0)
poly_lbl = labels(3, 1)
diff_cont = input(4, 0)
poly_cont = input(5, 0)
metal1 = input(6, 0)
metal1_lbl = labels(6, 1)
via1 = input(7, 0)
metal2 = input(8, 0)
metal2_lbl = labels(8, 1)
# Bulk layer for terminal provisioning
bulk = polygon_layer
psd = nil
nsd = nil
# Computed layers
active_in_nwell = active & nwell
pactive = active_in_nwell
pgate = pactive & poly
psd = pactive - pgate
active_outside_nwell = active - nwell
nactive = active_outside_nwell
ngate = nactive & poly
nsd = nactive - ngate
# Device extraction
# PMOS transistor device extraction
extract_devices(mos3("PMOS"), { "SD" => psd, "G" => pgate,
"tS" => psd, "tD" => psd, "tG" => poly })
# NMOS transistor device extraction
extract_devices(mos3("NMOS"), { "SD" => nsd, "G" => ngate,
"tS" => nsd, "tD" => nsd, "tG" => poly })
# Define connectivity for netlist extraction
# Inter-layer
connect(psd, diff_cont)
connect(nsd, diff_cont)
connect(poly, poly_cont)
connect(diff_cont, metal1)
connect(poly_cont, metal1)
connect(metal1, via1)
connect(via1, metal2)
# attach labels
connect(poly, poly_lbl)
connect(metal1, metal1_lbl)
connect(metal2, metal2_lbl)
# Global
connect_global(bulk, "SUBSTRATE")
# Implicit connection of the INV2
# VSS nets
connect_implicit("GND")
connect_implicit("?") # "R"
connect_implicit("DOESNOTEXIST")
connect_implicit("*2", "*SS")
connect_implicit("*", "R")
connect_implicit("DOESNOTEXIST", "DOESNOTEXIST")
# Compare section
netlist.simplify
align
compare
+325
View File
@@ -0,0 +1,325 @@
#%lvsdb-klayout
J(
W(INVCHAIN)
U(0.001)
L(l3 '3/0')
L(l11 '3/1')
L(l6 '4/0')
L(l7 '2/0')
L(l8 '6/0')
L(l12 '6/1')
L(l9 '7/0')
L(l10 '8/0')
L(l13 '8/1')
L(l14)
L(l2)
L(l5)
C(l3 l3 l11 l7)
C(l11 l3)
C(l6 l6 l8 l2 l5)
C(l7 l3 l7 l8)
C(l8 l6 l7 l8 l12 l9)
C(l12 l8)
C(l9 l8 l9 l10)
C(l10 l9 l10 l13)
C(l13 l10)
C(l14 l14)
C(l2 l6 l2)
C(l5 l6 l5)
G(l14 SUBSTRATE)
K(PMOS MOS3)
K(NMOS MOS3)
D(D$PMOS PMOS
T(S
R(l2 (-900 -475) (775 950))
)
T(G
R(l3 (-125 -475) (250 950))
)
T(D
R(l2 (125 -475) (775 950))
)
)
D(D$NMOS NMOS
T(S
R(l5 (-900 -475) (775 950))
)
T(G
R(l3 (-125 -475) (250 950))
)
T(D
R(l5 (125 -475) (775 950))
)
)
X(INV
R((-1500 -800) (3000 4600))
N(1
R(l6 (290 -310) (220 220))
R(l6 (-220 180) (220 220))
R(l8 (-290 -690) (360 760))
R(l9 (-305 -705) (250 250))
R(l9 (-250 150) (250 250))
R(l10 (-2025 -775) (3000 900))
R(l5 (-1375 -925) (775 950))
)
N(2
R(l6 (290 2490) (220 220))
R(l6 (-220 180) (220 220))
R(l8 (-290 -690) (360 760))
R(l9 (-305 -705) (250 250))
R(l9 (-250 150) (250 250))
R(l10 (-2025 -775) (3000 900))
R(l2 (-1375 -925) (775 950))
)
N(3
R(l3 (-125 -250) (250 2500))
R(l3 (-250 -3050) (250 1600))
R(l3 (-250 1200) (250 1600))
)
N(4
R(l6 (-510 -310) (220 220))
R(l6 (-220 180) (220 220))
R(l6 (-220 2180) (220 220))
R(l6 (-220 180) (220 220))
R(l8 (-290 -3530) (360 2840))
R(l8 (-360 -2800) (360 760))
R(l8 (-360 2040) (360 760))
R(l2 (-680 -855) (775 950))
R(l5 (-775 -3750) (775 950))
)
P(1)
P(2)
P(3)
P(4)
D(1 D$PMOS
Y(0 2800)
E(L 0.25)
E(W 0.95)
E(AS 0.73625)
E(AD 0.73625)
E(PS 3.45)
E(PD 3.45)
T(S 4)
T(G 3)
T(D 2)
)
D(2 D$NMOS
Y(0 0)
E(L 0.25)
E(W 0.95)
E(AS 0.73625)
E(AD 0.73625)
E(PS 3.45)
E(PD 3.45)
T(S 4)
T(G 3)
T(D 1)
)
)
X(INV2
R((0 0) (3000 9200))
N(1 I(A1)
J(l11 A1 (1480 7110))
)
N(2 I(A2)
J(l11 A2 (1520 1950))
)
N(3 I(Q1)
J(l12 Q1 (1920 7070))
)
N(4 I(Q2)
J(l12 Q2 (1940 1950))
)
N(5 I(R)
J(l13 R (2720 5560))
J(l13 R (-90 -1940))
)
N(6 I(VSS)
J(l13 VSS (2680 8390))
J(l13 VSS (-30 -7640))
)
P(1 I(A1))
P(2 I(A2))
P(3 I(Q1))
P(4 I(Q2))
P(5 I(R))
P(6 I(VSS))
X(1 INV O(180) Y(1500 8400)
P(0 6)
P(1 5)
P(2 1)
P(3 3)
)
X(2 INV M O(180) Y(1500 800)
P(0 6)
P(1 5)
P(2 2)
P(3 4)
)
)
X(INVCHAIN
R((-90 0) (3090 9200))
N(1 I(ANY)
R(l3 (-90 6850) (1590 650))
J(l11 ANY (-700 -350))
)
N(2 I(R)
J(l11 R (1480 2370))
R(l8 (440 4580) (690 510))
J(l12 R (-300 -290))
)
N(3 I(ANY)
R(l8 (-90 1720) (1890 470))
J(l12 ANY (-1170 -230))
)
N(4 I(PWR)
J(l13 PWR (300 5550))
J(l13 PWR (-10 -1990))
)
N(5 I(GND)
J(l13 GND (320 8400))
J(l13 GND (-50 -7600))
)
P(1 I(ANY))
P(2 I(R))
P(3 I(ANY))
P(4 I(PWR))
P(5 I(GND))
X(1 INV2 Y(0 0)
P(0 1)
P(1 2)
P(2 2)
P(3 3)
P(4 4)
P(5 5)
)
)
)
H(
K(PMOS MOS3)
K(NMOS MOS3)
X(INV
N(1 I(VDD))
N(2 I(VSS))
N(3 I(A))
N(4 I(Q))
P(1 I(VDD))
P(2 I(VSS))
P(3 I(A))
P(4 I(Q))
D(1 PMOS
I($1)
E(L 0.25)
E(W 0.95)
E(AS 0)
E(AD 0)
E(PS 0)
E(PD 0)
T(S 1)
T(G 3)
T(D 4)
)
D(2 NMOS
I($3)
E(L 0.25)
E(W 0.95)
E(AS 0)
E(AD 0)
E(PS 0)
E(PD 0)
T(S 2)
T(G 3)
T(D 4)
)
)
X(INV2
N(1 I(VDD))
N(2 I(VSS))
N(3 I(A1))
N(4 I(Q1))
N(5 I(A2))
N(6 I(Q2))
P(1 I(VDD))
P(2 I(VSS))
P(3 I(A1))
P(4 I(Q1))
P(5 I(A2))
P(6 I(Q2))
X(1 INV I($1)
P(0 1)
P(1 2)
P(2 3)
P(3 4)
)
X(2 INV I($2)
P(0 1)
P(1 2)
P(2 5)
P(3 6)
)
)
X(INVCHAIN
N(1 I('1'))
N(2 I('2'))
N(3 I('3'))
N(4 I('4'))
N(5 I('5'))
X(1 INV2 I($2)
P(0 1)
P(1 2)
P(2 3)
P(3 4)
P(4 4)
P(5 5)
)
)
)
Z(
X(INV INV 1
Z(
N(3 3 1)
N(4 4 1)
N(2 1 1)
N(1 2 1)
P(2 2 1)
P(3 3 1)
P(1 0 1)
P(0 1 1)
D(2 2 1)
D(1 1 1)
)
)
X(INV2 INV2 1
Z(
N(1 3 1)
N(2 5 1)
N(3 4 W)
N(4 6 W)
N(5 1 1)
N(6 2 1)
P(0 2 1)
P(1 4 1)
P(2 3 1)
P(3 5 1)
P(4 0 1)
P(5 1 1)
X(1 1 1)
X(2 2 1)
)
)
X(INVCHAIN INVCHAIN 1
Z(
N(1 3 1)
N(3 5 1)
N(5 2 1)
N(4 1 1)
N(2 4 1)
P(2 () 1)
P(0 () 1)
P(4 () 1)
P(3 () 1)
P(1 () 1)
X(1 1 1)
)
)
)
+9 -9
View File
@@ -26,10 +26,10 @@ layout(
connect(l4 l4 l8)
connect(l8 l4 l8 l9 l2 l6)
connect(l9 l8 l9 l10 l11)
connect(l10 l9 l10)
connect(l10 l9)
connect(l11 l9 l11 l12)
connect(l12 l11 l12 l13)
connect(l13 l12 l13)
connect(l13 l12)
connect(l7 l7)
connect(l2 l8 l2)
connect(l6 l8 l6)
@@ -88,7 +88,7 @@ layout(
rect(l4 (-800 -3100) (550 400))
rect(l8 (-450 -300) (200 200))
rect(l9 (-300 -300) (400 400))
rect(l10 (-201 -201) (2 2))
text(l10 IN (-200 -200))
)
net(2 name(VSS)
rect(l8 (550 300) (200 200))
@@ -97,8 +97,8 @@ layout(
rect(l11 (-250 -950) (200 200))
rect(l11 (-200 300) (200 200))
rect(l12 (-750 -850) (2000 1000))
rect(l13 (-101 -851) (2 2))
rect(l6 (-1451 49) (450 900))
text(l13 VSS (-100 -850))
rect(l6 (-1450 50) (450 900))
)
net(3 name(VDD)
rect(l8 (550 4350) (200 200))
@@ -108,8 +108,8 @@ layout(
rect(l11 (-250 -800) (200 200))
rect(l11 (-200 300) (200 200))
rect(l12 (-750 -850) (2000 1000))
rect(l13 (-151 -851) (2 2))
rect(l2 (-1401 -851) (450 1500))
text(l13 VDD (-150 -850))
rect(l2 (-1400 -850) (450 1500))
)
net(4 name(OUT)
rect(l8 (1300 4350) (200 200))
@@ -121,8 +121,8 @@ layout(
rect(l9 (-300 -4600) (300 3200))
rect(l9 (-300 -2900) (450 400))
rect(l9 (-450 -1550) (300 850))
rect(l10 (-51 499) (2 2))
rect(l2 (-351 2649) (450 1500))
text(l10 OUT (-50 500))
rect(l2 (-350 2650) (450 1500))
rect(l6 (-450 -5500) (450 900))
)
net(5 name(NWELL)
+9 -9
View File
@@ -19,10 +19,10 @@ J(
C(l4 l4 l8)
C(l8 l4 l8 l11 l2 l9 l6 l10)
C(l11 l8 l11 l12 l13)
C(l12 l11 l12)
C(l12 l11)
C(l13 l11 l13 l14)
C(l14 l13 l14 l15)
C(l15 l14 l15)
C(l15 l14)
C(l7 l7)
C(l2 l8 l2)
C(l9 l3 l8 l9)
@@ -69,7 +69,7 @@ J(
R(l4 (-800 -3100) (550 400))
R(l8 (-450 -300) (200 200))
R(l11 (-300 -300) (400 400))
R(l12 (-201 -201) (2 2))
J(l12 IN (-200 -200))
)
N(2 I(VDD)
R(l3 (0 2950) (3000 3200))
@@ -85,8 +85,8 @@ J(
R(l13 (1400 -700) (200 200))
R(l13 (-200 300) (200 200))
R(l14 (-2350 -850) (3000 1000))
R(l15 (-151 -851) (2 2))
R(l2 (-2401 -851) (450 1500))
J(l15 VDD (-150 -850))
R(l2 (-2400 -850) (450 1500))
R(l9 (1050 -1200) (600 1200))
)
N(3 I(OUT)
@@ -99,8 +99,8 @@ J(
R(l11 (-300 -4600) (300 3200))
R(l11 (-300 -2900) (450 400))
R(l11 (-450 -1550) (300 850))
R(l12 (-51 499) (2 2))
R(l2 (-351 2649) (450 1500))
J(l12 OUT (-50 500))
R(l2 (-350 2650) (450 1500))
R(l6 (-450 -5500) (450 900))
)
N(4 I(VSS)
@@ -115,8 +115,8 @@ J(
R(l13 (1400 -700) (200 200))
R(l13 (-200 300) (200 200))
R(l14 (-2350 -850) (3000 1000))
R(l15 (-151 -851) (2 2))
R(l6 (-2401 49) (450 900))
J(l15 VSS (-150 -850))
R(l6 (-2400 50) (450 900))
R(l10 (1050 -900) (600 1200))
)
D(1 D$PMOS
+10 -10
View File
@@ -28,10 +28,10 @@ layout(
connect(l4 l4 l8)
connect(l8 l4 l8 l11 l2 l9 l6 l10)
connect(l11 l8 l11 l12 l13)
connect(l12 l11 l12)
connect(l12 l11)
connect(l13 l11 l13 l14)
connect(l14 l13 l14 l15)
connect(l15 l14 l15)
connect(l15 l14)
connect(l7 l7)
connect(l2 l8 l2)
connect(l9 l3 l8 l9)
@@ -121,7 +121,7 @@ layout(
rect(l4 (-250 300) (250 1050))
rect(l8 (-700 400) (200 200))
rect(l11 (-300 -300) (400 400))
rect(l12 (-201 -201) (2 2))
text(l12 B (-200 -200))
)
net(2 name(A)
rect(l4 (1900 3400) (550 400))
@@ -131,7 +131,7 @@ layout(
rect(l4 (-250 300) (250 1050))
rect(l8 (250 1050) (200 200))
rect(l11 (-300 -300) (400 400))
rect(l12 (-201 -201) (2 2))
text(l12 A (-200 -200))
)
net(3
rect(l8 (1300 300) (200 200))
@@ -167,8 +167,8 @@ layout(
rect(l11 (-1200 -300) (1050 300))
rect(l11 (-1050 1150) (300 1400))
rect(l11 (-300 -2700) (300 1950))
rect(l12 (699 -2001) (2 2))
rect(l2 (-1101 1299) (500 1500))
text(l12 OUT (700 -2000))
rect(l2 (-1100 1300) (500 1500))
rect(l6 (250 -5500) (450 900))
rect(l6 (-450 450) (450 900))
)
@@ -192,8 +192,8 @@ layout(
rect(l13 (700 -700) (200 200))
rect(l13 (-200 300) (200 200))
rect(l14 (-3150 -850) (3750 1000))
rect(l15 (-101 -851) (2 2))
rect(l2 (-3201 -851) (450 1500))
text(l15 VDD (-100 -850))
rect(l2 (-3200 -850) (450 1500))
rect(l2 (1000 -1500) (450 1500))
rect(l9 (400 -1200) (600 1200))
)
@@ -212,8 +212,8 @@ layout(
rect(l13 (2200 -700) (200 200))
rect(l13 (-200 300) (200 200))
rect(l14 (-3150 -850) (3750 1000))
rect(l15 (-101 -851) (2 2))
rect(l6 (-3201 1399) (450 900))
text(l15 VSS (-100 -850))
rect(l6 (-3200 1400) (450 900))
rect(l6 (-450 -2250) (450 900))
rect(l10 (1850 -900) (600 1200))
)
+10 -10
View File
@@ -28,10 +28,10 @@ layout(
connect(l4 l4 l8)
connect(l8 l4 l8 l11 l2 l9 l6 l10)
connect(l11 l8 l11 l12 l13)
connect(l12 l11 l12)
connect(l12 l11)
connect(l13 l11 l13 l14)
connect(l14 l13 l14 l15)
connect(l15 l14 l15)
connect(l15 l14)
connect(l7 l7)
connect(l2 l8 l2)
connect(l9 l3 l8 l9)
@@ -121,7 +121,7 @@ layout(
rect(l4 (-250 300) (250 1050))
rect(l8 (-700 400) (200 200))
rect(l11 (-300 -300) (400 400))
rect(l12 (-201 -201) (2 2))
text(l12 B (-200 -200))
)
net(2 name(A)
rect(l4 (1900 3400) (550 400))
@@ -131,7 +131,7 @@ layout(
rect(l4 (-250 300) (250 1050))
rect(l8 (250 1050) (200 200))
rect(l11 (-300 -300) (400 400))
rect(l12 (-201 -201) (2 2))
text(l12 A (-200 -200))
)
net(3
rect(l8 (1300 300) (200 200))
@@ -167,8 +167,8 @@ layout(
rect(l11 (-1200 -300) (1050 300))
rect(l11 (-1050 1150) (300 1400))
rect(l11 (-300 -2700) (300 1950))
rect(l12 (699 -2001) (2 2))
rect(l2 (-1101 1299) (500 1500))
text(l12 OUT (700 -2000))
rect(l2 (-1100 1300) (500 1500))
rect(l6 (250 -5500) (450 900))
rect(l6 (-450 450) (450 900))
)
@@ -192,8 +192,8 @@ layout(
rect(l13 (700 -700) (200 200))
rect(l13 (-200 300) (200 200))
rect(l14 (-3150 -850) (3750 1000))
rect(l15 (-101 -851) (2 2))
rect(l2 (-3201 -851) (450 1500))
text(l15 VDD (-100 -850))
rect(l2 (-3200 -850) (450 1500))
rect(l2 (1000 -1500) (450 1500))
rect(l9 (400 -1200) (600 1200))
)
@@ -212,8 +212,8 @@ layout(
rect(l13 (2200 -700) (200 200))
rect(l13 (-200 300) (200 200))
rect(l14 (-3150 -850) (3750 1000))
rect(l15 (-101 -851) (2 2))
rect(l6 (-3201 1399) (450 900))
text(l15 VSS (-100 -850))
rect(l6 (-3200 1400) (450 900))
rect(l6 (-450 -2250) (450 900))
rect(l10 (1850 -900) (600 1200))
)
+4 -5
View File
@@ -28,7 +28,6 @@ layout(
connect(l11 l8 l11 l12)
connect(l12 l11 l12 l13)
connect(l13 l12 l13)
connect(l7 l7)
connect(l2 l8 l2)
connect(l9 l3 l8 l9)
connect(l6 l8 l6)
@@ -47,7 +46,7 @@ layout(
circuit(ND2X1
# Circuit boundary
rect((-100 249) (2600 7751))
rect((-100 250) (2600 7750))
# Outgoing pins and their connections to nets
pin(name(VDD))
@@ -62,7 +61,7 @@ layout(
circuit(INVX1
# Circuit boundary
rect((-100 249) (2000 7751))
rect((-100 250) (2000 7750))
# Outgoing pins and their connections to nets
pin(name(VDD))
@@ -76,7 +75,7 @@ layout(
circuit(INVX2
# Circuit boundary
rect((-100 249) (2600 7751))
rect((-100 250) (2600 7750))
# Outgoing pins and their connections to nets
pin(name(IN))
@@ -90,7 +89,7 @@ layout(
circuit(RINGO
# Circuit boundary
rect((600 249) (25800 7751))
rect((600 250) (25800 7750))
# Nets with their geometries
net(1
+1 -1
View File
@@ -443,7 +443,7 @@ end;
l2n = pya.LayoutToNetlist()
infile = os.path.join(ut_testsrc, "testdata", "algo", "l2n_writer_au.txt")
infile = os.path.join(ut_testsrc, "testdata", "algo", "l2n_reader_in.txt")
l2n.read(infile)
tmp = os.path.join(ut_testtmp, "tmp.txt")
+3 -3
View File
@@ -68,7 +68,7 @@ class DBLayoutToNetlist_TestClass < TestBase
# cell mapping with nets
l2n = RBA::LayoutToNetlist::new
l2n.read(File.join($ut_testsrc, "testdata", "algo", "l2n_writer_au.txt"))
l2n.read(File.join($ut_testsrc, "testdata", "algo", "l2n_reader_in.txt"))
nets = [
l2n.netlist.circuit_by_name("RINGO").net_by_name("VSS"),
@@ -481,7 +481,7 @@ END
l2n = RBA::LayoutToNetlist::new
input = File.join($ut_testsrc, "testdata", "algo", "l2n_writer_au.txt")
input = File.join($ut_testsrc, "testdata", "algo", "l2n_reader_in.txt")
l2n.read(input)
tmp = File::join($ut_testtmp, "tmp.txt")
@@ -499,7 +499,7 @@ END
l2n = RBA::LayoutToNetlist::new
input = File.join($ut_testsrc, "testdata", "algo", "l2n_writer_au.txt")
input = File.join($ut_testsrc, "testdata", "algo", "l2n_reader_in.txt")
l2n.read(input)
# build_all_nets
+315
View File
@@ -0,0 +1,315 @@
# encoding: UTF-8
# KLayout Layout Viewer
# Copyright (C) 2006-2020 Matthias Koefferlein
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
if !$:.member?(File::dirname($0))
$:.push(File::dirname($0))
end
load("test_prologue.rb")
class DBTexts_TestClass < TestBase
# Basics
def test_1
r = RBA::Texts::new
assert_equal(r.to_s, "")
assert_equal(r.is_empty?, true)
assert_equal(r.size, 0)
assert_equal(r.bbox.to_s, "()")
data_id = r.data_id
r.insert(RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(100, -200))))
assert_equal(data_id != r.data_id, true)
assert_equal(r.to_s, "('abc',r0 100,-200)")
r.clear
r.insert(RBA::Text::new("uvw", RBA::Trans::new(RBA::Vector::new(110, 210))))
assert_equal(r.to_s, "('uvw',r0 110,210)")
assert_equal(r.extents.to_s, "(109,209;109,211;111,211;111,209)")
assert_equal(r.extents(10).to_s, "(100,200;100,220;120,220;120,200)")
assert_equal(r.extents(5, 10).to_s, "(105,200;105,220;115,220;115,200)")
assert_equal(r.edges.to_s, "(110,210;110,210)")
assert_equal(r.is_empty?, false)
assert_equal(r.size, 1)
assert_equal(r[0].to_s, "('uvw',r0 110,210)")
assert_equal(r[1].to_s, "")
assert_equal(r.bbox.to_s, "(110,210;110,210)")
assert_equal(r.moved(-10, 10).to_s, "('uvw',r0 100,220)")
assert_equal(r.moved(RBA::Point::new(-10, 10)).to_s, "('uvw',r0 100,220)")
rr = r.dup
assert_equal(rr.data_id != r.data_id, true)
rr.move(-10, 10)
assert_equal(rr.to_s, "('uvw',r0 100,220)")
rr = r.dup
rr.move(RBA::Point::new(-10, 10))
assert_equal(rr.to_s, "('uvw',r0 100,220)")
assert_equal(r.transformed(RBA::Trans::new(1)).to_s, "('uvw',r90 -210,110)")
assert_equal(r.transformed(RBA::ICplxTrans::new(2.0)).to_s, "('uvw',r0 220,420)")
rr = r.dup
rr.transform(RBA::Trans::new(1))
assert_equal(rr.to_s, "('uvw',r90 -210,110)")
rr = r.dup
rr.transform(RBA::ICplxTrans::new(2.0))
assert_equal(rr.to_s, "('uvw',r0 220,420)")
rr = RBA::Texts::new
rr.swap(r)
assert_equal(rr.to_s, "('uvw',r0 110,210)")
assert_equal(r.to_s, "")
rr.swap(r)
assert_equal(r.to_s, "('uvw',r0 110,210)")
r.clear
assert_equal(r.to_s, "")
assert_equal(r.is_empty?, true)
assert_equal(r.size, 0)
assert_equal(r.bbox.to_s, "()")
texts = RBA::Texts::new
t = RBA::Texts::new
t.insert(RBA::Text::new("uvw", RBA::Trans::new(RBA::Vector::new(-110, 210))))
texts.insert(t)
assert_equal(texts.to_s, "('uvw',r0 -110,210)")
end
# Basics
def test_2
r1 = RBA::Texts::new
r1.insert(RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(100, -200))))
r1.insert(RBA::Text::new("uvm", RBA::Trans::new(RBA::Vector::new(110, 210))))
r2 = RBA::Texts::new
r1.insert(RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(101, -201))))
r1.insert(RBA::Text::new("uvm", RBA::Trans::new(RBA::Vector::new(111, 211))))
assert_equal((r1 + r2).to_s, "('abc',r0 100,-200);('uvm',r0 110,210);('abc',r0 101,-201);('uvm',r0 111,211)")
r1 += r2
assert_equal(r1.to_s, "('abc',r0 100,-200);('uvm',r0 110,210);('abc',r0 101,-201);('uvm',r0 111,211)")
end
def test_3
text1 = RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(100, -200)))
text2 = RBA::Text::new("uvm", RBA::Trans::new(RBA::Vector::new(110, 210)))
text3 = RBA::Text::new("xyz", RBA::Trans::new(RBA::Vector::new(-101, 201)))
r1 = RBA::Texts::new([ text1, text2 ])
assert_equal(r1.to_s, "('abc',r0 100,-200);('uvm',r0 110,210)")
assert_equal(r1.with_text("abc", false).to_s, "('abc',r0 100,-200)")
assert_equal(r1.with_text("abc", true).to_s, "('uvm',r0 110,210)")
assert_equal(r1.with_match("*b*", false).to_s, "('abc',r0 100,-200)")
assert_equal(r1.with_match("*b*", true).to_s, "('uvm',r0 110,210)")
r1 = RBA::Texts::new(text1)
assert_equal(r1.to_s, "('abc',r0 100,-200)")
s = RBA::Shapes::new
s.insert(text1)
s.insert(text2)
r1 = RBA::Texts::new(s)
assert_equal(r1.to_s, "('abc',r0 100,-200);('uvm',r0 110,210)")
ly = RBA::Layout::new
l1 = ly.layer("l1")
l2 = ly.layer("l2")
l3 = ly.layer("l3")
c1 = ly.create_cell("C1")
c2 = ly.create_cell("C2")
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(0, 0)))
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(0, 100)))
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(200, 100)))
c2.shapes(l1).insert(text1)
c2.shapes(l2).insert(text2)
c2.shapes(l3).insert(text3)
r = RBA::Texts::new(ly.begin_shapes(c1.cell_index, l1))
assert_equal(r.to_s(30), "('abc',r0 100,-200);('abc',r0 100,-100);('abc',r0 300,-100)")
assert_equal(r.to_s(2), "('abc',r0 100,-200);('abc',r0 100,-100)...")
assert_equal(r.is_empty?, false)
assert_equal(r.size, 3)
assert_equal(r.has_valid_texts?, false)
assert_equal(r.bbox.to_s, "(100,-200;300,-100)")
assert_equal(r.is_deep?, false)
r.flatten
assert_equal(r.has_valid_texts?, true)
assert_equal(r[1].to_s, "('abc',r0 100,-100)")
assert_equal(r[100].inspect, "nil")
assert_equal(r.bbox.to_s, "(100,-200;300,-100)")
dss = RBA::DeepShapeStore::new
r = RBA::Texts::new(ly.begin_shapes(c1.cell_index, l1), dss)
assert_equal(r.to_s(30), "('abc',r0 100,-200);('abc',r0 100,-100);('abc',r0 300,-100)")
assert_equal(r.to_s(2), "('abc',r0 100,-200);('abc',r0 100,-100)...")
assert_equal(r.is_empty?, false)
assert_equal(r.size, 3)
assert_equal(r.has_valid_texts?, false)
assert_equal(r.bbox.to_s, "(100,-200;300,-100)")
assert_equal(r.is_deep?, true)
r.flatten
assert_equal(r.has_valid_texts?, true)
assert_equal(r[1].to_s, "('abc',r0 100,-100)")
assert_equal(r[100].inspect, "nil")
assert_equal(r.bbox.to_s, "(100,-200;300,-100)")
assert_equal(r.is_deep?, false)
end
def test_4
# insert_into and insert_into_as_polygons
text1 = RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(100, -200)))
ly = RBA::Layout::new
l1 = ly.layer("l1")
c1 = ly.create_cell("C1")
c2 = ly.create_cell("C2")
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(0, 0)))
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(0, 100)))
c1.insert(RBA::CellInstArray::new(c2.cell_index, RBA::Trans::new(200, 100)))
c2.shapes(l1).insert(text1)
dss = RBA::DeepShapeStore::new
r = RBA::Texts::new(ly.begin_shapes(c1.cell_index, l1), dss)
target = RBA::Layout::new
target_top = target.add_cell("TOP")
target_li = target.layer
r.insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
target = RBA::Layout::new
target_top = target.add_cell("TOP")
target_li = target.layer
r.with_text("abc", false).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
target_li = target.layer
r.with_text("abd", true).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
target_li = target.layer
r.with_text("abc", true).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "")
target_li = target.layer
r.with_match("*b*", false).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
target_li = target.layer
r.with_match("*bb*", true).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
target_li = target.layer
r.with_match("*b*", true).insert_into(target, target_top, target_li)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "")
target = RBA::Layout::new
target_top = target.add_cell("TOP")
target_li = target.layer
r.insert_into_as_polygons(target, target_top, target_li, 1)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Region::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Region::new(target.cell("C2").shapes(target_li)).to_s, "(99,-201;99,-199;101,-199;101,-201)")
target_li = target.layer
target.insert(target_top, target_li, r)
cells = []
target.each_cell { |c| cells << c.name }
assert_equal(cells.join(","), "TOP,C2")
assert_equal(RBA::Texts::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Region::new(target.cell("TOP").shapes(target_li)).to_s, "")
assert_equal(RBA::Texts::new(target.cell("C2").shapes(target_li)).to_s, "('abc',r0 100,-200)")
assert_equal(RBA::Region::new(target.cell("C2").shapes(target_li)).to_s, "")
end
# interact
def test_5
r = RBA::Texts::new
r.insert(RBA::Text::new("abc", RBA::Trans::new(RBA::Vector::new(100, 200))))
r.insert(RBA::Text::new("uvw", RBA::Trans::new(RBA::Vector::new(110, -210))))
g2 = RBA::Region::new
g2.insert(RBA::Box::new(0, 100, 200, 200))
g2.insert(RBA::Box::new(-200, 100, -100, 200))
assert_equal(r.interacting(g2).to_s, "('abc',r0 100,200)")
assert_equal(g2.interacting(r).to_s, "(0,100;0,200;200,200;200,100)")
assert_equal(r.not_interacting(g2).to_s, "('uvw',r0 110,-210)")
assert_equal(g2.not_interacting(r).to_s, "(-200,100;-200,200;-100,200;-100,100)")
rr = r.dup
rr.select_interacting(g2)
assert_equal(rr.to_s, "('abc',r0 100,200)")
rr = r.dup
rr.select_not_interacting(g2)
assert_equal(rr.to_s, "('uvw',r0 110,-210)")
assert_equal(r.pull_interacting(g2).to_s, "(0,100;0,200;200,200;200,100)")
assert_equal(g2.pull_interacting(r).to_s, "('abc',r0 100,200)")
end
end
load("test_epilogue.rb")