pull the test circuit out into a subckt and make a testbench for it. getting ready to layout and lvs just the cell.
diff --git a/xschem/cellA.sch b/xschem/cellA.sch
index 41d402d..547f6a3 100644
--- a/xschem/cellA.sch
+++ b/xschem/cellA.sch
@@ -7,22 +7,16 @@
B 5 1677.5 -292.5 1682.5 -287.5 {name=XXX
dir=inout}
T {9084ohm} 1760 -410 0 0 0.4 0.4 {}
-N 1670 -290 1670 -280 { lab=GND}
-N 1670 -290 1670 -260 { lab=GND}
-N 1550 -270 1670 -270 { lab=GND}
-N 1500 -340 1500 -270 { lab=GND}
-N 1500 -270 1550 -270 { lab=GND}
-N 1600 -320 1630 -320 { lab=vin}
-N 1600 -340 1600 -320 { lab=vin}
-N 1550 -340 1600 -340 { lab=vin}
-N 1550 -340 1550 -330 { lab=vin}
-N 1670 -390 1670 -350 { lab=vout}
-N 1500 -480 1500 -400 { lab=#net1}
-N 1500 -480 1670 -480 { lab=#net1}
-N 1670 -480 1670 -450 { lab=#net1}
-N 1590 -360 1590 -340 { lab=vin}
-N 1590 -360 1590 -350 { lab=vin}
+N 1670 -390 1670 -350 { lab=out}
N 1630 -420 1650 -420 { lab=GND}
+N 1600 -320 1630 -320 { lab=in}
+N 1590 -320 1600 -320 { lab=in}
+N 1670 -370 1700 -370 { lab=out}
+N 1670 -480 1670 -450 { lab=VDD}
+N 1670 -480 1690 -480 { lab=VDD}
+N 1670 -290 1680 -290 { lab=VSS}
+N 1670 -290 1670 -250 { lab=VSS}
+N 1670 -250 1690 -250 { lab=VSS}
C {sky130_fd_pr/nfet3_g5v0d10v5.sym} 1650 -320 0 0 {name=M3
L=0.8
W=2
@@ -38,24 +32,14 @@
model=nfet_g5v0d10v5
spiceprefix=X
}
-C {devices/gnd.sym} 1670 -260 0 0 {name=l1 lab=GND}
-C {devices/vsource.sym} 1550 -300 0 0 {name=V1 value="sin 2 .1 1000"}
C {sky130_fd_pr/res_high_po_0p35.sym} 1670 -420 0 0 {name=R1
W=0.35
L=20
model=res_high_po_0p35
spiceprefix=X
mult=1}
-C {devices/vsource.sym} 1500 -370 0 0 {name=V2 value=7
-}
-C {devices/lab_pin.sym} 1670 -370 0 0 {name=l2 sig_type=std_logic lab=vout}
-C {devices/lab_pin.sym} 1590 -360 0 0 {name=l3 sig_type=std_logic lab=vin
-}
C {devices/gnd.sym} 1630 -420 0 0 {name=l4 lab=GND}
-C {devices/code_shown.sym} 1320 -170 0 0 {name=s1 only_toplevel=false value=".param mc_mm_switch=0
-.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"}
-C {devices/code_shown.sym} 1320 -60 0 0 {name=s2 only_toplevel=false value=".control
-tran 1u 20m
-plot V(vin) V(vout)
-.endc"}
+C {devices/ipin.sym} 1590 -320 0 0 {name=p1 lab=in}
+C {devices/iopin.sym} 1690 -480 0 0 {name=p2 lab=VDD}
+C {devices/opin.sym} 1700 -370 0 0 {name=p3 lab=out}
+C {devices/iopin.sym} 1690 -250 0 0 {name=p4 lab=VSS}
diff --git a/xschem/cellA.sym b/xschem/cellA.sym
new file mode 100644
index 0000000..5a0d1f4
--- /dev/null
+++ b/xschem/cellA.sym
@@ -0,0 +1,24 @@
+v {xschem version=2.9.9 file_version=1.2}
+K {type=subcircuit
+format="@name @pinlist @symname"
+template="name=x1"
+}
+
+T {@symname} -40.5 -6 0 0 0.3 0.3 {}
+T {@name} 135 -42 0 0 0.2 0.2 {}
+L 4 -130 -30 130 -30 {}
+L 4 -130 30 130 30 {}
+L 4 -130 -30 -130 30 {}
+L 4 130 -30 130 30 {}
+B 5 147.5 -22.5 152.5 -17.5 {name=VDD dir=inout }
+L 7 130 -20 150 -20 {}
+T {VDD} 125 -24 0 1 0.2 0.2 {}
+B 5 147.5 -2.5 152.5 2.5 {name=out dir=out }
+L 4 130 0 150 0 {}
+T {out} 125 -4 0 1 0.2 0.2 {}
+B 5 -152.5 -22.5 -147.5 -17.5 {name=in dir=in }
+L 4 -150 -20 -130 -20 {}
+T {in} -125 -24 0 0 0.2 0.2 {}
+B 5 147.5 17.5 152.5 22.5 {name=VSS dir=inout }
+L 7 130 20 150 20 {}
+T {VSS} 125 16 0 1 0.2 0.2 {}
diff --git a/xschem/cellA_tb.sch b/xschem/cellA_tb.sch
new file mode 100644
index 0000000..f0a56b9
--- /dev/null
+++ b/xschem/cellA_tb.sch
@@ -0,0 +1,40 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 1550 -270 1670 -270 { lab=GND}
+N 1500 -340 1500 -270 { lab=GND}
+N 1500 -270 1550 -270 { lab=GND}
+N 1550 -340 1600 -340 { lab=vin}
+N 1550 -340 1550 -330 { lab=vin}
+N 1500 -480 1500 -400 { lab=#net1}
+N 1500 -480 1670 -480 { lab=#net1}
+N 1590 -360 1590 -340 { lab=vin}
+N 1590 -360 1590 -350 { lab=vin}
+N 1630 -390 1630 -340 { lab=vin}
+N 1600 -340 1630 -340 { lab=vin}
+N 1670 -480 1950 -480 { lab=#net1}
+N 1950 -480 1950 -390 { lab=#net1}
+N 1930 -390 1950 -390 { lab=#net1}
+N 1930 -350 1950 -350 { lab=GND}
+N 1950 -350 1950 -340 { lab=GND}
+N 1930 -370 1960 -370 { lab=vin}
+C {devices/gnd.sym} 1670 -270 0 0 {name=l1 lab=GND}
+C {devices/vsource.sym} 1550 -300 0 0 {name=V1 value="sin 2 .1 1000"}
+C {devices/vsource.sym} 1500 -370 0 0 {name=V2 value=7
+}
+C {devices/lab_pin.sym} 1590 -360 0 0 {name=l3 sig_type=std_logic lab=vin
+}
+C {devices/code_shown.sym} 1320 -170 0 0 {name=s1 only_toplevel=false value=".param mc_mm_switch=0
+.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"}
+C {devices/code_shown.sym} 1320 -60 0 0 {name=s2 only_toplevel=false value=".control
+tran 1u 20m
+plot V(vin) V(vout)
+.endc"}
+C {cellA.sym} 1780 -370 0 0 {name=x1}
+C {devices/gnd.sym} 1950 -340 0 0 {name=l2 lab=GND}
+C {devices/lab_pin.sym} 1960 -370 2 0 {name=l4 sig_type=std_logic lab=vout
+}
diff --git a/xschem/cellA_tb.spice b/xschem/cellA_tb.spice
new file mode 100644
index 0000000..968179a
--- /dev/null
+++ b/xschem/cellA_tb.spice
@@ -0,0 +1,36 @@
+**.subckt cellA_tb
+V1 vin GND sin 2 .1 1000
+V2 net1 GND 7
+x1 net1 vout vin GND cellA
+**** begin user architecture code
+
+.param mc_mm_switch=0
+.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(vin) V(vout)
+.endc
+
+**** end user architecture code
+**.ends
+
+* expanding symbol: cellA.sym # of pins=4
+* sym_path: /home/malvira/repos/asic/projects/vlsi-sky130-analog-caravel-test1/xschem/cellA.sym
+* sch_path: /home/malvira/repos/asic/projects/vlsi-sky130-analog-caravel-test1/xschem/cellA.sch
+.subckt cellA VDD out in VSS
+*.ipin in
+*.iopin VDD
+*.opin out
+*.iopin VSS
+XM3 out in VSS GND 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 out VDD GND sky130_fd_pr__res_high_po_0p35 W=0.35 L=20 mult=1 m=1
+.ends
+
+.GLOBAL GND
+** flattened .save nodes
+.end