Add reset to PRBS

* Add to top level
diff --git a/gds/user_analog_project_wrapper.gds b/gds/user_analog_project_wrapper.gds
index 8c73baf..57ea5b2 100644
--- a/gds/user_analog_project_wrapper.gds
+++ b/gds/user_analog_project_wrapper.gds
Binary files differ
diff --git a/mag/analog_proj_wrapper_din.txt b/mag/analog_proj_wrapper_din.txt
index c76e4b4..724886e 100755
--- a/mag/analog_proj_wrapper_din.txt
+++ b/mag/analog_proj_wrapper_din.txt
@@ -30,11 +30,11 @@
 56n     1s 1s

 58n     0s 0s

 60n     1s 0s

-62n      0s 0s

-64n      1s 0s

+62n      0s 1s

+64n      1s 1s

 

-66n      0s 1s  

-68n      1s 1s

+66n      0s 0s  

+68n      1s 0s

 70n     0s 0s

 72n     1s 0s

 74n     0s 1s

diff --git a/mag/analog_proj_wrapper_tb.spice b/mag/analog_proj_wrapper_tb.spice
index 29cf90d..9b81b95 100755
--- a/mag/analog_proj_wrapper_tb.spice
+++ b/mag/analog_proj_wrapper_tb.spice
@@ -9,8 +9,8 @@
 + gpio_noesd[11] gpio_noesd[12] gpio_noesd[13] gpio_noesd[14] gpio_noesd[15] gpio_noesd[16]

 + gpio_noesd[17] gpio_noesd[1] gpio_noesd[2] gpio_noesd[3] gpio_noesd[4] gpio_noesd[5]

 + gpio_noesd[6] gpio_noesd[7] gpio_noesd[8] gpio_noesd[9] io_analog[0] io_analog[10]

-+ io_analog[1] io_analog[2] io_analog[7] io_analog[8] io_analog[9] io_clamp_high[0]

-+ io_clamp_high[2] io_clamp_low[2] io_in[0] io_in[10] io_in[11] io_in[12] io_in[13]

++ io_analog[1] io_analog[2] io_analog[3] io_analog[4] io_analog[5] io_analog[6] io_analog[7] io_analog[8] io_analog[9] io_clamp_high[0] io_clamp_high[1]

++ io_clamp_high[2] io_clamp_low[0] io_clamp_low[1] io_clamp_low[2] io_in[0] io_in[10] io_in[11] io_in[12] io_in[13]

 + io_in[14] io_in[15] io_in[16] io_in[17] io_in[18] io_in[19] io_in[1] io_in[20] io_in[21]

 + io_in[22] io_in[23] io_in[24] io_in[25] io_in[26] io_in[2] io_in[3] io_in[4] io_in[5]

 + io_in[6] io_in[7] io_in[8] io_in[9] io_in_3v3[0] io_in_3v3[10] io_in_3v3[11] io_in_3v3[12]

@@ -113,10 +113,15 @@
 vdin gpio_analog[7] a_din 0

 A2 [d_clk]  [a_clk] dac_1v5

 A1 [d_d_in] [a_din] dac_1v5

+* config PRBS speed

+vprbs_cfg2 gpio_analog[11]  0  0

+vprbs_cfg1 gpio_analog[10]  0  0

+vprbs_cfg0 gpio_analog[9]   0  0

 

 * signal in

 vsig io_analog[10] 0 0 PULSE 0 1.5 1n 10p 10p 5n 10n 0

 vsigalt la_data_in[0] 0 0

+vprbsrst gpio_analog[12] 0 0 PWL 0 0 19.990ns 0 20ns 1.5

 

 * Connect VDD and VSS

 vvddio  io_clamp_high[2] VDD 0

@@ -142,16 +147,18 @@
 

 

 .control

-set num_threads=12

 save all

 set temp=27

+set num_threads=6

 

 * RUN SIMULATION

-tran 10p 200n

+*tran 5p 5n

+tran 5p 150n

 

 * OUTPUT

 set hcopydevtype = svg

-hardcopy ./sig_in_sig_out.svg "io_analog[10]"-2 "io_analog[9]" "io_analog[8]" title 'Signal input and output'

+hardcopy ./prbs.svg "xdut.prbs_gen_0/dout" "gpio_analog[12]" "xdut.xprbs_gen_0.sky130_fd_sc_hd__clkinv_4_0/y"+2 "xdut.xprbs_gen_0.sky130_fd_sc_hd__einvn_4_0/a"+4 title "PRBS Gen Signals"

+hardcopy ./sig_in_sig_out.svg "io_analog[10]"-2 "io_analog[9]" "io_analog[8]" "xdut.prbs_gen_0/dout"+2 title 'Signal input and output'

 hardcopy ./reg_write.svg a_clk-2 a_din title 'Register write'

 

 .endc

diff --git a/mag/prbs_gen.mag b/mag/prbs_gen.mag
index 4f22b4c..98c52e8 100644
--- a/mag/prbs_gen.mag
+++ b/mag/prbs_gen.mag
@@ -1,10 +1,17 @@
 magic
 tech sky130A
 magscale 1 2
-timestamp 1647028378
+timestamp 1647065735
+<< checkpaint >>
+rect 8957 8368 18461 8912
+rect 1413 6736 18461 8368
+rect -243 5648 18461 6736
+rect -3923 -3944 19197 5648
+rect -3923 -4488 5213 -3944
 << nwell >>
 rect 9929 3882 9945 4127
 rect 9929 2794 9945 3039
+rect 4685 1706 4885 1951
 rect 9929 1706 9945 1951
 << psubdiff >>
 rect 9880 4404 9931 4438
@@ -24,7 +31,6 @@
 rect 14322 2923 14356 2960
 rect 3749 2311 3790 2336
 rect 3910 2004 3957 2031
-rect 6873 1784 6907 1869
 rect 14322 1835 14356 1872
 rect 2481 872 2637 913
 rect 4228 861 4340 895
@@ -167,8 +173,7 @@
 rect 12603 2356 12637 2390
 rect 12940 2356 12974 2390
 rect 14071 2357 14114 2391
-rect 5754 2034 5788 2068
-rect 6900 2034 6934 2068
+rect 6820 2034 6854 2068
 rect 7236 2034 7270 2068
 rect 8372 2034 8406 2068
 rect 8709 2034 8743 2068
@@ -182,14 +187,15 @@
 rect 3910 1957 3957 2004
 rect 4119 1963 4154 1998
 rect 4570 1948 4630 2008
-rect 5508 1954 5556 2002
+rect 5044 1954 5092 2002
+rect 5387 1954 5427 1994
 rect 6994 1961 7028 1995
 rect 8464 1961 8498 1995
 rect 10026 1961 10060 1995
 rect 11491 1961 11525 1995
 rect 12963 1961 12997 1995
 rect 14322 1872 14356 1906
-rect 6873 1750 6907 1784
+rect 6821 1753 6855 1787
 rect 3288 1549 3322 1583
 rect 4313 1549 4347 1583
 rect 6057 1549 6091 1583
@@ -573,6 +579,10 @@
 rect 14356 2960 14368 2994
 rect 14120 2951 14126 2960
 rect 14310 2954 14368 2960
