Merge branch 'main' of https://github.com/mabrains/caravel_user_project_ldo into main
diff --git a/Makefile b/Makefile
index d97988b..2e7e533 100644
--- a/Makefile
+++ b/Makefile
@@ -140,7 +140,7 @@
 	$(eval INPUT_DIRECTORY := $(shell pwd))
 	cd $(PRECHECK_ROOT) && \
 	docker run -e INPUT_DIRECTORY=$(INPUT_DIRECTORY) -e PDK_ROOT=$(PDK_ROOT) -e CARAVEL_ROOT=$(CARAVEL_ROOT) -v $(PRECHECK_ROOT):$(PRECHECK_ROOT) -v $(INPUT_DIRECTORY):$(INPUT_DIRECTORY) -v $(PDK_ROOT):$(PDK_ROOT) -v $(CARAVEL_ROOT):$(CARAVEL_ROOT) \
-	-u $(shell id -u $(USER)):$(shell id -g $(USER)) efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --pdk_root $(PDK_ROOT) --input_directory $(INPUT_DIRECTORY) --caravel_root $(CARAVEL_ROOT)"
+	-u 0 efabless/mpw_precheck:latest bash -c "cd $(PRECHECK_ROOT) ; python3 mpw_precheck.py --pdk_root $(PDK_ROOT) --input_directory $(INPUT_DIRECTORY) --caravel_root $(CARAVEL_ROOT)"
 
 # Install PDK using OL's Docker Image
 .PHONY: pdk-nonnative
