Tim Edwards | e4c4409 | 2021-02-12 10:18:56 -0500 | [diff] [blame] | 1 | set XCOps(liboverride) 1 |
| 2 | config search libraries .:STAGING_PATH/TECHNAME/libs.tech/xcircuit:$XCIRCUIT_LIB_DIR |
Tim Edwards | 6e20d4f | 2021-02-14 17:57:57 -0500 | [diff] [blame] | 3 | library make generic |
| 4 | library 1 load generic |
| 5 | library make ngspice |
| 6 | library 2 load ngspice |
Tim Edwards | e4c4409 | 2021-02-12 10:18:56 -0500 | [diff] [blame] | 7 | library make TECHNAME_analog |
Tim Edwards | 6e20d4f | 2021-02-14 17:57:57 -0500 | [diff] [blame] | 8 | library 3 load sky130_fd_pr |
Tim Edwards | e4c4409 | 2021-02-12 10:18:56 -0500 | [diff] [blame] | 9 | library make TECHNAME_digital |
Tim Edwards | 6e20d4f | 2021-02-14 17:57:57 -0500 | [diff] [blame] | 10 | library 4 load sky130_fd_sc_hd |
Tim Edwards | 2af86c7 | 2021-02-15 17:58:57 -0500 | [diff] [blame] | 11 | # |
| 12 | # Load math libraries |
| 13 | namespace path {::tcl::mathop ::tcl::mathfunc} |
| 14 | |
| 15 | # Deal with SPICE-type unit suffixes |
| 16 | proc unit_val {unit} { |
| 17 | if {$unit == "T"} { |
| 18 | return 1.0E9 |
| 19 | } elseif {$unit == "G"} { |
| 20 | return 1.0E9 |
| 21 | } elseif {$unit == "M"} { |
| 22 | return 1.0E6 |
| 23 | } elseif {$unit == "k"} { |
| 24 | return 1.0E3 |
| 25 | } elseif {$unit == "m"} { |
| 26 | return 1.0E-3 |
| 27 | } elseif {$unit == "u"} { |
| 28 | return 1.0E-6 |
| 29 | } elseif {$unit == "n"} { |
| 30 | return 1.0E-9 |
| 31 | } elseif {$unit == "p"} { |
| 32 | return 1.0E-12 |
| 33 | } elseif {$unit == "f"} { |
| 34 | return 1.0E-15 |
| 35 | } elseif {$unit == "a"} { |
| 36 | return 1.0E-18 |
| 37 | } else { |
| 38 | return 1.0 |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | #----------------------------------------------- |
| 43 | # Procedures used with sky130_fd_pr library |
| 44 | #----------------------------------------------- |
| 45 | |
Tim Edwards | 2af86c7 | 2021-02-15 17:58:57 -0500 | [diff] [blame] | 46 | # Return MiM cap capacitance value in fF |
| 47 | proc get_mim_value {l w mult} { |
| 48 | return [* $l $w $mult] |
| 49 | } |
| 50 | |
| 51 | # Return high-res poly resistor value in kOhms |
| 52 | proc get_xres_value {l name} { |
| 53 | case $name in \ |
| 54 | res_high_po_0p35 {set rval [* 2.0 [/ $l 0.35]]} \ |
| 55 | res_high_po_0p69 {set rval [* 2.0 [/ $l 0.69]]} \ |
| 56 | res_high_po_1p41 {set rval [* 2.0 [/ $l 1.41]]} \ |
| 57 | res_high_po_2p85 {set rval [* 2.0 [/ $l 2.85]]} \ |
| 58 | res_high_po_5p73 {set rval [* 2.0 [/ $l 5.73]]} \ |
| 59 | default {set rval 0} |
| 60 | return [format "%1.3f" $rval] |
| 61 | } |
| 62 | |
| 63 | # Get VPP cap values according to model (values in fF) |
| 64 | proc get_vpp_noshield_value {name mult} { |
| 65 | case $name in \ |
| 66 | 02p4x04p6_m1m2_noshield {set cval 4.627} \ |
| 67 | 02p7x06p1_m1m2m3m4_shieldl1_fingercap {set cval 12.549} \ |
| 68 | 02p7x11p1_m1m2m3m4_shieldl1_fingercap {set cval 12.399} \ |
| 69 | 02p7x21p1_m1m2m3m4_shieldl1_fingercap {set cval 46.896} \ |
| 70 | 02p7x41p1_m1m2m3m4_shieldl1_fingercap {set cval 93.188} \ |
| 71 | 02p9x06p1_m1m2m3m4_shieldl1_fingercap2 {set cval 13.125} \ |
| 72 | 04p4x04p6_l1m1m2_noshield {set cval 10.281} \ |
| 73 | 04p4x04p6_m1m2_noshield {set cval 8.150} \ |
| 74 | 04p4x04p6_m1m2_noshield_o2 {set cval 9.841} \ |
| 75 | 04p4x04p6_m1m2_shieldl1 {set cval 8.879} \ |
| 76 | 04p4x04p6_m1m2m3_shieldl1 {set cval 11.117} \ |
| 77 | 08p6x07p8_l1m1m2_noshield {set cval 41.828} \ |
| 78 | 08p6x07p8_m1m2_noshield {set cval 35.826} \ |
| 79 | 08p6x07p8_m1m2_shieldl1 {set cval 34.782} \ |
| 80 | 08p6x07p8_m1m2m3_shieldl1 {set cval 43.728} \ |
| 81 | 11p3x11p3_m1m2m3m4_shieldl1_wafflecap {set cval 112.497} \ |
| 82 | 11p5x11p7_l1m1m2_noshield {set cval 96.064} \ |
| 83 | 11p5x11p7_m1m2_noshield {set cval 75.963} \ |
| 84 | 11p5x11p7_m1m2_shieldl1 {set cval 78.124} \ |
| 85 | 11p5x11p7_m1m2m3_shieldl1 {set cval 98.696} \ |
| 86 | 11p5x11p7_m1m4_noshield {set cval 111.693} \ |
| 87 | 44p7x23p1_pol1m1m2m3m4m5_noshield {set cval 1495.053} \ |
| 88 | default {set cval 0} |
| 89 | return [* $cval $mult] |
| 90 | } |
| 91 | |
| 92 | proc get_vpp_shield_value {name mult} { |
| 93 | case $name in \ |
| 94 | 04p4x04p6_m1m2m3_shieldl1m5_floatm4 {set cval 11.443} \ |
| 95 | 04p4x04p6_m1m2m3_shieldl1m5_floatm4_top {set cval 12.098} \ |
| 96 | 05p9x05p9_m1m2m3m4_shieldl1_wafflecap {set cval 28.577} \ |
| 97 | 06p8x06p1_l1m1m2m3_shieldpom4 {set cval 36.122} \ |
| 98 | 06p8x06p1_l1m1m2m3_shieldpom4_top {set cval 36.666} \ |
| 99 | 06p8x06p1_m1m2m3_shieldl1m4 {set cval 28.220} \ |
| 100 | 06p8x06p1_m1m2m3_shieldl1m4_top {set cval 27.723} \ |
| 101 | 08p6x07p8_m1m2m3_shieldl1m5_floatm4 {set cval 43.643} \ |
| 102 | 08p6x07p8_m1m2m3_shieldl1m5_floatm4_top {set 6.363} \ |
| 103 | 11p3x11p8_l1m1m2m3m4_shieldm5_nhvtop {set cval 183.472} \ |
| 104 | 11p5x11p7_l1m1m2m3_shieldm4 {set cval 123.258} \ |
| 105 | 11p5x11p7_l1m1m2m3_shieldm4_top {set cval 493.018} \ |
| 106 | 11p5x11p7_l1m1m2m3_shieldpom4 {set cval 128.617} \ |
| 107 | 11p5x11p7_l1m1m2m3_shieldpom4_top {set cval 516.838} \ |
| 108 | 11p5x11p7_l1m1m2m3m4_shieldm5 {set cval 141.412} \ |
| 109 | 11p5x11p7_l1m1m2m3m4_shieldm5_top {set cval 565.641} \ |
| 110 | 11p5x11p7_l1m1m2m3m4_shieldpom5 {set cval 147.117} \ |
| 111 | 11p5x11p7_l1m1m2m3m4_shieldpom5_top {set cval 588.113} \ |
| 112 | 11p5x11p7_m1m2m3_shieldl1m5_floatm4 {set cval 100.308} \ |
| 113 | 11p5x11p7_m1m2m3_shieldl1m5_floatm4_top {set cval 78.913} \ |
| 114 | 11p5x11p7_m1m2m3m4_shieldl1m5 {set cval 120.658} \ |
| 115 | 11p5x11p7_m1m2m3m4_shieldl1m5_top {set cval 482.574} \ |
| 116 | 11p5x11p7_m1m2m3m4_shieldm5 {set cval 111.909} \ |
| 117 | default {set cval 0} |
| 118 | return [* $cval $mult] |
| 119 | } |