+rect 5881 2665 5887 2677
+rect 3587 2637 5887 2665
+rect 5881 2625 5887 2637
+rect 5939 2625 5945 2677
 rect 5120 2492 5126 2544
 rect 5178 2492 5184 2544
 rect 4123 2470 4187 2476
@@ -681,24 +691,27 @@
 rect 10023 2313 10069 2325
 rect 4465 2082 4471 2134
 rect 4523 2129 4529 2134
-rect 4523 2088 5791 2129
+rect 4523 2124 5193 2129
+rect 5375 2124 5381 2136
+rect 4523 2096 5381 2124
+rect 4523 2088 5193 2096
 rect 4523 2082 4529 2088
-rect 5742 2080 5791 2088
-rect 5742 2069 5794 2080
-rect 5742 2068 5800 2069
+rect 5375 2084 5381 2096
+rect 5433 2084 5439 2136
+rect 6808 2068 6866 2074
 rect 3719 1972 3725 2040
 rect 3793 1972 3799 2040
-rect 5742 2034 5754 2068
-rect 5788 2034 5800 2068
-rect 5742 2027 5800 2034
-rect 6888 2068 6946 2074
-rect 6888 2034 6900 2068
-rect 6934 2065 6946 2068
+rect 3898 2004 3969 2010
+rect 4564 2008 4636 2020
+rect 5881 2016 5887 2068
+rect 5939 2016 5945 2068
+rect 6808 2034 6820 2068
+rect 6854 2065 6866 2068
 rect 7224 2068 7283 2074
 rect 7224 2065 7236 2068
-rect 6934 2037 7236 2065
-rect 6934 2034 6946 2037
-rect 6888 2028 6946 2034
+rect 6854 2037 7236 2065
+rect 6854 2034 6866 2037
+rect 6808 2028 6866 2034
 rect 7224 2034 7236 2037
 rect 7270 2034 7283 2068
 rect 7224 2028 7283 2034
@@ -746,8 +759,6 @@
 rect 13205 2034 13217 2037
 rect 13251 2034 13263 2068
 rect 13205 2028 13263 2034
-rect 3898 2004 3969 2010
-rect 4564 2008 4636 2020
 rect 3898 1957 3910 2004
 rect 3957 1998 4166 2004
 rect 3957 1963 4119 1998
@@ -755,33 +766,41 @@
 rect 3957 1957 4166 1963
 rect 3898 1951 3969 1957
 rect 4564 1948 4570 2008
-rect 4630 2002 5568 2008
-rect 4630 1954 5508 2002
-rect 5556 1999 5568 2002
+rect 4630 2002 5104 2008
+rect 4630 1954 5044 2002
+rect 5092 1986 5104 2002
+rect 5092 1958 5166 1986
+rect 5092 1954 5104 1958
+rect 4630 1948 5104 1954
+rect 4564 1936 4636 1948
+rect 5138 1920 5166 1958
+rect 5375 1948 5381 2000
+rect 5433 1948 5439 2000
 rect 6982 1999 7040 2001
 rect 8458 1999 8504 2007
 rect 10014 1999 10072 2001
 rect 11479 1999 11537 2001
 rect 12957 1999 13003 2007
 rect 14316 1999 14322 2004
-rect 5556 1995 14322 1999
-rect 5556 1961 6994 1995
+rect 6976 1995 14322 1999
+rect 6976 1990 6994 1995
+rect 6890 1962 6994 1990
+rect 6890 1920 6918 1962
+rect 6976 1961 6994 1962
 rect 7028 1961 8464 1995
 rect 8498 1961 10026 1995
 rect 10060 1961 11491 1995
 rect 11525 1961 12963 1995
 rect 12997 1961 14322 1995
-rect 5556 1957 14322 1961
-rect 5556 1954 5568 1957
+rect 6976 1957 14322 1961
 rect 6982 1955 7040 1957
-rect 4630 1948 5568 1954
 rect 8458 1949 8504 1957
 rect 10014 1955 10072 1957
 rect 11479 1955 11537 1957
 rect 12957 1949 13003 1957
 rect 14316 1952 14322 1957
 rect 14374 1952 14380 2004
-rect 4564 1936 4636 1948
+rect 5138 1892 6918 1920
 rect 14062 1863 14068 1915
 rect 14120 1906 14126 1915
 rect 14310 1906 14368 1912
@@ -789,13 +808,17 @@
 rect 14356 1872 14368 1906
 rect 14120 1863 14126 1872
 rect 14310 1866 14368 1872
-rect 5251 1851 5303 1857
-rect 5251 1793 5303 1799
-rect 5260 1784 5303 1793
-rect 6861 1784 6919 1790
-rect 5260 1750 6873 1784
-rect 6907 1750 6919 1784
-rect 6861 1744 6919 1750
+rect 5238 1784 5244 1796
+rect 5226 1756 5244 1784
+rect 5238 1744 5244 1756
+rect 5296 1784 5302 1796
+rect 6809 1787 6867 1793
+rect 6809 1784 6821 1787
+rect 5296 1756 6821 1784
+rect 5296 1744 5302 1756
+rect 6809 1753 6821 1756
+rect 6855 1753 6867 1787
+rect 6809 1747 6867 1753
 rect 3276 1583 3334 1589
 rect 4108 1583 4114 1592
 rect 47 1552 3288 1583
@@ -1201,6 +1224,7 @@
 rect 6542 2708 7308 2804
 rect 10037 2708 10803 2804
 rect 13532 2708 13992 2804
+rect 5887 2625 5939 2677
 rect 5126 2535 5178 2544
 rect 5126 2501 5135 2535
 rect 5135 2501 5169 2535
@@ -1230,14 +1254,21 @@
 rect 8317 2164 9083 2260
 rect 11792 2164 12558 2260
 rect 4471 2082 4523 2134
+rect 5381 2084 5433 2136
 rect 3725 2034 3793 2040
 rect 3725 1978 3731 2034
 rect 3731 1978 3787 2034
 rect 3787 1978 3793 2034
 rect 3725 1972 3793 1978
+rect 5887 2016 5939 2068
+rect 5381 1994 5433 2000
+rect 5381 1954 5387 1994
+rect 5387 1954 5427 1994
+rect 5427 1954 5433 1994
+rect 5381 1948 5433 1954
 rect 14322 1952 14374 2004
 rect 14068 1863 14120 1915
-rect 5251 1799 5303 1851
+rect 5244 1744 5296 1796
 rect 262 1620 939 1716
 rect 2434 1620 3000 1716
 rect 6542 1620 7308 1716
@@ -1563,13 +1594,23 @@
 rect 3482 864 3534 870
 rect 3491 858 3525 864
 rect 3725 767 3793 1972
-rect 5259 1851 5293 2426
+rect 5259 1802 5293 2426
 rect 5510 2414 5562 2420
 rect 5749 2375 5805 3116
-rect 5749 2313 5805 2319
 rect 6542 2804 7308 3257
-rect 5245 1799 5251 1851
-rect 5303 1799 5309 1851
+rect 5887 2677 5939 2683
+rect 5887 2619 5939 2625
+rect 5749 2313 5805 2319
+rect 5381 2136 5433 2142
+rect 5381 2078 5433 2084
+rect 5393 2006 5421 2078
+rect 5899 2068 5927 2619
+rect 5881 2016 5887 2068
+rect 5939 2016 5945 2068
+rect 5381 2000 5433 2006
+rect 5381 1942 5433 1948
+rect 5244 1796 5296 1802
+rect 5244 1738 5296 1744
 rect 6542 1716 7308 2708
 rect 4114 1592 4166 1598
 rect 4114 1534 4166 1540