diff --git a/README.md b/README.md
index 6f0ae63..0e947f1 100644
--- a/README.md
+++ b/README.md
@@ -3,14 +3,100 @@
 [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![CI](https://github.com/efabless/caravel_user_project_analog/actions/workflows/user_project_ci.yml/badge.svg)](https://github.com/efabless/caravel_user_project_analog/actions/workflows/user_project_ci.yml) [![Caravan Build](https://github.com/efabless/caravel_user_project_analog/actions/workflows/caravan_build.yml/badge.svg)](https://github.com/efabless/caravel_user_project_analog/actions/workflows/caravan_build.yml)
 
 
-
-## LDO Design
 This is a caravel that has an LDO Design implemented on Skywaters 130nm technology.
 
-### Circuit Design
-The implementation of the LDO is as follows.
+## Circuit Design
+The implementation of the LDO is as follows
 
-### Layout Design
+### Schematic
+
+![Image of LDO schematic](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/Testbench_schematic.png)
+
+### Error Amplifier 
+
+![Image of LDO_Error amplifier](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/Error_Amp.png)
+
+### Bandgap
+
+![Image of LDO_BGR](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/Bandgap_symbol.png)
+
+
+## LDO Simulation
+
+We have an enable switch so all the following analysis when the enable signal is high.
+
+### a. DC analysis
+
+We used dc analysis for displaying the operating point for proper biasing of transistors and also dc sweep of output voltage against variations in supply and temprature to calculate dropout voltage,line regulation,temperature coefficient.
+
+### Supply variation
+We made dc sweep on the supply and plotted voltage of the output node and vdd node overlaid on the same plot
+@Load current = 0.1mA
+![Image of LDO_Vout_vs_Vin](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/vddsweep100u.png)
+
+@Load current = 10mA
+![Image of LDO_Vout_vs_Vin](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/vddsweep10m.png)
+
+@Load current = 100mA
+![Image of LDO_Vout_vs_Vin](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/vddsweep100m.png)
+
+### Temperature variation
+We made dc sweep on temperature from 0 to 85°C and plotted the output voltage vs temperature from which we found temperature coeffiecient in ppm/°C.
+@Load current = 100uA
+![Image of LDO_Vout_vs_Vin](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/tempvar100u.png)
+
+@Load current = 10mA
+![Image of LDO_Vout_vs_Vin](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/tempvar100u.png)
+
+### c. AC analysis
+#### PSRR
+We used AC analysis by injecting small ac signal over the supply and plotted the output voltage in dB which refers to the PSRR vs Frequency.
+
+![Image of LDO_PSRR](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/psrr50u.png)
+### Stability analysis
+We made the above testbench to cut the feedback loop of the ldo and inject ac signal and then measure the loop gain and phase to find phase margin.
+
+### d. Transient analysis
+#### Line Transient 
+We used transient analysis to show the line transient by varying the supply from 0 to vdd where the nominal supply voltage is 2.3v.
+When VDD varies from 0 to 2.3v
+![Image of LDO_Transient](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/tran02.3v.png)
+When VDD varies from 2 to 3v
+![Image of LDO_Transient](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/line_tran_2v3v.png)
+
+#### Load Transient 
+The load is varied from 0.1mA to 10mA where the load is modeled as current source varied as PWL source where the output voltage suffers from under shoot of 40mV due to change of load current from 0.1mA to 10mA in 10uS then it settles back to its original value so we used this analysis to measure the load regulation. 
+
+The plot includes load current variation and ac-coupled ldo_output overlaid on the same plot.
+![Image of LDO_netlist](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/load_transient_ac_coupled.png)
+
+#### Turn-on Characteristic
+We have an enable signal so we varied it from 0 to Vin in 0.1uS and plotted the ldo_out. The start up time is less than 10uS.
+![Image of LDO_netlist](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/stup_50m.png)
+
+### e. Testbench netlist
+![Image of LDO_netlist](https://github.com/mabrains/Analog_blocks/blob/main/Analog_Blocks/LDO/Images/LDO_v2/TB.png)
+
+### Simulation results
+The typical conditions are tt corner ,load of 50uA, T=27°C , VDD=2.3V , We have a script to automate running process corners then getting their statistical distribution where the variation of the load from 50uA till 100mA is included in the corners  
+
+  Specification  |      TT                  
+-----------------| ---------------
+Temperature Coeffiecient   | 49.4 ppm/°C
+Dropout Voltage @IL=0.1mA  | 0.211mV 
+Dropout Voltage @IL=10mA   |  85.6mV @IL=10mA
+Dropout Voltage @IL=100mA  |  168.45mV @IL=100mA
+Line Regulation            | 0.0325 mv/v
+Load Regulation            | 0.06mV    IL=0.1mA till IL=10mA
+PSRR @ 100Hz               | 88.1dB
+PSRR @ 100kHz              | 44.7dB
+Load range                 | 50uA -> 100mA
+Phase Margin               | 50.1°
+Quiescent Current          | 130uA
+Startup time               | 7uS
+
+
+## Layout Design
 
 
 ## Analog User Project Documentation
diff --git a/caravel b/caravel
index 42c9cab..c294344 160000
--- a/caravel
+++ b/caravel
@@ -1 +1 @@
-Subproject commit 42c9cab06c7fdd94b7eacc12a5c4ff4a60338e74
+Subproject commit c2943440e278814787f761585b99b9ea3c1f4121
diff --git a/gds/bandgap/bandgap_2.gds b/gds/bandgap/bandgap_2.gds
new file mode 100644
index 0000000..657bf6a
--- /dev/null
+++ b/gds/bandgap/bandgap_2.gds
Binary files differ
diff --git a/gds/ldo_v1/ldo.gds b/gds/ldo_v1/ldo.gds
new file mode 100644
index 0000000..a0281b8
--- /dev/null
+++ b/gds/ldo_v1/ldo.gds
Binary files differ
diff --git a/gds/ldo_v1/ldo_flattened.gds b/gds/ldo_v1/ldo_flattened.gds
new file mode 100644
index 0000000..05b7559
--- /dev/null
+++ b/gds/ldo_v1/ldo_flattened.gds
Binary files differ
diff --git a/xschem/LDO_V1.sch b/xschem/LDO_V1.sch
new file mode 100644
index 0000000..98244d8
--- /dev/null
+++ b/xschem/LDO_V1.sch
@@ -0,0 +1,1137 @@
+v {xschem version=2.9.9 file_version=1.2 }
+G {}
+K {}
+V {}
+S {}
+E {}
+N 5150 -1450 5150 -1430 { lab=VDD}
+N 5150 -1450 5400 -1450 { lab=VDD}
+N 5400 -1450 5400 -1430 { lab=VDD}
+N 5400 -1370 5400 -1330 { lab=#net1}
+N 5190 -1400 5360 -1400 { lab=#net2}
+N 5150 -1370 5150 -1330 { lab=#net2}
+N 5150 -1270 5150 -1210 { lab=#net3}
+N 5150 -1210 5400 -1210 { lab=#net3}
+N 5400 -1270 5400 -1210 { lab=#net3}
+N 5240 -1210 5240 -1190 { lab=#net3}
+N 5240 -1080 5240 -1060 { lab=GND}
+N 5150 -1300 5400 -1300 { lab=GND}
+N 5330 -1300 5330 -1070 { lab=GND}
+N 5240 -1070 5330 -1070 { lab=GND}
+N 5270 -1470 5270 -1450 { lab=VDD}
+N 5400 -1400 5500 -1400 { lab=VDD}
+N 5500 -1450 5500 -1400 { lab=VDD}
+N 5390 -1450 5500 -1450 { lab=VDD}
+N 5050 -1400 5150 -1400 { lab=VDD}
+N 5050 -1450 5050 -1400 { lab=VDD}
+N 5050 -1450 5150 -1450 { lab=VDD}
+N 5240 -1160 5330 -1160 { lab=GND}
+N 5540 -1420 5580 -1420 { lab=#net1}
+N 5490 -1450 5620 -1450 { lab=VDD}
+N 5620 -1420 5720 -1420 { lab=VDD}
+N 5620 -1450 5720 -1450 { lab=VDD}
+N 5720 -1450 5720 -1420 { lab=VDD}
+N 5620 -1390 5620 -1350 { lab=out}
+N 5330 -1070 5620 -1070 { lab=GND}
+N 5620 -1070 5710 -1070 { lab=GND}
+N 4940 -1330 4940 -1310 { lab=VDD}
+N 4940 -1250 4940 -1200 { lab=vb}
+N 4860 -1170 4900 -1170 { lab=vb}
+N 4860 -1220 4860 -1170 { lab=vb}
+N 4860 -1220 4940 -1220 { lab=vb}
+N 4940 -1140 4940 -1120 { lab=GND}
+N 4940 -1170 5020 -1170 { lab=GND}
+N 5020 -1170 5020 -1130 { lab=GND}
+N 4940 -1130 5020 -1130 { lab=GND}
+N 4830 -1170 4860 -1170 { lab=vb}
+N 5540 -1280 5580 -1280 { lab=vb}
+N 5170 -1160 5200 -1160 { lab=vb}
+N 5260 -1400 5260 -1350 { lab=#net2}
+N 5150 -1350 5260 -1350 { lab=#net2}
+N 5540 -1350 5550 -1350 { lab=#net4}
+N 5610 -1350 5620 -1350 { lab=out}
+N 5620 -1350 5620 -1310 { lab=out}
+N 5620 -1280 5720 -1280 { lab=GND}
+N 5720 -1280 5720 -1070 { lab=GND}
+N 5710 -1070 5720 -1070 { lab=GND}
+N 5620 -1250 5620 -1070 { lab=GND}
+N 5090 -1300 5110 -1300 { lab=bg_out}
+N 5440 -1300 5470 -1300 { lab=pos}
+N 5520 -1350 5540 -1350 { lab=#net4}
+N 5540 -1420 5540 -1380 { lab=#net1}
+N 5720 -1070 6050 -1070 { lab=GND}
+N 5720 -1450 6050 -1450 { lab=VDD}
+N 6050 -1450 6150 -1450 { lab=VDD}
+N 6010 -1210 6090 -1210 { lab=pos}
+N 5910 -1350 5970 -1350 { lab=#net5}
+N 5400 -1350 5460 -1350 { lab=#net1}
+N 5430 -1380 5540 -1380 { lab=#net1}
+N 5430 -1380 5430 -1350 { lab=#net1}
+N 5900 -1350 5910 -1350 { lab=#net5}
+N 5620 -1350 5680 -1350 { lab=out}
+N 5680 -1350 5690 -1350 { lab=out}
+N 5690 -1350 5700 -1350 { lab=out}
+N 4940 -1280 4970 -1280 { lab=VDD}
+N 4970 -1320 4970 -1280 { lab=VDD}
+N 4940 -1320 4970 -1320 { lab=VDD}
+N 4900 -1330 4900 -1280 { lab=mir}
+N 4860 -1330 4900 -1330 { lab=mir}
+N 5560 -1330 5580 -1330 { lab=GND}
+N 5560 -1330 5560 -1070 { lab=GND}
+N 5810 -1280 5810 -1250 { lab=#net6}
+N 5810 -1190 5810 -1070 { lab=GND}
+N 5810 -1350 5810 -1340 { lab=#net5}
+N 5810 -1350 5900 -1350 { lab=#net5}
+N 5760 -1350 5810 -1350 { lab=#net5}
+N 5970 -1390 5970 -1350 { lab=#net5}
+N 5970 -1390 6050 -1390 { lab=#net5}
+N 6090 -1450 6090 -1420 { lab=VDD}
+N 6150 -1450 6150 -1390 { lab=VDD}
+N 6090 -1390 6150 -1390 { lab=VDD}
+N 5240 -1130 5240 -1080 { lab=GND}
+N 6090 -1360 6090 -1340 { lab=ldo_out}
+N 6090 -1280 6090 -1270 { lab=#net7}
+N 6090 -1210 6090 -1200 { lab=pos}
+N 6090 -1140 6090 -1130 { lab=#net8}
+N 6070 -1170 6070 -1100 { lab=GND}
+N 6070 -1290 6070 -1240 { lab=GND}
+N 6070 -1310 6070 -1290 { lab=GND}
+N 6070 -1240 6070 -1170 { lab=GND}
+N 6070 -1100 6070 -1070 { lab=GND}
+N 6090 -1350 6190 -1350 { lab=ldo_out}
+N 6050 -1070 6070 -1070 { lab=GND}
+N 6070 -1070 6080 -1070 { lab=GND}
+N 6080 -1070 6090 -1070 { lab=GND}
+N 2790 -800 2790 -750 { lab=GND}
+N 2640 -890 2640 -850 { lab=#net9}
+N 2750 -830 2750 -780 { lab=GND}
+N 2750 -780 2790 -780 { lab=GND}
+N 2600 -820 2600 -770 { lab=GND}
+N 2600 -770 2640 -770 { lab=GND}
+N 2680 -1090 2750 -1090 { lab=mir}
+N 2640 -1180 2640 -1120 { lab=VDD}
+N 2640 -1180 2790 -1180 { lab=VDD}
+N 2790 -1180 2790 -1120 { lab=VDD}
+N 2780 -1180 3030 -1180 { lab=VDD}
+N 2640 -790 2640 -780 { lab=GND}
+N 2640 -780 2640 -770 { lab=GND}
+N 2640 -750 2790 -750 { lab=GND}
+N 2640 -770 2640 -750 { lab=GND}
+N 2790 -1090 2830 -1090 { lab=VDD}
+N 2830 -1180 2830 -1090 { lab=VDD}
+N 2530 -1090 2640 -1090 { lab=VDD}
+N 2530 -1180 2750 -1180 { lab=VDD}
+N 1780 -1180 1780 -1120 { lab=VDD}
+N 1670 -1090 1780 -1090 { lab=VDD}
+N 1670 -1180 1670 -1090 { lab=VDD}
+N 1670 -1180 1780 -1180 { lab=VDD}
+N 1780 -1180 1870 -1180 { lab=VDD}
+N 1710 -950 1780 -950 { lab=bg_out}
+N 2570 -1050 2600 -1050 { lab=inp}
+N 2790 -1050 2830 -1050 { lab=inn}
+N 2470 -810 2470 -770 { lab=GND}
+N 2410 -840 2430 -840 { lab=GND}
+N 2410 -840 2410 -800 { lab=GND}
+N 2470 -890 2470 -870 { lab=#net9}
+N 2390 -810 2390 -770 { lab=GND}
+N 2330 -840 2350 -840 { lab=GND}
+N 2330 -840 2330 -800 { lab=GND}
+N 2390 -890 2390 -870 { lab=#net9}
+N 2300 -810 2300 -770 { lab=GND}
+N 2240 -840 2260 -840 { lab=GND}
+N 2240 -840 2240 -800 { lab=GND}
+N 2300 -890 2300 -870 { lab=#net9}
+N 2190 -810 2190 -770 { lab=GND}
+N 2130 -840 2150 -840 { lab=GND}
+N 2130 -840 2130 -800 { lab=GND}
+N 2190 -890 2190 -870 { lab=#net9}
+N 2100 -810 2100 -770 { lab=GND}
+N 2040 -840 2060 -840 { lab=GND}
+N 2040 -840 2040 -800 { lab=GND}
+N 2100 -890 2100 -870 { lab=#net9}
+N 1990 -810 1990 -770 { lab=GND}
+N 1930 -840 1950 -840 { lab=GND}
+N 1930 -840 1930 -800 { lab=GND}
+N 1990 -890 1990 -870 { lab=#net9}
+N 1890 -810 1890 -770 { lab=GND}
+N 1830 -840 1850 -840 { lab=GND}
+N 1830 -840 1830 -800 { lab=GND}
+N 1890 -890 1890 -870 { lab=#net9}
+N 2510 -750 2640 -750 { lab=GND}
+N 1890 -890 1990 -890 { lab=#net9}
+N 1980 -890 2100 -890 { lab=#net9}
+N 2100 -890 2190 -890 { lab=#net9}
+N 2190 -890 2300 -890 { lab=#net9}
+N 2300 -890 2390 -890 { lab=#net9}
+N 2380 -890 2470 -890 { lab=#net9}
+N 1820 -1180 2530 -1180 { lab=VDD}
+N 2530 -1180 2530 -1090 { lab=VDD}
+N 1830 -800 1830 -770 { lab=GND}
+N 1830 -770 1890 -770 { lab=GND}
+N 1890 -770 1990 -770 { lab=GND}
+N 1990 -770 2110 -770 { lab=GND}
+N 2110 -770 2190 -770 { lab=GND}
+N 2190 -770 2300 -770 { lab=GND}
+N 2300 -770 2410 -770 { lab=GND}
+N 2410 -770 2470 -770 { lab=GND}
+N 1760 -750 2510 -750 { lab=GND}
+N 1930 -800 1930 -770 { lab=GND}
+N 2240 -800 2240 -770 { lab=GND}
+N 2330 -800 2330 -770 { lab=GND}
+N 2410 -800 2410 -770 { lab=GND}
+N 2040 -800 2040 -770 { lab=GND}
+N 2130 -800 2130 -770 { lab=GND}
+N 1750 -750 1760 -750 { lab=GND}
+N 1780 -770 1780 -750 { lab=GND}
+N 1820 -1090 1850 -1090 { lab=mir}
+N 1370 -840 1370 -750 { lab=GND}
+N 1370 -870 1460 -870 { lab=GND}
+N 1460 -870 1460 -750 { lab=GND}
+N 1370 -1180 1370 -1090 { lab=VDD}
+N 1370 -1060 1470 -1060 { lab=VDD}
+N 1470 -1180 1470 -1060 { lab=VDD}
+N 1290 -1060 1330 -1060 { lab=#net10}
+N 1290 -870 1330 -870 { lab=bg_out}
+N 1250 -870 1290 -870 { lab=bg_out}
+N 2790 -1060 2790 -1050 { lab=inn}
+N 3180 -1000 3390 -1000 { lab=GND}
+N 3390 -1050 3390 -1030 { lab=mir}
+N 3390 -1180 3390 -1110 { lab=VDD}
+N 3110 -1180 3390 -1180 { lab=VDD}
+N 3180 -1180 3180 -1110 { lab=VDD}
+N 3340 -840 3340 -750 { lab=GND}
+N 3250 -1000 3250 -750 { lab=GND}
+N 3080 -1080 3180 -1080 { lab=VDD}
+N 3080 -1180 3080 -1080 { lab=VDD}
+N 3390 -1080 3500 -1080 { lab=VDD}
+N 3500 -1180 3500 -1080 { lab=VDD}
+N 3380 -1180 3500 -1180 { lab=VDD}
+N 3340 -870 3420 -870 { lab=GND}
+N 3420 -870 3420 -750 { lab=GND}
+N 2790 -750 3160 -750 { lab=GND}
+N 3250 -750 3340 -750 { lab=GND}
+N 3340 -750 3420 -750 { lab=GND}
+N 3120 -1000 3140 -1000 { lab=inp}
+N 3430 -1000 3460 -1000 { lab=inn}
+N 3030 -1180 3080 -1180 { lab=VDD}
+N 3080 -1180 3110 -1180 { lab=VDD}
+N 3160 -750 3250 -750 { lab=GND}
+N 2980 -1180 2980 -1040 { lab=VDD}
+N 2980 -1010 3040 -1010 { lab=VDD}
+N 3040 -1180 3040 -1010 { lab=VDD}
+N 2910 -1010 2940 -1010 { lab=mir}
+N 2980 -860 2980 -750 { lab=GND}
+N 2930 -890 2930 -750 { lab=GND}
+N 3390 -1040 3470 -1040 { lab=mir}
+N 2790 -870 2790 -860 { lab=#net11}
+N 3180 -970 3180 -930 { lab=#net12}
+N 3180 -1050 3180 -1030 { lab=#net13}
+N 3220 -1080 3350 -1080 { lab=#net13}
+N 3290 -1080 3290 -1040 { lab=#net13}
+N 3180 -1040 3290 -1040 { lab=#net13}
+N 3390 -970 3390 -930 { lab=#net12}
+N 3180 -930 3390 -930 { lab=#net12}
+N 3340 -930 3340 -900 { lab=#net12}
+N 2980 -980 2980 -920 { lab=#net14}
+N 3020 -890 3070 -890 { lab=#net14}
+N 3070 -930 3070 -890 { lab=#net14}
+N 2980 -930 3070 -930 { lab=#net14}
+N 3070 -870 3300 -870 { lab=#net14}
+N 3070 -890 3070 -870 { lab=#net14}
+N 2930 -890 2980 -890 { lab=GND}
+N 2440 -770 2440 -750 { lab=GND}
+N 2470 -890 2640 -890 { lab=#net9}
+N 2790 -960 2790 -870 { lab=#net11}
+N 2640 -900 2640 -880 { lab=#net9}
+N 2640 -1060 2640 -1050 { lab=inp}
+N 2790 -970 2790 -960 { lab=#net11}
+N 2600 -1050 2620 -1050 { lab=inp}
+N 2620 -1050 2640 -1050 { lab=inp}
+N 3540 -1040 3550 -1040 { lab=mir}
+N 3470 -1040 3540 -1040 { lab=mir}
+N 3550 -1040 3570 -1040 { lab=mir}
+N 1530 -1180 1560 -1180 { lab=VDD}
+N 1470 -1180 1530 -1180 { lab=VDD}
+N 1370 -1180 1470 -1180 { lab=VDD}
+N 1560 -750 1580 -750 { lab=GND}
+N 1460 -750 1560 -750 { lab=GND}
+N 1370 -750 1460 -750 { lab=GND}
+N 1780 -960 1780 -930 { lab=bg_out}
+N 1780 -1060 1780 -1020 { lab=bg_out}
+N 1780 -1020 1780 -960 { lab=bg_out}
+N 2640 -980 2640 -960 { lab=#net15}
+N 2640 -1050 2640 -1040 { lab=inp}
+N 2540 -970 2640 -970 { lab=#net15}
+N 2540 -810 2540 -750 { lab=GND}
+N 1780 -930 1780 -900 { lab=bg_out}
+N 1760 -870 1760 -750 { lab=GND}
+N 2860 -920 2860 -750 { lab=GND}
+N 2520 -840 2520 -750 { lab=GND}
+N 2570 -930 2620 -930 { lab=GND}
+N 2570 -930 2570 -750 { lab=GND}
+N 2730 -1000 2730 -750 { lab=GND}
+N 2510 -1010 2620 -1010 { lab=GND}
+N 2510 -1010 2510 -750 { lab=GND}
+N 1560 -1180 1670 -1180 { lab=VDD}
+N 1580 -750 1750 -750 { lab=GND}
+N 1370 -930 1420 -930 { lab=#net16}
+N 1370 -930 1370 -900 { lab=#net16}
+N 1370 -950 1370 -930 { lab=#net16}
+N 1420 -930 1460 -930 { lab=#net16}
+N 1500 -900 1500 -750 { lab=GND}
+N 1370 -1030 1370 -1010 { lab=#net10}
+N 1290 -1020 1370 -1020 { lab=#net10}
+N 1290 -1060 1290 -1020 { lab=#net10}
+N 1310 -980 1330 -980 { lab=#net16}
+N 1310 -980 1310 -930 { lab=#net16}
+N 1310 -930 1370 -930 { lab=#net16}
+N 1460 -980 1470 -980 { lab=VDD}
+N 1470 -1060 1470 -980 { lab=VDD}
+N 1500 -1020 1500 -960 { lab=mir}
+N 1500 -1020 1560 -1020 { lab=mir}
+N 1500 -930 1580 -930 { lab=GND}
+N 1580 -930 1580 -750 { lab=GND}
+N 3570 -1060 3570 -1040 { lab=mir}
+N 3570 -1180 3570 -1120 { lab=VDD}
+N 3500 -1180 3570 -1180 { lab=VDD}
+N 2540 -970 2540 -960 { lab=#net15}
+N 2540 -900 2540 -870 { lab=#net17}
+N 2790 -980 2790 -970 { lab=#net11}
+N 2730 -1010 2770 -1010 { lab=GND}
+N 2730 -1010 2730 -1000 { lab=GND}
+N 2840 -810 2840 -750 { lab=GND}
+N 2840 -890 2840 -870 { lab=#net18}
+N 2790 -950 2840 -950 { lab=#net11}
+N 2790 -1050 2790 -1040 { lab=inn}
+N 2510 -930 2520 -930 { lab=GND}
+N 1780 -840 1780 -830 { lab=#net19}
+N 2700 -1110 2700 -1090 { lab=mir}
+N 2680 -1140 2700 -1140 { lab=VDD}
+N 2680 -1180 2680 -1140 { lab=VDD}
+N 2700 -1180 2700 -1170 { lab=VDD}
+N 2740 -1140 2760 -1140 { lab=en}
+N 4180 -1270 4180 -1250 { lab=en}
+N 4180 -1190 4180 -1160 { lab=GND}
+N 1370 -980 1460 -980 { lab=VDD}
+N 2610 -540 2610 -530 { lab=GND}
+N 2610 -750 2610 -740 { lab=GND}
+N 2360 -1220 2360 -1180 { lab=VDD}
+N 3850 -1330 3850 -1300 { lab=GND}
+N 3850 -1420 3850 -1390 { lab=VDD}
+N 2360 -1250 2360 -1220 { lab=VDD}
+N 3850 -1450 3850 -1420 { lab=VDD}
+N 3850 -1510 3930 -1510 { lab=VDD}
+N 2610 -740 2610 -610 { lab=GND}
+N 2610 -550 2610 -540 { lab=GND}
+N 5000 -1010 5000 -990 { lab=GND}
+N 5000 -1090 5000 -1070 { lab=GND}
+N 4940 -1090 5000 -1090 { lab=GND}
+N 4940 -1120 4940 -1090 { lab=GND}
+N 5250 -980 5250 -960 { lab=GND}
+N 5250 -1060 5250 -1040 { lab=GND}
+N 5240 -1060 5250 -1060 { lab=GND}
+N 2610 -610 2610 -550 { lab=GND}
+N 5250 -1040 5250 -980 { lab=GND}
+N 5000 -1070 5000 -1010 { lab=GND}
+N 3850 -1510 3850 -1450 { lab=VDD}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 5170 -1400 0 1 {name=M8
+L=1.2
+W=3
+nf=1
+mult=4
+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} 5130 -1300 0 0 {name=M9
+L=1
+W=2
+nf=1
+mult=8
+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/nfet_g5v0d10v5.sym} 5420 -1300 0 1 {name=M10
+L=1
+W=2
+nf=1
+mult=8
+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} 5380 -1400 0 0 {name=M11
+L=1.2
+W=3
+nf=1
+mult=4
+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} 5220 -1160 0 0 {name=M13
+L=1
+W=1
+nf=1
+mult=8
+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 {devices/gnd.sym} 5250 -960 0 0 {name=l2 lab=GND}
+C {devices/vdd.sym} 5270 -1470 0 0 {name=l9 lab=VDD}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 5600 -1420 0 0 {name=M14
+L=1.2
+W=3
+nf=1
+mult=12
+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} 5600 -1280 0 0 {name=M18
+L=1
+W=1
+nf=1
+mult=12
+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/nfet_g5v0d10v5.sym} 4920 -1170 0 0 {name=M20
+L=1
+W=1
+nf=1
+mult=4
+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 {devices/gnd.sym} 5000 -990 0 0 {name=l10 lab=GND}
+C {devices/vdd.sym} 4940 -1330 0 0 {name=l12 lab=VDD}
+C {devices/lab_pin.sym} 4830 -1170 0 0 {name=l14 sig_type=std_logic lab=vb}
+C {devices/lab_pin.sym} 5170 -1160 0 0 {name=l15 sig_type=std_logic lab=vb}
+C {devices/lab_pin.sym} 5540 -1280 0 0 {name=l16 sig_type=std_logic lab=vb}
+C {devices/lab_pin.sym} 5470 -1300 0 1 {name=l17 sig_type=std_logic lab=pos}
+C {devices/ngspice_get_value.sym} 5430 -1260 0 0 {name=r7 node=v(@m.$\{path\}xm3.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/launcher.sym} 5420 -990 0 0 {name=h1
+descr=Annotate 
+tclcommand="ngspice::annotate"}
+C {devices/ngspice_get_value.sym} 5480 -1200 0 1 {name=r15 node=@m.$\{path\}xm3.msky130_fd_pr__nfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/launcher.sym} 5060 -620 0 0 {name=h2
+descr="View Raw file" 
+tclcommand="textwindow $netlist_dir/[file tail [file rootname [ xschem get schname 0 ] ] ].raw"
+}
+C {devices/ngspice_get_value.sym} 5430 -1230 0 0 {name=r16 node=v(@m.$\{path\}xm3.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5070 -1250 0 0 {name=r17 node=v(@m.$\{path\}xm2.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5120 -1190 0 1 {name=r18 node=@m.$\{path\}xm2.msky130_fd_pr__nfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5070 -1220 0 0 {name=r19 node=v(@m.$\{path\}xm2.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5130 -1110 0 0 {name=r20 node=v(@m.$\{path\}xm5.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5180 -1050 0 1 {name=r21 node=@m.$\{path\}xm5.msky130_fd_pr__nfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5130 -1080 0 0 {name=r22 node=v(@m.$\{path\}xm5.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 4860 -1120 0 0 {name=r23 node=v(@m.$\{path\}xm8.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 4910 -1060 0 1 {name=r24 node=@m.$\{path\}xm8.msky130_fd_pr__nfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 4860 -1090 0 0 {name=r25 node=v(@m.$\{path\}xm8.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5000 -1410 0 0 {name=r33 node=v(@m.$\{path\}xm1.msky130_fd_pr__pfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5050 -1350 0 1 {name=r34 node=@m.$\{path\}xm1.msky130_fd_pr__pfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5000 -1380 0 0 {name=r35 node=v(@m.$\{path\}xm1.msky130_fd_pr__pfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5320 -1420 0 0 {name=r36 node=v(@m.$\{path\}xm4.msky130_fd_pr__pfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5370 -1360 0 1 {name=r37 node=@m.$\{path\}xm4.msky130_fd_pr__pfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5320 -1390 0 0 {name=r38 node=v(@m.$\{path\}xm4.msky130_fd_pr__pfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5650 -1230 0 0 {name=r39 node=v(@m.$\{path\}xm7.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5700 -1170 0 1 {name=r40 node=@m.$\{path\}xm7.msky130_fd_pr__nfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5650 -1200 0 0 {name=r41 node=v(@m.$\{path\}xm7.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5660 -1510 0 0 {name=r42 node=v(@m.$\{path\}xm6.msky130_fd_pr__pfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 5710 -1450 0 1 {name=r43 node=@m.$\{path\}xm6.msky130_fd_pr__pfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 5660 -1480 0 0 {name=r44 node=v(@m.$\{path\}xm6.msky130_fd_pr__pfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 5430 -1170 0 0 {name=r45 node=v(@m.$\{path\}xm3.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5140 -1020 0 0 {name=r46 node=v(@m.$\{path\}xm5.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 4860 -1020 0 0 {name=r47 node=v(@m.$\{path\}xm8.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5010 -1320 0 0 {name=r50 node=v(@m.$\{path\}xm1.msky130_fd_pr__pfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5320 -1330 0 0 {name=r51 node=v(@m.$\{path\}xm4.msky130_fd_pr__pfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5730 -1420 0 0 {name=r52 node=v(@m.$\{path\}xm6.msky130_fd_pr__pfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5640 -1140 0 0 {name=r53 node=v(@m.$\{path\}xm7.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5070 -1150 0 0 {name=r54 node=v(@m.$\{path\}xm2.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 5060 -1110 0 0 {name=r55 node=v(@m.$\{path\}xm2.msky130_fd_pr__nfet_g5v0d10v5[vth])
+descr="vth="}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 6070 -1390 0 0 {name=M24
+L=0.5
+W=10
+nf=1
+mult=800
+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 {devices/lab_pin.sym} 6010 -1210 0 0 {name=l25 sig_type=std_logic lab=pos}
+C {devices/lab_pin.sym} 6190 -1350 0 1 {name=l29 sig_type=std_logic lab=ldo_out}
+C {devices/ngspice_get_value.sym} 6210 -1420 0 0 {name=r56 node=v(@m.$\{path\}xm11.msky130_fd_pr__pfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 6260 -1360 0 1 {name=r57 node=@m.$\{path\}xm11.msky130_fd_pr__pfet_g5v0d10v5[gm]
+descr="gm="}
+C {devices/ngspice_get_value.sym} 6210 -1390 0 0 {name=r58 node=v(@m.$\{path\}xm11.msky130_fd_pr__pfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 6280 -1330 0 0 {name=r59 node=v(@m.$\{path\}xm11.msky130_fd_pr__pfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/lab_pin.sym} 5680 -1350 1 0 {name=l30 sig_type=std_logic lab=out}
+C {devices/lab_pin.sym} 5090 -1300 0 0 {name=l31 sig_type=std_logic lab=bg_out}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 4920 -1280 0 0 {name=M26
+L=2
+W=3
+nf=1
+mult=4
+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 {devices/lab_pin.sym} 4870 -1330 1 0 {name=l32 sig_type=std_logic lab=mir}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 5490 -1350 3 1 {name=C3 model=cap_mim_m3_1 W=60 L=60 MF=1 spiceprefix=X}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 5580 -1350 3 0 {name=R7
+W=0.69
+L=4.5
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=1}
+C {devices/vsource.sym} 3850 -1360 0 0 {name=Vs value=2.3}
+C {devices/vsource.sym} 5810 -1220 0 0 {name=Vt value=0}
+C {devices/capa.sym} 5810 -1310 0 0 {name=C2
+m=1
+value=5G
+footprint=1206
+device="ceramic capacitor"}
+C {devices/ind.sym} 5730 -1350 3 0 {name=L1
+m=1
+value=5G
+footprint=1206
+device=inductor}
+C {devices/code_shown.sym} 6840 -2950 0 0 {name=SPICE only_toplevel=false value=
+"
+.param R=18k
+R10 ldo_out GND \{R\}
+IL ldo_out 0 PWL(0 0.1m 10u 0.1m 20u 10m 30u 10m)
+*CL ldo_out gnd 10p
+.lib "/home/mustafa/mabrains/pdks/share/pdk/sky130A/libs.tech/ngspice/sky130.lib_mod.spice" tt
+
+
+
+
+.nodeset v(inn)=1.2
+.nodeset v(inp)=1.2
+.nodeset v(mir)=1
+.nodeset v(net13)=1
+.nodeset v(bg_out)=1.1
+.nodeset v(ldo_out)=1.8
+.nodeset v(pos)=1.1
+*.nodeset v(net3)=0.8
+*.nodeset v(net1)=0.7
+.nodeset v(net14)=0.9
+*.nodeset v(net7)=0.75
+.nodeset v(vb)=0.9
+
+.option temp=27
+*User_defined_functions
+.control
+define max(vector_name) (vecmax(vector_name))
+define min(vector_name) (vecmin(vector_name))
+.endc
+
+
+*Temp_sweep
+.control
+alter IL 0
+dc temp 85 0 -1
+let temp_coeff=1000000*(max(ldo_out)-min(ldo_out))/85
+print temp_coeff
+plot v(ldo_out)
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+.endc
+
+
+.control
+alter IL 0
+*alter R10 1G
+op
+let iq =i(Vs)
+print iq
+*print all
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+if v(ldo_out)>1
+wrdata op_point_test v(ldo_out)
+end
+.endc
+
+
+
+*Stability_Analysis
+.control
+alter IL 0
+alter Vs AC =0
+alter Vt AC=1
+ac dec 10 1 1G
+plot vdb(out)
+plot (180/pi)*vp(out)
+let ph= (180/pi)*vp(out)
+meas ac pm FIND ph WHEN vdb(out)=0
+.endc
+
+
+*PSRR_Analysis
+.control
+alter IL 0
+alter Vs AC =1
+alter Vt AC=0
+alter L1 0
+alter C2 0
+ac dec 10 1 1G
+meas AC PSRR100 FIND vdb(ldo_out) AT=100
+meas AC PSRR100k FIND vdb(ldo_out) AT=100k
+plot vdb(ldo_out)
+.endc
+
+
+
+
+*supply_sweep
+.control
+alter IL 0
+dc Vs 2.8 0 -0.01
+plot vdd ldo_out
+meas DC Vldo_Sup_2 FIND ldo_out AT=2
+meas DC Vldo_nom FIND ldo_out AT=2.3
+meas DC Vldo_Sup_2_8 FIND ldo_out AT=2.8
+let line_reg = abs((Vldo_Sup_2_8-Vldo_Sup_2)/0.8)
+print line_reg
+meas DC vin WHEN v(ldo_out)=1.764
+let dropout=vin-1.764
+print dropout
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+.endc
+
+
+
+
+
+*Load_Reg_switches
+*V1 c1 0 DC 0 PWL(0 5 20u 5 35u 0 50u 0 100u 0)
+*V2 c2 0 DC 0 PWL(0 0 20u 0 35u 0 50u 5 100u 5)
+*s1 ldo_out 2 c1 0 switch1 ON
+*s2 ldo_out 3 c2 0 switch1 OFF
+*.model switch1 sw vt=0.1 ron =0.1 roff =1G
+*R1 2 0 18k
+*R2 3 0 180
+
+*.control
+*alter R10 1G
+*tran 0.1u 90u
+*plot v(ldo_out) v(c1) v(c2)
+*meas TRAN V_ldo_100u FIND v(ldo_out) AT=10u
+*meas TRAN V_ldo_10m FIND v(ldo_out) AT=50u
+*let load_reg= V_ldo_100u-V_ldo_10m
+*print load_reg
+*.endc
+
+
+**Load_Transient
+.control
+alter IL 50u
+alter R10 3600k
+tran 0.1u 100u 
+meas TRAN V_ldo_100u FIND v(ldo_out) AT=5u
+meas TRAN V_ldo_10m FIND v(ldo_out) AT=100u
+let load_reg= V_ldo_100u-V_ldo_10m
+let load_current =(-1*i(Vs)-131.8e-6) 
+print load_reg
+plot load_current v(ldo_out)-1.8
+.endc
+
+
+**Transient
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Vs[pulse] = [ 1.8 3 10u 10u 1u 100u 200u ]
+alter IL 0
+tran 0.1u 100u 
+plot vdd ldo_out
+.endc
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Vs[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
+tran 0.1u 100u 
+plot vdd ldo_out
+.endc
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Ven[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
+tran 0.1u 100u 
+*meas TRAN st_up_time when v(ldo_out)>1.782 
+plot en ldo_out
+.endc
+
+
+
+
+"}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 6090 -1310 0 0 {name=R8
+W=0.69
+L=24
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=8}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 6090 -1240 0 0 {name=R9
+W=0.69
+L=24
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=3}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 6090 -1170 0 0 {name=R12
+W=0.69
+L=24
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=2}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 6090 -1100 0 0 {name=R13
+W=0.69
+L=24
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=4}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2770 -1090 0 0 {name=M1
+L=2
+W=3
+nf=1
+mult=8
+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} 2660 -1090 0 1 {name=M2
+L=2
+W=3
+nf=1
+mult=8
+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} 1800 -1090 0 1 {name=M3
+L=2
+W=3
+nf=1
+mult=8
+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 {devices/lab_pin.sym} 1710 -950 0 0 {name=l1 sig_type=std_logic lab=bg_out}
+C {sky130_fd_pr/pnp_05v5.sym} 2770 -830 0 0 {name=Q1
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2620 -820 0 0 {name=Q5
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2450 -840 0 0 {name=Q6
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2370 -840 0 0 {name=Q7
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2280 -840 0 0 {name=Q9
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2170 -840 0 0 {name=Q11
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 2080 -840 0 0 {name=Q13
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 1970 -840 0 0 {name=Q15
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {sky130_fd_pr/pnp_05v5.sym} 1870 -840 0 0 {name=Q17
+model=pnp_05v5_W0p68L0p68
+spiceprefix=X
+}
+C {devices/gnd.sym} 2610 -530 0 0 {name=l6 lab=GND}
+C {sky130_fd_pr/nfet_g5v0d10v5.sym} 1350 -870 0 0 {name=M4
+L=2
+W=0.42
+nf=1
+mult=2
+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/nfet_g5v0d10v5.sym} 1480 -930 0 0 {name=M5
+L=0.5
+W=5
+nf=1
+mult=4
+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} 1350 -1060 0 0 {name=M6
+L=3
+W=0.42
+nf=1
+mult=2
+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} 3200 -1080 0 1 {name=M7
+L=2
+W=3
+nf=1
+mult=4
+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} 3160 -1000 0 0 {name=M12
+L=1
+W=3
+nf=1
+mult=8
+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/nfet_g5v0d10v5.sym} 3410 -1000 0 1 {name=M21
+L=1
+W=3
+nf=1
+mult=8
+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} 3370 -1080 0 0 {name=M23
+L=2
+W=3
+nf=1
+mult=4
+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} 3320 -870 0 0 {name=M15
+L=2
+W=5
+nf=1
+mult=4
+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} 2960 -1010 0 0 {name=M25
+L=2
+W=3
+nf=1
+mult=8
+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} 3000 -890 0 1 {name=M16
+L=2
+W=5
+nf=1
+mult=4
+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 {devices/lab_pin.sym} 1850 -1090 0 1 {name=l7 sig_type=std_logic lab=mir}
+C {devices/lab_pin.sym} 2710 -1090 3 0 {name=l8 sig_type=std_logic lab=mir}
+C {devices/lab_pin.sym} 2910 -1010 0 0 {name=l11 sig_type=std_logic lab=mir}
+C {devices/lab_pin.sym} 3460 -1000 0 1 {name=l13 sig_type=std_logic lab=inn}
+C {devices/lab_pin.sym} 3120 -1000 0 0 {name=l18 sig_type=std_logic lab=inp}
+C {devices/ngspice_get_value.sym} 4000 -900 0 0 {name=r1 node=v(@m.$\{path\}xm1.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 4050 -840 0 1 {name=r2 node=@m.$\{path\}xm1.msky130_fd_pr__nfet_g5v0d10v5[gds]
+descr="gds="}
+C {devices/ngspice_get_value.sym} 4000 -870 0 0 {name=r3 node=v(@m.$\{path\}xm1.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 4000 -810 0 0 {name=r4 node=v(@m.$\{path\}xm1.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 4030 -1070 0 0 {name=r5 node=v(@m.$\{path\}xm7.msky130_fd_pr__pfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 4030 -1040 0 0 {name=r6 node=v(@m.$\{path\}xm7.msky130_fd_pr__pfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 4020 -1000 0 0 {name=r8 node=v(@m.$\{path\}xm7.msky130_fd_pr__pfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 4020 -1100 0 0 {name=r9 node=v(@m.$\{path\}xm7.msky130_fd_pr__pfet_g5v0d10v5[vth])
+descr="vth="}
+C {devices/ngspice_get_value.sym} 3960 -740 0 0 {name=r10 node=v(@m.$\{path\}xm22.msky130_fd_pr__nfet_g5v0d10v5[vgs])
+descr="vgs="}
+C {devices/ngspice_get_value.sym} 4010 -680 0 1 {name=r11 node=@m.$\{path\}xm22.msky130_fd_pr__nfet_g5v0d10v5[gds]
+descr="gds="}
+C {devices/ngspice_get_value.sym} 3960 -710 0 0 {name=r12 node=v(@m.$\{path\}xm22.msky130_fd_pr__nfet_g5v0d10v5[vdsat])
+descr="vdsat="}
+C {devices/ngspice_get_value.sym} 3960 -650 0 0 {name=r13 node=v(@m.$\{path\}xm22.msky130_fd_pr__nfet_g5v0d10v5[vds])
+descr="vds="}
+C {devices/ngspice_get_value.sym} 3960 -610 0 0 {name=r26 node=v(@m.$\{path\}xm22.msky130_fd_pr__nfet_g5v0d10v5[vth])
+descr="vth="}
+C {devices/ngspice_get_value.sym} 3940 -840 0 0 {name=r27 node=v(@m.$\{path\}xm1.msky130_fd_pr__nfet_g5v0d10v5[vth])
+descr="vth="}
+C {devices/lab_pin.sym} 2570 -1050 0 0 {name=l19 sig_type=std_logic lab=inp}
+C {devices/lab_pin.sym} 2830 -1050 0 1 {name=l20 sig_type=std_logic lab=inn}
+C {sky130_fd_pr/cap_mim_m3_1.sym} 3570 -1090 0 0 {name=C1 model=cap_mim_m3_1 W=20 L=20 MF=1 spiceprefix=X}
+C {devices/lab_pin.sym} 3520 -1040 1 0 {name=l21 sig_type=std_logic lab=mir}
+C {devices/lab_pin.sym} 1250 -870 0 0 {name=l24 sig_type=std_logic lab=bg_out}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2640 -1010 0 0 {name=R1
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=3}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2790 -1010 0 0 {name=R2
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=3}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2840 -920 0 1 {name=R3
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2640 -930 0 0 {name=R10
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=6}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2540 -840 0 0 {name=R4
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=15}
+C {devices/lab_pin.sym} 1560 -1020 0 1 {name=l22 sig_type=std_logic lab=mir}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2840 -840 0 1 {name=R11
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=15}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 2540 -930 0 0 {name=R6
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 1780 -870 0 0 {name=R5
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=1}
+C {sky130_fd_pr/res_xhigh_po_0p69.sym} 1780 -800 0 0 {name=R14
+W=0.69
+L=27
+model=res_xhigh_po_0p69
+spiceprefix=X
+mult=53}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 2720 -1140 0 1 {name=M19
+L=0.5
+W=0.42
+nf=1
+mult=2
+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 {devices/lab_pin.sym} 2760 -1140 0 1 {name=l23 sig_type=std_logic lab=en}
+C {devices/vsource.sym} 4180 -1220 0 0 {name=Ven value=2.3}
+C {devices/gnd.sym} 4180 -1160 0 0 {name=l26 lab=GND}
+C {devices/lab_pin.sym} 4180 -1270 0 0 {name=l27 sig_type=std_logic lab=en}
+C {sky130_fd_pr/pfet_g5v0d10v5.sym} 1350 -980 0 0 {name=M17
+L=3
+W=0.42
+nf=1
+mult=2
+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 {devices/gnd.sym} 3850 -1300 0 0 {name=l3 lab=GND}
+C {devices/vdd.sym} 2360 -1250 0 0 {name=l5 lab=VDD}
+C {devices/vdd.sym} 3930 -1510 0 0 {name=l4 lab=VDD}
diff --git a/xschem/LDO_V1.spice b/xschem/LDO_V1.spice
new file mode 100644
index 0000000..cf15a82
--- /dev/null
+++ b/xschem/LDO_V1.spice
@@ -0,0 +1,290 @@
+**.subckt untitled-17
+XM8 net2 net2 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=1.2 W=3 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=4 m=4 
+XM9 net2 bg_out net3 GND sky130_fd_pr__nfet_g5v0d10v5 L=1 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=8 m=8 
+XM10 net1 pos net3 GND sky130_fd_pr__nfet_g5v0d10v5 L=1 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=8 m=8 
+XM11 net1 net2 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=1.2 W=3 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=4 m=4 
+XM13 net3 vb GND GND sky130_fd_pr__nfet_g5v0d10v5 L=1 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=8 m=8 
+XM14 out net1 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=1.2 W=3 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=12 m=12 
+XM18 out vb GND GND sky130_fd_pr__nfet_g5v0d10v5 L=1 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=12 m=12 
+XM20 vb vb GND GND sky130_fd_pr__nfet_g5v0d10v5 L=1 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=4 m=4 
+XM24 ldo_out net5 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=0.5 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=800 m=800 
+XM26 vb mir VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=4 m=4 
+XC3 net1 net4 sky130_fd_pr__cap_mim_m3_1 W=60 L=60 MF=1 m=1
+XR7 out net4 GND sky130_fd_pr__res_xhigh_po_0p69 L=4.5 mult=1 m=1
+Vs VDD GND 2.3
+Vt net6 GND 0
+C2 net5 net6 5G m=1
+L1 out net5 5G m=1
+XR8 net7 ldo_out GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=8 m=8
+XR9 pos net7 GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=3 m=3
+XR12 net8 pos GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=2 m=2
+XR13 GND net8 GND sky130_fd_pr__res_xhigh_po_0p69 L=24 mult=4 m=4
+XM1 inn mir VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=8 m=8 
+XM2 inp mir VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=8 m=8 
+XM3 bg_out mir VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=8 m=8 
+XQ1 GND GND net11 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ5 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ6 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ7 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ9 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ11 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ13 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ15 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XQ17 GND GND net9 sky130_fd_pr__pnp_05v5_W0p68L0p68
+XM4 net16 bg_out GND GND sky130_fd_pr__nfet_g5v0d10v5 L=2 W=0.42 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=2 m=2 
+XM5 mir net16 GND GND sky130_fd_pr__nfet_g5v0d10v5 L=0.5 W=5 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=4 m=4 
+XM6 net10 net10 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=3 W=0.42 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=2 m=2 
+XM7 net13 net13 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=4 m=4 
+XM12 net13 inp net12 GND sky130_fd_pr__nfet_g5v0d10v5 L=1 W=3 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=8 m=8 
+XM21 mir inn net12 GND sky130_fd_pr__nfet_g5v0d10v5 L=1 W=3 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=8 m=8 
+XM23 mir net13 VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=4 m=4 
+XM15 net12 net14 GND GND sky130_fd_pr__nfet_g5v0d10v5 L=2 W=5 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=4 m=4 
+XM25 net14 mir VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=2 W=3 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=8 m=8 
+XM16 net14 net14 GND GND sky130_fd_pr__nfet_g5v0d10v5 L=2 W=5 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=4 m=4 
+XC1 VDD mir sky130_fd_pr__cap_mim_m3_1 W=20 L=20 MF=1 m=1
+XR1 net15 inp GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=3 m=3
+XR2 net11 inn GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=3 m=3
+XR3 net18 net11 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=1 m=1
+XR10 net9 net15 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=6 m=6
+XR4 GND net17 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=15 m=15
+XR11 GND net18 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=15 m=15
+XR6 net17 net15 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=1 m=1
+XR5 net19 bg_out GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=1 m=1
+XR14 GND net19 GND sky130_fd_pr__res_xhigh_po_0p69 L=27 mult=53 m=53
+XM19 mir en VDD VDD sky130_fd_pr__pfet_g5v0d10v5 L=0.5 W=0.42 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=2 m=2 
+Ven en GND 2.3
+XM17 net16 net16 net10 VDD sky130_fd_pr__pfet_g5v0d10v5 L=3 W=0.42 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=2 m=2 
+**** begin user architecture code
+
+
+.param R=18k
+R10 ldo_out GND {R}
+IL ldo_out 0 PWL(0 0.1m 10u 0.1m 20u 10m 30u 10m)
+*CL ldo_out gnd 10p
+.lib /home/mustafa/mabrains/pdks/share/pdk/sky130A/libs.tech/ngspice/sky130.lib_mod.spice tt
+
+
+
+
+.nodeset v(inn)=1.2
+.nodeset v(inp)=1.2
+.nodeset v(mir)=1
+.nodeset v(net13)=1
+.nodeset v(bg_out)=1.1
+.nodeset v(ldo_out)=1.8
+.nodeset v(pos)=1.1
+*.nodeset v(net3)=0.8
+*.nodeset v(net1)=0.7
+.nodeset v(net14)=0.9
+*.nodeset v(net7)=0.75
+.nodeset v(vb)=0.9
+
+.option temp=27
+*User_defined_functions
+.control
+define max(vector_name) (vecmax(vector_name))
+define min(vector_name) (vecmin(vector_name))
+.endc
+
+
+*Temp_sweep
+.control
+alter IL 0
+dc temp 85 0 -1
+let temp_coeff=1000000*(max(ldo_out)-min(ldo_out))/85
+print temp_coeff
+plot v(ldo_out)
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+.endc
+
+
+.control
+alter IL 0
+*alter R10 1G
+op
+let iq =i(Vs)
+print iq
+*print all
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+if v(ldo_out)>1
+wrdata op_point_test v(ldo_out)
+end
+.endc
+
+
+
+*Stability_Analysis
+.control
+alter IL 0
+alter Vs AC =0
+alter Vt AC=1
+ac dec 10 1 1G
+plot vdb(out)
+plot (180/pi)*vp(out)
+let ph= (180/pi)*vp(out)
+meas ac pm FIND ph WHEN vdb(out)=0
+.endc
+
+
+*PSRR_Analysis
+.control
+alter IL 0
+alter Vs AC =1
+alter Vt AC=0
+alter L1 0
+alter C2 0
+ac dec 10 1 1G
+meas AC PSRR100 FIND vdb(ldo_out) AT=100
+meas AC PSRR100k FIND vdb(ldo_out) AT=100k
+plot vdb(ldo_out)
+.endc
+
+
+
+
+*supply_sweep
+.control
+alter IL 0
+dc Vs 2.8 0 -0.01
+plot vdd ldo_out
+meas DC Vldo_Sup_2 FIND ldo_out AT=2
+meas DC Vldo_nom FIND ldo_out AT=2.3
+meas DC Vldo_Sup_2_8 FIND ldo_out AT=2.8
+let line_reg = abs((Vldo_Sup_2_8-Vldo_Sup_2)/0.8)
+print line_reg
+meas DC vin WHEN v(ldo_out)=1.764
+let dropout=vin-1.764
+print dropout
+set wr_singlescale
+set wr_vecnames
+set appendwrite
+.endc
+
+
+
+
+
+*Load_Reg_switches
+*V1 c1 0 DC 0 PWL(0 5 20u 5 35u 0 50u 0 100u 0)
+*V2 c2 0 DC 0 PWL(0 0 20u 0 35u 0 50u 5 100u 5)
+*s1 ldo_out 2 c1 0 switch1 ON
+*s2 ldo_out 3 c2 0 switch1 OFF
+*.model switch1 sw vt=0.1 ron =0.1 roff =1G
+*R1 2 0 18k
+*R2 3 0 180
+
+*.control
+*alter R10 1G
+*tran 0.1u 90u
+*plot v(ldo_out) v(c1) v(c2)
+*meas TRAN V_ldo_100u FIND v(ldo_out) AT=10u
+*meas TRAN V_ldo_10m FIND v(ldo_out) AT=50u
+*let load_reg= V_ldo_100u-V_ldo_10m
+*print load_reg
+*.endc
+
+
+**Load_Transient
+.control
+alter IL 50u
+alter R10 3600k
+tran 0.1u 100u
+meas TRAN V_ldo_100u FIND v(ldo_out) AT=5u
+meas TRAN V_ldo_10m FIND v(ldo_out) AT=100u
+let load_reg= V_ldo_100u-V_ldo_10m
+let load_current =(-1*i(Vs)-131.8e-6)
+print load_reg
+plot load_current v(ldo_out)-1.8
+.endc
+
+
+**Transient
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Vs[pulse] = [ 1.8 3 10u 10u 1u 100u 200u ]
+alter IL 0
+tran 0.1u 100u
+plot vdd ldo_out
+.endc
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Vs[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
+tran 0.1u 100u
+plot vdd ldo_out
+.endc
+.control
+alter R10 36k
+alter @IL[PWL] = [ 0 0 10u 0 20u 0 30u 0 ]
+alter @Ven[pulse] = [ 0 2.3 10u 0.1u 1u 100u 200u ]
+tran 0.1u 100u
+*meas TRAN st_up_time when v(ldo_out)>1.782
+plot en ldo_out
+.endc
+
+
+
+
+
+
+**** end user architecture code
+**.ends
+.GLOBAL GND
+.GLOBAL VDD
+** flattened .save nodes
+.end
diff --git a/xschem/analog_wrapper_tb.spice b/xschem/analog_wrapper_tb.spice
index b32d07c..23b8d03 100644
--- a/xschem/analog_wrapper_tb.spice
+++ b/xschem/analog_wrapper_tb.spice
@@ -65,8 +65,8 @@
 V2 net2 GND PWL(0.0 0 300u 0 5.3 1.8)
 V3 io_analog[4] GND PWL(0.0 0 100u 0 5m 3.3)
 **** 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
+.lib /home/mina/mabrains/open_pdks/sky130/sky130A/libs.tech/ngspice/sky130.lib.spice tt
+.include /home/mina/mabrains/open_pdks/sky130/sky130A/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice
 
 .control
 tran 10u 20m
@@ -78,8 +78,8 @@
 **.ends
 
 * expanding   symbol:  user_analog_project_wrapper.sym # of pins=32
-* sym_path: /home/tim/gits/caravel_user_project_analog/xschem/user_analog_project_wrapper.sym
-* sch_path: /home/tim/gits/caravel_user_project_analog/xschem/user_analog_project_wrapper.sch
+* sym_path: /home/mina/mabrains/caravel_user_project_ldo/xschem/user_analog_project_wrapper.sym
+* sch_path: /home/mina/mabrains/caravel_user_project_ldo/xschem/user_analog_project_wrapper.sch
 .subckt user_analog_project_wrapper  vdda1 vdda2 vssa1 vssa2 vccd1 vccd2 vssd1 vssd2 wb_clk_i
 + wb_rst_i wbs_stb_i wbs_cyc_i wbs_we_i wbs_sel_i[3] wbs_sel_i[2] wbs_sel_i[1] wbs_sel_i[0] wbs_dat_i[31]
 + wbs_dat_i[30] wbs_dat_i[29] wbs_dat_i[28] wbs_dat_i[27] wbs_dat_i[26] wbs_dat_i[25] wbs_dat_i[24] wbs_dat_i[23]
@@ -216,8 +216,8 @@
 
 
 * 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
+* sym_path: /home/mina/mabrains/caravel_user_project_ldo/xschem/example_por.sym
+* sch_path: /home/mina/mabrains/caravel_user_project_ldo/xschem/example_por.sch
 .subckt example_por  vdd3v3 vdd1v8 porb_h porb_l por_l vss
 *.iopin vdd3v3
 *.iopin vss