Small bugfix for MAG writer + tests.

This commit is contained in:
Matthias Koefferlein 2019-12-08 20:25:25 +01:00
parent 76c42f2959
commit 8916dd12a9
12 changed files with 570 additions and 1 deletions

View File

@ -350,7 +350,7 @@ MAGWriter::write_single_instance (db::cell_index_type ci, db::ICplxTrans trans,
a = trinv * a;
b = trinv * b;
if (a.y () != 0) {
if (a.y () != 0 || b.x () != 0) {
std::swap (a, b);
std::swap (na, nb);
}

View File

@ -151,3 +151,8 @@ TEST(2)
run_test (_this, tl::testsrc (), "PearlRiver/Layout/magic/PearlRiver_die.mag", "PearlRiver_au.cif.gz", 0, 1.0, 0.001, &lp);
}
TEST(3)
{
run_test (_this, tl::testsrc (), "ringo/RINGO.mag", "ringo_au.cif.gz");
}

18
testdata/magic/ringo/EMPTY.mag vendored Normal file
View File

@ -0,0 +1,18 @@
magic
timestamp 1575832387
<< checkpaint >>
rect 0 0 6 80
<< l1001d0 >>
rect 0 20 6 24
rect 0 29 6 33
rect 0 38 6 42
rect 0 47 6 51
rect 0 56 6 60
<< l9d0 >>
rect 0 4 6 12
rect 0 68 6 76
<< l13d0 >>
rect 0 0 6 80
<< l1d0 >>
rect 0 45 6 80
<< end >>

55
testdata/magic/ringo/INVX1.mag vendored Normal file
View File

@ -0,0 +1,55 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -1 0 19 80
<< l5d0 >>
rect 7 29 10 48
<< l1001d0 >>
rect 0 20 18 24
rect 0 29 18 33
rect 0 38 18 42
rect 0 47 18 51
rect 0 56 18 60
<< l8d0 >>
rect 4 63 6 64
rect 4 57 6 59
rect 11 52 13 53
rect 4 52 6 53
rect 11 63 13 64
rect 11 57 13 59
rect 11 18 13 20
rect 4 18 6 20
rect 11 23 13 25
rect 4 23 6 25
<< l9d0 >>
rect 0 4 18 12
rect 0 68 18 76
rect 4 51 7 65
rect 11 17 14 65
rect 4 12 7 26
rect 4 65 7 68
<< l13d0 >>
rect 0 0 18 80
<< l1d0 >>
rect -1 45 19 80
<< l14d0 >>
rect 2 49 9 67
rect 2 15 9 28
<< labels >>
rlabel l9d0 9.5 72 9.5 72 0 VDD
rlabel l9d0 9.5 8 9.5 8 0 VSS
rlabel l9d0 6 31 6 31 0 IN
rlabel l9d0 12 40 12 40 0 OUT
use POLYM1 POLYM1_1
timestamp 1575832387
transform 1 0 6 0 1 31
box -5 -5 5 5
use NMOS2 NMOS2_1
timestamp 1575832387
transform 1 0 3 0 1 17
box -1 -3 12 12
use PMOS3 PMOS3_1
timestamp 1575832387
transform 1 0 3 0 1 51
box -1 -3 12 18
<< end >>

13
testdata/magic/ringo/M1M2.mag vendored Normal file
View File

@ -0,0 +1,13 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -5 -5 5 5
<< l1001d0 >>
rect -5 -5 5 5
<< l9d0 >>
rect -2 -2 2 2
<< l10d0 >>
rect -1 -1 1 1
<< l11d0 >>
rect -2 -2 2 2
<< end >>

78
testdata/magic/ringo/ND2X1.mag vendored Normal file
View File

@ -0,0 +1,78 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -1 0 25 80
<< l5d0 >>
rect 14 29 17 48
rect 7 29 10 48
<< l1001d0 >>
rect 0 20 24 24
rect 0 29 24 33
rect 0 38 24 42
rect 0 47 24 51
rect 0 56 24 60
<< l8d0 >>
rect 18 63 20 64
rect 18 52 20 53
rect 18 57 20 59
rect 4 63 6 64
rect 4 57 6 59
rect 11 52 13 53
rect 4 52 6 53
rect 11 63 13 64
rect 11 57 13 59
rect 18 18 20 20
rect 4 18 6 20
rect 18 23 20 25
rect 4 23 6 25
<< l9d0 >>
rect 18 17 21 28
rect 18 28 22 31
rect 19 31 22 45
rect 4 45 22 48
rect 4 48 7 51
rect 0 4 24 12
rect 0 68 24 76
rect 18 51 21 65
rect 4 51 7 65
rect 11 51 14 68
rect 18 48 21 51
rect 4 12 7 26
<< l13d0 >>
rect 0 0 24 80
<< l1d0 >>
rect -1 45 25 80
<< l14d0 >>
rect 9 49 16 67
rect 9 13 16 28
<< labels >>
rlabel l9d0 12.5 72 12.5 72 0 VDD
rlabel l9d0 12.5 8 12.5 8 0 VSS
rlabel l9d0 21 40 21 40 0 OUT
rlabel l9d0 8 31 8 31 0 A
rlabel l9d0 15 40 15 40 0 B
use POLYM1 POLYM1_1
timestamp 1575832387
transform 1 0 8 0 1 31
box -5 -5 5 5
use POLYM1 POLYM1_2
timestamp 1575832387
transform 1 0 15 0 1 40
box -5 -5 5 5
use NMOS2 NMOS2_1
timestamp 1575832387
transform 1 0 3 0 1 17
box -1 -3 12 12
use PMOS3 PMOS3_1
timestamp 1575832387
transform 1 0 3 0 1 51
box -1 -3 12 18
use PMOS3 PMOS3_2
timestamp 1575832387
transform 1 0 10 0 1 51
box -1 -3 12 18
use NMOS2 NMOS2_2
timestamp 1575832387
transform 1 0 10 0 1 17
box -1 -3 12 12
<< end >>

19
testdata/magic/ringo/NMOS2.mag vendored Normal file
View File

@ -0,0 +1,19 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -1 -3 12 12
<< l5d0 >>
rect 4 -3 7 12
<< l1001d0 >>
rect 8 1 11 9
rect 1 1 4 9
<< l2d0 >>
rect 0 0 11 10
<< l1000d0 >>
rect 1 7 3 8
rect 1 1 3 3
rect 8 1 10 3
rect 8 7 10 8
<< l4d0 >>
rect -1 -1 12 10
<< end >>

23
testdata/magic/ringo/PMOS3.mag vendored Normal file
View File

@ -0,0 +1,23 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -1 -3 12 18
<< l5d0 >>
rect 4 -3 7 18
rect 4 -3 7 18
<< l1001d0 >>
rect 8 1 11 15
rect 1 1 4 15
<< l2d0 >>
rect 0 0 11 15
rect 0 0 11 15
<< l1000d0 >>
rect 1 7 3 8
rect 8 7 10 8
rect 1 1 3 3
rect 8 1 10 3
rect 8 12 10 14
rect 1 12 3 14
<< l3d0 >>
rect -1 -1 12 16
<< end >>

13
testdata/magic/ringo/POLYM1.mag vendored Normal file
View File

@ -0,0 +1,13 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -5 -5 5 5
<< l5d0 >>
rect -2 -2 2 2
<< l1001d0 >>
rect -5 -5 5 5
<< l8d0 >>
rect -1 -1 1 1
<< l9d0 >>
rect -2 -2 2 2
<< end >>

70
testdata/magic/ringo/RINGO.mag vendored Normal file
View File

@ -0,0 +1,70 @@
magic
timestamp 1575832387
<< checkpaint >>
rect 0 0 258 80
<< l9d0 >>
rect 40 30 47 33
rect 56 30 65 33
rect 74 30 83 33
rect 92 30 101 33
rect 110 30 119 33
rect 128 30 137 33
rect 146 30 155 33
rect 164 30 173 33
rect 182 30 191 33
rect 200 30 209 33
rect 218 30 227 33
<< l11d0 >>
rect 35 38 212 42
<< labels >>
rlabel l9d0 29.5 72.5 29.5 72.5 0 VDD
rlabel l9d0 29.5 8.5 29.5 8.5 0 VSS
rlabel l11d0 236 40 236 40 0 OUT
rlabel l11d0 26 31 26 31 0 ENABLE
rlabel l11d0 33 40 33 40 0 FB
use ND2X1 ND2X1_1
timestamp 1575832387
transform 1 0 18 0 1 0
box -1 0 25 80
use INVX1 INVX1_1
array 0 9 18 0 0 0
timestamp 1575832387
transform 1 0 42 0 1 0
box -1 0 19 80
use M1M2 M1M2_1
timestamp 1575832387
transform 1 0 33 0 1 40
box -5 -5 5 5
use M1M2 M1M2_2
timestamp 1575832387
transform 1 0 214 0 1 40
box -5 -5 5 5
use TIE TIE_1
timestamp 1575832387
transform 1 0 240 0 1 0
box -1 0 13 80
use TIE TIE_2
timestamp 1575832387
transform 1 0 6 0 1 0
box -1 0 13 80
use EMPTY EMPTY_1
timestamp 1575832387
transform 1 0 252 0 1 0
box 0 0 6 80
use EMPTY EMPTY_2
timestamp 1575832387
transform 1 0 0 0 1 0
box 0 0 6 80
use M1M2 M1M2_3
timestamp 1575832387
transform 1 0 26 0 1 31
box -5 -5 5 5
use INVX1 INVX1_2
timestamp 1575832387
transform 1 0 222 0 1 0
box -1 0 19 80
use M1M2 M1M2_4
timestamp 1575832387
transform 1 0 236 0 1 40
box -5 -5 5 5
<< end >>

37
testdata/magic/ringo/TIE.mag vendored Normal file
View File

@ -0,0 +1,37 @@
magic
timestamp 1575832387
<< checkpaint >>
rect -1 0 13 80
<< l1001d0 >>
rect 0 20 12 24
rect 0 29 12 33
rect 0 38 12 42
rect 0 47 12 51
rect 0 56 12 60
<< l8d0 >>
rect 5 16 7 18
rect 5 5 7 7
rect 5 68 7 69
rect 5 11 7 12
rect 5 73 7 75
rect 5 62 7 64
<< l9d0 >>
rect 0 4 12 12
rect 0 68 12 76
rect 5 5 8 19
rect 5 62 8 76
<< l2d0 >>
rect 4 61 9 76
rect 4 4 9 19
<< l4d0 >>
rect 3 61 9 77
<< l3d0 >>
rect 3 4 9 20
<< l13d0 >>
rect 0 0 12 80
<< l1d0 >>
rect -1 45 13 80
<< labels >>
rlabel l9d0 6.5 72 6.5 72 0 VDD
rlabel l9d0 6.5 8 6.5 8 0 VSS
<< end >>

238
testdata/magic/ringo_au.cif.gz vendored Normal file
View File

@ -0,0 +1,238 @@
(CIF file written 2019-12-08 20:16:23 by KLayout);
DS 1 1 10;
9 PMOS3;
L L1001D0;
P 1000,1000 1000,15000 4000,15000 4000,1000;
P 8000,1000 8000,15000 11000,15000 11000,1000;
L L5D0;
P 4000,-3000 4000,18000 7000,18000 7000,-3000;
L L2D0;
P 0,0 0,15000 11000,15000 11000,0;
L L1000D0;
P 1000,1000 1000,3000 3000,3000 3000,1000;
P 8000,1000 8000,3000 10000,3000 10000,1000;
P 1000,7000 1000,8000 3000,8000 3000,7000;
P 8000,7000 8000,8000 10000,8000 10000,7000;
P 1000,12000 1000,14000 3000,14000 3000,12000;
P 8000,12000 8000,14000 10000,14000 10000,12000;
L L3D0;
P -1000,-1000 -1000,16000 12000,16000 12000,-1000;
DF;
DS 2 1 10;
9 NMOS2;
L L1001D0;
P 1000,1000 1000,9000 4000,9000 4000,1000;
P 8000,1000 8000,9000 11000,9000 11000,1000;
L L5D0;
P 4000,-3000 4000,12000 7000,12000 7000,-3000;
L L2D0;
P 0,0 0,10000 11000,10000 11000,0;
L L1000D0;
P 1000,1000 1000,3000 3000,3000 3000,1000;
P 8000,1000 8000,3000 10000,3000 10000,1000;
P 1000,7000 1000,8000 3000,8000 3000,7000;
P 8000,7000 8000,8000 10000,8000 10000,7000;
L L4D0;
P -1000,-1000 -1000,10000 12000,10000 12000,-1000;
DF;
DS 3 1 10;
9 POLYM1;
L L9D0;
P -2000,-2000 -2000,2000 2000,2000 2000,-2000;
L L1001D0;
P -5000,-5000 -5000,5000 5000,5000 5000,-5000;
L L5D0;
P -2000,-2000 -2000,2000 2000,2000 2000,-2000;
L L8D0;
P -1000,-1000 -1000,1000 1000,1000 1000,-1000;
DF;
DS 4 1 10;
9 EMPTY;
L L9D0;
P 0,4000 0,12000 6000,12000 6000,4000;
P 0,68000 0,76000 6000,76000 6000,68000;
L L1001D0;
P 0,20000 0,24000 6000,24000 6000,20000;
P 0,29000 0,33000 6000,33000 6000,29000;
P 0,38000 0,42000 6000,42000 6000,38000;
P 0,47000 0,51000 6000,51000 6000,47000;
P 0,56000 0,60000 6000,60000 6000,56000;
L L13D0;
P 0,0 0,80000 6000,80000 6000,0;
L L1D0;
P 0,45000 0,80000 6000,80000 6000,45000;
DF;
DS 5 1 10;
9 TIE;
L L9D0;
94 VDD 6500,72000 0;
94 VSS 6500,8000 0;
P 0,4000 0,12000 5000,12000 5000,19000 8000,19000 8000,12000 12000,12000 12000,4000;
P 5000,62000 5000,68000 0,68000 0,76000 12000,76000 12000,68000 8000,68000 8000,62000;
L L1001D0;
P 0,20000 0,24000 12000,24000 12000,20000;
P 0,29000 0,33000 12000,33000 12000,29000;
P 0,38000 0,42000 12000,42000 12000,38000;
P 0,47000 0,51000 12000,51000 12000,47000;
P 0,56000 0,60000 12000,60000 12000,56000;
L L13D0;
P 0,0 0,80000 12000,80000 12000,0;
L L1D0;
P -1000,45000 -1000,80000 13000,80000 13000,45000;
L L8D0;
P 5000,5000 5000,7000 7000,7000 7000,5000;
P 5000,11000 5000,12000 7000,12000 7000,11000;
P 5000,16000 5000,18000 7000,18000 7000,16000;
P 5000,62000 5000,64000 7000,64000 7000,62000;
P 5000,68000 5000,69000 7000,69000 7000,68000;
P 5000,73000 5000,75000 7000,75000 7000,73000;
L L2D0;
P 4000,4000 4000,19000 9000,19000 9000,4000;
P 4000,61000 4000,76000 9000,76000 9000,61000;
L L4D0;
P 3000,61000 3000,77000 9000,77000 9000,61000;
L L3D0;
P 3000,4000 3000,20000 9000,20000 9000,4000;
DF;
DS 6 1 10;
9 M1M2;
L L9D0;
P -2000,-2000 -2000,2000 2000,2000 2000,-2000;
L L11D0;
P -2000,-2000 -2000,2000 2000,2000 2000,-2000;
L L1001D0;
P -5000,-5000 -5000,5000 5000,5000 5000,-5000;
L L10D0;
P -1000,-1000 -1000,1000 1000,1000 1000,-1000;
DF;
DS 7 1 10;
9 INVX1;
C3 R1,0 T6000,31000;
C2 R1,0 T3000,17000;
C1 R1,0 T3000,51000;
L L9D0;
94 VDD 9500,72000 0;
94 VSS 9500,8000 0;
94 IN 6000,31000 0;
94 OUT 12000,40000 0;
P 0,4000 0,12000 4000,12000 4000,26000 7000,26000 7000,12000 18000,12000 18000,4000;
P 11000,17000 11000,65000 14000,65000 14000,17000;
P 4000,51000 4000,68000 0,68000 0,76000 18000,76000 18000,68000 7000,68000 7000,51000;
L L1001D0;
P 0,20000 0,24000 18000,24000 18000,20000;
P 0,29000 0,33000 18000,33000 18000,29000;
P 0,38000 0,42000 18000,42000 18000,38000;
P 0,47000 0,51000 18000,51000 18000,47000;
P 0,56000 0,60000 18000,60000 18000,56000;
L L13D0;
P 0,0 0,80000 18000,80000 18000,0;
L L1D0;
P -1000,45000 -1000,80000 19000,80000 19000,45000;
L L5D0;
P 7000,29000 7000,48000 10000,48000 10000,29000;
L L8D0;
P 4000,18000 4000,20000 6000,20000 6000,18000;
P 11000,18000 11000,20000 13000,20000 13000,18000;
P 4000,23000 4000,25000 6000,25000 6000,23000;
P 11000,23000 11000,25000 13000,25000 13000,23000;
P 4000,52000 4000,53000 6000,53000 6000,52000;
P 11000,52000 11000,53000 13000,53000 13000,52000;
P 4000,57000 4000,59000 6000,59000 6000,57000;
P 11000,57000 11000,59000 13000,59000 13000,57000;
P 4000,63000 4000,64000 6000,64000 6000,63000;
P 11000,63000 11000,64000 13000,64000 13000,63000;
L L14D0;
P 2000,15000 2000,28000 9000,28000 9000,15000;
P 2000,49000 2000,67000 9000,67000 9000,49000;
DF;
DS 8 1 10;
9 ND2X1;
C3 R1,0 T8000,31000;
C3 R1,0 T15000,40000;
C2 R1,0 T3000,17000;
C1 R1,0 T3000,51000;
C1 R1,0 T10000,51000;
C2 R1,0 T10000,17000;
L L9D0;
94 VDD 12500,72000 0;
94 VSS 12500,8000 0;
94 OUT 21000,40000 0;
94 A 8000,31000 0;
94 B 15000,40000 0;
P 0,4000 0,12000 4000,12000 4000,26000 7000,26000 7000,12000 24000,12000 24000,4000;
P 18000,17000 18000,31000 19000,31000 19000,45000 4000,45000 4000,65000 7000,65000 7000,48000 18000,48000 18000,65000 21000,65000 21000,48000 22000,48000 22000,28000 21000,28000 21000,17000;
P 11000,51000 11000,68000 0,68000 0,76000 24000,76000 24000,68000 14000,68000 14000,51000;
L L1001D0;
P 0,20000 0,24000 24000,24000 24000,20000;
P 0,29000 0,33000 24000,33000 24000,29000;
P 0,38000 0,42000 24000,42000 24000,38000;
P 0,47000 0,51000 24000,51000 24000,47000;
P 0,56000 0,60000 24000,60000 24000,56000;
L L13D0;
P 0,0 0,80000 24000,80000 24000,0;
L L1D0;
P -1000,45000 -1000,80000 25000,80000 25000,45000;
L L5D0;
P 7000,29000 7000,48000 10000,48000 10000,29000;
P 14000,29000 14000,48000 17000,48000 17000,29000;
L L8D0;
P 4000,18000 4000,20000 6000,20000 6000,18000;
P 18000,18000 18000,20000 20000,20000 20000,18000;
P 4000,23000 4000,25000 6000,25000 6000,23000;
P 18000,23000 18000,25000 20000,25000 20000,23000;
P 4000,52000 4000,53000 6000,53000 6000,52000;
P 11000,52000 11000,53000 13000,53000 13000,52000;
P 18000,52000 18000,53000 20000,53000 20000,52000;
P 4000,57000 4000,59000 6000,59000 6000,57000;
P 11000,57000 11000,59000 13000,59000 13000,57000;
P 18000,57000 18000,59000 20000,59000 20000,57000;
P 4000,63000 4000,64000 6000,64000 6000,63000;
P 11000,63000 11000,64000 13000,64000 13000,63000;
P 18000,63000 18000,64000 20000,64000 20000,63000;
L L14D0;
P 9000,13000 9000,28000 16000,28000 16000,13000;
P 9000,49000 9000,67000 16000,67000 16000,49000;
DF;
DS 9 1 10;
9 RINGO;
C8 R1,0 T18000,0;
C7 R1,0 T42000,0;
C7 R1,0 T60000,0;
C7 R1,0 T78000,0;
C7 R1,0 T96000,0;
C7 R1,0 T114000,0;
C7 R1,0 T132000,0;
C7 R1,0 T150000,0;
C7 R1,0 T168000,0;
C7 R1,0 T186000,0;
C7 R1,0 T204000,0;
C6 R1,0 T33000,40000;
C6 R1,0 T214000,40000;
C5 R1,0 T240000,0;
C5 R1,0 T6000,0;
C4 R1,0 T252000,0;
C4 R1,0 T0,0;
C6 R1,0 T26000,31000;
C7 R1,0 T222000,0;
C6 R1,0 T236000,40000;
L L9D0;
94 VDD 29500,72500 0;
94 VSS 29500,8500 0;
P 40000,30000 40000,33000 47000,33000 47000,30000;
P 56000,30000 56000,33000 65000,33000 65000,30000;
P 74000,30000 74000,33000 83000,33000 83000,30000;
P 92000,30000 92000,33000 101000,33000 101000,30000;
P 110000,30000 110000,33000 119000,33000 119000,30000;
P 128000,30000 128000,33000 137000,33000 137000,30000;
P 146000,30000 146000,33000 155000,33000 155000,30000;
P 164000,30000 164000,33000 173000,33000 173000,30000;
P 182000,30000 182000,33000 191000,33000 191000,30000;
P 200000,30000 200000,33000 209000,33000 209000,30000;
P 218000,30000 218000,33000 227000,33000 227000,30000;
L L11D0;
94 OUT 236000,40000 0;
94 ENABLE 26000,31000 0;
94 FB 33000,40000 0;
P 35000,38000 35000,42000 212000,42000 212000,38000;
DF;
E