@@ -1578,25 +1619,25 @@
 rect 4123 1394 4157 1534
 rect 4114 1388 4166 1394
 rect 4500 1391 4534 1534
+rect 5872 1524 5924 1530
+rect 5872 1466 5924 1472
+rect 5881 1394 5915 1466
 rect 4114 1327 4166 1333
 rect 4491 1385 4543 1391
 rect 4491 1327 4543 1333
+rect 5872 1388 5924 1394
+rect 5872 1330 5924 1336
 rect 4673 1310 4737 1316
 rect 4673 1258 4679 1310
 rect 4731 1258 4737 1310
 rect 4673 1252 4737 1258
-rect 4031 928 4083 934
-rect 4680 912 4730 1252
-rect 4798 1172 5695 1716
-rect 5872 1524 5924 1530
-rect 5872 1466 5924 1472
-rect 5881 1394 5915 1466
-rect 5872 1388 5924 1394
-rect 5872 1330 5924 1336
 rect 6421 1310 6485 1316
 rect 6421 1258 6427 1310
 rect 6479 1258 6485 1310
 rect 6421 1252 6485 1258
+rect 4031 928 4083 934
+rect 4680 912 4730 1252
+rect 4798 1172 5695 1187
 rect 4031 870 4083 876
 rect 4679 906 4731 912
 rect 3719 699 3725 767
@@ -1961,6 +2002,10 @@
 timestamp 1646787781
 transform 1 0 4003 0 -1 2212
 box -38 -48 682 592
+use sky130_fd_sc_hd__dfstp_1  sky130_fd_sc_hd__dfstp_1_0 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
+timestamp 1646787781
+transform 1 0 5015 0 -1 2212
+box -38 -48 1970 592
 use sky130_fd_sc_hd__dfxbp_1  sky130_fd_sc_hd__dfxbp_1_0 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
 timestamp 1646787781
 transform 1 0 2255 0 1 36
@@ -1989,11 +2034,7 @@
 timestamp 1646787781
 transform 1 0 12743 0 1 36
 box -38 -48 1786 592
-use sky130_fd_sc_hd__dfxtp_1  sky130_fd_sc_hd__dfxtp_1_0 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
-timestamp 1646787781
-transform 1 0 5475 0 -1 2212
-box -38 -48 1510 592
-use sky130_fd_sc_hd__dfxtp_1  sky130_fd_sc_hd__dfxtp_1_1
+use sky130_fd_sc_hd__dfxtp_1  sky130_fd_sc_hd__dfxtp_1_1 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
 timestamp 1646787781
 transform 1 0 6947 0 -1 2212
 box -38 -48 1510 592
@@ -2278,15 +2319,15 @@
 transform 1 0 14859 0 1 1124
 box -38 -48 406 592
 use sky130_fd_sc_hd__nand3b_1  sky130_fd_sc_hd__nand3b_1_0 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
-timestamp 1646787781
+timestamp 1647065735
 transform 1 0 7683 0 1 1124
 box -38 -48 590 592
 use sky130_fd_sc_hd__nand3b_1  sky130_fd_sc_hd__nand3b_1_1
-timestamp 1646787781
+timestamp 1647065735
 transform 1 0 11179 0 1 1124
 box -38 -48 590 592
 use sky130_fd_sc_hd__nand3b_1  sky130_fd_sc_hd__nand3b_1_2
-timestamp 1646787781
+timestamp 1647065735
 transform 1 0 12927 0 1 1124
 box -38 -48 590 592
 use sky130_fd_sc_hd__or3_1  sky130_fd_sc_hd__or3_1_0 ~/proj/caravan-project/pdk/sky130A/libs.ref/sky130_fd_sc_hd/mag
@@ -2327,7 +2368,7 @@
 box -38 -48 130 592
 use sky130_fd_sc_hd__tapvpwrvgnd_1  sky130_fd_sc_hd__tapvpwrvgnd_1_5
 timestamp 1646787781
-transform 1 0 5383 0 -1 2212
+transform 1 0 4923 0 -1 2212
 box -38 -48 130 592
 use sky130_fd_sc_hd__tapvpwrvgnd_1  sky130_fd_sc_hd__tapvpwrvgnd_1_6
 timestamp 1646787781
@@ -2382,4 +2423,6 @@
 port 5 n
 flabel metal4 8068 -556 15852 4436 1 FreeSerif 3200 0 0 0 VDD
 port 6 n
+flabel metal1 3587 2637 3615 2665 1 FreeSerif 320 0 0 0 n_rst
+port 7 n
 << end >>
diff --git a/mag/user_analog_project_wrapper.mag b/mag/user_analog_project_wrapper.mag
index 1018c8b..afff4c9 100644
--- a/mag/user_analog_project_wrapper.mag
+++ b/mag/user_analog_project_wrapper.mag
@@ -1,7 +1,7 @@
 magic
 tech sky130A
 magscale 1 2
-timestamp 1647032025
+timestamp 1647066335
 << checkpaint >>
 rect 11573 647230 53167 689591
 rect 3068 645581 11100 647230
@@ -147,6 +147,10 @@
 rect 12881 641849 12887 641975
 rect 13013 641849 25640 641975
 rect 25766 641849 25772 641975
+rect 9285 639288 9291 639340
+rect 9343 639328 9349 639340
+rect 9343 639300 13078 639328
+rect 9343 639288 9349 639300
 rect 12881 638956 12887 639082
 rect 13013 638956 13105 639082
 rect 8603 638203 8609 638255
@@ -229,6 +233,7 @@
 rect 52883 642658 53101 642754
 rect 12887 641849 13013 641975
 rect 25640 641849 25766 641975
+rect 9291 639288 9343 639340
 rect 12887 638956 13013 639082
 rect 8609 638203 8661 638255
 rect 8874 638110 8926 638162
@@ -367,6 +372,25 @@
 rect 6999 641447 7206 642601
 rect 6999 641231 7206 641240
 rect 12887 641975 13013 641981
+rect 9291 639340 9343 639346
+rect 9291 639282 9343 639288
+rect 8609 638255 8661 638261
+rect 8609 638197 8661 638203
+rect 8618 635487 8652 638197
+rect 8868 638110 8874 638162
+rect 8926 638110 8932 638162
+rect 8594 635476 8676 635487
+rect 8883 635480 8917 638110
+rect 9041 638040 9047 638092
+rect 9099 638040 9105 638092
+rect 8594 635416 8605 635476
+rect 8665 635416 8676 635476
+rect 8594 635405 8676 635416
+rect 8859 635469 8941 635480
+rect 8859 635409 8870 635469
+rect 8930 635409 8941 635469
+rect 9056 635468 9090 638040
+rect 9303 635527 9331 639282
 rect 12887 639082 13013 641849
 rect 25640 641975 25766 643732
 rect 26218 643236 26258 644029
@@ -499,27 +523,16 @@
 rect 57514 641802 57739 642827
 rect 57514 641568 57739 641577
 rect 12887 638950 13013 638956
