fixed lvs with hvtgate
diff --git a/xschem/hv_tgate.sch b/xschem/hv_tgate.sch
index dc79a40..6ccae6a 100644
--- a/xschem/hv_tgate.sch
+++ b/xschem/hv_tgate.sch
@@ -9,19 +9,19 @@
 N 380 -430 380 -370 { lab=VHVPWR}
 N 380 -270 380 -220 { lab=VGND}
 N 380 -270 450 -270 { lab=VGND}
-N 380 -510 380 -470 { lab=pgate}
+N 380 -510 380 -470 { lab=not_pgate}
 N 290 -180 380 -180 { lab=pgate}
 N -190 -420 -190 -400 { lab=VGND}
 N -190 -400 -30 -400 { lab=VGND}
 N -30 -420 -30 -400 { lab=VGND}
-N -190 -600 -190 -480 { lab=pgate}
+N -190 -600 -190 -480 { lab=not_pgate}
 N -30 -600 -30 -480 { lab=pgate}
 N -150 -630 -120 -630 { lab=pgate}
 N -120 -630 -120 -580 { lab=pgate}
 N -120 -580 -30 -580 { lab=pgate}
-N -110 -630 -70 -630 { lab=pgate}
-N -190 -570 -110 -570 { lab=pgate}
-N -110 -630 -110 -570 { lab=pgate}
+N -110 -630 -70 -630 { lab=not_pgate}
+N -190 -570 -110 -570 { lab=not_pgate}
+N -110 -630 -110 -570 { lab=not_pgate}
 N -190 -690 -190 -660 { lab=VHVPWR}
 N -190 -690 -30 -690 { lab=VHVPWR}
 N -30 -690 -30 -660 { lab=VHVPWR}
@@ -39,7 +39,7 @@
 N -390 -290 -70 -290 { lab=S_NOT}
 N -70 -450 -70 -290 { lab=S_NOT}
 N -470 -450 -230 -450 { lab=S}
-N -190 -510 380 -510 { lab=pgate}
+N -190 -510 380 -510 { lab=not_pgate}
 N 290 -490 290 -180 { lab=pgate}
 N -30 -490 290 -490 { lab=pgate}
 N -470 -290 -390 -290 { lab=S_NOT}
@@ -48,6 +48,8 @@
 N 410 -320 480 -320 { lab=B}
 N -40 -400 -40 -340 { lab=VGND}
 N 380 -370 450 -370 { lab=VHVPWR}
+N -40 -340 -30 -340 {
+lab=VGND}
 C {devices/lab_wire.sym} 450 -370 2 0 {name=l2 lab=VHVPWR}
 C {devices/lab_wire.sym} 230 -510 0 0 {name=l13 lab=not_pgate}
 C {devices/lab_wire.sym} 160 -490 0 0 {name=l3 lab=pgate}
diff --git a/xschem/hv_tgate.sym b/xschem/hv_tgate.sym
index 6e1cdab..386689c 100644
--- a/xschem/hv_tgate.sym
+++ b/xschem/hv_tgate.sym
@@ -23,14 +23,14 @@
 L 4 -40 40 0 20 {}
 L 4 -0 -50 -0 -20 {}
 L 4 -0 30 -0 50 {}
-L 4 30 60 30 80 {}
 L 4 30 -80 30 -60 {}
+L 4 30 60 30 80 {}
 B 5 -2.5 47.5 2.5 52.5 {name=S_NOT dir=in }
-B 5 27.5 77.5 32.5 82.5 {name=VGND dir=inout}
 B 5 27.5 -82.5 32.5 -77.5 {name=VHVPWR dir=inout}
 B 5 -62.5 -2.5 -57.5 2.5 {name=A dir=inout}
 B 5 57.5 -2.5 62.5 2.5 {name=B dir=inout }
 B 5 -2.5 -52.5 2.5 -47.5 {name=S dir=in }
+B 5 27.5 77.5 32.5 82.5 {name=VGND dir=inout}
 A 4 0.3125 24.4375 4.448489912318562 94.02826366648515 351.9434726670297 {}
 T {@name} 45 -32 0 0 0.2 0.2 {}
 T {S_NOT} -35 36 0 0 0.2 0.2 {}
diff --git a/xschem/user_analog_project_wrapper.sch b/xschem/user_analog_project_wrapper.sch
index 7ba95f1..61172a9 100644
--- a/xschem/user_analog_project_wrapper.sch
+++ b/xschem/user_analog_project_wrapper.sch
@@ -41,24 +41,28 @@
 lab=#net1}
 N 910 -979 1000 -979 {
 lab=gpio_noesd[0]}
