uploaded recovered schematics
diff --git a/xschem/._FB1 b/xschem/._FB1
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._FB1
Binary files differ
diff --git a/xschem/._FB1.spice b/xschem/._FB1.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._FB1.spice
Binary files differ
diff --git a/xschem/._balaced-pd.sch b/xschem/._balaced-pd.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._balaced-pd.sch
Binary files differ
diff --git a/xschem/._balaced-pd.spice b/xschem/._balaced-pd.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._balaced-pd.spice
Binary files differ
diff --git a/xschem/._balaced-pd.sym b/xschem/._balaced-pd.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._balaced-pd.sym
Binary files differ
diff --git a/xschem/._basic-invert.sch b/xschem/._basic-invert.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._basic-invert.sch
Binary files differ
diff --git a/xschem/._basic-invert.sym b/xschem/._basic-invert.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._basic-invert.sym
Binary files differ
diff --git a/xschem/._compiled.sch b/xschem/._compiled.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._compiled.sch
Binary files differ
diff --git a/xschem/._compiled.spice b/xschem/._compiled.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._compiled.spice
Binary files differ
diff --git a/xschem/._cs-abstract.sch b/xschem/._cs-abstract.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs-abstract.sch
Binary files differ
diff --git a/xschem/._cs-abstract.spice b/xschem/._cs-abstract.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs-abstract.spice
Binary files differ
diff --git a/xschem/._cs-exper.sch b/xschem/._cs-exper.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs-exper.sch
Binary files differ
diff --git a/xschem/._cs-exper.spice b/xschem/._cs-exper.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs-exper.spice
Binary files differ
diff --git a/xschem/._cs3v3-abstract.sch b/xschem/._cs3v3-abstract.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs3v3-abstract.sch
Binary files differ
diff --git a/xschem/._cs3v3-abstract.spice b/xschem/._cs3v3-abstract.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._cs3v3-abstract.spice
Binary files differ
diff --git a/xschem/._csfd-abstract.sch b/xschem/._csfd-abstract.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._csfd-abstract.sch
Binary files differ
diff --git a/xschem/._csfd-abstract.spice b/xschem/._csfd-abstract.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._csfd-abstract.spice
Binary files differ
diff --git a/xschem/._csfd-abstract.sym b/xschem/._csfd-abstract.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._csfd-abstract.sym
Binary files differ
diff --git a/xschem/._data.raw b/xschem/._data.raw
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._data.raw
Binary files differ
diff --git a/xschem/._dsa.sch b/xschem/._dsa.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._dsa.sch
Binary files differ
diff --git a/xschem/._dsa.spice b/xschem/._dsa.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._dsa.spice
Binary files differ
diff --git a/xschem/._dsa.sym b/xschem/._dsa.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._dsa.sym
Binary files differ
diff --git a/xschem/._gate-switch.sch b/xschem/._gate-switch.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._gate-switch.sch
Binary files differ
diff --git a/xschem/._gate-switch.spice b/xschem/._gate-switch.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._gate-switch.spice
Binary files differ
diff --git a/xschem/._gate-switch.sym b/xschem/._gate-switch.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._gate-switch.sym
Binary files differ
diff --git a/xschem/._invert b/xschem/._invert
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._invert
Binary files differ
diff --git a/xschem/._invert.sch b/xschem/._invert.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._invert.sch
Binary files differ
diff --git a/xschem/._invert.spice b/xschem/._invert.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._invert.spice
Binary files differ
diff --git a/xschem/._invert.sym b/xschem/._invert.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._invert.sym
Binary files differ
diff --git a/xschem/._lvtnot.spice b/xschem/._lvtnot.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._lvtnot.spice
Binary files differ
diff --git a/xschem/._n_diffamp.raw b/xschem/._n_diffamp.raw
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._n_diffamp.raw
Binary files differ
diff --git a/xschem/._n_diffamp.spice b/xschem/._n_diffamp.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._n_diffamp.spice
Binary files differ
diff --git a/xschem/._not.spice b/xschem/._not.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._not.spice
Binary files differ
diff --git a/xschem/._passgate.spice b/xschem/._passgate.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._passgate.spice
Binary files differ
diff --git a/xschem/._power-detector.sch b/xschem/._power-detector.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._power-detector.sch
Binary files differ
diff --git a/xschem/._power-detector.spice b/xschem/._power-detector.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._power-detector.spice
Binary files differ
diff --git a/xschem/._rms-detector.sch b/xschem/._rms-detector.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._rms-detector.sch
Binary files differ
diff --git a/xschem/._rms-detector.spice b/xschem/._rms-detector.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._rms-detector.spice
Binary files differ
diff --git a/xschem/._test_analog.raw b/xschem/._test_analog.raw
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_analog.raw
Binary files differ
diff --git a/xschem/._test_analog.spice b/xschem/._test_analog.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_analog.spice
Binary files differ
diff --git a/xschem/._test_comparator.spice b/xschem/._test_comparator.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_comparator.spice
Binary files differ
diff --git a/xschem/._test_inv.raw b/xschem/._test_inv.raw
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_inv.raw
Binary files differ
diff --git a/xschem/._test_inv.spice b/xschem/._test_inv.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_inv.spice
Binary files differ
diff --git a/xschem/._test_nmos.spice b/xschem/._test_nmos.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_nmos.spice
Binary files differ
diff --git a/xschem/._test_nmos_sizes.spice b/xschem/._test_nmos_sizes.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_nmos_sizes.spice
Binary files differ
diff --git a/xschem/._test_res.spice b/xschem/._test_res.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._test_res.spice
Binary files differ
diff --git a/xschem/._testbank.sch b/xschem/._testbank.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._testbank.sch
Binary files differ
diff --git a/xschem/._testbank.spice b/xschem/._testbank.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._testbank.spice
Binary files differ
diff --git a/xschem/._trans-gate-testbench.sch b/xschem/._trans-gate-testbench.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._trans-gate-testbench.sch
Binary files differ
diff --git a/xschem/._trans-gate-testbench.spice b/xschem/._trans-gate-testbench.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._trans-gate-testbench.spice
Binary files differ
diff --git a/xschem/._trans-gate.sch b/xschem/._trans-gate.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._trans-gate.sch
Binary files differ
diff --git a/xschem/._trans-gate.sym b/xschem/._trans-gate.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._trans-gate.sym
Binary files differ
diff --git a/xschem/._transgate-full.sch b/xschem/._transgate-full.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._transgate-full.sch
Binary files differ
diff --git a/xschem/._transgate-full.spice b/xschem/._transgate-full.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._transgate-full.spice
Binary files differ
diff --git a/xschem/._transgate-full.sym b/xschem/._transgate-full.sym
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._transgate-full.sym
Binary files differ
diff --git a/xschem/._untitled-1.sch b/xschem/._untitled-1.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-1.sch
Binary files differ
diff --git a/xschem/._untitled-1.spice b/xschem/._untitled-1.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-1.spice
Binary files differ
diff --git a/xschem/._untitled-2.sch b/xschem/._untitled-2.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-2.sch
Binary files differ
diff --git a/xschem/._untitled-3.sch b/xschem/._untitled-3.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-3.sch
Binary files differ
diff --git a/xschem/._untitled-3.spice b/xschem/._untitled-3.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-3.spice
Binary files differ
diff --git a/xschem/._untitled-4.sch b/xschem/._untitled-4.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-4.sch
Binary files differ
diff --git a/xschem/._untitled-4.spice b/xschem/._untitled-4.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled-4.spice
Binary files differ
diff --git a/xschem/._untitled.sch b/xschem/._untitled.sch
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled.sch
Binary files differ
diff --git a/xschem/._untitled.spice b/xschem/._untitled.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._untitled.spice
Binary files differ
diff --git a/xschem/._waveforms.lxt b/xschem/._waveforms.lxt
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._waveforms.lxt
Binary files differ
diff --git a/xschem/._xschemrc b/xschem/._xschemrc
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._xschemrc
Binary files differ
diff --git a/xschem/._zero_opamp.spice b/xschem/._zero_opamp.spice
new file mode 100644
index 0000000..6dd15e9
--- /dev/null
+++ b/xschem/._zero_opamp.spice
Binary files differ
diff --git a/xschem/FB1 b/xschem/FB1
new file mode 100644
index 0000000..f7de620
--- /dev/null
+++ b/xschem/FB1
@@ -0,0 +1,88 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+T {NMOS Characterization
+} 20 -260 0 0 0.4 0.4 {}
+N 90 -100 90 -90 { lab=vg}
+N 90 -100 130 -100 { lab=vg}
+N 170 -150 170 -130 { lab=vd}
+N 170 -150 260 -150 { lab=vd}
+N 260 -150 260 -130 { lab=vd}
+N 80 -140 90 -140 { lab=vg}
+N 70 -140 80 -140 { lab=vg}
+N 60 -140 70 -140 { lab=vg}
+N 60 -140 60 -100 { lab=vg}
+N 60 -100 90 -100 { lab=vg}
+N 160 -150 170 -150 { lab=vd}
+N 160 -170 160 -150 { lab=vd}
+N 160 -170 190 -170 { lab=vd}
+C {sky130_fd_pr/nfet3_01v8.sym} 150 -100 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/code_shown.sym} 360 -240 0 0 {name=NGSPICE 
+only_toplevel=false 
+value=".option TEMP=27C
+
+.dc v2 0 3 0.01
+
+.control
+  set color0 = rgb:f/f/f
+  alter @v1[dc] = 1
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.2
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.4
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.8
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 2
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+
+  plot (-dc1.i(v2)) (-dc2.i(v2)) (-dc3.i(v2)) (-dc4.i(v2)) (-dc5.i(v2))
+
+.endc
+
+.save all
+"}
+C {devices/code.sym} -170 -290 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/gnd.sym} 170 -70 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 90 -60 0 0 {name=v1 value=1}
+C {devices/vsource.sym} 260 -100 0 0 {name=v2 value=0
+}
+C {devices/gnd.sym} 90 -30 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 260 -70 0 0 {name=l3 lab=GND}
+C {devices/opin.sym} 70 -140 0 0 {name=vg lab=vg}
+C {devices/opin.sym} 170 -170 0 0 {name=vd lab=vd}
+C {invert.sym} 660 140 0 0 {}
diff --git a/xschem/FB1.spice b/xschem/FB1.spice
new file mode 100644
index 0000000..8a754ed
--- /dev/null
+++ b/xschem/FB1.spice
@@ -0,0 +1,53 @@
+**.subckt FB1 vg vd
+*.opin vg
+*.opin vd
+XM1 vd vg GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+v1 vg GND 1
+v2 vd GND 0
+**** begin user architecture code
+
+.option TEMP=27C
+
+.dc v2 0 3 0.01
+
+.control
+  set color0 = rgb:f/f/f
+  alter @v1[dc] = 1
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.2
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.4
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 1.8
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+  alter @v1[dc] = 2
+  print @m.xm1.msky130_fd_pr__nfet_01v8[vdsat]
+  run
+
+  plot (-dc1.i(v2)) (-dc2.i(v2)) (-dc3.i(v2)) (-dc4.i(v2)) (-dc5.i(v2))
+
+.endc
+
+.save all
+
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/balaced-pd.sch b/xschem/balaced-pd.sch
new file mode 100644
index 0000000..b973db2
--- /dev/null
+++ b/xschem/balaced-pd.sch
@@ -0,0 +1,236 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 250 -50 250 -40 { lab=gnd}
+N 410 -50 410 -40 { lab=gnd}
+N 250 -40 410 -40 { lab=gnd}
+N 180 -80 210 -80 { lab=in1}
+N 180 -80 180 -60 { lab=in1}
+N 450 -80 480 -80 { lab=in2}
+N 480 -80 480 -60 { lab=in2}
+N 250 -120 250 -110 { lab=#net1}
+N 250 -120 410 -120 { lab=#net1}
+N 410 -120 410 -110 { lab=#net1}
+N 330 -150 330 -120 { lab=#net1}
+N 330 -180 330 -150 { lab=#net1}
+N 180 -210 290 -210 { lab=#net1}
+N 230 -210 230 -160 { lab=#net1}
+N 230 -160 230 -150 { lab=#net1}
+N 230 -150 330 -150 { lab=#net1}
+N 80 -210 180 -210 { lab=#net1}
+N 100 -120 100 -110 { lab=#net2}
+N -20 -120 100 -120 { lab=#net2}
+N -20 -120 -20 -110 { lab=#net2}
+N 40 -180 40 -120 { lab=#net2}
+N 140 -80 160 -80 { lab=vbias}
+N 160 -80 170 -80 { lab=vbias}
+N 170 -100 170 -80 { lab=vbias}
+N -20 -50 -20 -40 { lab=gnd}
+N -20 -40 100 -40 { lab=gnd}
+N 100 -50 100 -40 { lab=gnd}
+N -100 -80 -60 -80 { lab=#net2}
+N -140 -180 -140 -110 { lab=#net3}
+N -260 -210 -180 -210 { lab=#net3}
+N -220 -210 -220 -150 { lab=#net3}
+N -220 -150 -140 -150 { lab=#net3}
+N -420 -150 -300 -150 { lab=output}
+N -80 -150 -80 -80 { lab=#net2}
+N -80 -150 40 -150 { lab=#net2}
+N -300 -260 -300 -240 { lab=vdd}
+N -300 -280 330 -280 { lab=vdd}
+N 330 -260 330 -240 { lab=vdd}
+N 40 -260 40 -240 { lab=vdd}
+N -140 -260 -140 -240 { lab=vdd}
+N 40 -300 40 -280 { lab=vdd}
+N 330 -40 330 40 { lab=gnd}
+N -140 -50 -140 40 { lab=gnd}
+N 40 -40 40 40 { lab=gnd}
+N -50 40 -50 60 { lab=gnd}
+N 180 -60 180 -40 { lab=in1}
+N 480 -60 480 -40 { lab=in2}
+N 40 -280 40 -260 { lab=vdd}
+N 330 -280 330 -260 { lab=vdd}
+N -300 -280 -300 -260 { lab=vdd}
+N -140 -280 -140 -260 { lab=vdd}
+N 170 -120 170 -100 { lab=vbias}
+N -300 -180 -300 -170 { lab=output}
+N -140 -210 -120 -210 { lab=vdd}
+N -120 -240 -120 -210 { lab=vdd}
+N -140 -240 -120 -240 { lab=vdd}
+N 330 -210 350 -210 { lab=vdd}
+N 350 -240 350 -210 { lab=vdd}
+N 330 -240 350 -240 { lab=vdd}
+N 20 -210 40 -210 { lab=vdd}
+N 20 -240 20 -210 { lab=vdd}
+N 20 -240 40 -240 { lab=vdd}
+N -320 -210 -300 -210 { lab=vdd}
+N -320 -240 -320 -210 { lab=vdd}
+N -320 -240 -300 -240 { lab=vdd}
+N -160 -50 -140 -50 { lab=gnd}
+N -160 -80 -160 -50 { lab=gnd}
+N -160 -80 -140 -80 { lab=gnd}
+N 80 -50 100 -50 { lab=gnd}
+N 80 -80 80 -50 { lab=gnd}
+N 80 -80 100 -80 { lab=gnd}
+N 390 -50 410 -50 { lab=gnd}
+N 390 -80 390 -50 { lab=gnd}
+N 390 -80 410 -80 { lab=gnd}
+N 250 -50 270 -50 { lab=gnd}
+N 270 -80 270 -50 { lab=gnd}
+N 250 -80 270 -80 { lab=gnd}
+N -20 -50 0 -50 { lab=gnd}
+N 0 -80 0 -50 { lab=gnd}
+N -20 -80 0 -80 { lab=gnd}
+N -300 -170 -300 -150 {}
+N -140 40 330 40 {}
+C {devices/code.sym} 530 -170 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} 530 -320 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.0005s 0.5s
+"}
+C {devices/ipin.sym} 40 -300 1 0 {name=vdd lab=vdd}
+C {devices/ipin.sym} -50 60 3 0 {name=gnd lab=gnd}
+C {devices/opin.sym} -420 -150 2 0 {name=output lab=output}
+C {devices/ipin.sym} 180 -40 3 0 {name=in1 lab=in1}
+C {devices/ipin.sym} 480 -40 3 0 {name=in2 lab=in2}
+C {devices/ipin.sym} 170 -120 1 0 {name=vbias lab=vbias}
+C {sky130_fd_pr/nfet_01v8.sym} -40 -80 0 0 {name=M10
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet_01v8.sym} -280 -210 0 1 {name=M11
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet_01v8.sym} 60 -210 0 1 {name=M3
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet_01v8.sym} -160 -210 0 0 {name=M4
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet_01v8.sym} 310 -210 0 0 {name=M8
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} 230 -80 0 0 {name=M1
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} -120 -80 0 1 {name=M2
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} 430 -80 0 1 {name=M5
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} 120 -80 0 1 {name=M6
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
diff --git a/xschem/balaced-pd.spice b/xschem/balaced-pd.spice
new file mode 100644
index 0000000..f43c3bd
--- /dev/null
+++ b/xschem/balaced-pd.spice
@@ -0,0 +1,55 @@
+**.subckt balaced-pd vdd gnd output in1 in2 vbias
+*.ipin vdd
+*.ipin gnd
+*.opin output
+*.ipin in1
+*.ipin in2
+*.ipin vbias
+XM1 net1 in1 gnd GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net1 in2 gnd GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 net1 net1 vdd VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net2 net1 vdd VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net2 net2 gnd GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 net2 vbias gnd GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM7 net3 net2 gnd GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM8 net3 net3 vdd VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM9 output net3 vdd VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+R1 output gnd 100k m=1
+C1 output gnd 1n m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.0005s 0.5s
+
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/balaced-pd.sym b/xschem/balaced-pd.sym
new file mode 100644
index 0000000..08eccc3
--- /dev/null
+++ b/xschem/balaced-pd.sym
@@ -0,0 +1,43 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=X1"}
+V {}
+S {}
+E {}
+L 4 80 -140 80 -60 {}
+L 4 80 -60 210 -60 {}
+L 4 210 -140 210 -60 {}
+L 4 80 -140 210 -140 {}
+L 4 50 -110 80 -110 {}
+L 4 50 -90 80 -90 {}
+L 4 210 -100 240 -100 {}
+L 4 150 -60 150 -40 {}
+L 4 110 -160 110 -140 {}
+L 4 180 -160 180 -140 {}
+L 4 120 -125 120 -75 {}
+L 4 120 -75 170 -100 {}
+L 4 120 -125 170 -100 {}
+L 4 80 -90 120 -90 {}
+L 4 80 -110 120 -110 {}
+L 4 170 -100 210 -100 {}
+L 4 200 -65 205 -65 {}
+L 4 205 -70 205 -65 {}
+L 4 200 -70 205 -70 {}
+L 4 200 -70 200 -65 {}
+L 4 85 -65 90 -70 {}
+L 4 85 -70 90 -65 {}
+B 5 47.5 -112.5 52.5 -107.5 {name=in1
+dir=in}
+B 5 47.5 -92.5 52.5 -87.5 {name=in2
+dir=in}
+B 5 107.5 -162.5 112.5 -157.5 {name=vbias
+dir=in}
+B 5 177.5 -162.5 182.5 -157.5 {name=vdd
+dir=in}
+B 5 237.5 -102.5 242.5 -97.5 {name=output
+dir=out}
+B 5 147.5 -42.5 152.5 -37.5 {name=gnd
+dir=in}
+T {@name} 125 -75 0 0 0.15 0.15 {}
diff --git a/xschem/basic-invert.sch b/xschem/basic-invert.sch
new file mode 100644
index 0000000..c8a3de0
--- /dev/null
+++ b/xschem/basic-invert.sch
@@ -0,0 +1,52 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 170 -200 170 -160 { lab=xxx}
+N 170 -290 170 -260 { lab=vdd}
+N 170 -100 170 -70 { lab=gnd}
+N 170 -230 190 -230 { lab=vdd}
+N 190 -260 190 -230 { lab=vdd}
+N 170 -260 190 -260 { lab=vdd}
+N 170 -130 190 -130 { lab=gnd}
+N 190 -130 190 -100 { lab=gnd}
+N 170 -100 190 -100 { lab=gnd}
+N 170 -180 260 -180 { lab=xxx}
+N 100 -230 130 -230 { lab=in}
+N 100 -230 100 -130 { lab=in}
+N 100 -130 130 -130 { lab=in}
+N 60 -180 100 -180 { lab=in}
+C {sky130_fd_pr/nfet_01v8.sym} 150 -130 0 0 {name=M1
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet_01v8.sym} 150 -230 0 0 {name=M2
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/ipin.sym} 60 -180 0 0 {name=in lab=in}
+C {devices/ipin.sym} 170 -70 3 0 {name=gnd lab=gnd}
+C {devices/ipin.sym} 170 -290 1 0 {name=vdd lab=vdd}
+C {devices/opin.sym} 260 -180 0 0 {name=out lab=out}
diff --git a/xschem/basic-invert.sym b/xschem/basic-invert.sym
new file mode 100644
index 0000000..9accd5d
--- /dev/null
+++ b/xschem/basic-invert.sym
@@ -0,0 +1,25 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=XI1"}
+V {}
+S {}
+E {}
+L 4 120 -200 120 -120 {}
+L 4 120 -200 200 -160 {}
+L 4 120 -120 200 -160 {}
+L 4 100 -160 120 -160 {}
+L 4 210 -160 230 -160 {}
+L 4 160 -200 160 -180 {}
+L 4 160 -140 160 -120 {}
+B 5 157.5 -202.5 162.5 -197.5 {name=vdd
+dir=in}
+B 5 157.5 -122.5 162.5 -117.5 {name=gnd
+dir=in}
+B 5 227.5 -162.5 232.5 -157.5 {name=out
+dir=out}
+B 5 97.5 -162.5 102.5 -157.5 {name=in
+dir=in}
+A 4 205 -160 7.071067811865476 225 360 {}
+T {@name} 125 -165 0 0 0.2 0.2 {}
diff --git a/xschem/compiled.sch b/xschem/compiled.sch
new file mode 100644
index 0000000..feb6fed
--- /dev/null
+++ b/xschem/compiled.sch
@@ -0,0 +1,138 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 1720 -720 1750 -720 { lab=out}
+N 1830 -720 1830 -700 { lab=out}
+N 1750 -720 1750 -700 { lab=out}
+N 1750 -720 1860 -720 { lab=out}
+N 1750 -640 1750 -620 { lab=GND}
+N 1830 -640 1830 -620 { lab=GND}
+N 850 -360 880 -360 { lab=#net1}
+N 850 -460 850 -410 { lab=#net2}
+N 850 -420 880 -420 { lab=#net2}
+N 850 -370 850 -320 { lab=#net1}
+N 750 -440 850 -440 { lab=#net2}
+N 750 -340 850 -340 { lab=#net1}
+N 790 -480 790 -460 { lab=#net3}
+N 790 -320 790 -300 { lab=#net4}
+N 750 -440 750 -420 { lab=#net2}
+N 690 -420 750 -420 { lab=#net2}
+N 750 -360 750 -340 { lab=#net1}
+N 690 -360 750 -360 { lab=#net1}
+N 1100 -390 1120 -390 { lab=#net5}
+N 1100 -370 1100 -340 { lab=#net6}
+N 1100 -340 1220 -340 { lab=#net6}
+N 1100 -440 1100 -410 { lab=#net7}
+N 1100 -440 1220 -440 { lab=#net7}
+N 1090 -280 1110 -280 { lab=GND}
+N 1010 -280 1030 -280 { lab=#net8}
+N 1010 -300 1010 -280 { lab=#net8}
+N 1090 -500 1110 -500 { lab=GND}
+N 1010 -500 1030 -500 { lab=#net9}
+N 1010 -500 1010 -480 { lab=#net9}
+N 970 -300 970 -280 { lab=GND}
+C {devices/gnd.sym} 1630 -660 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 1660 -810 2 0 {name=V1 value="1.8"}
+C {devices/gnd.sym} 1660 -840 2 0 {name=l2 lab=GND}
+C {devices/vsource.sym} 1590 -810 2 0 {name=V2 value="0.5"}
+C {devices/gnd.sym} 1590 -840 2 0 {name=l3 lab=GND}
+C {devices/lab_wire.sym} 1860 -720 2 0 {name=out sig_type=std_logic lab=out}
+C {devices/code.sym} 320 -310 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} 320 -460 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+
+.tran 0.000001s 0.00001s
+"}
+C {balaced-pd.sym} 1480 -620 0 0 {name=X1}
+C {devices/res.sym} 1830 -670 0 0 {name=R2
+value=500k
+footprint=1206
+device=resistor
+m=1}
+C {devices/capa.sym} 1750 -670 0 0 {name=C2
+m=1
+value=200p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/gnd.sym} 1750 -620 0 0 {name=l6 lab=GND}
+C {devices/gnd.sym} 1830 -620 0 0 {name=l7 lab=GND}
+C {devices/res.sym} 820 -410 1 0 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 820 -370 1 1 {name=R3
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 820 -460 1 0 {name=R4
+value=800
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 820 -320 1 1 {name=R5
+value=800
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 760 -300 1 0 {name=V5 value="1.8"}
+C {devices/gnd.sym} 730 -300 1 0 {name=l8 lab=GND}
+C {devices/vsource.sym} 760 -480 1 0 {name=V6 value="1.8"}
+C {devices/gnd.sym} 730 -480 1 0 {name=l9 lab=GND}
+C {devices/gnd.sym} 790 -370 1 0 {name=l10 lab=GND}
+C {devices/gnd.sym} 790 -410 1 0 {name=l11 lab=GND}
+C {devices/gnd.sym} 970 -280 0 0 {name=l12 lab=GND}
+C {devices/vsource.sym} 970 -510 2 0 {name=V7 value="1.8"}
+C {devices/gnd.sym} 970 -540 2 0 {name=l13 lab=GND}
+C {devices/res.sym} 1150 -390 1 1 {name=R6
+value=250
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 1210 -390 3 0 {name=V8 value="1.8"}
+C {devices/gnd.sym} 1240 -390 3 0 {name=l14 lab=GND}
+C {devices/res.sym} 1060 -280 3 0 {name=R7
+value=13k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 1110 -280 3 0 {name=l15 lab=GND}
+C {devices/res.sym} 1060 -500 3 1 {name=R8
+value=13k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 1110 -500 3 1 {name=l16 lab=GND}
+C {devices/vsource.sym} 600 -360 1 0 {name=V9 value="SIN(0 0.2 400000)"}
+C {devices/vsource.sym} 600 -420 1 1 {name=V10 value="SIN(0 0.2 400000 0 0 180)"}
+C {devices/gnd.sym} 570 -420 1 0 {name=l17 lab=GND}
+C {devices/gnd.sym} 570 -360 1 0 {name=l18 lab=GND}
+C {csfd-abstract.sym} 800 -280 0 0 {name=XLNA1}
+C {devices/capa.sym} 660 -420 1 0 {name=C1
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/capa.sym} 660 -360 1 0 {name=C3
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {dsa.sym} 1140 -250 0 0 {name=XDSA1}
+C {dsa.sym} 1140 -530 2 1 {name=XDSA2}
+C {devices/title-2.sym} 80 -70 0 0 {name=l4 author="Ryan Wans" rev=1.0}
diff --git a/xschem/compiled.spice b/xschem/compiled.spice
new file mode 100644
index 0000000..21afe9f
--- /dev/null
+++ b/xschem/compiled.spice
@@ -0,0 +1,227 @@
+**.subckt compiled
+V1 net10 GND 1.8
+V2 net11 GND 0.5
+X1 __UNCONNECTED_PIN__0 __UNCONNECTED_PIN__1 net11 net10 out GND balaced-pd
+R2 out GND 500k m=1
+C2 out GND 200p m=1
+R1 net2 GND 1k m=1
+R3 net1 GND 1k m=1
+R4 net2 net3 800 m=1
+R5 net1 net4 800 m=1
+V5 net4 GND 1.8
+V6 net3 GND 1.8
+V7 net12 GND 1.8
+R6 net13 net5 250 m=1
+V8 net13 GND 1.8
+R7 net8 GND 13k m=1
+R8 net9 GND 13k m=1
+V9 net14 GND SIN(0 0.2 400000)
+V10 net15 GND SIN(0 0.2 400000 0 0 180)
+XLNA1 net2 net1 net12 GND net7 net6 net9 net5 net8 csfd-abstract
+C1 net2 net15 500u m=1
+C3 net1 net14 500u m=1
+XDSA1 __UNCONNECTED_PIN__2 __UNCONNECTED_PIN__3 __UNCONNECTED_PIN__4 __UNCONNECTED_PIN__5
++ __UNCONNECTED_PIN__6 __UNCONNECTED_PIN__7 __UNCONNECTED_PIN__8 __UNCONNECTED_PIN__9 __UNCONNECTED_PIN__10 dsa
+XDSA2 __UNCONNECTED_PIN__11 __UNCONNECTED_PIN__12 __UNCONNECTED_PIN__13 __UNCONNECTED_PIN__14
++ __UNCONNECTED_PIN__15 __UNCONNECTED_PIN__16 __UNCONNECTED_PIN__17 __UNCONNECTED_PIN__18 __UNCONNECTED_PIN__19 dsa
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+
+.tran 0.000001s 0.00001s
+
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  balaced-pd.sym # of pins=6
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/balaced-pd.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/balaced-pd.sch
+.subckt balaced-pd  in1 in2 vbias vdd output gnd
+*.ipin vdd
+*.ipin gnd
+*.opin output
+*.ipin in1
+*.ipin in2
+*.ipin vbias
+**** begin user architecture code
+
+
+.tran 0.0005s 0.5s
+
+
+**** end user architecture code
+XM10 net2 net2 gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM11 output net3 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 net2 net1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net3 net3 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM8 net1 net1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 net1 in1 gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net3 net2 gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net1 in2 gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 net2 vbias gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  csfd-abstract.sym # of pins=9
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/csfd-abstract.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/csfd-abstract.sch
+.subckt csfd-abstract  in1 in2 vdd gnd out1 out2 lc1 tc lc2
+*.ipin vdd
+*.ipin in1
+*.ipin in2
+*.ipin gnd
+*.opin out1
+*.opin out2
+*.ipin tc
+*.ipin lc1
+*.ipin lc2
+**** begin user architecture code
+
+
+.tran 0.000001s 0.00001s
+.plot v(drain1) v(drain2)
+
+
+**** end user architecture code
+XM9 out1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM10 out1 in1 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 lc2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 out2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM7 lc1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 source tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 tc tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 out2 in2 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  dsa.sym # of pins=9
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/dsa.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/dsa.sch
+.subckt dsa  in cntrl1 cntrl2 cntrl3 cntrl4 out vbias vdd gnd
+*.ipin cntrl1
+*.ipin cntrl2
+*.ipin cntrl3
+*.ipin cntrl4
+*.ipin in
+*.opin out
+*.ipin gnd
+*.ipin vbias
+*.ipin vdd
+**** begin user architecture code
+
+
+.tran 0.000001s 0.0001s
+.save all
+
+
+**** end user architecture code
+R1 net1 net2 50 m=1
+R2 net3 net4 200 m=1
+XDTG1 in cntrl1 vdd vbias gnd net2 net1 transgate-full
+XDTG2 net2 cntrl2 vdd vbias gnd net4 net3 transgate-full
+R3 net5 net6 1k m=1
+XDTG3 net4 cntrl3 vdd vbias gnd net6 net5 transgate-full
+R4 net7 out 10k m=1
+XDTG4 net6 cntrl4 vdd vbias gnd out net7 transgate-full
+.ends
+
+
+* expanding   symbol:  transgate-full.sym # of pins=7
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/transgate-full.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/transgate-full.sch
+.subckt transgate-full  in cntrl vdd vbias gnd out2 out1
+*.ipin cntrl
+*.ipin vdd
+*.ipin in
+*.ipin gnd
+*.ipin vbias
+*.opin out2
+*.opin out1
+XI1 vdd gnd net1 cntrl basic-invert
+XTG1 in out1 gnd vbias net1 cntrl gate-switch
+XTG2 in out2 gnd vbias cntrl net1 gate-switch
+.ends
+
+
+* expanding   symbol:  basic-invert.sym # of pins=4
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sch
+.subckt basic-invert  vdd gnd out in
+*.ipin in
+*.ipin gnd
+*.ipin vdd
+*.opin out
+XM1 out in gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 out in vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  gate-switch.sym # of pins=6
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sch
+.subckt gate-switch  in out gnd vbias cntrl2 cntrl1
+*.ipin in
+*.ipin vbias
+*.ipin gnd
+*.opin out
+*.ipin cntrl1
+*.ipin cntrl2
+XM5 in cntrl2 out vbias sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 out cntrl1 in gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/cs-abstract.sch b/xschem/cs-abstract.sch
new file mode 100644
index 0000000..382c7c7
--- /dev/null
+++ b/xschem/cs-abstract.sch
@@ -0,0 +1,98 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+T {NOTES:
+- Step Rl to simulate different gains
+- Compare the output (net4) until something looks sufficient
+- Play with the source degeneration R3 accordingly
+- Iterate and settle
+} 590 -230 0 0 0.4 0.4 {}
+N 20 -140 40 -140 { lab=#net1}
+N 100 -140 150 -140 { lab=#net2}
+N 130 -140 130 -130 { lab=#net2}
+N 130 -150 130 -140 { lab=#net2}
+N 170 -90 210 -90 { lab=#net3}
+N 190 -110 190 -90 { lab=#net3}
+N 170 -30 210 -30 { lab=GND}
+N 190 -190 190 -170 { lab=#net4}
+N 190 -170 270 -170 { lab=#net4}
+N 190 -260 190 -250 { lab=#net5}
+N 130 -260 130 -210 { lab=#net6}
+C {sky130_fd_pr/nfet3_01v8.sym} 170 -140 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/code.sym} 460 -170 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/vsource.sym} 20 -110 0 0 {name=V1 value="SIN(0 0.5 40)"}
+C {devices/gnd.sym} 20 -80 0 0 {name=l1 lab=GND}
+C {devices/capa.sym} 70 -140 1 0 {name=C1
+m=1
+value=28u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/res.sym} 130 -100 0 0 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 130 -180 0 0 {name=R2
+value=1.4k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 170 -60 0 0 {name=R3
+value=0k
+footprint=1206
+device=resistor
+m=1}
+C {devices/capa.sym} 210 -60 0 0 {name=C2
+m=1
+value=28u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/gnd.sym} 190 -30 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 130 -70 0 0 {name=l3 lab=GND}
+C {devices/res.sym} 190 -220 0 0 {name=R4
+value=117k
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 190 -290 2 0 {name=V2 value=2}
+C {devices/gnd.sym} 190 -320 2 0 {name=l4 lab=GND}
+C {devices/code.sym} 460 -320 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(net4) v(net2)
+  plot -i(v2)
+.endc
+.save all
+"}
+C {devices/vsource.sym} 130 -290 2 0 {name=V3 value=1.8}
+C {devices/gnd.sym} 130 -320 2 0 {name=l5 lab=GND}
diff --git a/xschem/cs-abstract.spice b/xschem/cs-abstract.spice
new file mode 100644
index 0000000..c506d41
--- /dev/null
+++ b/xschem/cs-abstract.spice
@@ -0,0 +1,39 @@
+**.subckt cs-abstract
+XM1 net4 net2 net3 GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V1 net1 GND SIN(0 0.5 40)
+C1 net2 net1 28u m=1
+R1 net2 GND 1k m=1
+R2 net6 net2 1.4k m=1
+R3 net3 GND 0k m=1
+C2 net3 GND 28u m=1
+R4 net5 net4 117k m=1
+V2 net5 GND 2
+V3 net6 GND 1.8
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(net4) v(net2)
+  plot -i(v2)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/cs-exper.sch b/xschem/cs-exper.sch
new file mode 100644
index 0000000..b54e1d5
--- /dev/null
+++ b/xschem/cs-exper.sch
@@ -0,0 +1,95 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 60 -140 80 -140 { lab=#net1}
+N 140 -140 190 -140 { lab=gate}
+N 170 -140 170 -130 { lab=gate}
+N 170 -150 170 -140 { lab=gate}
+N 210 -90 250 -90 { lab=source}
+N 230 -110 230 -90 { lab=source}
+N 210 -30 250 -30 { lab=GND}
+N 230 -190 230 -170 { lab=drain}
+N 230 -170 310 -170 { lab=drain}
+N 230 -260 230 -250 { lab=#net2}
+N 170 -260 170 -210 { lab=#net3}
+C {sky130_fd_pr/nfet3_01v8.sym} 210 -140 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/code.sym} 500 -170 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/vsource.sym} 60 -110 0 1 {name=V1 value="SIN(0 0.3 40)"}
+C {devices/gnd.sym} 60 -80 0 0 {name=l1 lab=GND}
+C {devices/capa.sym} 110 -140 1 0 {name=C1
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/res.sym} 170 -100 0 0 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 170 -180 0 0 {name=R2
+value=880
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 210 -60 0 0 {name=R3
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 230 -30 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 170 -70 0 0 {name=l3 lab=GND}
+C {devices/res.sym} 230 -220 0 0 {name=R4
+value=45k
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 230 -290 2 0 {name=V2 value=1.8}
+C {devices/gnd.sym} 230 -320 2 0 {name=l4 lab=GND}
+C {devices/code.sym} 500 -320 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(drain) v(gate) v(source)
+  plot -i(v2)
+.endc
+.save all
+"}
+C {devices/vsource.sym} 170 -290 2 0 {name=V3 value=1.8}
+C {devices/gnd.sym} 170 -320 2 0 {name=l5 lab=GND}
+C {devices/lab_wire.sym} 310 -170 0 1 {name=l6 sig_type=std_logic lab=drain}
+C {devices/lab_wire.sym} 180 -140 1 1 {name=l7 sig_type=std_logic lab=gate}
+C {devices/lab_wire.sym} 230 -90 0 1 {name=l8 sig_type=std_logic lab=source}
+C {devices/capa.sym} 250 -60 0 0 {name=C2
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
diff --git a/xschem/cs-exper.spice b/xschem/cs-exper.spice
new file mode 100644
index 0000000..b2aa7f5
--- /dev/null
+++ b/xschem/cs-exper.spice
@@ -0,0 +1,39 @@
+**.subckt cs-exper
+XM1 drain gate source GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V1 net1 GND SIN(0 0.3 40)
+C1 gate net1 500u m=1
+R1 gate GND 1k m=1
+R2 net3 gate 880 m=1
+R3 source GND 1k m=1
+R4 net2 drain 45k m=1
+V2 net2 GND 1.8
+V3 net3 GND 1.8
+C2 source GND 500u m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(drain) v(gate) v(source)
+  plot -i(v2)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/cs3v3-abstract.sch b/xschem/cs3v3-abstract.sch
new file mode 100644
index 0000000..d91ee35
--- /dev/null
+++ b/xschem/cs3v3-abstract.sch
@@ -0,0 +1,91 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 40 -150 60 -150 { lab=#net1}
+N 120 -150 170 -150 { lab=#net2}
+N 150 -150 150 -140 { lab=#net2}
+N 150 -160 150 -150 { lab=#net2}
+N 190 -100 230 -100 { lab=#net3}
+N 210 -120 210 -100 { lab=#net3}
+N 190 -40 230 -40 { lab=GND}
+N 210 -200 210 -180 { lab=#net4}
+N 210 -180 290 -180 { lab=#net4}
+N 210 -270 210 -260 { lab=#net5}
+N 150 -270 150 -220 { lab=#net6}
+C {devices/code.sym} 480 -180 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/vsource.sym} 40 -120 0 1 {name=V1 value="SIN(0 0.8 40)"}
+C {devices/gnd.sym} 40 -90 0 0 {name=l1 lab=GND}
+C {devices/capa.sym} 90 -150 1 0 {name=C1
+m=1
+value=28u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/res.sym} 150 -110 0 0 {name=R1
+value=100
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 150 -190 0 0 {name=R2
+value=500
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 190 -70 0 0 {name=R3
+value=0
+footprint=1206
+device=resistor
+m=1}
+C {devices/capa.sym} 230 -70 0 0 {name=C2
+m=1
+value=28u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/gnd.sym} 210 -40 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 150 -80 0 1 {name=l3 lab=GND}
+C {devices/res.sym} 210 -230 0 0 {name=R4
+value=400k
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 210 -300 2 0 {name=V2 value=5}
+C {devices/gnd.sym} 210 -330 2 0 {name=l4 lab=GND}
+C {devices/code.sym} 480 -330 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(net4) v(net2)
+.endc
+.save all
+"}
+C {devices/vsource.sym} 150 -300 2 0 {name=V3 value=1.8}
+C {devices/gnd.sym} 150 -330 2 0 {name=l5 lab=GND}
+C {sky130_fd_pr/nfet3_05v0_nvt.sym} 190 -150 0 0 {name=M1
+L=4
+W=10
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_05v0_nvt
+spiceprefix=X
+}
diff --git a/xschem/cs3v3-abstract.spice b/xschem/cs3v3-abstract.spice
new file mode 100644
index 0000000..78c5a27
--- /dev/null
+++ b/xschem/cs3v3-abstract.spice
@@ -0,0 +1,38 @@
+**.subckt cs3v3-abstract
+V1 net1 GND SIN(0 0.8 40)
+C1 net2 net1 28u m=1
+R1 net2 GND 100 m=1
+R2 net6 net2 500 m=1
+R3 net3 GND 0 m=1
+C2 net3 GND 28u m=1
+R4 net5 net4 400k m=1
+V2 net5 GND 5
+V3 net6 GND 1.8
+XM1 net4 net2 net3 GND sky130_fd_pr__nfet_05v0_nvt L=4 W=10 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(net4) v(net2)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/csfd-abstract.sch b/xschem/csfd-abstract.sch
new file mode 100644
index 0000000..98712db
--- /dev/null
+++ b/xschem/csfd-abstract.sch
@@ -0,0 +1,219 @@
+v {xschem version=3.0.0 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 100 -270 120 -270 { lab=#net1}
+N 340 -340 340 -320 { lab=#net2}
+N 340 -400 340 -340 { lab=#net2}
+N 140 -400 220 -400 { lab=#net3}
+N 220 -400 270 -400 { lab=#net3}
+N 220 -480 220 -460 { lab=#net4}
+N 340 -480 340 -460 { lab=#net4}
+N 260 -430 300 -430 { lab=#net3}
+N 280 -430 280 -400 { lab=#net3}
+N 270 -400 280 -400 { lab=#net3}
+N 260 -270 300 -270 { lab=#net1}
+N 220 -270 260 -270 { lab=#net1}
+N 120 -270 160 -270 { lab=#net1}
+N 340 -320 340 -300 { lab=#net2}
+N 480 -140 520 -140 { lab=#net5}
+N 500 -170 500 -140 { lab=#net5}
+N 440 -170 500 -170 { lab=#net5}
+N 440 -110 440 -100 { lab=#net6}
+N 440 -100 560 -100 { lab=#net6}
+N 560 -110 560 -100 { lab=#net6}
+N 800 -270 820 -270 { lab=#net7}
+N 580 -340 580 -320 { lab=#net8}
+N 580 -400 580 -340 { lab=#net8}
+N 700 -400 780 -400 { lab=#net9}
+N 650 -400 700 -400 { lab=#net9}
+N 700 -480 700 -460 { lab=#net4}
+N 580 -480 580 -460 { lab=#net4}
+N 620 -430 660 -430 { lab=#net9}
+N 640 -430 640 -400 { lab=#net9}
+N 640 -400 650 -400 { lab=#net9}
+N 620 -270 660 -270 { lab=#net7}
+N 660 -270 700 -270 { lab=#net7}
+N 760 -270 800 -270 { lab=#net7}
+N 580 -320 580 -300 { lab=#net8}
+N 580 -240 580 -200 { lab=#net10}
+N 340 -200 580 -200 { lab=#net10}
+N 340 -240 340 -200 { lab=#net10}
+N 560 -200 560 -170 { lab=#net10}
+N 220 -500 220 -480 { lab=#net4}
+N 340 -500 340 -480 { lab=#net4}
+N 580 -500 580 -480 { lab=#net4}
+N 700 -500 700 -480 { lab=#net4}
+N 220 -500 700 -500 { lab=#net4}
+N 460 -530 460 -500 { lab=#net4}
+N 340 -350 400 -350 { lab=#net2}
+N 520 -350 580 -350 { lab=#net8}
+N 500 -100 500 -80 { lab=#net6}
+N 370 -170 430 -170 { lab=#net5}
+N 430 -170 440 -170 { lab=#net5}
+N 700 -270 760 -270 { lab=#net7}
+N 160 -270 220 -270 { lab=#net1}
+N 200 -430 220 -430 { lab=#net4}
+N 200 -460 200 -430 { lab=#net4}
+N 200 -460 220 -460 { lab=#net4}
+N 560 -430 580 -430 { lab=#net4}
+N 560 -460 560 -430 { lab=#net4}
+N 560 -460 580 -460 { lab=#net4}
+N 340 -430 360 -430 { lab=#net4}
+N 360 -460 360 -430 { lab=#net4}
+N 340 -460 360 -460 { lab=#net4}
+N 700 -430 720 -430 { lab=#net4}
+N 720 -460 720 -430 { lab=#net4}
+N 700 -460 720 -460 { lab=#net4}
+N 420 -140 440 -140 { lab=#net6}
+N 420 -140 420 -110 { lab=#net6}
+N 420 -110 440 -110 { lab=#net6}
+N 560 -110 580 -110 { lab=#net6}
+N 580 -140 580 -110 { lab=#net6}
+N 560 -140 580 -140 { lab=#net6}
+N 310 -240 340 -270 { lab=#net6}
+N 310 -240 310 -100 { lab=#net6}
+N 310 -100 440 -100 { lab=#net6}
+N 580 -270 610 -240 { lab=#net6}
+N 610 -240 610 -100 { lab=#net6}
+N 560 -100 610 -100 { lab=#net6}
+C {devices/code.sym} -210 -200 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} -210 -350 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.000001s 0.00001s
+.plot v(drain1) v(drain2)
+"}
+C {devices/ipin.sym} 460 -530 1 0 {name=vdd lab=vdd}
+C {devices/ipin.sym} 100 -270 0 0 {name=in1 lab=in1}
+C {devices/ipin.sym} 820 -270 2 0 {name=in2 lab=in2}
+C {devices/ipin.sym} 500 -80 3 0 {name=gnd lab=gnd}
+C {devices/opin.sym} 400 -350 0 0 {name=out1 lab=out1}
+C {devices/opin.sym} 520 -350 2 0 {name=out2 lab=out2}
+C {devices/ipin.sym} 370 -170 0 0 {name=tc lab=tc}
+C {devices/ipin.sym} 140 -400 0 0 {name=lc1 lab=lc1}
+C {devices/ipin.sym} 780 -400 2 0 {name=lc2 lab=lc2}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/nfet_01v8.sym} 320 -270 0 0 {name=M10
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/pfet_01v8.sym} 600 -430 0 1 {name=M3
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/pfet_01v8.sym} 680 -430 0 0 {name=M2
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/pfet_01v8.sym} 240 -430 0 1 {name=M6
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/pfet_01v8.sym} 320 -430 0 0 {name=M7
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/nfet_01v8.sym} 600 -270 0 1 {name=M5
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/nfet_01v8.sym} 540 -140 0 0 {name=M1
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {/Volumes/WORK_DRIVE/open_pdks/sky130/sky130A/libs.tech/xschem/sky130_fd_pr/nfet_01v8.sym} 460 -140 0 1 {name=M4
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
diff --git a/xschem/csfd-abstract.spice b/xschem/csfd-abstract.spice
new file mode 100644
index 0000000..125f4c4
--- /dev/null
+++ b/xschem/csfd-abstract.spice
@@ -0,0 +1,54 @@
+**.subckt csfd-abstract vdd in1 in2 gnd out1 out2 tc lc1 lc2
+*.ipin vdd
+*.ipin in1
+*.ipin in2
+*.ipin gnd
+*.opin out1
+*.opin out2
+*.ipin tc
+*.ipin lc1
+*.ipin lc2
+XM9 out1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM10 out1 in1 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 lc2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 out2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM7 lc1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 source tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 tc tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 out2 in2 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.000001s 0.00001s
+.plot v(drain1) v(drain2)
+
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/csfd-abstract.sym b/xschem/csfd-abstract.sym
new file mode 100644
index 0000000..0601f85
--- /dev/null
+++ b/xschem/csfd-abstract.sym
@@ -0,0 +1,66 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=XLNA1"}
+V {}
+S {}
+E {}
+L 4 100 -140 150 -140 {}
+L 4 100 -80 150 -80 {}
+L 4 150 -160 150 -70 {}
+L 4 150 -70 150 -60 {}
+L 4 150 -60 250 -110 {}
+L 4 150 -160 250 -110 {}
+L 4 210 -130 280 -130 {}
+L 4 210 -90 280 -90 {}
+L 4 170 -180 170 -150 {}
+L 4 170 -70 170 -40 {}
+L 4 100 -180 100 -140 {}
+L 4 100 -180 280 -180 {}
+L 4 280 -180 280 -40 {}
+L 4 100 -40 280 -40 {}
+L 4 100 -140 100 -40 {}
+L 4 170 -200 170 -180 {}
+L 4 280 -130 300 -130 {}
+L 4 280 -90 300 -90 {}
+L 4 80 -140 100 -140 {}
+L 4 80 -80 100 -80 {}
+L 4 170 -40 170 -20 {}
+L 4 105 -45 110 -50 {}
+L 4 105 -50 110 -45 {}
+L 4 275 -50 275 -45 {}
+L 4 270 -50 275 -50 {}
+L 4 270 -50 270 -45 {}
+L 4 270 -45 275 -45 {}
+L 4 210 -200 210 -180 {}
+L 4 210 -40 210 -20 {}
+L 4 190 -80 210 -60 {}
+L 4 210 -60 210 -40 {}
+L 4 190 -140 210 -160 {}
+L 4 210 -180 210 -160 {}
+L 4 250 -110 300 -110 {}
+B 5 77.5 -142.5 82.5 -137.5 {name=in1
+dir=in}
+B 5 77.5 -82.5 82.5 -77.5 {name=in2
+dir=in}
+B 5 167.5 -202.5 172.5 -197.5 {name=vdd
+dir=in}
+B 5 167.5 -22.5 172.5 -17.5 {name=gnd
+dir=in}
+B 5 297.5 -132.5 302.5 -127.5 {name=out1
+dir=out}
+B 5 297.5 -92.5 302.5 -87.5 {name=out2
+dir=out}
+B 5 207.5 -202.5 212.5 -197.5 {name=lc1
+dir=in}
+B 5 297.5 -112.5 302.5 -107.5 {name=tc
+dir=in}
+B 5 207.5 -22.5 212.5 -17.5 {name=lc2
+dir=in}
+T {TC} 225 -115 0 0 0.15 0.15 {}
+T {LC1} 177.5 -137.5 0 0 0.15 0.15 {}
+T {LC2} 177.5 -92.5 0 0 0.15 0.15 {}
+T {+} 165 -150 0 0 0.15 0.15 {}
+T {-} 165 -80 0 0 0.2 0.2 {}
+T {@name} 230 -170 0 0 0.2 0.2 {}
diff --git a/xschem/data.raw b/xschem/data.raw
new file mode 100644
index 0000000..d26c3f0
--- /dev/null
+++ b/xschem/data.raw
Binary files differ
diff --git a/xschem/dsa.sch b/xschem/dsa.sch
new file mode 100644
index 0000000..3a6b082
--- /dev/null
+++ b/xschem/dsa.sch
@@ -0,0 +1,107 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 400 -190 440 -190 { lab=#net1}
+N 400 -150 440 -150 { lab=#net2}
+N 500 -190 540 -190 { lab=#net2}
+N 440 -150 540 -150 { lab=#net2}
+N 540 -190 540 -150 { lab=#net2}
+N 540 -170 560 -170 { lab=#net2}
+N 320 -300 320 -230 { lab=cntrl1}
+N 720 -190 760 -190 { lab=#net3}
+N 720 -150 760 -150 { lab=#net4}
+N 820 -190 860 -190 { lab=#net4}
+N 760 -150 860 -150 { lab=#net4}
+N 860 -190 860 -150 { lab=#net4}
+N 860 -170 880 -170 { lab=#net4}
+N 640 -300 640 -230 { lab=cntrl2}
+N 1040 -190 1080 -190 { lab=#net5}
+N 1040 -150 1080 -150 { lab=#net6}
+N 1140 -190 1180 -190 { lab=#net6}
+N 1080 -150 1180 -150 { lab=#net6}
+N 1180 -190 1180 -150 { lab=#net6}
+N 1180 -170 1200 -170 { lab=#net6}
+N 960 -300 960 -230 { lab=cntrl3}
+N 1360 -190 1400 -190 { lab=#net7}
+N 1360 -150 1400 -150 { lab=out}
+N 1460 -190 1500 -190 { lab=out}
+N 1400 -150 1500 -150 { lab=out}
+N 1500 -190 1500 -150 { lab=out}
+N 1500 -170 1520 -170 { lab=out}
+N 1280 -300 1280 -230 { lab=cntrl4}
+N 1520 -170 1560 -170 { lab=out}
+N 200 -170 240 -170 { lab=in}
+N 1320 -120 1320 -110 { lab=gnd}
+N 1000 -120 1320 -120 { lab=gnd}
+N 1000 -120 1000 -110 { lab=gnd}
+N 680 -120 1000 -120 { lab=gnd}
+N 680 -120 680 -110 { lab=gnd}
+N 360 -120 680 -120 { lab=gnd}
+N 360 -120 360 -110 { lab=gnd}
+N 200 -120 360 -120 { lab=gnd}
+N 320 -110 320 -90 { lab=vbias}
+N 320 -90 640 -90 { lab=vbias}
+N 640 -110 640 -90 { lab=vbias}
+N 640 -90 960 -90 { lab=vbias}
+N 960 -110 960 -90 { lab=vbias}
+N 960 -90 1280 -90 { lab=vbias}
+N 1280 -110 1280 -90 { lab=vbias}
+N 200 -90 320 -90 { lab=vbias}
+N 280 -110 280 -70 { lab=gnd}
+N 600 -110 600 -70 { lab=gnd}
+N 920 -110 920 -70 { lab=gnd}
+N 1240 -110 1240 -70 { lab=gnd}
+N 200 -70 1240 -70 { lab=gnd}
+C {devices/code.sym} -130 -330 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} -130 -180 0 0 {name=NGSPICE only_toplevel=false value="
+.tran 0.000001s 0.0001s
+.save all
+"}
+C {devices/res.sym} 470 -190 3 0 {name=R1
+value=50
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 790 -190 3 0 {name=R2
+value=200
+footprint=1206
+device=resistor
+m=1}
+C {transgate-full.sym} 40 50 0 0 {name=XDTG1}
+C {transgate-full.sym} 360 50 0 0 {name=XDTG2}
+C {devices/res.sym} 1110 -190 3 0 {name=R3
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {transgate-full.sym} 680 50 0 0 {name=XDTG3}
+C {devices/res.sym} 1430 -190 3 0 {name=R4
+value=10k
+footprint=1206
+device=resistor
+m=1}
+C {transgate-full.sym} 1000 50 0 0 {name=XDTG4}
+C {devices/ipin.sym} 320 -300 1 0 {name=cntrl1 lab=cntrl1}
+C {devices/ipin.sym} 640 -300 1 0 {name=cntrl2 lab=cntrl2}
+C {devices/ipin.sym} 960 -300 1 0 {name=cntrl3 lab=cntrl3}
+C {devices/ipin.sym} 1280 -300 1 0 {name=cntrl4 lab=cntrl4}
+C {devices/ipin.sym} 200 -170 0 0 {name=in lab=in}
+C {devices/opin.sym} 1560 -170 0 0 {name=out lab=out}
+C {devices/ipin.sym} 200 -120 0 0 {name=gnd lab=gnd}
+C {devices/ipin.sym} 200 -90 0 0 {name=vbias lab=vbias}
+C {devices/ipin.sym} 200 -70 0 0 {name=vdd lab=vdd}
diff --git a/xschem/dsa.spice b/xschem/dsa.spice
new file mode 100644
index 0000000..394d046
--- /dev/null
+++ b/xschem/dsa.spice
@@ -0,0 +1,91 @@
+**.subckt dsa cntrl1 cntrl2 cntrl3 cntrl4 in out gnd vbias vdd
+*.ipin cntrl1
+*.ipin cntrl2
+*.ipin cntrl3
+*.ipin cntrl4
+*.ipin in
+*.opin out
+*.ipin gnd
+*.ipin vbias
+*.ipin vdd
+R1 net1 net2 50 m=1
+R2 net3 net4 200 m=1
+XDTG1 in cntrl1 vdd vbias gnd net2 net1 transgate-full
+XDTG2 net2 cntrl2 vdd vbias gnd net4 net3 transgate-full
+R3 net5 net6 1k m=1
+XDTG3 net4 cntrl3 vdd vbias gnd net6 net5 transgate-full
+R4 net7 out 10k m=1
+XDTG4 net6 cntrl4 vdd vbias gnd out net7 transgate-full
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.000001s 0.0001s
+.save all
+
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  transgate-full.sym # of pins=7
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/transgate-full.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/transgate-full.sch
+.subckt transgate-full  in cntrl vdd vbias gnd out2 out1
+*.ipin cntrl
+*.ipin vdd
+*.ipin in
+*.ipin gnd
+*.ipin vbias
+*.opin out2
+*.opin out1
+XI1 vdd gnd net1 cntrl basic-invert
+XTG1 in out1 gnd vbias net1 cntrl gate-switch
+XTG2 in out2 gnd vbias cntrl net1 gate-switch
+.ends
+
+
+* expanding   symbol:  basic-invert.sym # of pins=4
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sch
+.subckt basic-invert  vdd gnd out in
+*.ipin in
+*.ipin gnd
+*.ipin vdd
+*.opin out
+XM1 out in gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 out in vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  gate-switch.sym # of pins=6
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sch
+.subckt gate-switch  in out gnd vbias cntrl2 cntrl1
+*.ipin in
+*.ipin vbias
+*.ipin gnd
+*.opin out
+*.ipin cntrl1
+*.ipin cntrl2
+XM5 in cntrl2 out vbias sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 out cntrl1 in gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+** flattened .save nodes
+.end
diff --git a/xschem/dsa.sym b/xschem/dsa.sym
new file mode 100644
index 0000000..b7dee5d
--- /dev/null
+++ b/xschem/dsa.sym
@@ -0,0 +1,107 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=XDSA1"}
+V {}
+S {}
+E {}
+L 4 200 -240 220 -240 {}
+L 4 220 -240 230 -250 {}
+L 4 250 -225 310 -225 {}
+L 4 250 -255 260 -255 {}
+L 4 300 -255 310 -255 {}
+L 4 260 -255 265 -265 {}
+L 4 265 -265 275 -245 {}
+L 4 275 -245 285 -265 {}
+L 4 285 -265 295 -245 {}
+L 4 295 -245 300 -255 {}
+L 4 310 -255 310 -225 {}
+L 4 310 -240 320 -240 {}
+L 4 320 -240 340 -240 {}
+L 4 340 -240 350 -250 {}
+L 4 370 -225 430 -225 {}
+L 4 370 -255 380 -255 {}
+L 4 420 -255 430 -255 {}
+L 4 380 -255 385 -265 {}
+L 4 385 -265 395 -245 {}
+L 4 395 -245 405 -265 {}
+L 4 405 -265 415 -245 {}
+L 4 415 -245 420 -255 {}
+L 4 430 -255 430 -225 {}
+L 4 430 -240 440 -240 {}
+L 4 440 -240 460 -240 {}
+L 4 460 -240 470 -250 {}
+L 4 490 -225 550 -225 {}
+L 4 490 -255 500 -255 {}
+L 4 540 -255 550 -255 {}
+L 4 500 -255 505 -265 {}
+L 4 505 -265 515 -245 {}
+L 4 515 -245 525 -265 {}
+L 4 525 -265 535 -245 {}
+L 4 535 -245 540 -255 {}
+L 4 550 -255 550 -225 {}
+L 4 550 -240 560 -240 {}
+L 4 560 -240 580 -240 {}
+L 4 580 -240 590 -250 {}
+L 4 610 -225 670 -225 {}
+L 4 610 -255 620 -255 {}
+L 4 660 -255 670 -255 {}
+L 4 620 -255 625 -265 {}
+L 4 625 -265 635 -245 {}
+L 4 635 -245 645 -265 {}
+L 4 645 -265 655 -245 {}
+L 4 655 -245 660 -255 {}
+L 4 670 -255 670 -225 {}
+L 4 670 -240 680 -240 {}
+L 4 160 -240 200 -240 {}
+L 4 180 -280 180 -240 {}
+L 4 180 -280 700 -280 {}
+L 4 700 -280 700 -200 {}
+L 4 180 -200 700 -200 {}
+L 4 180 -240 180 -200 {}
+L 4 680 -240 720 -240 {}
+L 4 140 -240 160 -240 {}
+L 4 720 -240 740 -240 {}
+L 4 200 -320 200 -240 {}
+L 4 320 -320 320 -240 {}
+L 4 440 -320 440 -240 {}
+L 4 560 -320 560 -240 {}
+L 4 440 -200 440 -160 {}
+L 4 500 -200 500 -160 {}
+L 4 380 -200 380 -160 {}
+B 4 195 -245 205 -235 {}
+B 4 240 -260 250 -250 {}
+B 4 240 -230 250 -220 {}
+B 4 315 -245 325 -235 {}
+B 4 360 -260 370 -250 {}
+B 4 360 -230 370 -220 {}
+B 4 435 -245 445 -235 {}
+B 4 480 -260 490 -250 {}
+B 4 480 -230 490 -220 {}
+B 4 555 -245 565 -235 {}
+B 4 600 -260 610 -250 {}
+B 4 600 -230 610 -220 {}
+B 5 137.5 -242.5 142.5 -237.5 {name=in
+dir=in}
+B 5 197.5 -322.5 202.5 -317.5 {name=cntrl1
+dir=in}
+B 5 317.5 -322.5 322.5 -317.5 {name=cntrl2
+dir=in}
+B 5 437.5 -322.5 442.5 -317.5 {name=cntrl3
+dir=in}
+B 5 557.5 -322.5 562.5 -317.5 {name=cntrl4
+dir=in}
+B 5 737.5 -242.5 742.5 -237.5 {name=out
+dir=out}
+B 5 497.5 -162.5 502.5 -157.5 {name=vbias
+dir=in}
+B 5 437.5 -162.5 442.5 -157.5 {name=vdd
+dir=in}
+B 5 377.5 -162.5 382.5 -157.5 {name=gnd
+dir=in}
+T {@name} 185 -215 0 0 0.2 0.2 {}
+T {GND} 385 -215 1 0 0.1 0.1 {}
+T {VDD} 445 -215 1 0 0.1 0.1 {}
+T {VBIAS
+} 510 -220 1 0 0.1 0.1 {}
diff --git a/xschem/example_por.sch b/xschem/example_por.sch
deleted file mode 100644
index cf6e0c3..0000000
--- a/xschem/example_por.sch
+++ /dev/null
@@ -1,297 +0,0 @@
-v {xschem version=2.9.9 file_version=1.2 }
-G {}
-K {}
-V {}
-S {}
-E {}
-L 4 3370 -60 3390 -60 {}
-L 4 3390 -60 3390 80 {}
-L 4 3370 80 3390 80 {}
-T {Current step-down mirror} 2270 140 0 0 0.4 0.4 {}
-T {Charge accumulator} 2650 140 0 0 0.4 0.4 {}
-T {Voltage divider} 1860 140 0 0 0.4 0.4 {}
-T {Schmitt trigger} 2930 -200 0 0 0.4 0.4 {}
-T {150 / 650 * 3.3V = 0.76V} 1860 180 0 0 0.4 0.4 {}
-T {step down 8x} 2130 -430 0 0 0.4 0.4 {}
-T {step down 7x} 2330 80 0 0 0.4 0.4 {}
-T {step down 7x} 2520 -430 0 0 0.4 0.4 {}
-T {1.8V domain outputs} 3400 0 0 0 0.4 0.4 {}
-T {3.3V domain output} 3410 -140 0 0 0.4 0.4 {}
-T {392 : 1} 2270 180 0 0 0.4 0.4 {}
-T {Simple power-on-reset circuit
-calibrated to 500us nominal delay
-no temperature compensation} 1950 -570 0 0 0.6 0.6 {}
-N 2500 -310 2500 -270 { lab=#net1}
-N 2500 -210 2500 -100 { lab=#net2}
-N 2300 -40 2300 20 { lab=#net3}
-N 2300 80 2300 110 { lab=vss}
-N 2360 110 2500 110 { lab=vss}
-N 2500 80 2500 110 { lab=vss}
-N 2400 50 2460 50 { lab=#net3}
-N 2360 -400 2500 -400 { lab=vdd3v3}
-N 2500 -400 2500 -370 { lab=vdd3v3}
-N 2500 -400 2790 -400 { lab=vdd3v3}
-N 2300 -10 2370 -10 { lab=#net3}
-N 2370 -10 2370 50 { lab=#net3}
-N 2500 -290 2570 -290 { lab=#net1}
-N 2570 -340 2570 -290 { lab=#net1}
-N 2540 -340 2570 -340 { lab=#net1}
-N 2500 -190 2570 -190 { lab=#net2}
-N 2570 -240 2570 -190 { lab=#net2}
-N 2540 -240 2570 -240 { lab=#net2}
-N 2240 110 2360 110 { lab=vss}
-N 2500 110 2630 110 { lab=vss}
-N 2500 50 2630 50 { lab=vss}
-N 2110 110 2240 110 { lab=vss}
-N 1930 60 1930 110 { lab=vss}
-N 1930 -160 1930 0 { lab=#net4}
-N 1930 -400 1930 -220 { lab=vdd3v3}
-N 2110 -400 2360 -400 { lab=vdd3v3}
-N 1880 -190 1910 -190 { lab=vss}
-N 1880 -190 1880 110 { lab=vss}
-N 1880 110 1930 110 { lab=vss}
-N 1880 30 1910 30 { lab=vss}
-N 2300 -310 2300 -270 { lab=#net5}
-N 2300 -400 2300 -370 { lab=vdd3v3}
-N 2300 -140 2300 -100 { lab=#net3}
-N 2340 50 2400 50 { lab=#net3}
-N 2300 -210 2300 -140 { lab=#net3}
-N 2100 80 2100 110 { lab=vss}
-N 2100 110 2110 110 { lab=vss}
-N 2050 50 2060 50 { lab=#net4}
-N 2050 -70 2050 50 { lab=#net4}
-N 1930 -70 2050 -70 { lab=#net4}
-N 1930 -400 2110 -400 { lab=vdd3v3}
-N 2100 -400 2100 -370 { lab=vdd3v3}
-N 2100 -310 2100 -270 { lab=#net6}
-N 2100 -210 2100 20 { lab=#net7}
-N 2100 50 2300 50 { lab=vss}
-N 2200 50 2200 110 { lab=vss}
-N 2140 -240 2260 -240 { lab=#net7}
-N 2140 -340 2260 -340 { lab=#net6}
-N 2100 -290 2180 -290 { lab=#net6}
-N 2180 -340 2180 -290 { lab=#net6}
-N 2100 -180 2180 -180 { lab=#net7}
-N 2180 -240 2180 -180 { lab=#net7}
-N 1930 -240 2100 -240 { lab=vdd3v3}
-N 1930 -340 2100 -340 { lab=vdd3v3}
-N 1930 110 2100 110 { lab=vss}
-N 2300 -240 2500 -240 { lab=vdd3v3}
-N 2300 -340 2500 -340 { lab=vdd3v3}
-N 2400 -340 2400 -240 { lab=vdd3v3}
-N 2400 -400 2400 -340 { lab=vdd3v3}
-N 2570 -240 2650 -240 { lab=#net2}
-N 2570 -340 2650 -340 { lab=#net1}
-N 2690 -400 2690 -370 { lab=vdd3v3}
-N 2790 -400 2790 -340 { lab=vdd3v3}
-N 2690 -340 2790 -340 { lab=vdd3v3}
-N 2690 -240 2790 -240 { lab=vdd3v3}
-N 2790 -340 2790 -240 { lab=vdd3v3}
-N 2690 -310 2690 -270 { lab=#net8}
-N 2690 -210 2690 -150 { lab=#net9}
-N 1830 30 1880 30 { lab=vss}
-N 1810 60 1810 110 { lab=vss}
-N 1810 110 1880 110 { lab=vss}
-N 1810 -70 1810 0 { lab=vss}
-N 1810 -70 1880 -70 { lab=vss}
-N 2690 -150 2690 -70 { lab=#net9}
-N 2820 -130 2820 -70 { lab=#net9}
-N 2690 -130 2820 -130 { lab=#net9}
-N 2630 110 2820 110 { lab=vss}
-N 2820 -10 2820 110 { lab=vss}
-N 2690 -10 2690 110 { lab=vss}
-N 2820 -130 2980 -130 { lab=#net9}
-N 3060 -130 3130 -130 { lab=#net10}
-N 3090 -130 3090 60 { lab=#net10}
-N 3090 60 3130 60 { lab=#net10}
-N 3090 -40 3130 -40 { lab=#net10}
-N 3210 -130 3300 -130 { lab=porb_h}
-N 3210 -40 3300 -40 { lab=porb_l}
-N 3210 60 3300 60 { lab=por_l}
-N 2790 -400 2840 -400 { lab=vdd3v3}
-N 2820 110 2870 110 { lab=vss}
-N 2630 50 2690 50 { lab=vss}
-N 2300 -100 2300 -40 { lab=#net3}
-N 2500 -100 2500 -30 { lab=#net2}
-N 2500 -30 2500 20 { lab=#net2}
-C {sky130_fd_pr/cap_mim_m3_1.sym} 2690 -40 0 0 {name=C1 model=cap_mim_m3_1 W=30 L=30 MF=1 spiceprefix=X}
-C {sky130_fd_pr/cap_mim_m3_2.sym} 2820 -40 2 1 {name=C2 model=cap_mim_m3_2 W=30 L=30 MF=1 spiceprefix=X}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2280 -240 0 0 {name=M1
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/nfet_g5v0d10v5.sym} 2480 50 0 0 {name=M2
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=nfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/res_xhigh_po_0p69.sym} 1930 -190 0 0 {name=R1
-L=500
-model=res_xhigh_po_0p69
-spiceprefix=X
-mult=1}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2280 -340 0 0 {name=M4
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/nfet_g5v0d10v5.sym} 2320 50 0 1 {name=M5
-L=0.8
-W=14
-nf=7
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=nfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/res_xhigh_po_0p69.sym} 1930 30 0 0 {name=R2
-L=150
-model=res_xhigh_po_0p69
-spiceprefix=X
-mult=1}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2520 -240 0 1 {name=M7
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2520 -340 0 1 {name=M8
-L=0.8
-W=14
-nf=7
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/nfet_g5v0d10v5.sym} 2080 50 0 0 {name=M10
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=nfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2120 -240 0 1 {name=M9
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2120 -340 0 1 {name=M11
-L=0.8
-W=16
-nf=8
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2670 -340 0 0 {name=M12
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2670 -240 0 0 {name=M13
-L=0.8
-W=2
-nf=1
-mult=1
-ad="'int((nf+1)/2) * W/nf * 0.29'" 
-pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
-as="'int((nf+2)/2) * W/nf * 0.29'" 
-ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
-nrd="'0.29 / W'" nrs="'0.29 / W'"
-sa=0 sb=0 sd=0
-model=pfet_g5v0d10v5
-spiceprefix=X
-}
-C {sky130_fd_pr/res_xhigh_po_0p69.sym} 1810 30 0 1 {name=R3
-L=25
-model=res_xhigh_po_0p69
-spiceprefix=X
-mult=2}
-C {sky130_stdcells/buf_8.sym} 3170 -130 0 0 {name=x2 VGND=vss VNB=vss VPB=vdd3v3 VPWR=vdd3v3 prefix=sky130_fd_sc_hvl__ }
-C {sky130_stdcells/buf_8.sym} 3170 -40 0 0 {name=x3 VGND=vss VNB=vss VPB=vdd1v8 VPWR=vdd1v8 prefix=sky130_fd_sc_hvl__ }
-C {sky130_stdcells/inv_8.sym} 3170 60 0 0 {name=x4 VGND=vss VNB=vss VPB=vdd1v8 VPWR=vdd1v8 prefix=sky130_fd_sc_hvl__ }
-C {sky130_stdcells/buf_1.sym} 3020 -130 0 0 {name=x5 VGND=vss VNB=vss VPB=vdd3v3 VPWR=vdd3v3 prefix=sky130_fd_sc_hvl__schmitt }
-C {devices/iopin.sym} 2840 -400 0 0 {name=p1 lab=vdd3v3}
-C {devices/iopin.sym} 2870 110 0 0 {name=p2 lab=vss}
-C {devices/opin.sym} 3300 -130 0 0 {name=p3 lab=porb_h}
-C {devices/opin.sym} 3300 -40 0 0 {name=p4 lab=porb_l}
-C {devices/opin.sym} 3300 60 0 0 {name=p5 lab=por_l}
-C {devices/iopin.sym} 2840 -330 0 0 {name=p6 lab=vdd1v8}
diff --git a/xschem/example_por.sym b/xschem/example_por.sym
deleted file mode 100644
index e3875f5..0000000
--- a/xschem/example_por.sym
+++ /dev/null
@@ -1,33 +0,0 @@
-v {xschem version=2.9.9 file_version=1.2 }
-G {}
-K {type=subcircuit
-format="@name @pinlist @symname"
-template="name=x1"
-}
-V {}
-S {}
-E {}
-L 4 -130 -60 130 -60 {}
-L 4 -130 60 130 60 {}
-L 4 -130 -60 -130 60 {}
-L 4 130 -60 130 60 {}
-L 4 130 -30 150 -30 {}
-L 4 130 0 150 0 {}
-L 4 130 30 150 30 {}
-L 7 -30 -80 -30 -60 {}
-L 7 30 -80 30 -60 {}
-L 7 0 60 0 80 {}
-B 5 -32.5 -82.5 -27.5 -77.5 {name=vdd3v3 dir=inout }
-B 5 27.5 -82.5 32.5 -77.5 {name=vdd1v8 dir=inout }
-B 5 147.5 -32.5 152.5 -27.5 {name=porb_h dir=out }
-B 5 147.5 -2.5 152.5 2.5 {name=porb_l dir=out }
-B 5 147.5 27.5 152.5 32.5 {name=por_l dir=out }
-B 5 -2.5 77.5 2.5 82.5 {name=vss dir=inout }
-T {@symname} -47.5 -6 0 0 0.3 0.3 {}
-T {@name} -25 18 0 0 0.2 0.2 {}
-T {vdd3v3} -15 -54 0 1 0.2 0.2 {}
-T {vdd1v8} 55 -54 0 1 0.2 0.2 {}
-T {porb_h} 125 -34 0 1 0.2 0.2 {}
-T {porb_l} 125 -4 0 1 0.2 0.2 {}
-T {por_l} 125 26 0 1 0.2 0.2 {}
-T {vss} 5 46 0 1 0.2 0.2 {}
diff --git a/xschem/example_por_tb.sch b/xschem/example_por_tb.sch
deleted file mode 100644
index a24d814..0000000
--- a/xschem/example_por_tb.sch
+++ /dev/null
@@ -1,45 +0,0 @@
-v {xschem version=2.9.9 file_version=1.2 }
-G {}
-K {}
-V {}
-S {}
-E {}
-T {Testbench for simple POR} -350 -240 0 0 0.6 0.6 {}
-N -280 60 -10 60 { lab=GND}
-N -540 0 -540 60 { lab=GND}
-N -330 0 -330 60 { lab=GND}
-N -330 -100 -330 -60 { lab=vdd3v3}
-N -330 -110 -330 -100 { lab=vdd3v3}
-N -210 -110 -40 -110 { lab=vdd3v3}
-N -40 -110 -40 -100 { lab=vdd3v3}
-N -540 -130 -540 -60 { lab=vdd1v8}
-N -280 -130 20 -130 { lab=vdd1v8}
-N 20 -130 20 -100 { lab=vdd1v8}
-N 140 -50 180 -50 { lab=porb_h}
-N 140 -20 180 -20 { lab=porb_l}
-N 140 10 180 10 { lab=por_l}
-N -340 -110 -330 -110 { lab=vdd3v3}
-N -500 -130 -490 -130 { lab=vdd1v8}
-N -540 -130 -500 -130 { lab=vdd1v8}
-N -560 -130 -540 -130 { lab=vdd1v8}
-N -540 60 -490 60 { lab=GND}
-N -490 -130 -280 -130 { lab=vdd1v8}
-N -490 60 -330 60 { lab=GND}
-N -330 60 -280 60 { lab=GND}
-N -330 -110 -210 -110 { lab=vdd3v3}
-C {example_por.sym} -10 -20 0 0 {name=x1}
-C {devices/gnd.sym} -100 60 0 0 {name=l1 lab=GND}
-C {devices/vsource.sym} -330 -30 0 0 {name=V1 value="PWL(0.0 0 100u 0 5m 3.3)"}
-C {devices/vsource.sym} -540 -30 0 0 {name=V2 value="PWL(0.0 0 300u 0 5.3m 1.8)"}
-C {devices/opin.sym} -340 -110 0 1 {name=p1 lab=vdd3v3}
-C {devices/opin.sym} -560 -130 0 1 {name=p2 lab=vdd1v8}
-C {devices/opin.sym} 180 -50 0 0 {name=p3 lab=porb_h}
-C {devices/opin.sym} 180 -20 0 0 {name=p4 lab=porb_l}
-C {devices/opin.sym} 180 10 0 0 {name=p5 lab=por_l}
-C {devices/code.sym} -470 140 0 0 {name=TT_MODELS only_toplevel=false
-format="tcleval(@value )" value=".lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
-.include \\\\$::PDKPATH\\\\/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice"}
-C {devices/code_shown.sym} -320 160 0 0 {name=s2 only_toplevel=false value=".control
-tran 1u 20m
-plot V(vdd3v3) V(vdd1v8) V(porb_h) V(porb_l) V(por_l)
-.endc"}
diff --git a/xschem/example_por_tb.spice b/xschem/example_por_tb.spice
deleted file mode 100644
index fa82f74..0000000
--- a/xschem/example_por_tb.spice
+++ /dev/null
@@ -1,78 +0,0 @@
-**.subckt example_por_tb vdd3v3 vdd1v8 porb_h porb_l por_l
-*.opin vdd3v3
-*.opin vdd1v8
-*.opin porb_h
-*.opin porb_l
-*.opin por_l
-x1 vdd3v3 vdd1v8 porb_h porb_l por_l GND example_por
-V1 vdd3v3 GND PWL(0.0 0 100u 0 5m 3.3)
-V2 vdd1v8 GND PWL(0.0 0 300u 0 5.3m 1.8)
-**** begin user architecture code
-.lib /usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
-.include /usr/share/pdk/sky130A/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice
-
-.control
-tran 1u 20m
-plot V(vdd3v3) V(vdd1v8) V(porb_h) V(porb_l) V(por_l)
-.endc
-
-**** end user architecture code
-**.ends
-
-* expanding   symbol:  example_por.sym # of pins=6
-* sym_path: /home/tim/gits/caravel_user_project_analog/xschem/example_por.sym
-* sch_path: /home/tim/gits/caravel_user_project_analog/xschem/example_por.sch
-.subckt example_por  vdd3v3 vdd1v8 porb_h porb_l por_l vss
-*.iopin vdd3v3
-*.iopin vss
-*.opin porb_h
-*.opin porb_l
-*.opin por_l
-*.iopin vdd1v8
-XC1 net9 vss sky130_fd_pr__cap_mim_m3_1 W=30 L=30 MF=1 m=1
-XC2 vss net9 sky130_fd_pr__cap_mim_m3_2 W=30 L=30 MF=1 m=1
-XM1 net3 net7 net5 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM2 net2 net3 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XR1 net4 vdd3v3 vss sky130_fd_pr__res_xhigh_po_0p69 L=500 mult=1 m=1
-XM4 net5 net6 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM5 net3 net3 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=14 nf=7 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XR2 vss net4 vss sky130_fd_pr__res_xhigh_po_0p69 L=150 mult=1 m=1
-XM7 net2 net2 net1 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM8 net1 net1 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=14 nf=7 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM10 net7 net4 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XM9 net7 net7 net6 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM11 net6 net6 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=16 nf=8 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM12 net8 net1 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM13 net9 net2 net8 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XR3 vss vss vss sky130_fd_pr__res_xhigh_po_0p69 L=25 mult=2 m=2
-x2 net10 vss vss vdd3v3 vdd3v3 porb_h sky130_fd_sc_hvl__buf_8
-x3 net10 vss vss vdd1v8 vdd1v8 porb_l sky130_fd_sc_hvl__buf_8
-x4 net10 vss vss vdd1v8 vdd1v8 por_l sky130_fd_sc_hvl__inv_8
-x5 net9 vss vss vdd3v3 vdd3v3 net10 sky130_fd_sc_hvl__schmittbuf_1
-.ends
-
-.GLOBAL GND
-** flattened .save nodes
-.end
diff --git a/xschem/example_por_tb.spice.orig b/xschem/example_por_tb.spice.orig
deleted file mode 100644
index 069c74d..0000000
--- a/xschem/example_por_tb.spice.orig
+++ /dev/null
@@ -1,88 +0,0 @@
-**.subckt example_por_tb vdd3v3 vdd1v8 porb_h porb_l por_l
-.param mc_switch=0
-*.opin vdd3v3
-*.opin vdd1v8
-*.opin porb_h
-*.opin porb_l
-*.opin por_l
-x1 vdd3v3 vdd1v8 porb_h porb_l por_l GND example_por
-V1 vdd3v3 GND PWL(0.0 0 100u 0 5m 3.3)
-V2 vdd1v8 GND PWL(0.0 0 300u 0 5.3m 1.8)
-**** begin user architecture code
-
-.lib /usr/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
-
-
-.include /usr/share/pdk/sky130A/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice
-
-.control
-tran 1u 20m
-plot V(vdd3v3) V(vdd1v8) V(porb_h) V(porb_l) V(por_l)
-.endc
-
-**** end user architecture code
-**.ends
-
-* expanding   symbol:  example_por.sym # of pins=6
-* sym_path: /home/tim/gits/caravel_user_project_analog/xschem/example_por.sym
-* sch_path: /home/tim/gits/caravel_user_project_analog/xschem/example_por.sch
-.subckt example_por  vdd3v3 vdd1v8 porb_h porb_l por_l vss
-*.iopin vdd3v3
-*.iopin vss
-*.opin porb_h
-*.opin porb_l
-*.opin por_l
-*.iopin vdd1v8
-XC1 net11 vss sky130_fd_pr__cap_mim_m3_1 W=30 L=30 MF=1 m=1
-XC2 net11 vss sky130_fd_pr__cap_mim_m3_2 W=30 L=30 MF=1 m=1
-XM1 net5 net9 net7 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM2 net1 net4 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XR1 net6 vdd3v3 vss sky130_fd_pr__res_xhigh_po_0p69 W=0.69 L=500 mult=1 m=1
-XM3 net3 net5 net1 vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XM4 net7 net8 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM5 net4 net4 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=14 nf=7 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XM6 net5 net5 net4 vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XR2 vss net6 vss sky130_fd_pr__res_xhigh_po_0p69 W=0.69 L=150 mult=1 m=1
-XM7 net3 net3 net2 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM8 net2 net2 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=14 nf=7 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM10 net9 net6 vss vss sky130_fd_pr__nfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
-+ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
-+ sa=0 sb=0 sd=0 mult=1 m=1 
-XM9 net9 net9 net8 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM11 net8 net8 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=16 nf=8 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM12 net10 net2 vdd3v3 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XM13 net11 net3 net10 vdd3v3 sky130_fd_pr__pfet_g5v0d10v5 L=0.8 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29'
-+ as='int((nf+2)/2) * W/nf * 0.29' pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)'
-+ nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
-XR3 vss vss vss sky130_fd_pr__res_xhigh_po_0p69 W=0.69 L=25 mult=2 m=2
-x2 net12 vss vss vdd3v3 vdd3v3 porb_h sky130_fd_sc_hvl__buf_8
-x3 net12 vss vss vdd1v8 vdd1v8 porb_l sky130_fd_sc_hvl__buf_8
-x4 net12 vss vss vdd1v8 vdd1v8 por_l sky130_fd_sc_hvl__inv_8
-x5 net11 vss vss vdd3v3 vdd3v3 net12 sky130_fd_sc_hvl__schmittbuf_1
-.ends
-
-.GLOBAL GND
-** flattened .save nodes
-.end
diff --git a/xschem/gate-switch.sch b/xschem/gate-switch.sch
new file mode 100644
index 0000000..1c16366
--- /dev/null
+++ b/xschem/gate-switch.sch
@@ -0,0 +1,53 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 155 -270 225 -270 { lab=in}
+N 285 -155 365 -155 { lab=out}
+N 285 -270 365 -270 { lab=out}
+N 155 -155 225 -155 { lab=in}
+N 365 -270 365 -155 { lab=out}
+N 155 -270 155 -155 { lab=in}
+N 120 -210 155 -210 { lab=in}
+N 365 -210 400 -210 { lab=out}
+N 255 -270 255 -245 { lab=vbias}
+N 255 -180 255 -155 { lab=gnd}
+N 255 -180 300 -180 { lab=gnd}
+N 255 -115 255 -100 { lab=cntrl1}
+N 255 -325 255 -310 { lab=cntrl1}
+C {sky130_fd_pr/pfet_01v8.sym} 255 -290 1 0 {name=M5
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} 255 -135 1 1 {name=M6
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/ipin.sym} 120 -210 0 0 {name=in lab=in}
+C {devices/ipin.sym} 255 -245 3 0 {name=vbias lab=vbias}
+C {devices/ipin.sym} 300 -180 2 0 {name=gnd lab=gnd}
+C {devices/opin.sym} 400 -210 0 0 {name=out lab=out}
+C {devices/ipin.sym} 255 -100 3 0 {name=cntrl1 lab=cntrl1}
+C {devices/ipin.sym} 255 -325 1 0 {name=cntrl2 lab=cntrl2}
diff --git a/xschem/gate-switch.spice b/xschem/gate-switch.spice
new file mode 100644
index 0000000..ed5e314
--- /dev/null
+++ b/xschem/gate-switch.spice
@@ -0,0 +1,16 @@
+**.subckt gate-switch in vbias gnd out cntrl1 cntrl2
+*.ipin in
+*.ipin vbias
+*.ipin gnd
+*.opin out
+*.ipin cntrl1
+*.ipin cntrl2
+XM5 in cntrl2 out vbias sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 out cntrl1 in gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/gate-switch.sym b/xschem/gate-switch.sym
new file mode 100644
index 0000000..7a82075
--- /dev/null
+++ b/xschem/gate-switch.sym
@@ -0,0 +1,41 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=XTG1"}
+V {}
+S {}
+E {}
+L 4 180 -200 200 -200 {}
+L 4 200 -200 230 -215 {}
+L 4 240 -200 280 -200 {}
+L 4 280 -200 300 -200 {}
+L 4 160 -200 180 -200 {}
+L 4 180 -230 180 -200 {}
+L 4 180 -200 180 -170 {}
+L 4 280 -230 280 -200 {}
+L 4 180 -230 280 -230 {}
+L 4 180 -170 280 -170 {}
+L 4 280 -200 280 -170 {}
+L 4 230 -170 230 -150 {}
+L 4 230 -250 230 -230 {}
+L 4 190 -170 190 -160 {}
+L 4 160 -160 190 -160 {}
+L 4 200 -170 200 -150 {}
+L 4 160 -140 200 -140 {}
+L 4 200 -150 200 -140 {}
+B 5 157.5 -202.5 162.5 -197.5 {name=in
+dir=in}
+B 5 297.5 -202.5 302.5 -197.5 {name=out
+dir=out}
+B 5 157.5 -162.5 162.5 -157.5 {name=gnd
+dir=in}
+B 5 157.5 -142.5 162.5 -137.5 {name=vbias
+dir=in}
+B 5 227.5 -152.5 232.5 -147.5 {name=cntrl2
+dir=in}
+B 5 227.5 -252.5 232.5 -247.5 {name=cntrl1
+dir=in}
+T {@name} 185 -225 0 0 0.2 0.2 {}
+T {GND} 190 -185 1 0 0.1 0.1 {}
+T {VBIAS} 205 -190 1 0 0.1 0.1 {}
diff --git a/xschem/invert b/xschem/invert
new file mode 100644
index 0000000..41b771f
--- /dev/null
+++ b/xschem/invert
@@ -0,0 +1,65 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 440 -270 440 -230 { lab=#net1}
+N 440 -250 520 -250 { lab=#net1}
+N 380 -200 400 -200 { lab=#net2}
+N 380 -300 380 -200 { lab=#net2}
+N 380 -300 400 -300 { lab=#net2}
+N 330 -250 380 -250 { lab=#net2}
+N 440 -350 440 -330 { lab=#net3}
+N 440 -170 440 -150 { lab=GND}
+C {sky130_fd_pr/nfet3_01v8.sym} 420 -200 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 420 -300 0 0 {name=M2
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 440 -150 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 440 -380 2 0 {name=V1 value=2}
+C {devices/gnd.sym} 440 -410 2 0 {name=l2 lab=GND}
+C {devices/vsource.sym} 300 -250 1 0 {name=V2 value=0}
+C {devices/gnd.sym} 270 -250 1 0 {name=l3 lab=GND}
+C {devices/code.sym} 10 -410 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code_shown.sym} 580 -410 0 0 {name="hi" only_toplevel=false value=".dc v2 0 3
+.plot v(v2) v(net1)
+"}
diff --git a/xschem/invert.sch b/xschem/invert.sch
new file mode 100644
index 0000000..16bbed0
--- /dev/null
+++ b/xschem/invert.sch
@@ -0,0 +1,75 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 440 -270 440 -230 { lab=out}
+N 440 -250 520 -250 { lab=out}
+N 380 -200 400 -200 { lab=in}
+N 380 -300 380 -200 { lab=in}
+N 380 -300 400 -300 { lab=in}
+N 330 -250 380 -250 { lab=in}
+N 440 -350 440 -330 { lab=vdd}
+N 440 -170 440 -150 { lab=GND}
+C {sky130_fd_pr/nfet3_01v8.sym} 420 -200 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 420 -300 0 0 {name=M2
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 440 -150 0 0 {name=l1 lab=GND}
+C {devices/code.sym} 10 -410 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code_shown.sym} 640 -420 0 0 {name=NGSPICE 
+only_toplevel=false 
+value=".option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v2 0 3 0.01
+
+.control
+  run
+  plot (v(v2)) (v(net1))
+.endc
+
+.save all
+"}
+C {devices/ipin.sym} 330 -250 0 0 {name=in lab=in}
+C {devices/opin.sym} 520 -250 0 0 {name=out lab=out}
+C {devices/ipin.sym} 440 -350 1 0 {name=vdd lab=vdd}
diff --git a/xschem/invert.spice b/xschem/invert.spice
new file mode 100644
index 0000000..ceb1511
--- /dev/null
+++ b/xschem/invert.spice
@@ -0,0 +1,39 @@
+**.subckt invert in out vdd
+*.ipin in
+*.opin out
+*.ipin vdd
+XM1 out in GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 out in vdd VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+.option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v2 0 3 0.01
+
+.control
+  run
+  plot (v(v2)) (v(net1))
+.endc
+
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/invert.sym b/xschem/invert.sym
new file mode 100644
index 0000000..5a8248c
--- /dev/null
+++ b/xschem/invert.sym
@@ -0,0 +1,25 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {type=inverter
+tedax_format="footprint @name @footprint
+device @name @device"
+template="name=inv device=inverter"
+
+}
+E {}
+L 4 240 -340 240 -280 {}
+L 4 240 -280 310 -310 {}
+L 4 240 -340 310 -310 {}
+L 4 330 -310 360 -310 {}
+L 4 200 -310 240 -310 {}
+L 4 270 -290 270 -260 {}
+B 5 197.5 -312.5 202.5 -307.5 {name=in dir=in}
+B 5 357.5 -312.5 362.5 -307.5 {name=out dir=out}
+B 5 267.5 -262.5 272.5 -257.5 {name=vdd dir=in}
+A 4 320 -310 10 360 360 {}
+T {@name} 240 -370 0 0 0.4 0.4 {}
+T {in} 190 -300 0 0 0.4 0.4 {}
+T {out} 340 -300 0 0 0.4 0.4 {}
+T {vdd} 280 -280 0 0 0.4 0.4 {}
diff --git a/xschem/lvtnot.spice b/xschem/lvtnot.spice
new file mode 100644
index 0000000..912610e
--- /dev/null
+++ b/xschem/lvtnot.spice
@@ -0,0 +1,17 @@
+**.subckt lvtnot y a
+*.opin y
+*.ipin a
+XM2 y a VCCPIN VCCPIN sky130_fd_pr__pfet_01v8_lvt L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 y a VSSPIN VSSPIN sky130_fd_pr__nfet_01v8_lvt L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/n_diffamp.raw b/xschem/n_diffamp.raw
new file mode 100644
index 0000000..867a350
--- /dev/null
+++ b/xschem/n_diffamp.raw
Binary files differ
diff --git a/xschem/n_diffamp.spice b/xschem/n_diffamp.spice
new file mode 100644
index 0000000..99e4dd0
--- /dev/null
+++ b/xschem/n_diffamp.spice
@@ -0,0 +1,53 @@
+**.subckt n_diffamp PLUS MINUS OUT NBIAS
+*.ipin PLUS
+*.ipin MINUS
+*.opin OUT
+*.ipin NBIAS
+XM1 net1 PLUS S GND sky130_fd_pr__nfet_01v8_lvt L=0.3 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 OUT MINUS S GND sky130_fd_pr__nfet_01v8_lvt L=0.3 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 OUT net1 VDD VDD sky130_fd_pr__pfet_01v8_lvt L=0.8 W=4 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net1 net1 VDD VDD sky130_fd_pr__pfet_01v8_lvt L=0.8 W=4 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net2 NBIAS GND GND sky130_fd_pr__nfet_01v8 L=1.2 W=0.7 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XR1 GND S GND sky130_fd_pr__res_xhigh_po_0p35 L=50 mult=1 m=1
+V1 PLUS GND 0.7
+V2 NBIAS GND 0.9
+V3 VDD GND 1.8
+V4 MINUS GND 0.7
+V5 S net2 0
+**** begin user architecture code
+
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+* Mismatch parameters
+* Resistor/ef/tech/SW.2/sky130A/libs.tech/ngspice/Capacitor
+* Special cells
+* All models
+* Corner
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+.GLOBAL VDD
+**** begin user architecture code
+
+.options savecurrents
+.control
+save @m.xm5.msky130_fd_pr__nfet_01v8[gm]
+save all
+op
+write n_diffamp.raw
+.endc
+
+
+**** end user architecture code
+** flattened .save nodes
+.end
diff --git a/xschem/not.spice b/xschem/not.spice
new file mode 100644
index 0000000..3fa956a
--- /dev/null
+++ b/xschem/not.spice
@@ -0,0 +1,17 @@
+**.subckt not y a
+*.opin y
+*.ipin a
+XM1 y a VSSPIN VSSPIN sky130_fd_pr__nfet_01v8 L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 y a VCCPIN VCCPIN sky130_fd_pr__pfet_01v8 L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/passgate.spice b/xschem/passgate.spice
new file mode 100644
index 0000000..b00c28c
--- /dev/null
+++ b/xschem/passgate.spice
@@ -0,0 +1,19 @@
+**.subckt passgate A Z GP GN
+*.iopin A
+*.iopin Z
+*.ipin GP
+*.ipin GN
+XM1 Z GN A VSSBPIN sky130_fd_pr__nfet_01v8 L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 Z GP A VCCBPIN sky130_fd_pr__pfet_01v8 L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.end
diff --git a/xschem/power-detector.sch b/xschem/power-detector.sch
new file mode 100644
index 0000000..385f791
--- /dev/null
+++ b/xschem/power-detector.sch
@@ -0,0 +1,150 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 460 -260 500 -260 { lab=#net1}
+N 420 -310 420 -290 { lab=#net2}
+N 540 -310 540 -290 { lab=#net2}
+N 420 -310 540 -310 { lab=#net2}
+N 420 -230 420 -180 { lab=#net1}
+N 540 -230 540 -180 { lab=#net3}
+N 420 -120 420 -100 { lab=GND}
+N 420 -100 540 -100 { lab=GND}
+N 540 -120 540 -100 { lab=GND}
+N 580 -150 600 -150 { lab=#net4}
+N 360 -150 380 -150 { lab=#net5}
+N 360 -90 360 -70 { lab=#net6}
+N 360 -70 600 -70 { lab=#net6}
+N 600 -90 600 -70 { lab=#net6}
+N 320 -150 360 -150 { lab=#net5}
+N 230 -150 260 -150 { lab=#net7}
+N 510 -190 510 -180 { lab=#net3}
+N 510 -190 540 -190 { lab=#net3}
+N 510 -120 510 -100 { lab=GND}
+N 450 -190 450 -180 { lab=#net1}
+N 420 -190 450 -190 { lab=#net1}
+N 450 -120 450 -100 { lab=GND}
+N 420 -210 480 -210 { lab=#net1}
+N 480 -260 480 -210 { lab=#net1}
+C {devices/code.sym} 10 -140 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} 10 -290 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1s
+"}
+C {sky130_fd_pr/nfet3_01v8.sym} 400 -150 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 520 -260 0 0 {name=M2
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 440 -260 0 1 {name=M3
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet3_01v8.sym} 560 -150 0 1 {name=M4
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/res.sym} 360 -120 2 1 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 360 -180 2 1 {name=R2
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 600 -120 2 0 {name=R3
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 600 -180 2 0 {name=R4
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 480 -100 0 0 {name=l2 lab=GND}
+C {devices/capa.sym} 290 -150 1 0 {name=C1
+m=1
+value=1p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/gnd.sym} 360 -210 2 0 {name=l1 lab=GND}
+C {devices/gnd.sym} 600 -210 2 0 {name=l3 lab=GND}
+C {devices/capa.sym} 450 -150 0 0 {name=C2
+m=1
+value=1p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/capa.sym} 510 -150 0 0 {name=C3
+m=1
+value=1p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/vsource.sym} 230 -120 0 1 {name=V1 value="SIN(0 0.6 40)"}
+C {devices/vsource.sym} 480 -40 0 0 {name=V2 value="1.8"}
+C {devices/vsource.sym} 480 -340 2 0 {name=V3 value="1.8"}
+C {devices/gnd.sym} 230 -90 0 0 {name=l4 lab=GND}
+C {devices/gnd.sym} 480 -10 0 0 {name=l5 lab=GND}
+C {devices/gnd.sym} 480 -370 2 0 {name=l6 lab=GND}
diff --git a/xschem/power-detector.spice b/xschem/power-detector.spice
new file mode 100644
index 0000000..db514ee
--- /dev/null
+++ b/xschem/power-detector.spice
@@ -0,0 +1,43 @@
+**.subckt power-detector
+XM1 net1 net5 GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net3 net1 net2 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 net1 net1 net2 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net3 net4 GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+R1 net6 net5 1k m=1
+R2 net5 GND 1k m=1
+R3 net6 net4 1k m=1
+R4 net4 GND 1k m=1
+C1 net5 net7 1p m=1
+C2 net1 GND 1p m=1
+C3 net3 GND 1p m=1
+V1 net7 GND SIN(0 0.6 40)
+V2 net6 GND 1.8
+V3 net2 GND 1.8
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/rms-detector.sch b/xschem/rms-detector.sch
new file mode 100644
index 0000000..7fc49dd
--- /dev/null
+++ b/xschem/rms-detector.sch
@@ -0,0 +1,189 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 180 -190 180 -170 { lab=#net1}
+N 180 -190 370 -190 { lab=#net1}
+N 380 -190 380 -170 { lab=#net1}
+N 370 -190 380 -190 { lab=#net1}
+N 280 -210 280 -190 { lab=#net1}
+N 40 -140 60 -140 { lab=GND}
+N 120 -140 140 -140 { lab=#net2}
+N 500 -140 520 -140 { lab=GND}
+N 420 -140 440 -140 { lab=#net3}
+N 180 -110 180 -60 { lab=out1}
+N 380 -110 380 -60 { lab=out2}
+N 180 -60 180 -20 { lab=out1}
+N 380 -60 380 -20 { lab=out2}
+N 60 -20 110 -20 { lab=#net4}
+N 100 10 140 10 { lab=#net4}
+N 120 -20 120 10 { lab=#net4}
+N 110 -20 120 -20 { lab=#net4}
+N 450 -20 500 -20 { lab=#net5}
+N 420 10 460 10 { lab=#net5}
+N 440 -20 440 10 { lab=#net5}
+N 440 -20 450 -20 { lab=#net5}
+N 60 40 60 60 { lab=#net6}
+N 60 60 180 60 { lab=#net6}
+N 180 40 180 60 { lab=#net6}
+N 380 40 380 60 { lab=#net7}
+N 380 60 500 60 { lab=#net7}
+N 500 40 500 60 { lab=#net7}
+N 180 -20 250 -20 { lab=out1}
+N 310 -20 380 -20 { lab=out2}
+N -20 -20 60 -20 { lab=#net4}
+N 500 -20 580 -20 { lab=#net5}
+N 60 60 60 80 { lab=#net6}
+N 500 60 500 80 { lab=#net7}
+N 150 -70 180 -70 { lab=out1}
+N 380 -70 410 -70 { lab=out2}
+N 540 -70 540 -20 { lab=#net5}
+N 470 -70 540 -70 { lab=#net5}
+N 20 -70 20 -20 { lab=#net4}
+N 20 -70 90 -70 { lab=#net4}
+C {sky130_fd_pr/nfet3_01v8.sym} 160 -140 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet3_01v8.sym} 400 -140 0 1 {name=M2
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/vsource.sym} 90 -140 1 1 {name=V1 value="SIN(0.9 0.25 40)"}
+C {devices/vsource.sym} 470 -140 3 1 {name=V2 value=0.9}
+C {devices/vsource.sym} 280 -240 2 1 {name=V3 value=1.8}
+C {devices/gnd.sym} 280 -270 2 0 {name=l1 lab=GND}
+C {devices/gnd.sym} 520 -140 3 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 40 -140 1 0 {name=l3 lab=GND}
+C {sky130_fd_pr/pfet3_01v8.sym} 160 10 2 1 {name=M3
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 80 10 2 0 {name=M4
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 400 10 2 0 {name=M5
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 480 10 2 1 {name=M6
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/vsource.sym} 60 110 0 0 {name=V4 value="1.8"}
+C {devices/vsource.sym} 500 110 0 0 {name=V5 value="1.8"}
+C {devices/gnd.sym} 60 140 0 0 {name=l4 lab=GND}
+C {devices/gnd.sym} 500 140 0 0 {name=l5 lab=GND}
+C {devices/res.sym} -50 -20 1 0 {name=R1
+value=5k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 610 -20 3 0 {name=R2
+value=5k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} -80 -20 1 0 {name=l6 lab=GND}
+C {devices/gnd.sym} 640 -20 3 0 {name=l7 lab=GND}
+C {devices/capa.sym} 120 -70 1 0 {name=C1
+m=1
+value=1p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/capa.sym} 440 -70 3 0 {name=C2
+m=1
+value=1p
+footprint=1206
+device="ceramic capacitor"}
+C {devices/lab_pin.sym} 310 -20 1 0 {name=out2 sig_type=std_logic lab=out2}
+C {devices/lab_pin.sym} 250 -20 1 0 {name=out1 sig_type=std_logic lab=out1}
+C {devices/code.sym} -270 -130 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} -270 -280 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1
+.control
+  run
+.endc
+.save all
+"}
diff --git a/xschem/rms-detector.spice b/xschem/rms-detector.spice
new file mode 100644
index 0000000..16a4afe
--- /dev/null
+++ b/xschem/rms-detector.spice
@@ -0,0 +1,52 @@
+**.subckt rms-detector
+XM1 net1 net2 out1 GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net1 net3 out2 GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V1 net2 GND SIN(0.9 0.25 40)
+V2 net3 GND 0.9
+V3 net1 GND 1.8
+XM3 out1 net4 net6 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net4 net4 net6 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 out2 net5 net7 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 net5 net5 net7 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V4 net6 GND 1.8
+V5 net7 GND 1.8
+R1 net4 GND 5k m=1
+R2 net5 GND 5k m=1
+C1 out1 net4 1p m=1
+C2 out2 net5 1p m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1
+.control
+  run
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/test_analog.raw b/xschem/test_analog.raw
new file mode 100644
index 0000000..0d3cba3
--- /dev/null
+++ b/xschem/test_analog.raw
Binary files differ
diff --git a/xschem/test_analog.spice b/xschem/test_analog.spice
new file mode 100644
index 0000000..ed1a3ad
--- /dev/null
+++ b/xschem/test_analog.spice
@@ -0,0 +1,69 @@
+**.subckt test_analog
+x1 OUT OUT IN BIAS n_diffamp
+x2 OUT2 OUT2 IN2 BIAS2 n_diffamp
+V1 IN GND 1.2
+V2 BIAS GND 1.1
+V3 VDD GND 1.8
+V4 IN2 GND 1.0
+V5 BIAS2 GND 1.0
+XR1 GND OUT2 GND sky130_fd_pr__res_xhigh_po_0p35 L=50 mult=1 m=1
+XR2 GND OUT GND sky130_fd_pr__res_xhigh_po_0p35 L=50 mult=1 m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  sky130_tests/n_diffamp.sym # of pins=4
+* sym_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/n_diffamp.sym
+* sch_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/n_diffamp.sch
+.subckt n_diffamp  OUT MINUS PLUS NBIAS
+*.ipin PLUS
+*.ipin MINUS
+*.opin OUT
+*.ipin NBIAS
+XM1 net1 PLUS S GND sky130_fd_pr__nfet_01v8_lvt L=0.3 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 OUT MINUS S GND sky130_fd_pr__nfet_01v8_lvt L=0.3 W=2 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 OUT net1 VDD VDD sky130_fd_pr__pfet_01v8_lvt L=0.8 W=4 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net1 net1 VDD VDD sky130_fd_pr__pfet_01v8_lvt L=0.8 W=4 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net2 NBIAS GND GND sky130_fd_pr__nfet_01v8 L=1.2 W=0.7 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XR1 GND S GND sky130_fd_pr__res_xhigh_po_0p35 L=50 mult=1 m=1
+V5 S net2 0
+.ends
+
+.GLOBAL GND
+.GLOBAL VDD
+**** begin user architecture code
+
+
+
+.options savecurrents
+.control
+save all
+save @m.x1.xm5.msky130_fd_pr__nfet_01v8[gm]
+save @m.x2.xm5.msky130_fd_pr__nfet_01v8[gm]
+op
+write test_analog.raw
+.endc
+
+
+**** end user architecture code
+** flattened .save nodes
+.end
diff --git a/xschem/test_comparator.spice b/xschem/test_comparator.spice
new file mode 100644
index 0000000..cc7b142
--- /dev/null
+++ b/xschem/test_comparator.spice
@@ -0,0 +1,170 @@
+**.subckt test_comparator CAL PLUS MINUS EN VSS VCC SAOUT
+*.ipin CAL
+*.ipin PLUS
+*.ipin MINUS
+*.ipin EN
+*.ipin VSS
+*.ipin VCC
+*.opin SAOUT
+E5 TEMPERAT VSS VOL=' temper ' 
+C38 VSS 0 2p m=1
+C3 SAOUTF 0 4f m=1
+C5 GN 0 4f m=1
+C30 SN 0 2f m=1
+C31 OUTDIFF 0 4f m=1
+v2 net1 VSSI 0
+v3 net4 VSSI 0
+v4 net3 VSSI 0
+v6 net2 VSSI 0
+C1 SAOUT 0 4f m=1
+v1 net5 VSSI 0
+v5 net6 VSSI 0
+C7 GP 0 4f m=1
+x4 CALBB CALB VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x5 CALB CAL VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+XM4 SP VSS VCC VCC sky130_fd_pr__pfet_01v8 L=1 W=0.55 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 OUTDIFF GN VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 GN GN VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM8 SAOUTF OUTDIFF VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM9 SAOUT SAOUTF VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM11 SAOUT EN VCC VCC sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM12 SAOUT ZERO2 VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM13 SAOUTF ZERO1 VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM14 OUTDIFF ZERO0 VCC VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 VSSI EN VSS VSS sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=2 m=2 
+XM2 OUTDIFF ZERO0 net2 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 SAOUTF ZERO1 net3 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM7 SAOUT ZERO2 net6 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM15 SAOUT SAOUTF net5 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM10 SAOUTF OUTDIFF net4 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM17 SN VCC net1 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=0.42 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM18 OUTDIFF GP VSSI VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM19 GP GP VSSI VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM20 OUTDIFF PLUS SP VCC sky130_fd_pr__pfet_01v8_lvt L=0.35 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM21 GP MINUS SP VCC sky130_fd_pr__pfet_01v8_lvt L=0.35 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM23 OUTDIFF PLUS SN VSS sky130_fd_pr__nfet_01v8_lvt L=0.25 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM16 GN MINUS SN VSS sky130_fd_pr__nfet_01v8_lvt L=0.25 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+x1 OUTDIFF ZERO0 CALB CALBB VCC VSS passgate_nlvt W_N=0.42 L_N=0.4 W_P=0.42 L_P=0.4 m=1
+x2 SAOUTF ZERO1 CALB CALBB VCC VSS passgate_nlvt W_N=0.42 L_N=0.4 W_P=0.42 L_P=0.4 m=1
+x3 SAOUT ZERO2 CALB CALBB VCC VSS passgate_nlvt W_N=0.42 L_N=0.4 W_P=0.42 L_P=0.4 m=1
+C2 ZERO0 VCC 15f m=1
+C4 ZERO1 VCC 15f m=1
+C6 ZERO2 VCC 15f m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  sky130_tests/not.sym # of pins=2
+* sym_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/not.sym
+* sch_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/not.sch
+.subckt not  y a  VCCPIN  VSSPIN      W_N=1 L_N=0.15 W_P=2 L_P=0.15
+*.opin y
+*.ipin a
+XM1 y a VSSPIN VSSPIN sky130_fd_pr__nfet_01v8 L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 y a VCCPIN VCCPIN sky130_fd_pr__pfet_01v8 L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  sky130_tests/passgate_nlvt.sym # of pins=4
+* sym_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/passgate_nlvt.sym
+* sch_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/passgate_nlvt.sch
+.subckt passgate_nlvt  Z A GP GN  VCCBPIN  VSSBPIN   W_N=1 L_N=0.35 W_P=1 L_P=0.35
+*.iopin A
+*.iopin Z
+*.ipin GP
+*.ipin GN
+XM1 Z GN A VSSBPIN sky130_fd_pr__nfet_01v8_lvt L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 Z GP A VCCBPIN sky130_fd_pr__pfet_01v8_lvt L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+**** begin user architecture code
+
+* .option SCALE=1e-6
+.option method=gear seed=12
+
+* this experimental option enables mos model bin
+* selection based on W/NF instead of W
+.option wnflag=1
+
+* .param VCC=1.8
+.param VCCGAUSS=agauss(1.8, 0.05, 1)
+.param VCC=VCCGAUSS
+.param VDL='VCC/2+0.2'
+.param ABSVAR=0.02
+.temp 25
+
+** to generate following file:
+** copy .../xschem_sky130/sky130_tests/stimuli.test_comparator to simulation directory
+** then do 'Simulation->Utile Stimuli Editor (GUI)' and press 'Translate'
+.include "stimuli_test_comparator.cir"
+
+** variation marameters:
+.param sky130_fd_pr__nfet_01v8_lvt__vth0_slope_spectre='agauss(0, ABSVAR, 3)/sky130_fd_pr__nfet_01v8_lvt__vth0_slope'
+.param sky130_fd_pr__pfet_01v8_lvt__vth0_slope_spectre='agauss(0, ABSVAR, 3)/sky130_fd_pr__pfet_01v8_lvt__vth0_slope'
+
+* .tran 0.1n 900n uic
+
+.control
+  let run=1
+  dowhile run <= 20
+    if run > 1
+      reset
+      set appendwrite
+    end
+    save all
+    * save saout cal i(vvcc) en plus minus
+    tran 0.1n 300n uic
+    write test_comparator.raw
+    let run = run + 1
+  end
+.endc
+
+
+**** end user architecture code
+** flattened .save nodes
+.save I(v2)
+.save I(v3)
+.save I(v4)
+.save I(v6)
+.save I(v1)
+.save I(v5)
+.end
diff --git a/xschem/test_inv.raw b/xschem/test_inv.raw
new file mode 100644
index 0000000..47651a6
--- /dev/null
+++ b/xschem/test_inv.raw
Binary files differ
diff --git a/xschem/test_inv.spice b/xschem/test_inv.spice
new file mode 100644
index 0000000..e5b5cd1
--- /dev/null
+++ b/xschem/test_inv.spice
@@ -0,0 +1,87 @@
+**.subckt test_inv
+C1 Z[1] 0 4f m=1
+C2 Z[2] 0 4f m=1
+C3 Z[3] 0 4f m=1
+C4 Z[4] 0 4f m=1
+C5 Z[5] 0 4f m=1
+C6 Z[6] 0 4f m=1
+C7 Z[0] 0 4.01f m=1
+C8 Y[1] 0 4f m=1
+C9 Y[2] 0 4f m=1
+C10 Y[3] 0 4f m=1
+C11 Y[4] 0 4f m=1
+C12 Y[5] 0 4f m=1
+C13 Y[6] 0 4f m=1
+C14 Y[0] 0 4.01f m=1
+x4 Z[1] Z[0] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x1 Z[2] Z[1] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x2 Z[3] Z[2] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x3 Z[4] Z[3] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x5 Z[5] Z[4] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x6 Z[6] Z[5] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x7 Z[0] Z[6] VCC VSS not W_N=1 L_N=0.15 W_P=2 L_P=0.15 m=1
+x8 Y[0] Y[1] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x9 Y[1] Y[2] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x10 Y[2] Y[3] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x11 Y[3] Y[4] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x12 Y[4] Y[5] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x13 Y[5] Y[6] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+x14 Y[6] Y[0] VCC VSS lvtnot W_N=1 L_N=0.15 W_P=2 L_P=0.35 m=1
+**** begin user architecture code
+
+
+vvss vss 0 dc 0
+vvcc vcc 0 pwl 0 0 10n 0 10.1n 1.8 20n 1.8 20.1n 0
+
+.control
+.save all
+tran 0.01n 30n
+plot "z[2]" "z[3]" "z[4]"
+plot "y[2]" "y[3]" "y[4]"
+write test_inv.raw
+.endc
+
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  sky130_tests/not.sym # of pins=2
+* sym_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/not.sym
+* sch_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/not.sch
+.subckt not  y a  VCCPIN  VSSPIN      W_N=1 L_N=0.15 W_P=2 L_P=0.15
+*.opin y
+*.ipin a
+XM1 y a VSSPIN VSSPIN sky130_fd_pr__nfet_01v8 L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 y a VCCPIN VCCPIN sky130_fd_pr__pfet_01v8 L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  sky130_tests/lvtnot.sym # of pins=2
+* sym_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/lvtnot.sym
+* sch_path: /ef/tech/SW.2/sky130A/libs.tech/xschem/sky130_tests/lvtnot.sch
+.subckt lvtnot  a y  VCCPIN  VSSPIN      W_N=1 L_N=0.15 W_P=2 L_P=0.35
+*.opin y
+*.ipin a
+XM2 y a VCCPIN VCCPIN sky130_fd_pr__pfet_01v8_lvt L=L_P W=W_P nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 y a VSSPIN VSSPIN sky130_fd_pr__nfet_01v8_lvt L=L_N W=W_N nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+** flattened .save nodes
+.end
diff --git a/xschem/test_nmos.spice b/xschem/test_nmos.spice
new file mode 100644
index 0000000..420e5b5
--- /dev/null
+++ b/xschem/test_nmos.spice
@@ -0,0 +1,93 @@
+**.subckt test_nmos G1v8 D1v8 B
+*.ipin G1v8
+*.ipin D1v8
+*.ipin B
+Vd1 D1v8 net1 0
+Vd3 D3v3 net2 0
+Vd2 D1v8 net3 0
+Vd4 D5v0 net4 0
+E1 D5v0 0 D1v8 0 '5/1.8' 
+E2 D3v3 0 D1v8 0 '3.3/1.8' 
+E3 G5v0 0 G1v8 0 '5/1.8' 
+E4 G3v3 0 G1v8 0 '3.3/1.8' 
+Vd5 D10v5 net5 0
+E5 D10v5 0 D1v8 0 '10.5/1.8' 
+E6 D16v0 0 D1v8 0 '16.0/1.8' 
+Vd6 D16v0 net6 0
+Vd7 D1v8 net7 0
+E7 D20v0 0 D1v8 0 '20.0/1.8' 
+XM1 net1 G1v8 S B sky130_fd_pr__nfet_01v8_lvt L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net3 G1v8 S B sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 net2 G3v3 S B sky130_fd_pr__nfet_03v3_nvt L=0.5 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 net4 G5v0 S B sky130_fd_pr__nfet_05v0_nvt L=0.9 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net5 G5v0 S B sky130_fd_pr__nfet_g5v0d10v5 L=0.5 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 net6 G5v0 S B sky130_fd_pr__nfet_g5v0d16v0 L=0.7 W=5.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+Vd8 D1v8 net8 0
+XM7 net7 G1v8 S B sky130_fd_pr__nfet_20v0 L=2.95 W=29.41 m=1
+XM16 net8 G1v8 S B sky130_fd_pr__nfet_20v0_zvt W=30 L=5 m=1
+**** begin user architecture code
+
+* this experimental option enables mos model bin
+* selection based on W/NF instead of W
+.option wnflag=1
+.option savecurrents
+vg G1v8 0 1.8
+vs s 0 0
+vd D1v8 0 1.8
+vb b 0 0
+.control
+save all
+dc vd 0 1.8 0.01 vg 0 1.8 0.2
+* dc vd 0 1.8 0.01 vg 0 1.2 0.1
+plot all.vd1#branch vs D1v8
+*plot all.vd2#branch vs D1v8
+plot all.vd3#branch vs D3v3
+*plot all.vd4#branch vs D5v0
+plot all.vd5#branch vs D10v5
+*plot all.vd6#branch vs D16v0
+plot all.vd8#branch vs D1v8
+plot all.vd7#branch vs D1v8
+save @m.xm1.msky130_fd_pr__nfet_01v8_lvt[gm]
+op
+write test_nmos.raw
+.endc
+
+
+
+** manual skywater-pdk install (with patches applied).
+
+** opencircuitdesign pdks install
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.save I(Vd1)
+.save I(Vd3)
+.save I(Vd2)
+.save I(Vd4)
+.save I(Vd5)
+.save I(Vd6)
+.save I(Vd7)
+.save I(Vd8)
+.end
diff --git a/xschem/test_nmos_sizes.spice b/xschem/test_nmos_sizes.spice
new file mode 100644
index 0000000..6822968
--- /dev/null
+++ b/xschem/test_nmos_sizes.spice
@@ -0,0 +1,54 @@
+**.subckt test_nmos_sizes
+XM1 D1 G 0 VSS sky130_fd_pr__nfet_01v8_lvt L=L W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='2 * (W + 0.29)'
++ ps='2 * (W + 0.29)' nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 D2 G 0 VSS sky130_fd_pr__nfet_01v8_lvt L=0.15 W=W nf=1 ad='W * 0.29' as='W * 0.29' pd='2 * (W + 0.29)'
++ ps='2 * (W + 0.29)' nrd='0.29 / W' nrs='0.29 / W' sa=0 sb=0 sd=0 mult=1 m=1 
+V2 D D2 0
+V1 D D1 0
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+**** begin user architecture code
+
+* .option SCALE=1e-6
+.option method=gear seed=12
+.param L=0.15
+.param W=0.5
+
+vd d 0 0
+vg g 0 0
+.control
+dc vd 0 2 0.01 vg 0 2 0.2
+alterparam L=0.18
+alterparam W=1
+reset
+dc vd 0 2 0.01 vg 0 2 0.2
+alterparam L=0.3
+alterparam W=2
+reset
+dc vd 0 2 0.01 vg 0 2 0.2
+alterparam L=0.5
+alterparam W=3
+reset
+dc vd 0 2 0.01 vg 0 2 0.2
+
+.endc
+
+
+
+
+
+**** end user architecture code
+** flattened .save nodes
+.save I(V2)
+.save I(V1)
+.end
diff --git a/xschem/test_res.spice b/xschem/test_res.spice
new file mode 100644
index 0000000..60414af
--- /dev/null
+++ b/xschem/test_res.spice
@@ -0,0 +1,79 @@
+**.subckt test_res P M B
+*.ipin P
+*.ipin M
+*.ipin B
+XR1 M net1 B sky130_fd_pr__res_iso_pw W=2.65 L=2.65 mult=1 m=1
+Vr1 P net1 0
+Vr2 P net2 0
+R2 M net2 B sky130_fd_pr__res_generic_nd W=1 L=1 mult=1 m=1
+Vr3 P net3 0
+R3 M net3 B sky130_fd_pr__res_generic_pd W=1 L=1 mult=1 m=1
+Vr4 P net4 0
+R4 M net4 sky130_fd_pr__res_generic_po W=1 L=1 mult=1 m=1
+Vr5 P net5 0
+XR5 M net5 B sky130_fd_pr__res_high_po W=1 L=1 mult=1 m=1
+Vr6 P net6 0
+XR6 M net6 B sky130_fd_pr__res_high_po_0p35 L=1 mult=1 m=1
+Vr7 P net7 0
+XR7 M net7 B sky130_fd_pr__res_high_po_0p69 L=0.69 mult=1 m=1
+Vr8 P net8 0
+XR8 M net8 B sky130_fd_pr__res_high_po_1p41 L=1.41 mult=1 m=1
+Vr9 P net9 0
+XR9 M net9 B sky130_fd_pr__res_xhigh_po W=1 L=1 mult=1 m=1
+Vr10 P net10 0
+XR10 M net10 B sky130_fd_pr__res_xhigh_po_0p35 L=0.35 mult=1 m=1
+Vr11 P net11 0
+XR11 M net11 B sky130_fd_pr__res_xhigh_po_0p69 L=0.69 mult=1 m=1
+Vr12 P net12 0
+XR12 M net12 B sky130_fd_pr__res_xhigh_po_1p41 L=1.41 mult=1 m=1
+**** begin user architecture code
+
+
+vp P 0 1.8
+vm M 0 0
+vb B 0 0
+.control
+save all
+* dc vp 0 3 0.01
+dc temp -40 140 1
+*plot v(p,m) / vr1#branch
+*plot v(p,m) / vr2#branch
+*plot v(p,m) / vr3#branch
+plot v(p,m) / vr4#branch
+plot v(p,m) / vr5#branch
+plot v(p,m) / vr6#branch
+*plot v(p,m) / vr7#branch
+*plot v(p,m) / vr8#branch
+plot v(p,m) / vr9#branch
+plot v(p,m) / vr10#branch
+*plot v(p,m) / vr11#branch
+*plot v(p,m) / vr12#branch
+
+.endc
+
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+** flattened .save nodes
+.save I(Vr1)
+.save I(Vr2)
+.save I(Vr3)
+.save I(Vr4)
+.save I(Vr5)
+.save I(Vr6)
+.save I(Vr7)
+.save I(Vr8)
+.save I(Vr9)
+.save I(Vr10)
+.save I(Vr11)
+.save I(Vr12)
+.end
diff --git a/xschem/testbank.sch b/xschem/testbank.sch
new file mode 100644
index 0000000..a8e81ca
--- /dev/null
+++ b/xschem/testbank.sch
@@ -0,0 +1,112 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 340 -410 370 -410 { lab=#net1}
+N 340 -510 340 -460 { lab=#net2}
+N 340 -470 370 -470 { lab=#net2}
+N 340 -420 340 -370 { lab=#net1}
+N 240 -490 340 -490 { lab=#net2}
+N 240 -390 340 -390 { lab=#net1}
+N 280 -530 280 -510 { lab=#net3}
+N 280 -370 280 -350 { lab=#net4}
+N 240 -490 240 -470 { lab=#net2}
+N 180 -470 240 -470 { lab=#net2}
+N 240 -410 240 -390 { lab=#net1}
+N 180 -410 240 -410 { lab=#net1}
+N 590 -440 610 -440 { lab=#net5}
+N 590 -420 590 -390 { lab=out1}
+N 590 -390 710 -390 { lab=out1}
+N 590 -490 590 -460 { lab=out2}
+N 590 -490 710 -490 { lab=out2}
+N 580 -330 600 -330 { lab=GND}
+N 500 -330 520 -330 { lab=#net6}
+N 500 -350 500 -330 { lab=#net6}
+N 580 -550 600 -550 { lab=GND}
+N 500 -550 520 -550 { lab=#net7}
+N 500 -550 500 -530 { lab=#net7}
+N 460 -350 460 -330 { lab=GND}
+C {devices/res.sym} 310 -460 1 0 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 310 -420 1 1 {name=R3
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 310 -510 1 0 {name=R4
+value=800
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 310 -370 1 1 {name=R5
+value=800
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 250 -350 1 0 {name=V5 value="1.8"}
+C {devices/gnd.sym} 220 -350 1 0 {name=l8 lab=GND}
+C {devices/vsource.sym} 250 -530 1 0 {name=V6 value="1.8"}
+C {devices/gnd.sym} 220 -530 1 0 {name=l9 lab=GND}
+C {devices/gnd.sym} 280 -420 1 0 {name=l10 lab=GND}
+C {devices/gnd.sym} 280 -460 1 0 {name=l11 lab=GND}
+C {devices/gnd.sym} 460 -330 0 0 {name=l12 lab=GND}
+C {devices/vsource.sym} 460 -560 2 0 {name=V7 value="1.8"}
+C {devices/gnd.sym} 460 -590 2 0 {name=l13 lab=GND}
+C {devices/res.sym} 640 -440 1 1 {name=R6
+value=250
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 700 -440 3 0 {name=V8 value="1.8"}
+C {devices/gnd.sym} 730 -440 3 0 {name=l14 lab=GND}
+C {devices/res.sym} 550 -330 3 0 {name=R7
+value=13k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 600 -330 3 0 {name=l15 lab=GND}
+C {devices/res.sym} 550 -550 3 1 {name=R8
+value=13k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 600 -550 3 1 {name=l16 lab=GND}
+C {devices/vsource.sym} 90 -410 1 0 {name=V9 value="SIN(0 0.2 400000)"}
+C {devices/vsource.sym} 90 -470 1 1 {name=V10 value="SIN(0 0.2 400000 0 0 180)"}
+C {devices/gnd.sym} 60 -470 1 0 {name=l17 lab=GND}
+C {devices/gnd.sym} 60 -410 1 0 {name=l18 lab=GND}
+C {devices/lab_wire.sym} 710 -390 2 0 {name=out1 sig_type=std_logic lab=out1}
+C {devices/lab_wire.sym} 710 -490 0 1 {name=out2 sig_type=std_logic lab=out2}
+C {csfd-abstract.sym} 290 -330 0 0 {name=XLNA1}
+C {devices/capa.sym} 150 -470 1 0 {name=C1
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/capa.sym} 150 -410 1 0 {name=C3
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/code.sym} 810 -420 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} 810 -570 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.0000001s 0.000001s
+.plot v(drain1) v(drain2)
+"}
diff --git a/xschem/testbank.spice b/xschem/testbank.spice
new file mode 100644
index 0000000..3076cfb
--- /dev/null
+++ b/xschem/testbank.spice
@@ -0,0 +1,86 @@
+**.subckt testbank
+R1 net2 GND 1k m=1
+R3 net1 GND 1k m=1
+R4 net2 net3 800 m=1
+R5 net1 net4 800 m=1
+V5 net4 GND 1.8
+V6 net3 GND 1.8
+V7 net8 GND 1.8
+R6 net9 net5 250 m=1
+V8 net9 GND 1.8
+R7 net6 GND 13k m=1
+R8 net7 GND 13k m=1
+V9 net10 GND SIN(0 0.2 400000)
+V10 net11 GND SIN(0 0.2 400000 0 0 180)
+XLNA1 net2 net1 net8 GND out2 out1 net7 net5 net6 csfd-abstract
+C1 net2 net11 500u m=1
+C3 net1 net10 500u m=1
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.0000001s 0.000001s
+.plot v(drain1) v(drain2)
+
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  csfd-abstract.sym # of pins=9
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/csfd-abstract.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/csfd-abstract.sch
+.subckt csfd-abstract  in1 in2 vdd gnd out1 out2 lc1 tc lc2
+*.ipin vdd
+*.ipin in1
+*.ipin in2
+*.ipin gnd
+*.opin out1
+*.opin out2
+*.ipin tc
+*.ipin lc1
+*.ipin lc2
+**** begin user architecture code
+
+
+.tran 0.000001s 0.00001s
+.plot v(drain1) v(drain2)
+
+
+**** end user architecture code
+XM9 out1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM10 out1 in1 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 lc2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 out2 lc2 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM7 lc1 lc1 vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 source tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 tc tc gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 out2 in2 source gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/trans-gate-testbench.sch b/xschem/trans-gate-testbench.sch
new file mode 100644
index 0000000..dfd05db
--- /dev/null
+++ b/xschem/trans-gate-testbench.sch
@@ -0,0 +1,39 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 190 -170 230 -170 { lab=#net1}
+N 290 -260 290 -230 { lab=#net2}
+N 350 -170 420 -170 { lab=output}
+N 290 -110 290 -80 { lab=#net3}
+C {devices/vsource.sym} 160 -170 1 0 {name=V1 value="SIN(0 0.5 40)"}
+C {devices/vsource.sym} 290 -290 2 0 {name=V2 value=1.8}
+C {devices/vsource.sym} 290 -50 0 0 {name=V3 value=0}
+C {devices/gnd.sym} 290 -20 0 0 {name=l1 lab=GND}
+C {devices/gnd.sym} 130 -170 1 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 290 -320 2 0 {name=l3 lab=GND}
+C {devices/code.sym} -40 -140 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} -40 -290 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(output) v(net1)
+.endc
+.save all
+"}
+C {devices/lab_wire.sym} 420 -170 0 1 {name=l4 sig_type=std_logic lab=output}
+C {trans-gate.sym} 200 -60 0 0 {}
diff --git a/xschem/trans-gate-testbench.spice b/xschem/trans-gate-testbench.spice
new file mode 100644
index 0000000..71200ce
--- /dev/null
+++ b/xschem/trans-gate-testbench.spice
@@ -0,0 +1,29 @@
+**.subckt trans-gate-testbench
+V1 net1 GND SIN(0 0.5 40)
+V2 net2 GND 1.8
+V3 net3 GND 0
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  run
+  plot v(output) v(net1)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/trans-gate.sch b/xschem/trans-gate.sch
new file mode 100644
index 0000000..b95887c
--- /dev/null
+++ b/xschem/trans-gate.sch
@@ -0,0 +1,74 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 240 -120 240 -70 { lab=vdd}
+N 240 -120 280 -120 { lab=vdd}
+N 240 -210 240 -160 { lab=GND}
+N 200 -160 240 -160 { lab=GND}
+N 140 -210 210 -210 { lab=input}
+N 140 -210 140 -70 { lab=input}
+N 140 -70 210 -70 { lab=input}
+N 270 -70 330 -70 { lab=output}
+N 330 -210 330 -70 { lab=output}
+N 270 -210 330 -210 { lab=output}
+N 240 -30 240 -10 { lab=#net1}
+N 140 -10 240 -10 { lab=#net1}
+N 240 -270 240 -250 { lab=cntrl}
+N 140 -270 240 -270 { lab=cntrl}
+N -40 -10 -20 -10 { lab=cntrl}
+N -40 -270 -40 -10 { lab=cntrl}
+N -40 -270 140 -270 { lab=cntrl}
+N -60 -140 -40 -140 { lab=cntrl}
+N 90 -140 140 -140 { lab=input}
+N 330 -140 380 -140 { lab=output}
+C {sky130_fd_pr/pfet_01v8.sym} 240 -50 3 0 {name=M1
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet_01v8.sym} 240 -230 1 0 {name=M2
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {invert.sym} -220 300 0 0 {}
+C {devices/gnd.sym} 200 -160 1 0 {name=l1 lab=GND}
+C {devices/ipin.sym} 280 -120 2 0 {name=vdd lab=vdd}
+C {devices/ipin.sym} 50 40 3 0 {name=vdd1 lab=vdd}
+C {devices/ipin.sym} 90 -140 0 0 {name=input lab=input}
+C {devices/ipin.sym} -60 -140 0 0 {name=cntrl lab=cntrl}
+C {devices/opin.sym} 380 -140 0 0 {name=output lab=output}
+C {devices/code.sym} 460 -330 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
diff --git a/xschem/trans-gate.sym b/xschem/trans-gate.sym
new file mode 100644
index 0000000..67aeef4
--- /dev/null
+++ b/xschem/trans-gate.sym
@@ -0,0 +1,28 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+L 4 60 -140 60 -80 {}
+L 4 60 -140 120 -140 {}
+L 4 120 -140 120 -80 {}
+L 4 60 -80 120 -80 {}
+L 4 120 -110 150 -110 {}
+L 4 30 -110 60 -110 {}
+L 4 90 -80 90 -50 {}
+L 4 90 -170 90 -140 {}
+L 4 60 -110 70 -110 {}
+L 4 110 -110 120 -110 {}
+L 4 75 -110 100 -120 {}
+B 5 27.5 -112.5 32.5 -107.5 {name=input dir=in}
+B 5 87.5 -52.5 92.5 -47.5 {name=cntrl dir=in}
+B 5 147.5 -112.5 152.5 -107.5 {name=output dir=out}
+B 5 87.5 -172.5 92.5 -167.5 {name=vdd dir=in}
+A 4 72.5 -110 3.535533905932738 135 360 {}
+A 4 107.5 -110 3.535533905932738 135 360 {}
+T {trans. gate} 120 -160 0 0 0.4 0.4 {}
+T {input} 0 -100 0 0 0.4 0.4 {}
+T {output} 130 -100 0 0 0.4 0.4 {}
+T {vdd} 40 -170 0 0 0.4 0.4 {}
+T {cntrl} 100 -70 0 0 0.4 0.4 {}
diff --git a/xschem/transgate-full.sch b/xschem/transgate-full.sch
new file mode 100644
index 0000000..1ac7df1
--- /dev/null
+++ b/xschem/transgate-full.sch
@@ -0,0 +1,69 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 890 -140 890 -120 { lab=cntrl}
+N 890 -380 890 -360 { lab=#net1}
+N 610 -120 630 -120 { lab=cntrl}
+N 610 -380 610 -120 { lab=cntrl}
+N 740 -250 790 -250 { lab=in}
+N 820 -120 890 -120 { lab=cntrl}
+N 720 -250 740 -250 { lab=in}
+N 630 -120 820 -120 { lab=cntrl}
+N 590 -380 610 -380 { lab=cntrl}
+N 890 -400 890 -380 { lab=#net1}
+N 890 -640 890 -620 { lab=cntrl}
+N 610 -640 890 -640 { lab=cntrl}
+N 610 -640 610 -380 { lab=cntrl}
+N 460 -250 720 -250 { lab=in}
+N 460 -510 790 -510 { lab=in}
+N 460 -510 460 -250 { lab=in}
+N 400 -380 460 -380 { lab=in}
+N 610 -380 650 -380 { lab=cntrl}
+N 780 -380 890 -380 { lab=#net1}
+N 790 -510 820 -510 { lab=in}
+N 890 -460 890 -400 { lab=#net1}
+N 890 -620 890 -570 { lab=cntrl}
+N 890 -570 890 -560 { lab=cntrl}
+N 960 -510 1020 -510 { lab=out1}
+N 790 -250 820 -250 { lab=in}
+N 890 -310 890 -300 { lab=#net1}
+N 890 -360 890 -310 { lab=#net1}
+N 890 -200 890 -140 { lab=cntrl}
+N 960 -250 1020 -250 { lab=out2}
+N 710 -440 710 -420 { lab=vdd}
+N 810 -470 820 -470 { lab=gnd}
+N 810 -470 810 -210 { lab=gnd}
+N 810 -210 820 -210 { lab=gnd}
+N 710 -340 710 -320 { lab=gnd}
+N 710 -320 810 -320 { lab=gnd}
+N 820 -450 860 -450 { lab=vbias}
+N 860 -450 860 -190 { lab=vbias}
+N 820 -190 860 -190 { lab=vbias}
+N 740 -320 740 -300 { lab=gnd}
+N 850 -190 850 -170 { lab=vbias}
+C {devices/code.sym} 140 -470 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {basic-invert.sym} 550 -220 0 0 {name=XI1}
+C {gate-switch.sym} 660 -310 0 0 {name=XTG1}
+C {gate-switch.sym} 660 -50 0 0 {name=XTG2}
+C {devices/ipin.sym} 590 -380 0 0 {name=cntrl lab=cntrl}
+C {devices/ipin.sym} 710 -440 1 0 {name=vdd lab=vdd}
+C {devices/ipin.sym} 400 -380 0 0 {name=in lab=in}
+C {devices/ipin.sym} 740 -300 3 0 {name=gnd lab=gnd}
+C {devices/ipin.sym} 850 -170 3 0 {name=vbias lab=vbias}
+C {devices/opin.sym} 1020 -250 0 0 {name=out2 lab=out2}
+C {devices/opin.sym} 1020 -510 0 0 {name=out1 lab=out1}
diff --git a/xschem/transgate-full.spice b/xschem/transgate-full.spice
new file mode 100644
index 0000000..ab0b8ba
--- /dev/null
+++ b/xschem/transgate-full.spice
@@ -0,0 +1,70 @@
+**.subckt transgate-full cntrl vdd in gnd vbias out2 out1
+*.ipin cntrl
+*.ipin vdd
+*.ipin in
+*.ipin gnd
+*.ipin vbias
+*.opin out2
+*.opin out1
+XI1 vdd gnd net1 cntrl basic-invert
+XTG1 in out1 gnd vbias net1 cntrl gate-switch
+XTG2 in out2 gnd vbias cntrl net1 gate-switch
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  plot v(output)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+
+* expanding   symbol:  basic-invert.sym # of pins=4
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/basic-invert.sch
+.subckt basic-invert  vdd gnd out in
+*.ipin in
+*.ipin gnd
+*.ipin vdd
+*.opin out
+XM1 out in gnd gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 out in vdd vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+
+* expanding   symbol:  gate-switch.sym # of pins=6
+* sym_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sym
+* sch_path: /home/u5921_ryanwan/design/FB1/xschem/gate-switch.sch
+.subckt gate-switch  in out gnd vbias cntrl2 cntrl1
+*.ipin in
+*.ipin vbias
+*.ipin gnd
+*.opin out
+*.ipin cntrl1
+*.ipin cntrl2
+XM5 in cntrl2 out vbias sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 out cntrl1 in gnd sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+.ends
+
+** flattened .save nodes
+.end
diff --git a/xschem/transgate-full.sym b/xschem/transgate-full.sym
new file mode 100644
index 0000000..a1d3650
--- /dev/null
+++ b/xschem/transgate-full.sym
@@ -0,0 +1,46 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=XDTG1"}
+V {}
+S {}
+E {}
+L 4 220 -220 260 -220 {}
+L 4 300 -240 340 -240 {}
+L 4 300 -200 340 -200 {}
+L 4 220 -260 330 -260 {}
+L 4 340 -260 340 -180 {}
+L 4 220 -180 330 -180 {}
+L 4 220 -260 220 -180 {}
+L 4 200 -220 220 -220 {}
+L 4 340 -240 360 -240 {}
+L 4 340 -200 360 -200 {}
+L 4 330 -260 340 -260 {}
+L 4 330 -180 340 -180 {}
+L 4 260 -220 290 -200 {}
+L 4 280 -280 280 -260 {}
+L 4 240 -180 240 -160 {}
+L 4 280 -180 280 -160 {}
+L 4 320 -180 320 -160 {}
+B 4 297.5 -242.5 302.5 -237.5 {}
+B 4 297.5 -202.5 302.5 -197.5 {}
+B 5 197.5 -222.5 202.5 -217.5 {name=in
+dir=in}
+B 5 277.5 -282.5 282.5 -277.5 {name=cntrl
+dir=in}
+B 5 237.5 -162.5 242.5 -157.5 {name=vdd
+dir=in}
+B 5 277.5 -162.5 282.5 -157.5 {name=vbias
+dir=in}
+B 5 317.5 -162.5 322.5 -157.5 {name=gnd
+dir=in}
+B 5 357.5 -202.5 362.5 -197.5 {name=out2
+dir=out}
+B 5 357.5 -242.5 362.5 -237.5 {name=out1
+dir=out}
+T {@name} 225 -255 0 0 0.2 0.2 {}
+T {GND} 322.5 -195 1 0 0.1 0.1 {}
+T {VDD} 242.5 -195 1 0 0.1 0.1 {}
+T {VBIAS} 282.5 -197.5 1 0 0.1 0.1 {}
+T {CTRL} 287.5 -252.5 2 0 0.1 0.1 {}
diff --git a/xschem/untitled-1.sch b/xschem/untitled-1.sch
new file mode 100644
index 0000000..153344d
--- /dev/null
+++ b/xschem/untitled-1.sch
@@ -0,0 +1,70 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+T {NMOS Characterization
+} 330 -370 0 0 0.4 0.4 {}
+N 400 -210 400 -200 { lab=vg}
+N 400 -210 440 -210 { lab=vg}
+N 480 -260 480 -240 { lab=vd}
+N 480 -260 570 -260 { lab=vd}
+N 570 -260 570 -240 { lab=vd}
+N 390 -250 400 -250 { lab=vg}
+N 380 -250 390 -250 { lab=vg}
+N 370 -250 380 -250 { lab=vg}
+N 370 -250 370 -210 { lab=vg}
+N 370 -210 400 -210 { lab=vg}
+N 470 -260 480 -260 { lab=vd}
+N 470 -280 470 -260 { lab=vd}
+N 470 -280 500 -280 { lab=vd}
+C {sky130_fd_pr/nfet3_01v8.sym} 460 -210 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/code_shown.sym} 670 -350 0 0 {name=NGSPICE 
+only_toplevel=false 
+value=".option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v1 0 3 0.01
+
+.control
+  run
+.endc
+
+.save all
+"}
+C {devices/code.sym} 140 -400 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/gnd.sym} 480 -180 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 400 -170 0 0 {name=v1 value=0}
+C {devices/vsource.sym} 570 -210 0 0 {name=v2 value=0.9
+}
+C {devices/gnd.sym} 400 -140 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 570 -180 0 0 {name=l3 lab=GND}
+C {devices/opin.sym} 380 -250 0 0 {name=vg lab=vg}
+C {devices/opin.sym} 480 -280 0 0 {name=vd lab=vd}
diff --git a/xschem/untitled-1.spice b/xschem/untitled-1.spice
new file mode 100644
index 0000000..ac9115b
--- /dev/null
+++ b/xschem/untitled-1.spice
@@ -0,0 +1,36 @@
+**.subckt untitled-1 vg vd
+*.opin vg
+*.opin vd
+XM1 vd vg GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+v1 vg GND 0
+v2 vd GND 0.9
+**** begin user architecture code
+
+.option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v1 0 3 0.01
+
+.control
+  run
+.endc
+
+.save all
+
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/untitled-2.sch b/xschem/untitled-2.sch
new file mode 100644
index 0000000..3f90796
--- /dev/null
+++ b/xschem/untitled-2.sch
@@ -0,0 +1,73 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 240 -370 320 -370 { lab=#net1}
+N 260 -380 260 -370 { lab=#net1}
+N 260 -370 260 -360 { lab=#net1}
+N 360 -430 360 -400 { lab=#net2}
+N 360 -340 360 -310 { lab=#net3}
+N 360 -310 390 -310 { lab=#net3}
+N 320 -310 360 -310 { lab=#net3}
+N 160.000000393216 -370.000000909312 180.000000442368 -370.000000909312 { lab=#net4}
+N 260.000000638976 -460.000001130496 260.000000638976 -440.000001081344 { lab=#net5}
+N 360.000000884736 -510.000001253376 360.000000884736 -490.000001204224 { lab=#net6}
+N 260.000000638976 -540.000001327104 260.000000638976 -520.000001277952 { lab=GND}
+N 360.000000884736 -590.000001449984 360.000000884736 -570.000001400832 { lab=GND}
+N 80.000000196608 -370.000000909312 100.00000024576 -370.000000909312 { lab=#net7}
+N 260.000000638976 -300.00000073728 260.000000638976 -280.000000688128 { lab=#net8}
+N 320.000000786432 -250.0000006144 320.000000786432 -230.000000565248 { lab=#net9}
+N 390.000000958464 -250.0000006144 390.000000958464 -230.000000565248 { lab=#net10}
+N 360.000000884736 -400.00000098304 480.000001179648 -400.00000098304 { lab=#net11}
+C {sky130_fd_pr/nfet3_01v8.sym} 340 -370 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 210 -370 1 0 {name=C1 model=cap_mim_m3_1 W=1 L=1 MF=1 spiceprefix=X}
+C {sky130_fd_pr/res_generic_m1.sym} 260 -330 0 0 {name=R1
+W=1
+L=1
+model=res_generic_m1
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_generic_m1.sym} 260 -410 0 0 {name=R2
+W=1
+L=1
+model=res_generic_m1
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_generic_m1.sym} 360 -460 0 0 {name=R3
+W=1
+L=1
+model=res_generic_m1
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_generic_m1.sym} 390 -280 0 0 {name=R4
+W=1
+L=1
+model=res_generic_m1
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 320 -280 0 0 {name=C2 model=cap_mim_m3_1 W=1 L=1 MF=1 spiceprefix=X}
+C {devices/vsource.sym} 130.000000319488 -370.000000909312 1 0 {name=V1 value=3}
+C {devices/vsource.sym} 260.000000638976 -490.000001204224 2 0 {name=V2 value=3}
+C {devices/vsource.sym} 360.000000884736 -540.000001327104 2 0 {name=V3 value=3}
+C {devices/gnd.sym} 80.00000019660797 -370.000000909312 1 0 {name=l1 lab=GND}
+C {devices/gnd.sym} 260.000000638976 -540.000001327104 2 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 360.000000884736 -590.000001449984 2 0 {name=l3 lab=GND}
+C {devices/gnd.sym} 260.000000638976 -280.000000688128 0 0 {name=l4 lab=GND}
+C {devices/gnd.sym} 320.000000786432 -230.000000565248 0 0 {name=l5 lab=GND}
+C {devices/gnd.sym} 390.000000958464 -230.000000565248 0 0 {name=l6 lab=GND}
diff --git a/xschem/untitled-3.sch b/xschem/untitled-3.sch
new file mode 100644
index 0000000..d8eeb23
--- /dev/null
+++ b/xschem/untitled-3.sch
@@ -0,0 +1,173 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+T {Ir = 45k} 40 120 0 0 0.4 0.4 {}
+N 270 50 290 50 { lab=#net1}
+N 510 -20 510 0 { lab=drain}
+N 510 0 590 0 { lab=drain}
+N 380 -50 410 -50 { lab=#net2}
+N 510 -80 510 -20 { lab=drain}
+N 310 -80 390 -80 { lab=#net3}
+N 390 -80 440 -80 { lab=#net3}
+N 390 -160 390 -140 { lab=#net4}
+N 510 -160 510 -140 { lab=#net5}
+N 430 -110 470 -110 { lab=#net3}
+N 450 -110 450 -80 { lab=#net3}
+N 440 -80 450 -80 { lab=#net3}
+N 410 -50 430 -50 { lab=#net2}
+N 430 -50 430 -30 { lab=#net2}
+N 430 30 430 70 { lab=gate}
+N 430 50 470 50 { lab=gate}
+N 390 50 430 50 { lab=gate}
+N 290 50 330 50 { lab=#net1}
+N 510 -0 510 20 { lab=drain}
+N 510 80 510 110 { lab=source}
+N 510 110 510 140 { lab=source}
+N 510 140 510 160 { lab=source}
+N 430 190 470 190 { lab=#net6}
+N 450 160 450 190 { lab=#net6}
+N 390 160 450 160 { lab=#net6}
+N 300 160 390 160 { lab=#net6}
+N 390 220 390 230 { lab=GND}
+N 390 230 510 230 { lab=GND}
+N 510 220 510 230 { lab=GND}
+C {sky130_fd_pr/nfet3_01v8.sym} 490 50 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/vsource.sym} 270 80 0 1 {name=V1 value="SIN(0 0.25 50)"}
+C {devices/gnd.sym} 270 110 0 0 {name=l1 lab=GND}
+C {devices/capa.sym} 360 50 1 0 {name=C1
+m=1
+value=500u
+footprint=1206
+device="ceramic capacitor"}
+C {devices/res.sym} 430 100 0 0 {name=R1
+value=1k
+footprint=1206
+device=resistor
+m=1}
+C {devices/res.sym} 430 0 0 0 {name=R2
+value=800
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 430 130 0 0 {name=l3 lab=GND}
+C {devices/vsource.sym} 350 -50 1 0 {name=V3 value=1.8}
+C {devices/gnd.sym} 320 -50 1 0 {name=l5 lab=GND}
+C {devices/lab_wire.sym} 590 0 0 1 {name=l6 sig_type=std_logic lab=drain}
+C {devices/lab_wire.sym} 450 50 1 1 {name=l7 sig_type=std_logic lab=gate}
+C {sky130_fd_pr/pfet3_01v8.sym} 490 -110 0 0 {name=M2
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 410 -110 0 1 {name=M3
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/vsource.sym} 510 -190 2 0 {name=V2 value=1.8}
+C {devices/vsource.sym} 390 -190 2 0 {name=V4 value=1.8}
+C {devices/gnd.sym} 510 -220 2 0 {name=l4 lab=GND}
+C {devices/gnd.sym} 390 -220 2 0 {name=l9 lab=GND}
+C {devices/res.sym} 280 -80 1 0 {name=R4
+value=13k
+footprint=1206
+device=resistor
+m=1}
+C {devices/gnd.sym} 250 -80 1 0 {name=l10 lab=GND}
+C {devices/code.sym} 20 -10 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/code.sym} 20 -160 0 0 {name="pepper, chilli, cinnamon" only_toplevel=false value="
+.tran 0.001s 0.1
+.control
+  run
+  plot v(drain) v(gate)
+.endc
+.save all
+"}
+C {devices/lab_wire.sym} 510 110 0 1 {name=l11 sig_type=std_logic lab=source}
+C {sky130_fd_pr/nfet3_01v8.sym} 490 190 0 0 {name=M4
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/nfet3_01v8.sym} 410 190 0 1 {name=M5
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 450 230 0 0 {name=l2 lab=GND}
+C {devices/res.sym} 300 190 0 0 {name=R3
+value=250
+footprint=1206
+device=resistor
+m=1}
+C {devices/vsource.sym} 300 250 0 1 {name=V5 value="1.8"}
+C {devices/gnd.sym} 300 280 0 0 {name=l8 lab=GND}
diff --git a/xschem/untitled-3.spice b/xschem/untitled-3.spice
new file mode 100644
index 0000000..89ace06
--- /dev/null
+++ b/xschem/untitled-3.spice
@@ -0,0 +1,51 @@
+**.subckt untitled-3
+XM1 drain gate source GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V1 net1 GND SIN(0 0.25 50)
+C1 gate net1 500u m=1
+R1 gate GND 1k m=1
+R2 net2 gate 800 m=1
+V3 net2 GND 1.8
+XM2 drain net3 net5 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM3 net3 net3 net4 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V2 net5 GND 1.8
+V4 net4 GND 1.8
+R4 net3 GND 13k m=1
+XM4 source net6 GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM5 net6 net6 GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+R3 net6 net7 250 m=1
+V5 net7 GND 1.8
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1
+.control
+  run
+  plot v(drain) v(gate)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/untitled-4.sch b/xschem/untitled-4.sch
new file mode 100644
index 0000000..9f0eaac
--- /dev/null
+++ b/xschem/untitled-4.sch
@@ -0,0 +1,177 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 420 -410 420 -370 { lab=#net1}
+N 360 -340 380 -340 { lab=#net2}
+N 360 -440 360 -340 { lab=#net2}
+N 360 -440 380 -440 { lab=#net2}
+N 420 -490 420 -470 { lab=#net3}
+N 420 -310 420 -290 { lab=GND}
+N 470 -290 540 -290 { lab=#net4}
+N 470 -290 470 -150 { lab=#net4}
+N 570 -110 570 -90 { lab=#net2}
+N 290 -90 310 -90 { lab=#net2}
+N 270 -390 290 -390 { lab=#net2}
+N 420 -220 470 -220 { lab=#net4}
+N 500 -90 570 -90 { lab=#net2}
+N 390 -490 420 -490 { lab=#net3}
+N 600 -150 680 -150 { lab=out1}
+N 680 -220 680 -150 { lab=out1}
+N 680 -290 680 -220 { lab=out1}
+N 600 -290 680 -290 { lab=out1}
+N 400 -220 420 -220 { lab=#net4}
+N 310 -90 500 -90 { lab=#net2}
+N 540 -260 570 -260 { lab=#net5}
+N 570 -290 570 -260 { lab=#net5}
+N 480 -260 480 -220 { lab=GND}
+N 570 -190 570 -150 { lab=GND}
+N 570 -190 620 -190 { lab=GND}
+N 470 -150 540 -150 { lab=#net4}
+N 470 -630 540 -630 { lab=#net4}
+N 470 -630 470 -490 { lab=#net4}
+N 600 -490 680 -490 { lab=out1}
+N 680 -560 680 -490 { lab=out1}
+N 680 -630 680 -560 { lab=out1}
+N 600 -630 680 -630 { lab=out1}
+N 540 -600 570 -600 { lab=#net6}
+N 570 -630 570 -600 { lab=#net6}
+N 480 -600 480 -560 { lab=GND}
+N 570 -530 570 -490 { lab=GND}
+N 570 -530 620 -530 { lab=GND}
+N 470 -490 540 -490 { lab=#net4}
+N 420 -390 570 -390 { lab=#net1}
+N 570 -450 570 -390 { lab=#net1}
+N 570 -390 570 -330 { lab=#net1}
+N 570 -690 570 -670 { lab=#net2}
+N 290 -690 570 -690 { lab=#net2}
+N 290 -690 290 -90 { lab=#net2}
+N 290 -390 360 -390 { lab=#net2}
+N 160 -220 400 -220 { lab=#net4}
+N 170 -560 470 -560 { lab=#net4}
+N 160 -560 170 -560 { lab=#net4}
+N 160 -560 160 -220 { lab=#net4}
+N 120 -390 160 -390 { lab=#net4}
+C {sky130_fd_pr/nfet3_01v8.sym} 400 -340 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {sky130_fd_pr/pfet3_01v8.sym} 400 -440 0 0 {name=M2
+L=0.15
+W=1
+body=VDD
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 420 -290 0 0 {name=l1 lab=GND}
+C {devices/code.sym} -160 -320 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/vsource.sym} 360 -490 1 0 {name=V1 value="1.8"}
+C {devices/gnd.sym} 330 -490 1 0 {name=l3 lab=GND}
+C {devices/vsource.sym} 510 -260 1 0 {name=V2 value="1.4"}
+C {devices/vsource.sym} 120 -360 0 1 {name=V3 value="SIN(0.4 0.4 40)"}
+C {devices/gnd.sym} 120 -330 0 0 {name=l5 lab=GND}
+C {devices/vsource.sym} 240 -390 1 0 {name=V4 value="1.8"}
+C {devices/gnd.sym} 210 -390 1 0 {name=l6 lab=GND}
+C {devices/code.sym} -160 -170 0 0 {name=s1 only_toplevel=false value="
+.tran 0.001s 0.1s  
+.control
+  plot v(output) 
+.endc
+.save all
+"}
+C {sky130_fd_pr/pfet_01v8.sym} 570 -310 1 0 {name=M3
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 480 -220 0 0 {name=l2 lab=GND}
+C {sky130_fd_pr/nfet_01v8.sym} 570 -130 1 1 {name=M4
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 620 -190 3 0 {name=l4 lab=GND}
+C {devices/vsource.sym} 510 -600 1 0 {name=V6 value="1.4"}
+C {sky130_fd_pr/pfet_01v8.sym} 570 -650 1 0 {name=M7
+L=0.15
+W=1
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=pfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 480 -560 0 0 {name=l12 lab=GND}
+C {sky130_fd_pr/nfet_01v8.sym} 570 -470 1 1 {name=M8
+L=0.15
+W=1
+nf=1 
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/gnd.sym} 620 -530 3 0 {name=l13 lab=GND}
+C {devices/lab_wire.sym} 680 -220 2 0 {name=out1 sig_type=std_logic lab=out1}
+C {devices/lab_wire.sym} 680 -570 2 0 {name=out2 sig_type=std_logic lab=out2}
diff --git a/xschem/untitled-4.spice b/xschem/untitled-4.spice
new file mode 100644
index 0000000..69a31c4
--- /dev/null
+++ b/xschem/untitled-4.spice
@@ -0,0 +1,48 @@
+**.subckt untitled-4
+XM1 net1 net2 GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 net1 net2 net3 VDD sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V1 net3 GND 1.8
+V2 net5 GND 1.4
+V3 net4 GND SIN(0.4 0.4 40)
+V4 net2 GND 1.8
+XM3 net4 net1 out1 net5 sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM4 out1 net2 net4 GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+V6 net6 GND 1.4
+XM7 net4 net2 out2 net6 sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+XM8 out2 net1 net4 GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+
+
+.tran 0.001s 0.1s
+.control
+  plot v(output)
+.endc
+.save all
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/untitled.sch b/xschem/untitled.sch
new file mode 100644
index 0000000..a043f99
--- /dev/null
+++ b/xschem/untitled.sch
@@ -0,0 +1,71 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+T {NMOS Characterization
+} 220 -460 0 0 0.4 0.4 {}
+N 290 -300 290 -290 { lab=vg}
+N 290 -300 330 -300 { lab=vg}
+N 370 -350 370 -330 { lab=vd}
+N 370 -350 460 -350 { lab=vd}
+N 460 -350 460 -330 { lab=vd}
+N 280 -340 290 -340 { lab=vg}
+N 270 -340 280 -340 { lab=vg}
+N 260 -340 270 -340 { lab=vg}
+N 260 -340 260 -300 { lab=vg}
+N 260 -300 290 -300 { lab=vg}
+N 360 -350 370 -350 { lab=vd}
+N 360 -370 360 -350 { lab=vd}
+N 360 -370 390 -370 { lab=vd}
+C {sky130_fd_pr/nfet3_01v8.sym} 350 -300 0 0 {name=M1
+L=0.15
+W=1
+body=GND
+nf=1
+mult=1
+ad="'int((nf+1)/2) * W/nf * 0.29'" 
+pd="'2*int((nf+1)/2) * (W/nf + 0.29)'"
+as="'int((nf+2)/2) * W/nf * 0.29'" 
+ps="'2*int((nf+2)/2) * (W/nf + 0.29)'"
+nrd="'0.29 / W'" nrs="'0.29 / W'"
+sa=0 sb=0 sd=0
+model=nfet_01v8
+spiceprefix=X
+}
+C {devices/code_shown.sym} 560 -440 0 0 {name=NGSPICE 
+only_toplevel=false 
+value=".option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v1 0 3 0.01
+
+.control
+  run
+  plot (-i(v2))
+.endc
+
+.save all
+"}
+C {devices/code.sym} 30 -490 0 0 {name=TT_MODELS
+only_toplevel=true
+format="tcleval( @value )"
+value="** manual skywater pdks install (with patches applied)
+* .lib \\\\$::SKYWATER_MODELS\\\\/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib \\\\$::SKYWATER_MODELS\\\\/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+"
+spice_ignore=false}
+C {devices/gnd.sym} 370 -270 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 290 -260 0 0 {name=v1 value=0}
+C {devices/vsource.sym} 460 -300 0 0 {name=v2 value=0.9
+}
+C {devices/gnd.sym} 290 -230 0 0 {name=l2 lab=GND}
+C {devices/gnd.sym} 460 -270 0 0 {name=l3 lab=GND}
+C {devices/opin.sym} 270 -340 0 0 {name=vg lab=vg}
+C {devices/opin.sym} 370 -370 0 0 {name=vd lab=vd}
diff --git a/xschem/untitled.spice b/xschem/untitled.spice
new file mode 100644
index 0000000..d9523b3
--- /dev/null
+++ b/xschem/untitled.spice
@@ -0,0 +1,37 @@
+**.subckt untitled vg vd
+*.opin vg
+*.opin vd
+XM1 vd vg GND GND sky130_fd_pr__nfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29'
++ pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W'
++ sa=0 sb=0 sd=0 mult=1 m=1 
+v1 vg GND 0
+v2 vd GND 0.9
+**** begin user architecture code
+
+.option TEMP=27C
+.option dccap post brief accurate nomod
+
+.dc v1 0 3 0.01
+
+.control
+  run
+  plot (-i(v2))
+.endc
+
+.save all
+
+
+ ** manual skywater pdks install (with patches applied)
+* .lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/models/sky130.lib.spice tt
+
+** opencircuitdesign pdks install
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+
+.param mc_mm_switch=0
+.param mc_pr_switch=0
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+** flattened .save nodes
+.end
diff --git a/xschem/waveforms.lxt b/xschem/waveforms.lxt
new file mode 100644
index 0000000..ea59ef9
--- /dev/null
+++ b/xschem/waveforms.lxt
Binary files differ
diff --git a/xschem/xschemrc b/xschem/xschemrc
index ca6e33e..8a6cdac 100644
--- a/xschem/xschemrc
+++ b/xschem/xschemrc
@@ -25,17 +25,13 @@
 # /home/schippes/share/doc/xschem/pcb
 # /home/schippes/share/doc/xschem/rom8k
 
-#### Allow user environment to override the path to the PDK
-if {[catch {set PDKPATH $env(PDKPATH)}]} {
-    set PDKPATH "/usr/share/pdk/sky130A"
-}
 #### Flush any previous definition
 set XSCHEM_LIBRARY_PATH {}
 #### include devices/*.sym
 append XSCHEM_LIBRARY_PATH ${XSCHEM_SHAREDIR}/xschem_library
 #### include skywater libraries. Here i use [pwd]. This works if i start xschem from here.
 append XSCHEM_LIBRARY_PATH :$env(PWD)
-append XSCHEM_LIBRARY_PATH :$PDKPATH/libs.tech/xschem
+append XSCHEM_LIBRARY_PATH :/ef/tech/SW.2/sky130A/libs.tech/xschem
 # append XSCHEM_LIBRARY_PATH :/mnt/sda7/home/schippes/pdks/sky130A/libs.tech/xschem
 #### add ~/.xschem/xschem_library (USER_CONF_DIR is normally ~/.xschem)
 append XSCHEM_LIBRARY_PATH :$USER_CONF_DIR/xschem_library 
@@ -253,14 +249,6 @@
 # set xschem_listen_port 2021
 
 ###########################################################################
-#### BESPICE WAVE SOCKET CONNECTION
-###########################################################################
-#### set bespice wave listening port; default: not enabled
-set bespice_listen_port 2022
-
-
-
-###########################################################################
 #### UTILE SPICE STIMULI DESCRIPTION LANGUAGE AND TRANSLATOR
 ###########################################################################
 #### default paths are set as shown here: 
@@ -273,7 +261,7 @@
 #### list of tcl files to preload.
 # lappend tcl_files ${XSCHEM_SHAREDIR}/change_index.tcl
 lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl
-lappend tcl_files $PDKPATH/libs.tech/xschem/scripts/sky130_models.tcl
+lappend tcl_files /ef/tech/SW.2/sky130A/libs.tech/xschem/scripts/sky130_models.tcl
 ###########################################################################
 #### XSCHEM TOOLBAR
 ###########################################################################
@@ -289,8 +277,6 @@
 # set SKYWATER_MODELS ~/skywater-pdk/libraries/sky130_fd_pr_ngspice/latest
 # set SKYWATER_STDCELLS ~/skywater-pdk/libraries/sky130_fd_sc_hd/latest
 
-## opencircuitdesign pdks install. You need to change these to point to your open_pdks installation
-# set SKYWATER_MODELS /usr/local/share/pdk/sky130A/libs.tech/ngspice
-# set SKYWATER_STDCELLS /usr/local/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/spice
-set SKYWATER_MODELS $PDKPATH/libs.tech/ngspice
-set SKYWATER_STDCELLS $PDKPATH/libs.ref/sky130_fd_sc_hd/spice
+## opencircuitdesign pdks install
+set SKYWATER_MODELS /ef/tech/SW.2/sky130A/libs.tech/ngspice
+set SKYWATER_STDCELLS /ef/tech/SW.2/sky130A/libs.ref/spi/sky130_fd_sc_hd
diff --git a/xschem/zero_opamp.spice b/xschem/zero_opamp.spice
new file mode 100644
index 0000000..92288b9
--- /dev/null
+++ b/xschem/zero_opamp.spice
@@ -0,0 +1,111 @@
+**.subckt zero_opamp PLUS MINUS EN_N VSS VCC DIFFOUT ADJ
+*.ipin PLUS
+*.ipin MINUS
+*.ipin EN_N
+*.ipin VSS
+*.ipin VCC
+*.opin DIFFOUT
+*.ipin ADJ
+C6 G1 0 2f m=1
+XM4 net6 EN_N VCC VCC sky130_fd_pr__pfet_01v8 L=8 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM18 G2 G2 VSS VSS sky130_fd_pr__nfet_01v8_lvt L=4 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM2 G1 G1 VSS VSS sky130_fd_pr__nfet_01v8_lvt L=4 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM20 G2 PLUS net7 VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=4 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM6 G1 MINUS net8 VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=4 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+v1 SP net8 0
+C4 SP 0 2f m=1
+C1 G2 0 2f m=1
+C5 DIFFOUT 0 4f m=1
+XM11 DIFFOUT G2 net1 VSS sky130_fd_pr__nfet_01v8_lvt L=4 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+v2 SP net7 0
+v4 net1 VSS 0
+v6 net6 SP 0
+XM7 DIFFOUT EN_N VSS VSS sky130_fd_pr__nfet_01v8 L=0.15 W=0.5 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=3 m=3 
+XM46 net9 EN_N VCC VCC sky130_fd_pr__pfet_01v8 L=0.15 W=5 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+v17 net9 net3 0
+XM53 net2 G1 VSS VSS sky130_fd_pr__nfet_01v8_lvt L=4 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM54 net2 net2 net3 VCC sky130_fd_pr__pfet_01v8_lvt L=4 W=4 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM55 DIFFOUT net2 net3 VCC sky130_fd_pr__pfet_01v8_lvt L=4 W=4 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM8 G1 ADJ net4 VCC sky130_fd_pr__pfet_01v8_lvt L=1 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM9 G1 ADJ net5 VSS sky130_fd_pr__nfet_01v8_lvt L=1 W=0.5 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM10 net5 VCC VSS VSS sky130_fd_pr__nfet_01v8_lvt L=8 W=0.5 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
++ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+XM1 net4 EN_N VCC VCC sky130_fd_pr__pfet_01v8 L=8 W=1 nf=1 ad='W * 0.29' as='W * 0.29' pd='W + 2 * 0.29'
++ ps='W + 2 * 0.29' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1 
+**** begin user architecture code
+
+.lib /ef/tech/SW.2/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+* Mismatch parameters
+* Resistor/ef/tech/SW.2/sky130A/libs.tech/ngspice/Capacitor
+* Special cells
+* All models
+* Corner
+
+**** end user architecture code
+**.ends
+**** begin user architecture code
+
+* .option SCALE=1e-6
+.option method=gear seed=12
+
+* this experimental option enables mos model bin
+* selection based on W/NF instead of W
+.option wnflag=1
+
+.param VCC=1.8
+* .param VCCGAUSS=agauss(1.8, 0.05, 1)
+* .param VCC=VCCGAUSS
+.param VDL=0.7
+.param ABSVAR=0.02
+.temp 25
+
+** to generate following file:
+** copy .../xschem_sky130/sky130_tests/stimuli.test_comparator to simulation directory
+** then do 'Simulation->Utile Stimuli Editor (GUI)' and press 'Translate'
+.include "stimuli_bandgap_opamp.cir"
+
+** variation marameters:
+* .param sky130_fd_pr__nfet_01v8_lvt__vth0_slope_spectre='agauss(0, ABSVAR, 3)/sky130_fd_pr__nfet_01v8_lvt__vth0_slope'
+* .param sky130_fd_pr__pfet_01v8_lvt__vth0_slope_spectre='agauss(0, ABSVAR, 3)/sky130_fd_pr__pfet_01v8_lvt__vth0_slope'
+
+* .tran 0.1n 900n uic
+
+.control
+  let run=1
+  dowhile run <= 1
+    if run > 1
+      reset
+      set appendwrite
+    end
+    save all
+    * save saout cal i(vvcc) en plus minus
+    tran 1n 10000n uic
+    plot saout
+    plot plus minus
+    write bandgap_opamp.raw
+    let run = run + 1
+  end
+.endc
+
+
+**** end user architecture code
+** flattened .save nodes
+.save I(v1)
+.save I(v2)
+.save I(v4)
+.save I(v6)
+.save I(v17)
+.end