-rect 8609 638255 8661 638261
-rect 8609 638197 8661 638203
-rect 8618 635487 8652 638197
-rect 8868 638110 8874 638162
-rect 8926 638110 8932 638162
-rect 8594 635476 8676 635487
-rect 8883 635480 8917 638110
-rect 9041 638040 9047 638092
-rect 9099 638040 9105 638092
-rect 8594 635416 8605 635476
-rect 8665 635416 8676 635476
-rect 8594 635405 8676 635416
-rect 8859 635469 8941 635480
-rect 8859 635409 8870 635469
-rect 8930 635409 8941 635469
-rect 9056 635468 9090 638040
 rect 8859 635398 8941 635409
 rect 9032 635457 9114 635468
 rect 9032 635397 9043 635457
 rect 9103 635397 9114 635457
+rect 9303 635434 9337 635527
 rect 9032 635386 9114 635397
+rect 9279 635423 9361 635434
+rect 9279 635363 9290 635423
+rect 9350 635363 9361 635423
+rect 9279 635352 9361 635363
 rect 125497 3554 126202 4191
 rect 125497 3530 126253 3554
 rect 125497 2835 125549 3530
@@ -1055,6 +1068,8 @@
 rect 23443 642658 23661 642754
 rect 24915 642658 25133 642754
 rect 6999 641240 7206 641447
+rect 8605 635416 8665 635476
+rect 8870 635409 8930 635469
 rect 26387 643202 26605 643298
 rect 27859 643202 28077 643298
 rect 29331 643202 29549 643298
@@ -1094,9 +1109,8 @@
 rect 51411 642658 51629 642754
 rect 52883 642658 53101 642754
 rect 57514 641577 57739 641802
-rect 8605 635416 8665 635476
-rect 8870 635409 8930 635469
 rect 9043 635397 9103 635457
+rect 9290 635363 9350 635423
 rect 125549 2835 126244 3530
 << metal3 >>
 rect 16194 702300 21194 704800
@@ -1309,6 +1323,10 @@
 rect 9032 635392 9038 635462
 rect 9108 635392 9114 635462
 rect 9032 635386 9114 635392
+rect 9279 635428 9361 635509
+rect 9279 635358 9285 635428
+rect 9355 635358 9361 635428
+rect 9279 635352 9361 635358
 rect 28557 635297 30607 635302
 rect 22687 633245 22693 635297
 rect 24745 635296 30608 635297
@@ -1406,7 +1424,8 @@
 rect 583520 316016 584800 316128
 rect 583520 314834 584800 314946
 rect 583520 313652 584800 313764
-rect -800 295420 480 295532
+rect -800 295420 9260 295532
+rect 9372 295420 9378 295532
 rect -800 294238 480 294350
 rect -800 293056 480 293168
 rect -800 291874 480 291986
@@ -1539,6 +1558,11 @@
 rect 9043 635397 9103 635457
 rect 9103 635397 9108 635457
 rect 9038 635392 9108 635397
+rect 9285 635423 9355 635428
+rect 9285 635363 9290 635423
+rect 9290 635363 9350 635423
+rect 9350 635363 9355 635423
+rect 9285 635358 9355 635363
 rect 22693 633245 24745 635297
 rect 28557 633246 30607 635296
 rect 14573 630589 16662 632678
@@ -1546,6 +1570,7 @@
 rect 8603 425185 8667 425249
 rect 8837 381864 8949 381976
 rect 9034 338642 9146 338754
+rect 9260 295420 9372 295532
 rect 125545 3530 126248 3534
 rect 125545 2835 125549 3530
 rect 125549 2835 126244 3530
@@ -1633,12 +1658,22 @@
 rect 9037 635392 9038 635462
 rect 9108 635392 9109 635462
 rect 9037 635391 9109 635392
+rect 9284 635428 9356 635429
 rect 8836 381976 8950 381977
 rect 8836 381864 8837 381976
 rect 8949 381864 8950 381976
 rect 8836 381863 8950 381864
 rect 8870 381754 8930 381863
 rect 9043 338755 9103 635391
+rect 9284 635358 9285 635428
+rect 9355 635358 9356 635428
+rect 9284 635357 9356 635358
+rect 9033 338754 9147 338755
+rect 9033 338642 9034 338754
+rect 9146 338642 9147 338754
+rect 9033 338641 9147 338642
+rect 9043 338573 9103 338641
+rect 9290 295533 9350 635357
 rect 14573 632679 16662 636497
 rect 22693 635298 24745 636496
 rect 22692 635297 24746 635298
@@ -1649,11 +1684,10 @@
 rect 14572 630589 14573 632678
 rect 16662 630589 16663 632678
 rect 14572 630588 16663 630589
-rect 9033 338754 9147 338755
-rect 9033 338642 9034 338754
-rect 9146 338642 9147 338754
-rect 9033 338641 9147 338642
-rect 9043 338573 9103 338641
+rect 9259 295532 9373 295533
+rect 9259 295420 9260 295532
+rect 9372 295420 9373 295532
+rect 9259 295419 9373 295420
 rect 26713 3535 27418 642076
 rect 71154 635297 73206 655927
 rect 73695 655832 75843 655833
@@ -1702,7 +1736,7 @@
 transform 1 0 7142 0 1 642694
 box -72 -183 11802 839
 use prbs_gen  prbs_gen_0
-timestamp 1647028378
+timestamp 1647065735
 transform 1 0 9436 0 1 636663
 box 9 -562 15852 4986
 use proj_sstl_test  proj_sstl_test_0
diff --git a/netgen/user_analog_project_wrapper.spice b/netgen/user_analog_project_wrapper.spice
index cca662d..ef65067 100644
--- a/netgen/user_analog_project_wrapper.spice
+++ b/netgen/user_analog_project_wrapper.spice
@@ -9,14 +9,6 @@
 X5 a_145_75# A a_59_75# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=1.176e+11p ps=1.4e+06u w=420000u l=150000u
 .ends
 
-.subckt sky130_fd_sc_hd__clkinv_2 A VGND VPWR Y VNB VPB
-X0 Y A VGND VNB sky130_fd_pr__nfet_01v8 ad=1.176e+11p pd=1.4e+06u as=2.205e+11p ps=2.73e+06u w=420000u l=150000u
-X1 Y A VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=5.45e+11p pd=5.09e+06u as=5.45e+11p ps=5.09e+06u w=1e+06u l=150000u
-X2 VPWR A Y VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=1e+06u l=150000u
-X3 VGND A Y VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
-X4 VPWR A Y VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=1e+06u l=150000u
-.ends
-
 .subckt sky130_fd_sc_hd__clkbuf_2 A VGND VPWR X VNB VPB
 X0 VPWR A a_27_47# VPB sky130_fd_pr__pfet_01v8_hvt ad=5.85e+11p pd=5.17e+06u as=2.65e+11p ps=2.53e+06u w=1e+06u l=150000u
 X1 VPWR a_27_47# X VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=2.7e+11p ps=2.54e+06u w=1e+06u l=150000u
@@ -26,6 +18,14 @@
 X5 VGND a_27_47# X VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
 .ends
 
