capacitor added to c4
diff --git a/mag/c4_1.mag b/mag/c4_1.mag
index 7ebdd00..eb2695c 100644
--- a/mag/c4_1.mag
+++ b/mag/c4_1.mag
@@ -1,7 +1,7 @@
magic
tech sky130B
magscale 1 2
-timestamp 1654226434
+timestamp 1654288242
<< nwell >>
rect 8 166 208 585
<< nmos >>
@@ -210,10 +210,10 @@
rect -273 397 51 433
rect -325 382 51 397
rect -135 262 -67 277
-rect -325 231 -255 247
-rect -325 197 -309 231
-rect -273 197 -255 231
-rect -325 180 -255 197
+rect -325 242 -255 247
+rect -325 187 -318 242
+rect -261 187 -255 242
+rect -325 180 -255 187
rect -135 228 -119 262
rect -84 228 -67 262
rect -260 6 -200 18
@@ -236,4 +236,30 @@
rect -73 -199 93 -165
rect 127 -199 139 -165
rect -135 -212 139 -199
+<< via1 >>
+rect -318 231 -261 242
+rect -318 197 -309 231
+rect -309 197 -273 231
+rect -273 197 -261 231
+rect -318 187 -261 197
+<< metal2 >>
+rect -329 242 -251 251
+rect -1392 136 -1272 210
+rect -329 185 -320 242
+rect -260 185 -251 242
+rect -329 176 -251 185
+<< via2 >>
+rect -320 187 -318 242
+rect -318 187 -261 242
+rect -261 187 -260 242
+rect -320 185 -260 187
+<< metal3 >>
+rect -363 242 -243 278
+rect -363 185 -320 242
+rect -260 185 -243 242
+rect -363 158 -243 185
+use sky130_fd_pr__cap_mim_m3_1_5NP42Z sky130_fd_pr__cap_mim_m3_1_5NP42Z_0
+timestamp 1654287887
+transform 1 0 -1036 0 1 178
+box -309 -400 794 400
<< end >>
diff --git a/mag/user_analog_project_wrapper.mag b/mag/user_analog_project_wrapper.mag
index 99610f0..728709c 100644
--- a/mag/user_analog_project_wrapper.mag
+++ b/mag/user_analog_project_wrapper.mag
@@ -1,7 +1,7 @@
magic
tech sky130B
magscale 1 2
-timestamp 1654229515
+timestamp 1654288977
<< locali >>
rect 256417 656497 256484 656565
<< metal1 >>
@@ -60,16 +60,18 @@
rect 227322 657034 256344 657078
rect 227322 581322 227510 657034
rect 255089 657032 256344 657034
-rect 255645 656975 255726 656988
-rect 255645 656923 255660 656975
-rect 255712 656923 255726 656975
-rect 255645 656659 255726 656923
+rect 254610 656928 254689 656937
+rect 254610 656869 254618 656928
+rect 254679 656869 254689 656928
+rect 254610 656615 254689 656869
rect 256286 656865 256344 657032
rect 256416 656714 256482 656720
rect 256416 656662 256424 656714
rect 256476 656662 256482 656714
-rect 255645 656591 255951 656659
rect 256416 656654 256482 656662
+rect 254610 656556 254620 656615
+rect 254681 656556 254689 656615
+rect 254610 656547 254689 656556
rect 256417 656557 256484 656565
rect 256417 656505 256424 656557
rect 256476 656505 256484 656557
@@ -94,8 +96,9 @@
rect 43042 663434 43190 663602
rect 56256 663434 56376 663594
rect 51858 657502 51982 657600
-rect 255660 656923 255712 656975
+rect 254618 656869 254679 656928
rect 256424 656662 256476 656714
+rect 254620 656556 254681 656615
rect 256424 656505 256476 656557
rect 255950 656373 256002 656427
rect 256860 656205 257122 656257
@@ -187,10 +190,9 @@
rect 512610 682292 513366 684870
rect 256850 681546 513366 682292
rect 256850 681536 513364 681546
-rect 172756 681134 256022 681286
+rect 254610 681286 254689 681288
+rect 172756 681134 254689 681286
rect 172756 681131 226746 681134
-rect 255948 681108 256022 681134
-rect 255948 680942 256024 681108
rect 51436 666500 51710 666510
rect 51436 666332 51446 666500
rect 51700 666332 51710 666500
@@ -207,13 +209,10 @@
rect 51838 657502 51856 657602
rect 51982 657502 52004 657602
rect 51838 657486 52004 657502
-rect 255950 657257 256024 680942
-rect 255646 657177 256025 657257
-rect 255646 656988 255725 657177
-rect 255645 656975 255726 656988
-rect 255645 656923 255660 656975
-rect 255712 656923 255726 656975
-rect 255645 656909 255726 656923
+rect 254610 656928 254689 681134
+rect 254610 656869 254618 656928
+rect 254679 656869 254689 656928
+rect 254610 656861 254689 656869
rect 213547 656795 255948 656796
rect 213547 656727 256482 656795
rect 213547 656306 213617 656727
@@ -221,17 +220,21 @@
rect 256416 656662 256424 656714
rect 256476 656662 256482 656714
rect 256416 656654 256482 656662
+rect 254611 656615 254934 656622
+rect 254611 656556 254620 656615
+rect 254681 656556 254934 656615
+rect 254611 656548 254934 656556
rect 256417 656557 256752 656566
-rect 213901 656473 255198 656548
+rect 213901 656473 254124 656548
rect 256417 656505 256424 656557
rect 256476 656505 256752 656557
rect 256417 656497 256752 656505
rect 213901 656327 213984 656473
-rect 255134 656434 255198 656473
-rect 255134 656427 256009 656434
-rect 255134 656373 255950 656427
+rect 253995 656434 254124 656473
+rect 253995 656427 256009 656434
+rect 253995 656373 255950 656427
rect 256002 656373 256009 656427
-rect 255134 656366 256009 656373
+rect 253995 656366 256009 656373
rect 4346 511652 4478 511670
rect 213548 511652 213616 656306
rect 340 511642 213616 511652
@@ -1078,9 +1081,9 @@
transform 1 0 52313 0 1 660624
box -2563 -40 1390 600
use c4_1 c4_1_1
-timestamp 1654226434
+timestamp 1654288242
transform 1 0 256206 0 1 656412
-box -325 -216 277 585
+box -1392 -222 277 585
<< labels >>
flabel metal3 s 582300 677984 584800 682984 0 FreeSans 1120 0 0 0 io_analog[0]
port 36 nsew signal bidirectional
diff --git a/xschem/C4.sch b/xschem/C4.sch
index 01150c1..de1d538 100644
--- a/xschem/C4.sch
+++ b/xschem/C4.sch
@@ -4,7 +4,7 @@
V {}
S {}
E {}
-N 130 -260 130 -190 {
+N 110 -260 110 -190 {
lab=#net1}
N 80 -190 130 -190 {
lab=#net1}
@@ -20,8 +20,6 @@
lab=#net1}
N 250 -90 250 -50 {
lab=#net2}
-N 130 -340 130 -320 {
-lab=#net3}
N 250 -380 250 -360 {
lab=#net3}
N 430 -160 430 -120 {
@@ -84,10 +82,11 @@
lab=#net3}
N 130 -460 250 -460 {
lab=#net3}
-N 130 -460 130 -340 {
+N 110 -460 110 -340 {
lab=#net3}
-N 20 -190 80 -190 {}
-N 130 -330 130 -260 {}
+N 110 -270 110 -260 {}
+N 110 -340 110 -330 {}
+N 110 -460 130 -460 {}
C {sky130_fd_pr/nfet_01v8.sym} 270 -120 0 1 {name=M3
L=0.15
W=1
@@ -131,3 +130,5 @@
C {devices/lab_pin.sym} -120 -450 0 0 {name=l15 sig_type=std_logic lab=vout}
C {devices/iopin.sym} 330 -10 0 0 {name=p5 lab=vss}
C {devices/iopin.sym} 240 -530 0 0 {name=p6 lab=vdda}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 50 -190 1 0 {name=C2 model=cap_mim_m3_1 W=1 L=1 MF=100 spiceprefix=X}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 110 -300 0 0 {name=C1 model=cap_mim_m3_1 W=1 L=1 MF=100 spiceprefix=X}
diff --git a/xschem/sky130_fd_pr/cap_mim_m3_1.sym b/xschem/sky130_fd_pr/cap_mim_m3_1.sym
new file mode 100644
index 0000000..7e3cea9
--- /dev/null
+++ b/xschem/sky130_fd_pr/cap_mim_m3_1.sym
@@ -0,0 +1,21 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=capacitor
+format="@spiceprefix@name @pinlist sky130_fd_pr__@model W=@W L=@L MF=@MF m=@MF"
+template="name=C1 model=cap_mim_m3_1 W=1 L=1 MF=1 spiceprefix=X"
+}
+V {}
+S {}
+E {}
+L 4 0 2.5 0 30 {}
+L 4 0 -30 0 -5 {}
+L 4 -10 -5 10 -5 {}
+B 5 -2.5 -32.5 2.5 -27.5 {name=c0 dir=inout}
+B 5 -2.5 27.5 2.5 32.5 {name=c1 dir=inout}
+A 4 -0 23.75 21.25 61.92751306414704 56.14497387170592 {}
+T {c0} 5 -27.5 0 0 0.15 0.15 {layer=7}
+T {c1} 5 18.75 0 0 0.15 0.15 {layer=7}
+T {MF=@MF} 17.5 18.75 0 0 0.2 0.2 {layer=13}
+T {@name} 15 -28.75 0 0 0.2 0.2 {}
+T {@W / @L} 15 6.25 0 0 0.2 0.2 {layer=13}
+T {@model} 15 -11.25 0 0 0.2 0.2 {}