-N 357 -497 357 -452 { lab=#net2}
-N 222 -372 267 -372 { lab=gpio_analog[11]}
-N 327 -452 327 -422 { lab=gpio_analog[9]}
-N 387 -372 437 -372 { lab=gpio_analog[12]}
 N 480 -1020 845 -1020 {
 lab=#net1}
 N 845 -1020 910 -1020 {
 lab=#net1}
 N 910 -1020 910 -1019 {
 lab=#net1}
-N 357 -292 357 -226 {
-lab=#net3}
-N 327 -322 327 -291 {
-lab=gpio_analog[10]}
 N 1090 -319 1090 -259 {
 lab=vssd2}
 N 1090 -539 1090 -439 {
 lab=vccd2}
+N 220 -360 260 -360 {
+lab=gpio_analog[11]}
+N 320 -440 320 -410 {
+lab=gpio_analog[9]}
+N 350 -490 350 -440 {
+lab=vdda1}
+N 380 -360 430 -360 {
+lab=gpio_analog[12]}
+N 320 -310 320 -280 {
+lab=gpio_analog[10]}
+N 350 -280 350 -240 {
+lab=vssa1}
 C {devices/lab_pin.sym} -430 -540 2 0 {name=l1 lab=io_analog[1]}
 C {devices/lab_pin.sym} -510 -540 0 0 {name=l2 lab=io_analog[0]}
 C {devices/lab_pin.sym} -580 -380 0 0 {name=l3 lab=io_analog[4]}
@@ -114,14 +118,12 @@
 }
 C {devices/lab_pin.sym} 1230 -999 2 0 {name=l28 sig_type=std_logic lab=gpio_noesd[0]}
 C {sky130_sc_ams__ota_1.sym} 1080 -999 0 0 {name=x3}
-C {devices/lab_pin.sym} 1090 -879 0 0 {name=l17 sig_type=std_logic lab=vssd1}
-C {hv_tgate.sym} 327 -372 0 0 {name=x8}
-C {devices/lab_pin.sym} 357.1199999999999 -497.6099999999999 3 1 {name=l49 lab=vdda1}
-C {devices/lab_pin.sym} 357.3599999999999 -226.63 0 1 {name=l50 lab=vssa1}
-C {devices/lab_pin.sym} 222 -372 0 0 {name=l51 sig_type=std_logic lab=gpio_analog[11]}
-C {devices/lab_pin.sym} 327 -452 1 0 {name=l52 sig_type=std_logic lab=gpio_analog[9]}
-C {devices/lab_pin.sym} 327 -292 3 0 {name=l53 sig_type=std_logic lab=gpio_analog[10]}
-C {devices/lab_pin.sym} 437 -372 2 0 {name=l54 sig_type=std_logic lab=gpio_analog[12]}
+C {devices/lab_pin.sym} 1090 -880 0 0 {name=l17 sig_type=std_logic lab=vssd1}
+C {devices/lab_pin.sym} 350 -490 3 1 {name=l49 lab=vdda1}
+C {devices/lab_pin.sym} 220 -360 0 0 {name=l51 sig_type=std_logic lab=gpio_analog[11]}
+C {devices/lab_pin.sym} 320 -440 1 0 {name=l52 sig_type=std_logic lab=gpio_analog[9]}
+C {devices/lab_pin.sym} 320 -280 3 0 {name=l53 sig_type=std_logic lab=gpio_analog[10]}
+C {devices/lab_pin.sym} 430 -360 2 0 {name=l54 sig_type=std_logic lab=gpio_analog[12]}
 C {devices/lab_pin.sym} 1090 -1159 0 0 {name=l55 sig_type=std_logic lab=vccd1
 }
 C {devices/lab_pin.sym} 120 -980 0 0 {name=l8 sig_type=std_logic lab=io_analog[6]}
@@ -133,3 +135,5 @@
 C {devices/lab_pin.sym} 1000 -399 0 0 {name=l12 sig_type=std_logic lab=gpio_noesd[13]}
 C {devices/lab_pin.sym} 1000 -359 0 0 {name=l13 sig_type=std_logic lab=gpio_noesd[14]}
 C {devices/lab_pin.sym} 1160 -379 0 1 {name=l14 sig_type=std_logic lab=gpio_noesd[15]}
+C {devices/lab_pin.sym} 350 -240 3 0 {name=l15 lab=vssa1}
+C {hv_tgate.sym} 320 -360 0 0 {name=x6}
diff --git a/xschem/user_analog_project_wrapper.spice b/xschem/user_analog_project_wrapper.spice
index f5b7304..f112142 100644
--- a/xschem/user_analog_project_wrapper.spice
+++ b/xschem/user_analog_project_wrapper.spice
@@ -64,8 +64,8 @@
 x4 io_analog[10] io_analog[8] vssa2 io_analog[9] FG_pfet
 x5 gpio_analog[1] gpio_analog[2] io_analog[6] net1 vccd1 vssd1 C4
 x3 vccd1 vssd1 net1 gpio_noesd[0] gpio_noesd[0] sky130_sc_ams__ota_1
-x8 gpio_analog[10] net3 net2 gpio_analog[11] gpio_analog[12] gpio_analog[9] hv_tgate
 x2 vccd2 vssd2 gpio_noesd[13] gpio_noesd[14] gpio_noesd[15] sky130_sc_ams__ota_1
+x6 gpio_analog[10] vdda1 gpio_analog[11] gpio_analog[12] gpio_analog[9] vssa1 hv_tgate
 **.ends
 
 * expanding   symbol:  1T1R_2x2.sym # of pins=7
@@ -236,7 +236,7 @@
 * expanding   symbol:  hv_tgate.sym # of pins=6
 ** sym_path: /home/carl/IC/mpw7/caravel_user_project_analog/xschem/hv_tgate.sym
 ** sch_path: /home/carl/IC/mpw7/caravel_user_project_analog/xschem/hv_tgate.sch
-.subckt hv_tgate  S_NOT VGND VHVPWR A B S
+.subckt hv_tgate  S_NOT VHVPWR A B S VGND
 *.ipin S
 *.ipin S_NOT
 *.iopin VHVPWR