+.subckt sky130_fd_sc_hd__clkinv_2 A VGND VPWR Y VNB VPB
+X0 Y A VGND VNB sky130_fd_pr__nfet_01v8 ad=1.176e+11p pd=1.4e+06u as=2.205e+11p ps=2.73e+06u w=420000u l=150000u
+X1 Y A VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=5.45e+11p pd=5.09e+06u as=5.45e+11p ps=5.09e+06u w=1e+06u l=150000u
+X2 VPWR A Y VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=1e+06u l=150000u
+X3 VGND A Y VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X4 VPWR A Y VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=1e+06u l=150000u
+.ends
+
 .subckt sky130_fd_sc_hd__mux4_1 A0 A1 A2 A3 S0 S1 VGND VPWR X VNB VPB
 X0 a_277_47# a_247_21# a_27_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=2.226e+11p pd=2.74e+06u as=2.184e+11p ps=2.72e+06u w=420000u l=150000u
 X1 VGND S0 a_247_21# VNB sky130_fd_pr__nfet_01v8 ad=6.142e+11p pd=7.3e+06u as=1.092e+11p ps=1.36e+06u w=420000u l=150000u
@@ -207,7 +207,7 @@
 .ends
 
 .subckt p-leg DQ n_cal_ctrl[0] n_cal_ctrl[1] n_cal_ctrl[2] n_cal_ctrl[3] n_pu_ctrl
-+ li_4_2169# VSUBS sky130_fd_sc_hd__fill_8_9/VGND sky130_fd_sc_hd__fill_8_8/VGND VDD
++ li_4_2169# sky130_fd_sc_hd__fill_8_9/VGND VSUBS sky130_fd_sc_hd__fill_8_8/VGND VDD
 Xp-leg_fet_16_4 n_pu_ctrl VDD VDD VDD VDD VDD VDD VDD v_pullup VDD VDD VDD p-leg_fet_16
 Xp-leg_fet_16_5 n_pu_ctrl VDD VDD VDD VDD VDD VDD VDD v_pullup VDD VDD VDD p-leg_fet_16
 Xp-leg_fet_16_6 n_cal_ctrl[0] v_pullup v_pullup v_pullup v_pullup v_pullup v_pullup
@@ -357,10 +357,10 @@
 X1 Y A VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=2.6e+11p pd=2.52e+06u as=2.6e+11p ps=2.52e+06u w=1e+06u l=150000u
 .ends
 
-.subckt SSTL DQ GND pd_cal_ctrl[0] pd_cal_ctrl[1] pd_cal_ctrl[2] pd_cal_ctrl[3] pd_ctrl[0]
+.subckt SSTL DQ pd_cal_ctrl[0] pd_cal_ctrl[1] pd_cal_ctrl[2] pd_cal_ctrl[3] pd_ctrl[0]
 + pd_ctrl[1] pd_ctrl[2] pd_ctrl[3] pd_ctrl[4] pd_ctrl[5] pd_ctrl[6] pu_cal_ctrl[0]
 + pu_cal_ctrl[1] pu_cal_ctrl[2] pu_cal_ctrl[3] pu_ctrl[1] pu_ctrl[2] pu_ctrl[3] pu_ctrl[4]
-+ pu_ctrl[5] pu_ctrl[6] pu_ctrl[0] VDD
++ pu_ctrl[5] pu_ctrl[6] pu_ctrl[0] GND VDD
 Xn-leg_0 n-leg_0/pd_ctrl DQ pd_cal_ctrl[0] pd_cal_ctrl[1] pd_cal_ctrl[2] pd_cal_ctrl[3]
 + VDD GND n-leg
 Xp-leg_3 DQ p-leg_6/n_cal_ctrl[0] p-leg_6/n_cal_ctrl[1] p-leg_6/n_cal_ctrl[2] p-leg_6/n_cal_ctrl[3]
@@ -498,59 +498,59 @@
 + rx_pd_cal[1] rx_pd_cal[2] rx_pd_cal[3] rx_pu_cal[0] rx_pu_cal[1] rx_pu_cal[2] rx_pu_cal[3]
 + tx_leg_ctrl[0] tx_leg_ctrl[1] tx_leg_ctrl[2] tx_leg_ctrl[3] tx_leg_ctrl[4] tx_leg_ctrl[5]
 + tx_leg_ctrl[6] tx_pd_cal[0] tx_pd_cal[1] tx_pd_cal[2] tx_pd_cal[3] tx_pu_cal[0]
-+ tx_pu_cal[1] tx_pu_cal[2] tx_pu_cal[3] dig_VDD dig_GND rx_leg_ctrl[6] SSTL_0/DQ
-+ SSTL_2/DQ SSTL_1/DQ VSUBS
-Xsky130_fd_sc_hd__and2_1_10 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[1] dig_GND dig_VDD
++ tx_pu_cal[1] tx_pu_cal[2] tx_pu_cal[3] dig_VDD rx_leg_ctrl[6] SSTL_0/DQ SSTL_2/DQ
++ SSTL_1/DQ VSUBS
+Xsky130_fd_sc_hd__and2_1_10 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[1] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[5] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_11 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[1] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_11 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[1] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[5] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_12 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[0] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_12 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[0] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[6] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_13 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[0] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_13 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[0] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[6] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_0 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[6] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_0 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[6] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[0] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_1 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[6] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_1 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[6] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[0] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_2 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[5] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_2 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[5] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[1] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_3 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[5] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_3 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[5] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[1] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__clkinv_2_0 sky130_fd_sc_hd__mux4_1_0/X dig_GND dig_VDD sky130_fd_sc_hd__and2_1_9/A
+Xsky130_fd_sc_hd__clkbuf_2_0 sky130_fd_sc_hd__clkbuf_2_0/A VSUBS dig_VDD sky130_fd_sc_hd__clkbuf_2_1/A
++ VSUBS dig_VDD sky130_fd_sc_hd__clkbuf_2
+Xsky130_fd_sc_hd__clkinv_2_0 sky130_fd_sc_hd__mux4_1_0/X VSUBS dig_VDD sky130_fd_sc_hd__and2_1_9/A
 + VSUBS dig_VDD sky130_fd_sc_hd__clkinv_2
-Xsky130_fd_sc_hd__clkbuf_2_0 sky130_fd_sc_hd__clkbuf_2_0/A dig_GND dig_VDD sky130_fd_sc_hd__clkbuf_2_1/A
-+ VSUBS dig_VDD sky130_fd_sc_hd__clkbuf_2
-Xsky130_fd_sc_hd__and2_1_4 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[4] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_4 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[4] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[2] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__mux4_1_0 data_0 sky130_fd_sc_hd__mux4_1_0/A1 data_2 data_3 d_sel_0
-+ d_sel_1 dig_GND dig_VDD sky130_fd_sc_hd__mux4_1_0/X VSUBS dig_VDD sky130_fd_sc_hd__mux4_1
-Xsky130_fd_sc_hd__clkbuf_2_1 sky130_fd_sc_hd__clkbuf_2_1/A dig_GND dig_VDD sky130_fd_sc_hd__mux4_1_0/A1
+Xsky130_fd_sc_hd__clkbuf_2_1 sky130_fd_sc_hd__clkbuf_2_1/A VSUBS dig_VDD sky130_fd_sc_hd__mux4_1_0/A1
 + VSUBS dig_VDD sky130_fd_sc_hd__clkbuf_2
-Xsky130_fd_sc_hd__and2_1_5 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[4] dig_GND dig_VDD
+Xsky130_fd_sc_hd__mux4_1_0 data_0 sky130_fd_sc_hd__mux4_1_0/A1 data_2 data_3 d_sel_0
++ d_sel_1 VSUBS dig_VDD sky130_fd_sc_hd__mux4_1_0/X VSUBS dig_VDD sky130_fd_sc_hd__mux4_1
+Xsky130_fd_sc_hd__and2_1_5 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[4] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[2] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_6 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[3] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_6 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[3] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[3] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_7 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[3] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_7 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[3] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[3] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_8 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[2] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_8 sky130_fd_sc_hd__mux4_1_0/X tx_leg_ctrl[2] VSUBS dig_VDD
 + SSTL_2/pu_ctrl[4] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-Xsky130_fd_sc_hd__and2_1_9 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[2] dig_GND dig_VDD
+Xsky130_fd_sc_hd__and2_1_9 sky130_fd_sc_hd__and2_1_9/A tx_leg_ctrl[2] VSUBS dig_VDD
 + SSTL_2/pd_ctrl[4] VSUBS dig_VDD sky130_fd_sc_hd__and2_1
-XSSTL_0 SSTL_0/DQ VSUBS rx_pd_cal[0] rx_pd_cal[1] rx_pd_cal[2] rx_pd_cal[3] rx_leg_ctrl[6]
+XSSTL_0 SSTL_0/DQ rx_pd_cal[0] rx_pd_cal[1] rx_pd_cal[2] rx_pd_cal[3] rx_leg_ctrl[6]
 + rx_leg_ctrl[5] rx_leg_ctrl[4] rx_leg_ctrl[3] rx_leg_ctrl[2] rx_leg_ctrl[1] rx_leg_ctrl[0]
 + rx_pu_cal[0] rx_pu_cal[1] rx_pu_cal[2] rx_pu_cal[3] rx_leg_ctrl[5] rx_leg_ctrl[4]
-+ rx_leg_ctrl[3] rx_leg_ctrl[2] rx_leg_ctrl[1] rx_leg_ctrl[0] rx_leg_ctrl[6] IO_VDD
-+ SSTL
-XSSTL_2 SSTL_2/DQ VSUBS tx_pd_cal[0] tx_pd_cal[1] tx_pd_cal[2] tx_pd_cal[3] SSTL_2/pd_ctrl[0]
++ rx_leg_ctrl[3] rx_leg_ctrl[2] rx_leg_ctrl[1] rx_leg_ctrl[0] rx_leg_ctrl[6] VSUBS
++ IO_VDD SSTL
+XSSTL_2 SSTL_2/DQ tx_pd_cal[0] tx_pd_cal[1] tx_pd_cal[2] tx_pd_cal[3] SSTL_2/pd_ctrl[0]
 + SSTL_2/pd_ctrl[1] SSTL_2/pd_ctrl[2] SSTL_2/pd_ctrl[3] SSTL_2/pd_ctrl[4] SSTL_2/pd_ctrl[5]
 + SSTL_2/pd_ctrl[6] tx_pu_cal[0] tx_pu_cal[1] tx_pu_cal[2] tx_pu_cal[3] SSTL_2/pu_ctrl[1]
 + SSTL_2/pu_ctrl[2] SSTL_2/pu_ctrl[3] SSTL_2/pu_ctrl[4] SSTL_2/pu_ctrl[5] SSTL_2/pu_ctrl[6]
-+ SSTL_2/pu_ctrl[0] IO_VDD SSTL
-XSSTL_1 SSTL_1/DQ VSUBS tx_pd_cal[0] tx_pd_cal[1] tx_pd_cal[2] tx_pd_cal[3] SSTL_2/pu_ctrl[0]
++ SSTL_2/pu_ctrl[0] VSUBS IO_VDD SSTL
+XSSTL_1 SSTL_1/DQ tx_pd_cal[0] tx_pd_cal[1] tx_pd_cal[2] tx_pd_cal[3] SSTL_2/pu_ctrl[0]
 + SSTL_2/pu_ctrl[1] SSTL_2/pu_ctrl[2] SSTL_2/pu_ctrl[3] SSTL_2/pu_ctrl[4] SSTL_2/pu_ctrl[5]
 + SSTL_2/pu_ctrl[6] tx_pu_cal[0] tx_pu_cal[1] tx_pu_cal[2] tx_pu_cal[3] SSTL_2/pd_ctrl[1]
 + SSTL_2/pd_ctrl[2] SSTL_2/pd_ctrl[3] SSTL_2/pd_ctrl[4] SSTL_2/pd_ctrl[5] SSTL_2/pd_ctrl[6]
-+ SSTL_2/pd_ctrl[0] IO_VDD SSTL
++ SSTL_2/pd_ctrl[0] VSUBS IO_VDD SSTL
 R0 SSTL_0/DQ sky130_fd_sc_hd__clkbuf_2_0/A sky130_fd_pr__res_generic_m1 w=535000u l=6.525e+06u
 .ends
 
@@ -616,6 +616,41 @@
 X7 VGND A a_29_53# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
 .ends
 
+.subckt sky130_fd_sc_hd__dfstp_1 CLK D SET_B VGND VPWR Q VNB VPB
+X0 VGND a_652_21# a_586_47# VNB sky130_fd_pr__nfet_01v8 ad=9.868e+11p pd=1.019e+07u as=1.341e+11p ps=1.5e+06u w=420000u l=150000u
+X1 a_956_413# a_476_47# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=9.66e+10p pd=1.3e+06u as=1.3171e+12p ps=1.335e+07u w=420000u l=150000u
+X2 VPWR a_476_47# a_652_21# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=1.134e+11p ps=1.38e+06u w=420000u l=150000u
+X3 a_586_47# a_193_47# a_476_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=1.44e+11p ps=1.52e+06u w=360000u l=150000u
+X4 VPWR CLK a_27_47# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=1.664e+11p ps=1.8e+06u w=640000u l=150000u
+X5 a_476_47# a_27_47# a_381_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=1.87e+11p ps=1.93e+06u w=360000u l=150000u
+X6 a_1056_47# a_476_47# VGND VNB sky130_fd_pr__nfet_01v8 ad=8.82e+10p pd=1.26e+06u as=0p ps=0u w=420000u l=150000u
+X7 a_381_47# D VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=2.499e+11p pd=2.35e+06u as=0p ps=0u w=840000u l=150000u
+X8 a_652_21# SET_B VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X9 a_1224_47# a_27_47# a_1032_413# VNB sky130_fd_pr__nfet_01v8 ad=8.82e+10p pd=1.26e+06u as=1.386e+11p ps=1.5e+06u w=420000u l=150000u
+X10 a_562_413# a_27_47# a_476_47# VPB sky130_fd_pr__pfet_01v8_hvt ad=1.89e+11p pd=1.74e+06u as=1.134e+11p ps=1.38e+06u w=420000u l=150000u
+X11 VGND a_1032_413# a_1602_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=1.092e+11p ps=1.36e+06u w=420000u l=150000u
+X12 VPWR a_1182_261# a_1140_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=8.82e+10p ps=1.26e+06u w=420000u l=150000u
+X13 Q a_1602_47# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=2.6e+11p pd=2.52e+06u as=0p ps=0u w=1e+06u l=150000u
+X14 a_1032_413# a_193_47# a_1056_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X15 a_476_47# a_193_47# a_381_47# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X16 a_1296_47# a_1182_261# a_1224_47# VNB sky130_fd_pr__nfet_01v8 ad=9.66e+10p pd=1.3e+06u as=0p ps=0u w=420000u l=150000u
+X17 a_193_47# a_27_47# VGND VNB sky130_fd_pr__nfet_01v8 ad=1.092e+11p pd=1.36e+06u as=0p ps=0u w=420000u l=150000u
+X18 VPWR a_652_21# a_562_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X19 VPWR SET_B a_1032_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=2.73e+11p ps=2.98e+06u w=420000u l=150000u
+X20 a_1032_413# a_27_47# a_956_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X21 a_1182_261# a_1032_413# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=2.184e+11p pd=2.2e+06u as=0p ps=0u w=840000u l=150000u
+X22 Q a_1602_47# VGND VNB sky130_fd_pr__nfet_01v8 ad=1.69e+11p pd=1.82e+06u as=0p ps=0u w=650000u l=150000u
+X23 a_193_47# a_27_47# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=1.664e+11p pd=1.8e+06u as=0p ps=0u w=640000u l=150000u
+X24 a_1140_413# a_193_47# a_1032_413# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+X25 VPWR a_1032_413# a_1602_47# VPB sky130_fd_pr__pfet_01v8_hvt ad=0p pd=0u as=1.664e+11p ps=1.8e+06u w=640000u l=150000u
+X26 a_796_47# SET_B VGND VNB sky130_fd_pr__nfet_01v8 ad=8.82e+10p pd=1.26e+06u as=0p ps=0u w=420000u l=150000u
+X27 a_381_47# D VGND VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=640000u l=150000u
+X28 a_1182_261# a_1032_413# VGND VNB sky130_fd_pr__nfet_01v8 ad=1.404e+11p pd=1.6e+06u as=0p ps=0u w=540000u l=150000u
+X29 a_652_21# a_476_47# a_796_47# VNB sky130_fd_pr__nfet_01v8 ad=1.092e+11p pd=1.36e+06u as=0p ps=0u w=420000u l=150000u
+X30 VGND CLK a_27_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=1.092e+11p ps=1.36e+06u w=420000u l=150000u
+X31 VGND SET_B a_1296_47# VNB sky130_fd_pr__nfet_01v8 ad=0p pd=0u as=0p ps=0u w=420000u l=150000u
+.ends
+
 .subckt sky130_fd_sc_hd__nand3b_1 A_N B C VGND VPWR Y VNB VPB
 X0 Y a_53_93# VPWR VPB sky130_fd_pr__pfet_01v8_hvt ad=5.5e+11p pd=5.1e+06u as=6.765e+11p ps=5.44e+06u w=1e+06u l=150000u
 X1 a_232_47# C VGND VNB sky130_fd_pr__nfet_01v8 ad=1.755e+11p pd=1.84e+06u as=2.005e+11p ps=1.97e+06u w=650000u l=150000u
@@ -735,7 +770,7 @@
 X9 X a_215_53# VGND VNB sky130_fd_pr__nfet_01v8 ad=1.7875e+11p pd=1.85e+06u as=0p ps=0u w=650000u l=150000u
 .ends
 
-.subckt prbs_gen cfg_in[0] cfg_in[1] cfg_in[2] dout GND VDD
+.subckt prbs_gen cfg_in[0] cfg_in[1] cfg_in[2] dout GND VDD n_rst
 Xsky130_fd_sc_hd__dfxtp_1_20 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_20/D
 + GND VDD sky130_fd_sc_hd__dfxtp_1_21/D GND VDD sky130_fd_sc_hd__dfxtp_1
 Xsky130_fd_sc_hd__clkbuf_1_7 sky130_fd_sc_hd__dfxbp_1_2/D GND VDD sky130_fd_sc_hd__einvn_1_2/A
@@ -762,10 +797,12 @@
 + GND VDD sky130_fd_sc_hd__dfxtp_1_12/D GND VDD sky130_fd_sc_hd__dfxtp_1
 Xsky130_fd_sc_hd__dfxtp_1_6 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_6/D
 + GND VDD sky130_fd_sc_hd__dfxtp_1_7/D GND VDD sky130_fd_sc_hd__dfxtp_1
-Xsky130_fd_sc_hd__dfxtp_1_23 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_23/D
-+ GND VDD sky130_fd_sc_hd__dfxtp_1_24/D GND VDD sky130_fd_sc_hd__dfxtp_1
+Xsky130_fd_sc_hd__dfstp_1_0 sky130_fd_sc_hd__clkinv_4_0/Y dout n_rst GND VDD sky130_fd_sc_hd__xor3_1_0/A
++ GND VDD sky130_fd_sc_hd__dfstp_1
 Xsky130_fd_sc_hd__dfxtp_1_12 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_12/D
 + GND VDD sky130_fd_sc_hd__dfxtp_1_13/D GND VDD sky130_fd_sc_hd__dfxtp_1
+Xsky130_fd_sc_hd__dfxtp_1_23 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_23/D
++ GND VDD sky130_fd_sc_hd__dfxtp_1_24/D GND VDD sky130_fd_sc_hd__dfxtp_1
 Xsky130_fd_sc_hd__dfxtp_1_7 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_7/D
 + GND VDD sky130_fd_sc_hd__dfxtp_1_8/D GND VDD sky130_fd_sc_hd__dfxtp_1
 Xsky130_fd_sc_hd__dfxtp_1_24 sky130_fd_sc_hd__clkinv_4_0/Y sky130_fd_sc_hd__dfxtp_1_24/D
@@ -860,8 +897,6 @@
 + GND VDD sky130_fd_sc_hd__clkinv_1
 Xsky130_fd_sc_hd__einvn_4_0 sky130_fd_sc_hd__einvn_4_0/A sky130_fd_sc_hd__or3_1_0/X
 + GND VDD sky130_fd_sc_hd__einvn_4_0/Z GND VDD sky130_fd_sc_hd__einvn_4
-Xsky130_fd_sc_hd__dfxtp_1_0 sky130_fd_sc_hd__clkinv_4_0/Y dout GND VDD sky130_fd_sc_hd__xor3_1_0/A
-+ GND VDD sky130_fd_sc_hd__dfxtp_1
 Xsky130_fd_sc_hd__clkinv_1_4 sky130_fd_sc_hd__clkinv_1_4/A GND VDD sky130_fd_sc_hd__clkinv_1_5/A
 + GND VDD sky130_fd_sc_hd__clkinv_1
 Xsky130_fd_sc_hd__clkbuf_1_4 sky130_fd_sc_hd__clkbuf_1_4/A GND VDD sky130_fd_sc_hd__einvn_4_0/A
@@ -1004,8 +1039,8 @@
 + cfg_shift_register_0/q[5] cfg_shift_register_0/q[6] cfg_shift_register_0/q[7] cfg_shift_register_1/q[4]
 + cfg_shift_register_1/q[3] cfg_shift_register_1/q[2] cfg_shift_register_1/q[1] cfg_shift_register_0/q[0]
 + cfg_shift_register_1/q[7] cfg_shift_register_1/q[6] cfg_shift_register_1/q[5] io_clamp_high[0]
-+ io_clamp_low[2] cfg_shift_register_3/q[6] io_analog[10] io_analog[8] io_analog[9]
-+ io_clamp_low[2] proj_sstl_test
++ cfg_shift_register_3/q[6] io_analog[10] io_analog[8] io_analog[9] io_clamp_low[2]
++ proj_sstl_test
 Xcfg_shift_register_0 gpio_analog[8] cfg_shift_register_1/q[7] cfg_shift_register_0/q[0]
 + cfg_shift_register_0/q[1] cfg_shift_register_0/q[2] cfg_shift_register_0/q[3] cfg_shift_register_0/q[4]
 + cfg_shift_register_0/q[5] cfg_shift_register_0/q[6] cfg_shift_register_0/q[7] io_clamp_high[0]
@@ -1023,6 +1058,6 @@
 + cfg_shift_register_3/q[6] cfg_shift_register_3/q[7] io_clamp_high[0] io_clamp_low[2]
 + cfg_shift_register
 Xprbs_gen_0 gpio_analog[9] gpio_analog[10] gpio_analog[11] prbs_gen_0/dout io_clamp_low[2]
-+ io_clamp_high[0] prbs_gen
++ io_clamp_high[0] gpio_analog[12] prbs_gen
 .ends
 
diff --git a/xschem/prb_gen_tb.sch b/xschem/prb_gen_tb.sch
index 810bbcb..c14679b 100644
--- a/xschem/prb_gen_tb.sch
+++ b/xschem/prb_gen_tb.sch
@@ -6,6 +6,7 @@
 E {}
 N 45 -115 145 -115 { lab=cfg_in[2:0]}
 N 685 -115 750 -115 { lab=prbs_dout}
+N 45 -65 145 -65 { lab=rst}
 C {xschem/prbs_gen.sym} 85 45 0 0 {name=X1 VDD=VDD GND=GND}
 C {devices/lab_wire.sym} 750 -115 0 0 {name=l2 sig_type=std_logic lab=prbs_dout}
 C {devices/code_shown.sym} 40 -340 0 0 {name=MODELS
@@ -31,6 +32,7 @@
 vcfg1 cfg_in[1]  0  0
 vcfg0 cfg_in[0]  0  0
 
+vrst rst 0 0 PWL 0 0 19.990ns 0 20ns 1.5
 
 
 
@@ -40,13 +42,14 @@
 set num_threads=6
 
 * RUN SIMULATION
-tran 1p 20n
+tran 1p 200n
 
 * OUTPUT
 set hcopydevtype = svg
-hardcopy ./prbs_tb.svg x1.clk_out prbs_dout+2 title 'PRBS Output'
+hardcopy ./prbs_tb.svg   x1.clk_out prbs_dout+2 rst+2 title 'PRBS Output'
 hardcopy ./prbs_clks.svg x1.clken_0 x1.clken_1+2 x1.clken_2+4 x1.clken_3+6 x1.clken_4+8 x1.clken_5+10 x1.clken_6+12 x1.clken_7+14 title 'prbs clkens'
 
 .endc
 "}
 C {devices/lab_wire.sym} 125 -115 0 0 {name=l1 sig_type=std_logic lab=cfg_in[2:0]}
+C {devices/lab_wire.sym} 125 -65 0 0 {name=l3 sig_type=std_logic lab=rst}
diff --git a/xschem/prbs_gen.sch b/xschem/prbs_gen.sch
index 671a2c2..8cc0661 100644
--- a/xschem/prbs_gen.sch
+++ b/xschem/prbs_gen.sch
@@ -336,6 +336,8 @@
 N -20 -1400 -20 -1280 { lab=cfg_in[0]}
 N -40 -1320 -40 -1200 { lab=cfg_in[1]}
 N -60 -1360 0 -1360 { lab=cfg_in[2]}
+N 2050 -1420 2200 -1420 { lab=n_rst}
+N 2050 -1600 2050 -1420 { lab=n_rst}
 C {sky130/sky130_stdcells/dfxbp_1.sym} 330 -290 0 0 {name=x8 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
 C {sky130/sky130_stdcells/clkbuf_1.sym} 840 -140 0 1 {name=x16 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
 C {devices/code_shown.sym} 995 -115 0 0 {name=MODELS
@@ -414,7 +416,7 @@
 C {devices/lab_wire.sym} 2150 -1460 0 0 {name=l21 sig_type=std_logic lab=clk_out}
 C {sky130/sky130_stdcells/clkinv_1.sym} 380 -80 0 0 {name=x42 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
 C {sky130/sky130_stdcells/clkinv_1.sym} 280 -80 0 0 {name=x43 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
-C {/home/derekhm/cad/share/pdk/sky130A/libs.tech/xschem/sky130_stdcells/dfxtp_1.sym} 2290 -1450 0 0 {name=xsr_0 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
+C {/home/derekhm/cad/share/pdk/sky130A/libs.tech/xschem/sky130_stdcells/dfstp_1.sym} 2290 -1440 0 0 {name=xsr_0 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
 C {sky130/sky130_stdcells/xor3_1.sym} 2320 -1580 2 0 {name=x44 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
 C {devices/opin.sym} 2180 -1600 0 0 {name=p2 lab=dout
 }
@@ -452,3 +454,4 @@
 C {devices/lab_wire.sym} 2980 -1040 2 0 {name=l23 sig_type=std_logic lab=lfsr_28}
 C {devices/lab_wire.sym} 3580 -1080 2 0 {name=l24 sig_type=std_logic lab=lfsr_31}
 C {sky130/sky130_stdcells/clkinv_4.sym} 1940 -1460 0 0 {name=x46 VGND=GND VNB=GND VPB=VDD VPWR=VDD prefix=sky130_fd_sc_hd__ }
+C {devices/ipin.sym} 2050 -1600 0 0 {name=p3 lab=n_rst}
diff --git a/xschem/prbs_gen.sym b/xschem/prbs_gen.sym
index 4a7b729..5e25806 100644
--- a/xschem/prbs_gen.sym
+++ b/xschem/prbs_gen.sym
@@ -1,7 +1,7 @@
 v {xschem version=3.0.0 file_version=1.2 }
 G {}
 K {type=subcircuit
-format="@name @@cfg_in[2:0] @@dout @VDD @GND @symname"
+format="@name @@cfg_in[2:0] @@n_rst @@dout @VDD @GND @symname"
 template="name=X1 VDD=VDD GND=GND"
 extra="VDD GND"}
 V {}
@@ -9,13 +9,17 @@
 E {}
 L 4 560 -160 600 -160 {}
 L 4 60 -160 100 -160 {}
+L 4 60 -110 100 -110 {}
 B 5 57.5 -162.5 62.5 -157.5 {name=cfg_in[2:0]
 dir=in}
 B 5 597.5 -162.5 602.5 -157.5 {name=dout
 dir=out}
+B 5 57.5 -112.5 62.5 -107.5 {name=n_rst
+dir=in}
 P 4 5 100 -200 560 -200 560 -80 100 -80 100 -200 {}
 T {PRBS Sequence 
 Generator} 205 -180 0 0 0.7 0.7 {}
 T {@name} 290 -220 0 0 0.3 0.3 {}
 T {cfg_in[2:0]} 100 -170 0 0 0.3 0.3 {}
 T {dout} 510 -170 0 0 0.3 0.3 {}
+T {n_rst} 100 -120 0 0 0.3 0.3 {}