summaryrefslogtreecommitdiff
path: root/Windows/spice/examples/tclspice
diff options
context:
space:
mode:
Diffstat (limited to 'Windows/spice/examples/tclspice')
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench1/PN2222.mod7
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench1/capa.cir30
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench1/tcl-testbench1.sh62
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench1/testCapa.cir9
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench2/example.cir587
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench2/tcl-testbench2.sh48
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench3/FB14.cir458
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench3/differentiate.tcl201
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench3/tcl-testbench3.sh125
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench4/bltGraph.tcl486
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench4/example.cir583
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench4/selectfromlist.tcl55
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench4/tcl-testbench4.sh3
-rw-r--r--Windows/spice/examples/tclspice/tcl-testbench4/vspicechart.tcl250
-rw-r--r--Windows/spice/examples/tclspice/tcl/diffpair.cir29
-rw-r--r--Windows/spice/examples/tclspice/tcl/test_vectoblt.sh59
16 files changed, 2992 insertions, 0 deletions
diff --git a/Windows/spice/examples/tclspice/tcl-testbench1/PN2222.mod b/Windows/spice/examples/tclspice/tcl-testbench1/PN2222.mod
new file mode 100644
index 00000000..d683d374
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench1/PN2222.mod
@@ -0,0 +1,7 @@
+.model PN2222 NPN(Is=14.34f Xti=3 Eg=1.11 Vaf=74.03 Bf=255.9 Ne=1.307
++ Ise=14.34f Ikf=.2847 Xtb=1.5 Br=6.092 Nc=2 Isc=0 Ikr=0 Rc=1
++ Cjc=7.306p Mjc=.3416 Vjc=.75 Fc=.5 Cje=22.01p Mje=.377 Vje=.75
++ Tr=46.91n Tf=411.1p Itf=.6 Vtf=1.7 Xtf=3 Rb=10)
+
+* Fairchild pid=19 case=TO92
+* 88-09-07 bam creation
diff --git a/Windows/spice/examples/tclspice/tcl-testbench1/capa.cir b/Windows/spice/examples/tclspice/tcl-testbench1/capa.cir
new file mode 100644
index 00000000..35478a72
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench1/capa.cir
@@ -0,0 +1,30 @@
+* Capa variable sur la base de la thèse de Marc KODRNJA
+
+.SUBCKT capa 4 6 5 7 8 0
+Vref1 26 0 DC 3
+Vref2 16 0 DC 3
+Vdp 7 0 DC 7
+I0 3 0 DC 0.07
+Ia1 15 0 DC 0.01
+Ia2 25 0 DC 0.01
+Ib1 14 0 DC 0.01
+Ib2 24 0 DC 0.01
+
+.INCLUDE PN2222.mod
+Qv1 4 16 14 PN2222
+Qv2 4 26 24 PN2222
+Q1 11 14 3 PN2222
+Q2 21 24 3 PN2222
+Qp1 5 8 11 PN2222
+Qm1 6 7 11 PN2222
+Qp2 6 8 21 PN2222
+Qm2 5 7 21 PN2222
+Qc1 4 5 15 PN2222
+Qc2 4 6 25 PN2222
+
+R1 4 5 100
+R2 4 6 100
+C1 15 14 10n
+C2 25 24 10n
+.ENDS
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench1/tcl-testbench1.sh b/Windows/spice/examples/tclspice/tcl-testbench1/tcl-testbench1.sh
new file mode 100644
index 00000000..6c74f5e6
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench1/tcl-testbench1.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+# -*- mode: tcl -*- \
+ exec wish -f "$0" ${1+"$@"}
+
+# old name: analyse-20070504-0.tcl
+package require BLT
+load ../../../src/.libs/libspice.so
+
+# Test of virtual capacitore circuit
+# Vary the control voltage and log the resulting capacitance
+spice::source "testCapa.cir"
+
+set n 30
+set dv 0.2
+set vmax [expr $dv/2]
+set vmin [expr -1 * $dv/2]
+set pas [expr $dv/ $n]
+
+blt::vector create Ctmp
+blt::vector create Cim
+blt::vector create check
+
+blt::vector create Vcmd
+blt::graph .cimvd -title "Cim = f(Vd)"
+blt::graph .checkvd -title "Rim = f(Vd)"
+
+blt::vector create Iex
+blt::vector create freq
+blt::graph .freqanal -title "Analyse frequentielle"
+
+set v [expr {$vmin + $n * $pas / 4}]
+spice::alter vd = $v
+spice::op
+spice::ac dec 10 100 100k
+spice::vectoblt {Vex#branch} Iex
+spice::vectoblt {frequency} freq
+pack .freqanal
+.freqanal element create line1 -xdata freq -ydata Iex
+
+for {set i 0} {[expr $n - $i]} {incr i } {
+set v [expr {$vmin + $i * $pas}]
+spice::alter vd = $v
+spice::op
+spice::ac dec 10 100 100k
+
+
+spice::let Cim = real(mean(Vex#branch/(2*Pi*i*frequency*(V(5)-V(6)))))
+spice::vectoblt Cim Ctmp
+Cim append $Ctmp(0:end)
+spice::let err = real(mean(sqrt((Vex#branch-(2*Pi*i*frequency*Cim*V(5)-V(6)))^2)))
+spice::vectoblt err Ctmp
+check append $Ctmp(0:end)
+Vcmd append $v
+
+}
+
+pack .cimvd
+.cimvd element create line1 -xdata Vcmd -ydata Cim
+pack .checkvd
+.checkvd element create line1 -xdata Vcmd -ydata check
+
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench1/testCapa.cir b/Windows/spice/examples/tclspice/tcl-testbench1/testCapa.cir
new file mode 100644
index 00000000..c74cb531
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench1/testCapa.cir
@@ -0,0 +1,9 @@
+Banc de test pour la Capa variable sur la base de la thèse de Marc KODRNJA
+
+.INCLUDE capa.cir
+
+Valim 4 0 DC 12
+Vex 6 5 DC 0 AC 0.01 0
+Vd 7 8 DC 0.0
+xcapa 4 6 5 7 8 0 capa
+.END
diff --git a/Windows/spice/examples/tclspice/tcl-testbench2/example.cir b/Windows/spice/examples/tclspice/tcl-testbench2/example.cir
new file mode 100644
index 00000000..34008f54
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench2/example.cir
@@ -0,0 +1,587 @@
+TITLE: proj1.cir.cir - Rotary Traveling Wave Oscillator
+.control
+set filetype=ascii
+.endc
+
+VDD0 VDD0 VDD DC 0
+VSS0 VSS0 0 DC 0
+VDD_A0 VDD_A0 VDD0 DC 0
+VSS_A0 VSS_A0 VSS0 DC 0
+VDD_B0 VDD_B0 VDD0 DC 0
+VSS_B0 VSS_B0 VSS0 DC 0
+LA0 A0 LCA0 3.69030941553353e-11
+RA0 LCA0 A1 0.266535044422507
+LB0 B0 LCB0 3.69030941553353e-11
+RB0 LCB0 B1 0.266535044422507
+C0 A1 B1 2.50418376625721e-14
+MNA0 B0 A0 VSS_B0 VSS_B0 Nmod L=2.53696435353243e-07 W=
++4.24857778403814e-05 AD=3.125e-11 AS=3.125e-11 PD=
++8.49715556807627e-05 PS=8.49715556807627e-05 NQSMOD=1
+MPA0 B0 A0 VDD_B0 VDD_B0 Pmod L=2.55343565546106e-07 W=
++0.000101772203908557 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203544407817114 PS=0.000203544407817114 NQSMOD=1
+MNB0 A0 B0 VSS_A0 VSS_A0 Nmod L=2.53941602497219e-07 W=
++4.10652659629401e-05 AD=3.125e-11 AS=3.125e-11 PD=
++8.21305319258802e-05 PS=8.21305319258802e-05 NQSMOD=1
+MPB0 A0 B0 VDD_A0 VDD_A0 Pmod L=2.52010168145607e-07 W=
++0.000103533977891464 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207067955782928 PS=0.000207067955782928 NQSMOD=1
+LA1 A1 LCA1 3.69030941553353e-11
+RA1 LCA1 A2 0.266535044422507
+LB1 B1 LCB1 3.69030941553353e-11
+RB1 LCB1 B2 0.266535044422507
+C1 A2 B2 2.50418376625721e-14
+MNA1 B1 A1 0 0 Nmod L=2.52370578161099e-07 W=4.12246995102289e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.24493990204578e-05 PS=
++8.24493990204578e-05 NQSMOD=1
+MPA1 B1 A1 VDD VDD Pmod L=2.45709468983316e-07 W=0.000103710764679465
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207421529358929 PS=
++0.000207421529358929 NQSMOD=1
+MNB1 A1 B1 0 0 Nmod L=2.48115895523017e-07 W=4.26306134285554e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.52612268571108e-05 PS=
++8.52612268571108e-05 NQSMOD=1
+MPB1 A1 B1 VDD VDD Pmod L=2.55265156192223e-07 W=0.000102043840486507
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000204087680973014 PS=
++0.000204087680973014 NQSMOD=1
+LA2 A2 LCA2 3.69030941553353e-11
+RA2 LCA2 A3 0.266535044422507
+LB2 B2 LCB2 3.69030941553353e-11
+RB2 LCB2 B3 0.266535044422507
+C2 A3 B3 2.50418376625721e-14
+MNA2 B2 A2 0 0 Nmod L=2.53484220592882e-07 W=4.16915225420459e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.33830450840917e-05 PS=
++8.33830450840917e-05 NQSMOD=1
+MPA2 B2 A2 VDD VDD Pmod L=2.44256748076514e-07 W=0.00010549295960702
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000210985919214039 PS=
++0.000210985919214039 NQSMOD=1
+MNB2 A2 B2 0 0 Nmod L=2.48805892712811e-07 W=4.15734692647458e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.31469385294916e-05 PS=
++8.31469385294916e-05 NQSMOD=1
+MPB2 A2 B2 VDD VDD Pmod L=2.54004987710956e-07 W=0.00010229621219808
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020459242439616 PS=
++0.00020459242439616 NQSMOD=1
+LA3 A3 LCA3 3.69030941553353e-11
+RA3 LCA3 A4 0.266535044422507
+LB3 B3 LCB3 3.69030941553353e-11
+RB3 LCB3 B4 0.266535044422507
+C3 A4 B4 2.50418376625721e-14
+MNA3 B3 A3 0 0 Nmod L=2.54307430347219e-07 W=4.11339076756089e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22678153512179e-05 PS=
++8.22678153512179e-05 NQSMOD=1
+MPA3 B3 A3 VDD VDD Pmod L=2.52369109463781e-07 W=0.000103371681055656
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206743362111311 PS=
++0.000206743362111311 NQSMOD=1
+MNB3 A3 B3 0 0 Nmod L=2.4960708801709e-07 W=4.21794611046917e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.43589222093833e-05 PS=
++8.43589222093833e-05 NQSMOD=1
+MPB3 A3 B3 VDD VDD Pmod L=2.53834779766428e-07 W=0.000105556314711602
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000211112629423204 PS=
++0.000211112629423204 NQSMOD=1
+LA4 A4 LCA4 3.69030941553353e-11
+RA4 LCA4 A5 0.266535044422507
+LB4 B4 LCB4 3.69030941553353e-11
+RB4 LCB4 B5 0.266535044422507
+C4 A5 B5 2.50418376625721e-14
+MNA4 B4 A4 0 0 Nmod L=2.48091656083177e-07 W=4.11207568141106e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22415136282211e-05 PS=
++8.22415136282211e-05 NQSMOD=1
+MPA4 B4 A4 VDD VDD Pmod L=2.47723605289033e-07 W=0.000103463392309261
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206926784618522 PS=
++0.000206926784618522 NQSMOD=1
+MNB4 A4 B4 0 0 Nmod L=2.49254771880382e-07 W=4.25122425012226e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.50244850024452e-05 PS=
++8.50244850024452e-05 NQSMOD=1
+MPB4 A4 B4 VDD VDD Pmod L=2.49689766979065e-07 W=0.000103227993619608
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206455987239216 PS=
++0.000206455987239216 NQSMOD=1
+LA5 A5 LCA5 3.69030941553353e-11
+RA5 LCA5 A6 0.266535044422507
+LB5 B5 LCB5 3.69030941553353e-11
+RB5 LCB5 B6 0.266535044422507
+C5 A6 B6 2.50418376625721e-14
+MNA5 B5 A5 0 0 Nmod L=2.53960031106522e-07 W=4.1129961792588e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22599235851759e-05 PS=
++8.22599235851759e-05 NQSMOD=1
+MPA5 B5 A5 VDD VDD Pmod L=2.47418707088064e-07 W=0.000101621693062467
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000203243386124935 PS=
++0.000203243386124935 NQSMOD=1
+MNB5 A5 B5 0 0 Nmod L=2.49659687529522e-07 W=4.2524931640785e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.50498632815701e-05 PS=
++8.50498632815701e-05 NQSMOD=1
+MPB5 A5 B5 VDD VDD Pmod L=2.46328059754468e-07 W=0.000102061546065548
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000204123092131096 PS=
++0.000204123092131096 NQSMOD=1
+LA6 A6 LCA6 3.69030941553353e-11
+RA6 LCA6 A7 0.266535044422507
+LB6 B6 LCB6 3.69030941553353e-11
+RB6 LCB6 B7 0.266535044422507
+C6 A7 B7 2.50418376625721e-14
+MNA6 B6 A6 0 0 Nmod L=2.54326804653788e-07 W=4.17332976706085e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.34665953412171e-05 PS=
++8.34665953412171e-05 NQSMOD=1
+MPA6 B6 A6 VDD VDD Pmod L=2.48727427835127e-07 W=0.000103244611103459
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206489222206918 PS=
++0.000206489222206918 NQSMOD=1
+MNB6 A6 B6 0 0 Nmod L=2.49697035135609e-07 W=4.23570035518e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.47140071036001e-05 PS=
++8.47140071036001e-05 NQSMOD=1
+MPB6 A6 B6 VDD VDD Pmod L=2.48995485890626e-07 W=0.000103695454759978
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207390909519956 PS=
++0.000207390909519956 NQSMOD=1
+LA7 A7 LCA7 3.69030941553353e-11
+RA7 LCA7 A8 0.266535044422507
+LB7 B7 LCB7 3.69030941553353e-11
+RB7 LCB7 B8 0.266535044422507
+C7 A8 B8 2.50418376625721e-14
+MNA7 B7 A7 0 0 Nmod L=2.53418975114981e-07 W=4.06421756574473e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.12843513148946e-05 PS=
++8.12843513148946e-05 NQSMOD=1
+MPA7 B7 A7 VDD VDD Pmod L=2.4471861043622e-07 W=0.000104600862141835
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020920172428367 PS=
++0.00020920172428367 NQSMOD=1
+MNB7 A7 B7 0 0 Nmod L=2.50159056393584e-07 W=4.06845582724173e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.13691165448345e-05 PS=
++8.13691165448345e-05 NQSMOD=1
+MPB7 A7 B7 VDD VDD Pmod L=2.55032245177227e-07 W=0.000106482118141681
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000212964236283363 PS=
++0.000212964236283363 NQSMOD=1
+LA8 A8 LCA8 3.69030941553353e-11
+RA8 LCA8 A9 0.266535044422507
+LB8 B8 LCB8 3.69030941553353e-11
+RB8 LCB8 B9 0.266535044422507
+C8 A9 B9 2.50418376625721e-14
+MNA8 B8 A8 0 0 Nmod L=2.45729547191971e-07 W=4.18266198665335e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.3653239733067e-05 PS=8.3653239733067e-05
++NQSMOD=1
+MPA8 B8 A8 VDD VDD Pmod L=2.45156004861421e-07 W=0.000101593205477244
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000203186410954489 PS=
++0.000203186410954489 NQSMOD=1
+MNB8 A8 B8 0 0 Nmod L=2.49014342219656e-07 W=4.14314219478801e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.28628438957603e-05 PS=
++8.28628438957603e-05 NQSMOD=1
+MPB8 A8 B8 VDD VDD Pmod L=2.50396673007567e-07 W=0.000103029640740115
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020605928148023 PS=
++0.00020605928148023 NQSMOD=1
+LA9 A9 LCA9 3.69030941553353e-11
+RA9 LCA9 A10 0.266535044422507
+LB9 B9 LCB9 3.69030941553353e-11
+RB9 LCB9 B10 0.266535044422507
+C9 A10 B10 2.50418376625721e-14
+MNA9 B9 A9 0 0 Nmod L=2.51066307645916e-07 W=4.17044186844862e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.34088373689724e-05 PS=
++8.34088373689724e-05 NQSMOD=1
+MPA9 B9 A9 VDD VDD Pmod L=2.4945438501494e-07 W=0.000104601836030031
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000209203672060063 PS=
++0.000209203672060063 NQSMOD=1
+MNB9 A9 B9 0 0 Nmod L=2.56178041422984e-07 W=4.17990098329256e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.35980196658511e-05 PS=
++8.35980196658511e-05 NQSMOD=1
+MPB9 A9 B9 VDD VDD Pmod L=2.5274010042983e-07 W=0.000103578149162769
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207156298325537 PS=
++0.000207156298325537 NQSMOD=1
+LA10 A10 LCA10 3.69030941553353e-11
+RA10 LCA10 A11 0.266535044422507
+LB10 B10 LCB10 3.69030941553353e-11
+RB10 LCB10 B11 0.266535044422507
+C10 A11 B11 2.50418376625721e-14
+MNA10 B10 A10 0 0 Nmod L=2.45772611943267e-07 W=4.24345922952649e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.48691845905299e-05 PS=
++8.48691845905299e-05 NQSMOD=1
+MPA10 B10 A10 VDD VDD Pmod L=2.55544710347746e-07 W=
++0.000105625826497323 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211251652994645 PS=0.000211251652994645 NQSMOD=1
+MNB10 A10 B10 0 0 Nmod L=2.55886308364338e-07 W=4.0850956346516e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.17019126930321e-05 PS=
++8.17019126930321e-05 NQSMOD=1
+MPB10 A10 B10 VDD VDD Pmod L=2.44778614470725e-07 W=
++0.000105511594248206 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211023188496411 PS=0.000211023188496411 NQSMOD=1
+LA11 A11 LCA11 3.69030941553353e-11
+RA11 LCA11 A12 0.266535044422507
+LB11 B11 LCB11 3.69030941553353e-11
+RB11 LCB11 B12 0.266535044422507
+C11 A12 B12 2.50418376625721e-14
+MNA11 B11 A11 0 0 Nmod L=2.4768739676619e-07 W=4.14724461551725e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.29448923103449e-05 PS=
++8.29448923103449e-05 NQSMOD=1
+MPA11 B11 A11 VDD VDD Pmod L=2.46276216123912e-07 W=
++0.000101782633723501 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203565267447002 PS=0.000203565267447002 NQSMOD=1
+MNB11 A11 B11 0 0 Nmod L=2.54985612770668e-07 W=4.24608643314108e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.49217286628216e-05 PS=
++8.49217286628216e-05 NQSMOD=1
+MPB11 A11 B11 VDD VDD Pmod L=2.45772463970764e-07 W=
++0.000106109588792745 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00021221917758549 PS=0.00021221917758549 NQSMOD=1
+LA12 A12 LCA12 3.69030941553353e-11
+RA12 LCA12 A13 0.266535044422507
+LB12 B12 LCB12 3.69030941553353e-11
+RB12 LCB12 B13 0.266535044422507
+C12 A13 B13 2.50418376625721e-14
+MNA12 B12 A12 0 0 Nmod L=2.45480481009462e-07 W=4.20858793029857e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.41717586059714e-05 PS=
++8.41717586059714e-05 NQSMOD=1
+MPA12 B12 A12 VDD VDD Pmod L=2.48462320158069e-07 W=
++0.00010650127744954 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00021300255489908 PS=0.00021300255489908 NQSMOD=1
+MNB12 A12 B12 0 0 Nmod L=2.51992945030792e-07 W=4.17981435096244e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.35962870192489e-05 PS=
++8.35962870192489e-05 NQSMOD=1
+MPB12 A12 B12 VDD VDD Pmod L=2.49941922576661e-07 W=
++0.0001044851795426 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208970359085199 PS=0.000208970359085199 NQSMOD=1
+LA13 A13 LCA13 3.69030941553353e-11
+RA13 LCA13 A14 0.266535044422507
+LB13 B13 LCB13 3.69030941553353e-11
+RB13 LCB13 B14 0.266535044422507
+C13 A14 B14 2.50418376625721e-14
+MNA13 B13 A13 0 0 Nmod L=2.51146190542173e-07 W=4.23276196447018e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.46552392894035e-05 PS=
++8.46552392894035e-05 NQSMOD=1
+MPA13 B13 A13 VDD VDD Pmod L=2.46359362747576e-07 W=
++0.00010249565409785 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.0002049913081957 PS=0.0002049913081957 NQSMOD=1
+MNB13 A13 B13 0 0 Nmod L=2.44656485453628e-07 W=4.11044634633624e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.22089269267248e-05 PS=
++8.22089269267248e-05 NQSMOD=1
+MPB13 A13 B13 VDD VDD Pmod L=2.56119611942636e-07 W=
++0.0001064085618438 AD=7.8125e-11 AS=7.8125e-11 PD=0.0002128171236876
++PS=0.0002128171236876 NQSMOD=1
+LA14 A14 LCA14 3.69030941553353e-11
+RA14 LCA14 A15 0.266535044422507
+LB14 B14 LCB14 3.69030941553353e-11
+RB14 LCB14 B15 0.266535044422507
+C14 A15 B15 2.50418376625721e-14
+MNA14 B14 A14 0 0 Nmod L=2.47663439668801e-07 W=4.20889991075918e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.41779982151835e-05 PS=
++8.41779982151835e-05 NQSMOD=1
+MPA14 B14 A14 VDD VDD Pmod L=2.51252450429323e-07 W=
++0.000103622229824819 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207244459649638 PS=0.000207244459649638 NQSMOD=1
+MNB14 A14 B14 0 0 Nmod L=2.5044796612668e-07 W=4.24685059762319e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.49370119524638e-05 PS=
++8.49370119524638e-05 NQSMOD=1
+MPB14 A14 B14 VDD VDD Pmod L=2.4786360459861e-07 W=
++0.000104258615459431 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208517230918863 PS=0.000208517230918863 NQSMOD=1
+LA15 A15 LCA15 3.69030941553353e-11
+RA15 LCA15 A16 0.266535044422507
+LB15 B15 LCB15 3.69030941553353e-11
+RB15 LCB15 B16 0.266535044422507
+C15 A16 B16 2.50418376625721e-14
+MNA15 B15 A15 0 0 Nmod L=2.5213362488047e-07 W=4.26610931467994e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.53221862935989e-05 PS=
++8.53221862935989e-05 NQSMOD=1
+MPA15 B15 A15 VDD VDD Pmod L=2.44411053097269e-07 W=
++0.000104344399065411 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208688798130821 PS=0.000208688798130821 NQSMOD=1
+MNB15 A15 B15 0 0 Nmod L=2.44947739168727e-07 W=4.18061319080677e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.36122638161354e-05 PS=
++8.36122638161354e-05 NQSMOD=1
+MPB15 A15 B15 VDD VDD Pmod L=2.45133067349567e-07 W=
++0.000103673770597555 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00020734754119511 PS=0.00020734754119511 NQSMOD=1
+LA16 A16 LCA16 3.69030941553353e-11
+RA16 LCA16 A17 0.266535044422507
+LB16 B16 LCB16 3.69030941553353e-11
+RB16 LCB16 B17 0.266535044422507
+C16 A17 B17 2.50418376625721e-14
+MNA16 B16 A16 0 0 Nmod L=2.5558903414348e-07 W=4.23651981762607e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.47303963525215e-05 PS=
++8.47303963525215e-05 NQSMOD=1
+MPA16 B16 A16 VDD VDD Pmod L=2.46968507923118e-07 W=
++0.000101577430536373 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203154861072746 PS=0.000203154861072746 NQSMOD=1
+MNB16 A16 B16 0 0 Nmod L=2.52441475326891e-07 W=4.0963445615255e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.192689123051e-05 PS=
++8.192689123051e-05 NQSMOD=1
+MPB16 A16 B16 VDD VDD Pmod L=2.49958772476576e-07 W=
++0.000102341104143712 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204682208287424 PS=0.000204682208287424 NQSMOD=1
+LA17 A17 LCA17 3.69030941553353e-11
+RA17 LCA17 A18 0.266535044422507
+LB17 B17 LCB17 3.69030941553353e-11
+RB17 LCB17 B18 0.266535044422507
+C17 A18 B18 2.50418376625721e-14
+MNA17 B17 A17 0 0 Nmod L=2.46623947628415e-07 W=4.07033737509309e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.14067475018618e-05 PS=
++8.14067475018618e-05 NQSMOD=1
+MPA17 B17 A17 VDD VDD Pmod L=2.52274212428759e-07 W=
++0.000105423152156798 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000210846304313596 PS=0.000210846304313596 NQSMOD=1
+MNB17 A17 B17 0 0 Nmod L=2.51233452024547e-07 W=4.12815452669714e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.25630905339429e-05 PS=
++8.25630905339429e-05 NQSMOD=1
+MPB17 A17 B17 VDD VDD Pmod L=2.49324495416238e-07 W=
++0.000104142717459091 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208285434918183 PS=0.000208285434918183 NQSMOD=1
+LA18 A18 LCA18 3.69030941553353e-11
+RA18 LCA18 A19 0.266535044422507
+LB18 B18 LCB18 3.69030941553353e-11
+RB18 LCB18 B19 0.266535044422507
+C18 A19 B19 2.50418376625721e-14
+MNA18 B18 A18 0 0 Nmod L=2.52038203439398e-07 W=4.17044670825126e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.34089341650252e-05 PS=
++8.34089341650252e-05 NQSMOD=1
+MPA18 B18 A18 VDD VDD Pmod L=2.46465042965348e-07 W=
++0.000102305682920291 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204611365840582 PS=0.000204611365840582 NQSMOD=1
+MNB18 A18 B18 0 0 Nmod L=2.45695550122768e-07 W=4.2510656912981e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.50213138259621e-05 PS=
++8.50213138259621e-05 NQSMOD=1
+MPB18 A18 B18 VDD VDD Pmod L=2.56212134001568e-07 W=
++0.000101696358889307 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203392717778614 PS=0.000203392717778614 NQSMOD=1
+LA19 A19 LCA19 3.69030941553353e-11
+RA19 LCA19 A20 0.266535044422507
+LB19 B19 LCB19 3.69030941553353e-11
+RB19 LCB19 B20 0.266535044422507
+C19 A20 B20 2.50418376625721e-14
+MNA19 B19 A19 0 0 Nmod L=2.46298724559332e-07 W=4.26183323927543e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.52366647855085e-05 PS=
++8.52366647855085e-05 NQSMOD=1
+MPA19 B19 A19 VDD VDD Pmod L=2.53903413760174e-07 W=
++0.000103580270078538 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207160540157077 PS=0.000207160540157077 NQSMOD=1
+MNB19 A19 B19 0 0 Nmod L=2.4541336381424e-07 W=4.1471197163819e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.2942394327638e-05 PS=8.2942394327638e-05
++NQSMOD=1
+MPB19 A19 B19 VDD VDD Pmod L=2.51953325753565e-07 W=
++0.0001019745929959 AD=7.8125e-11 AS=7.8125e-11 PD=0.0002039491859918
++PS=0.0002039491859918 NQSMOD=1
+LA20 A20 LCA20 3.69030941553353e-11
+RA20 LCA20 A21 0.266535044422507
+LB20 B20 LCB20 3.69030941553353e-11
+RB20 LCB20 B21 0.266535044422507
+C20 A21 B21 2.50418376625721e-14
+MNA20 B20 A20 0 0 Nmod L=2.55318350883171e-07 W=4.2257523363596e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.4515046727192e-05 PS=
++8.4515046727192e-05 NQSMOD=1
+MPA20 B20 A20 VDD VDD Pmod L=2.50733395598687e-07 W=
++0.000105848300738233 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211696601476467 PS=0.000211696601476467 NQSMOD=1
+MNB20 A20 B20 0 0 Nmod L=2.53961238224852e-07 W=4.07467605160825e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.1493521032165e-05 PS=
++8.1493521032165e-05 NQSMOD=1
+MPB20 A20 B20 VDD VDD Pmod L=2.52173406118976e-07 W=
++0.000104205251139887 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208410502279773 PS=0.000208410502279773 NQSMOD=1
+LA21 A21 LCA21 3.69030941553353e-11
+RA21 LCA21 A22 0.266535044422507
+LB21 B21 LCB21 3.69030941553353e-11
+RB21 LCB21 B22 0.266535044422507
+C21 A22 B22 2.50418376625721e-14
+MNA21 B21 A21 0 0 Nmod L=2.46323292867561e-07 W=4.1601573531982e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.32031470639639e-05 PS=
++8.32031470639639e-05 NQSMOD=1
+MPA21 B21 A21 VDD VDD Pmod L=2.54613442115316e-07 W=
++0.000104931161465525 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00020986232293105 PS=0.00020986232293105 NQSMOD=1
+MNB21 A21 B21 0 0 Nmod L=2.55836584454404e-07 W=4.10424160274173e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.20848320548346e-05 PS=
++8.20848320548346e-05 NQSMOD=1
+MPB21 A21 B21 VDD VDD Pmod L=2.54709741956022e-07 W=
++0.000102062091080516 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204124182161031 PS=0.000204124182161031 NQSMOD=1
+LA22 A22 LCA22 3.69030941553353e-11
+RA22 LCA22 A23 0.266535044422507
+LB22 B22 LCB22 3.69030941553353e-11
+RB22 LCB22 B23 0.266535044422507
+C22 A23 B23 2.50418376625721e-14
+MNA22 B22 A22 0 0 Nmod L=2.54430620981417e-07 W=4.19307535657001e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.38615071314001e-05 PS=
++8.38615071314001e-05 NQSMOD=1
+MPA22 B22 A22 VDD VDD Pmod L=2.46694525572975e-07 W=
++0.000103108817734331 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000206217635468663 PS=0.000206217635468663 NQSMOD=1
+MNB22 A22 B22 0 0 Nmod L=2.4991048194413e-07 W=4.12343575509987e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.24687151019974e-05 PS=
++8.24687151019974e-05 NQSMOD=1
+MPB22 A22 B22 VDD VDD Pmod L=2.53435790976082e-07 W=
++0.000105540213369592 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211080426739185 PS=0.000211080426739185 NQSMOD=1
+LA23 A23 LCA23 3.69030941553353e-11
+RA23 LCA23 A24 0.266535044422507
+LB23 B23 LCB23 3.69030941553353e-11
+RB23 LCB23 B24 0.266535044422507
+C23 A24 B24 2.50418376625721e-14
+MNA23 B23 A23 0 0 Nmod L=2.47985427798248e-07 W=4.14939059451511e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.29878118903023e-05 PS=
++8.29878118903023e-05 NQSMOD=1
+MPA23 B23 A23 VDD VDD Pmod L=2.50625862917368e-07 W=
++0.000104857443713713 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000209714887427425 PS=0.000209714887427425 NQSMOD=1
+MNB23 A23 B23 0 0 Nmod L=2.48906363214973e-07 W=4.09072154111792e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.18144308223583e-05 PS=
++8.18144308223583e-05 NQSMOD=1
+MPB23 A23 B23 VDD VDD Pmod L=2.544246792556e-07 W=
++0.000106667496188909 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000213334992377817 PS=0.000213334992377817 NQSMOD=1
+RCROSS1 A0 B24 0.001
+RCROSS2 B0 A24 0.001
+
+.SAVE VDD0
+.SAVE VSS0
+.SAVE VDD_A0
+.SAVE VSS_A0
+.SAVE VDD_B0
+.SAVE VSS_B0
+.SAVE A0 B0 LA0#branch LB0#branch A1 B1 LA1#branch LB1#branch A2 B2
++LA2#branch LB2#branch A3 B3 LA3#branch LB3#branch A4 B4 LA4#branch
++LB4#branch A5 B5 LA5#branch LB5#branch A6 B6 LA6#branch LB6#branch
++A7 B7 LA7#branch LB7#branch A8 B8 LA8#branch LB8#branch A9 B9
++LA9#branch LB9#branch A10 B10 LA10#branch LB10#branch A11 B11
++LA11#branch LB11#branch A12 B12 LA12#branch LB12#branch A13 B13
++LA13#branch LB13#branch A14 B14 LA14#branch LB14#branch A15 B15
++LA15#branch LB15#branch A16 B16 LA16#branch LB16#branch A17 B17
++LA17#branch LB17#branch A18 B18 LA18#branch LB18#branch A19 B19
++LA19#branch LB19#branch A20 B20 LA20#branch LB20#branch A21 B21
++LA21#branch LB21#branch A22 B22 LA22#branch LB22#branch A23 B23
++LA23#branch LB23#branch
+
+
+**
+**INCLUDING FILE: ./proj1/process.models....
+*
+* Typical N Typical P - from process corners (taken from tsmc025_corners.bsim3 fron NCSU)
+*
+* TSMC 0.25u 5M 1P process. 2.5V transistor models
+
+
+.MODEL Nmod NMOS LEVEL=8
++TNOM = 25
++VERSION = 3.2.2 TOX = 5.8e-9
++XJ = 1E-07 NCH = 2.354946E+17 LLN = 1
++LWN = 1 WLN = 1 WWN = 1
++LINT = 1.76E-08 WINT = 6.75E-09 MOBMOD = 1
++BINUNIT = 2 DWG = 0 DWB = 0
++VTH0 = 0.4321336 LVTH0 = 2.081814E-08 WVTH0 = -5.470342E-11
++PVTH0 = -6.721795E-16 K1 = 0.3281252 LK1 = 9.238362E-08
++WK1 = 2.878255E-08 PK1 = -2.426481E-14 K2 = 0.0402824
++LK2 = -3.208392E-08 WK2 = -1.154091E-08 PK2 = 9.192045E-15
++K3 = 0 DVT0 = 0 DVT1 = 0
++DVT2 = 0 DVT0W = 0 DVT1W = 0
++DVT2W = 0 NLX = 0 W0 = 0
++K3B = 0 VSAT = 7.586954E+04 LVSAT = 3.094656E-03
++WVSAT = -1.747416E-03 PVSAT = 8.820956E-10 UA = 8.924498E-10
++LUA = -1.511745E-16 WUA = -3.509821E-17 PUA = -3.08778E-23
++UB = 8.928832E-21 LUB = -1.655745E-27 WUB = -2.03282E-27
++PUB = 3.4578E-34 UC = -1.364265E-11 LUC = 1.170473E-17
++WUC = -1.256705E-18 PUC = -6.249644E-24 RDSW = 447.8871
++PRWB = 0 PRWG = 0 WR = 0.99
++U0 = 0.06005258 LU0 = -6.31976E-09 WU0 = -8.819531E-09
++PU0 = 3.57209E-15 A0 = -1.468837 LA0 = 6.419548E-07
++WA0 = 5.512414E-07 PA0 = -9.222928E-14 KETA = -0.04922795
++LKETA = 2.360844E-08 WKETA = 1.560385E-08 PKETA = -5.98377E-15
++A1 = 0.02659908 LA1 = -6.511454E-09 A2 = 1
++AGS = -4.01637 LAGS = 1.090294E-06 WAGS = 1.162021E-06
++PAGS = -3.108579E-13 B0 = 0 B1 = 0
++VOFF = -0.1829426 LVOFF = 9.941631E-09 WVOFF = 1.568082E-08
++PVOFF = -2.832958E-15 NFACTOR = 0.6790636 LNFACTOR= 3.454948E-08
++WNFACTOR= 1.501016E-07 PNFACTOR= -2.955591E-14 CIT = 2.218499E-04
++LCIT = -1.076934E-10 WCIT = -3.286884E-10 PCIT = 1.658928E-16
++CDSC = 0 CDSCB = 0 CDSCD = 0
++ETA0 = 1.215578E-04 LETA0 = -1.037758E-11 WETA0 = -3.030225E-11
++PETA0 = 1.529658E-17 ETAB = 3.548681E-03 LETAB = -1.791374E-09
++WETAB = -6.897268E-10 PETAB = 3.481742E-16 DSUB = 0
++PCLM = 3.583838 PDIBLC1 = 0 PDIBLC2 = 5.379674E-03
++LPDIBLC2= 7.808481E-09 WPDIBLC2= 5.516945E-10 PPDIBLC2= -2.784957E-16
++PDIBLCB = -0.1229374 LPDIBLCB= 4.956215E-08 WPDIBLCB= 3.299946E-08
++PPDIBLCB= -9.624918E-15 DROUT = 0 PSCBE1 = 4.472639E+08
++LPSCBE1 = 28.64041 WPSCBE1 = 15.7154 PPSCBE1 = -7.933138E-06
++PSCBE2 = 1.842585E-06 LPSCBE2 = 2.871008E-12 WPSCBE2 = 2.579183E-12
++PPSCBE2 = -1.301972E-18 PVAG = -2.015254E-03 LPVAG = 1.017757E-09
++WPVAG = 3.07622E-10 PPVAG = -1.55418E-16 DELTA = -0.02862256
++LDELTA = 1.492454E-08 WDELTA = -6.71663E-09 PDELTA = 3.407521E-15
++ALPHA0 = 0 BETA0 = 30 KT1 = -0.2579945
++LKT1 = -1.664895E-08 WKT1 = -1.633463E-08 PKT1 = 3.755864E-15
++KT2 = -0.05347481 LKT2 = 8.244731E-09 WKT2 = 1.13705E-09
++PKT2 = -1.240924E-15 AT = -1.132632E+04 LAT = 6.469047E-03
++WAT = 6.829220E-04 PAT = -4.154249E-10 UTE = -2.309089
++LUTE = 1.662427E-07 WUTE = 1.244801E-07 PUTE = -5.627924E-14
++UA1 = -3.461758E-10 LUA1 = 1.747495E-16 WUA1 = -1.42065E-16
++PUA1 = 7.171442E-23 UB1 = 0 UC1 = -2.38157E-12
++LUC1 = -2.895726E-18 WUC1 = -1.990052E-17 PUC1 = 1.004497E-23
++KT1L = 0 PRT = -1E-18 CJ = 2.024128E-3
++MJ = 0.4960069 PB = 0.9173808 CJSW = 2.751528E-10
++MJSW = 0.443145 PBSW = 0.9173808 CJSWG = 2.135064E-10
++MJSWG = 0.443145 PBSWG = 0.9173808
++RSH = 4.5
++XTI = 3
++CGDO = 3.11E-10 CGSO = 3.11E-10 CAPMOD = 2
++XPART = 1 CF = 0
++JS = 1E-06
++JSW = 5E-11
+
+
+
+.MODEL Pmod PMOS LEVEL=8
++VERSION = 3.2.2
++TNOM = 25 TOX = 5.8e-9
++XJ = 1E-7 NCH = 4.1589E17
++LLN = 1 LWN = 1 WLN = 1
++WWN = 1 LINT = 1.2365E-8 WINT = 7.8E-9
++MOBMOD = 1 BINUNIT = 2 DWG = 0
++DWB = 0 VTH0 = -0.6236538 LVTH0 = 2.649834E-8
++WVTH0 = 3.214189E-8 PVTH0 = -3.22268E-15 K1 = 0.4198155
++LK1 = 5.770498E-8 WK1 = 5.577151E-8 PK1 = -2.81684E-14
++K2 = 0.0429467 LK2 = -2.296405E-8 WK2 = -1.355302E-8
++PK2 = 6.848271E-15 K3 = 0 DVT0 = 0
++DVT1 = 0 DVT2 = 0 DVT0W = 0
++DVT1W = 0 DVT2W = 0 NLX = 0
++W0 = 0 K3B = 0 VSAT = 1.443912E5
++LVSAT = -7.688012E-4 WVSAT = -6.083648E-3 PVSAT = 2.186471E-10
++UA = 1.846811E-9 LUA = -3.27694E-16 WUA = -2.82106E-16
++PUA = 7.180233E-23 UB = -7.84535E-19 LUB = 4.772849E-25
++WUB = 2.599205E-25 PUB = -1.46530E-31 UC = -1.75560E-10
++LUC = 3.360832E-17 WUC = 1.504425E-17 PUC = -1.30556E-23
++RDSW = 1.03E3 PRWB = 0 PRWG = 0
++WR = 1 U0 = 0.0136443 LU0 = -7.22084E-10
++WU0 = -1.088554E-9 PU0 = 2.730854E-16 A0 = 0.1071803
++LA0 = 4.64252E-7 WA0 = 5.383179E-7 PA0 = -1.32033E-13
++KETA = -4.943762E-3 LKETA = -3.565304E-9 WKETA = -5.226247E-9
++PKETA = 2.640665E-15 A1 = 0 A2 = 0.4
++AGS = 0.1664005 LAGS = 1.19106E-7 WAGS = 5.29237E-8
++PAGS = -2.67304E-14 B0 = 0 B1 = 0
++VOFF = -0.0592623 LVOFF = -1.96686E-8 WVOFF = -1.486398E-8
++PVOFF = 7.510321E-15 NFACTOR = 0.8588103 LNFACTOR= -1.158881E-7
++WNFACTOR= 1.210664E-8 PNFACTOR= -6.11712E-15 CIT = 6.439495E-5
++LCIT = 2.916437E-10 WCIT = -3.11284E-11 PCIT = 1.572825E-17
++CDSC = 0 CDSCB = 0 CDSCD = 0
++ETA0 = -3.819468E-3 LETA0 = 2.155422E-9 WETA0 = 8.235612E-10
++PETA0 = -4.16037E-16 ETAB = 1.334637E-3 LETAB = -7.93631E-10
++WETAB = 5.284657E-11 PETAB = -2.68353E-17 DSUB = 0
++PCLM = 0.1098002 LPCLM = 6.874263E-7 WPCLM = 6.724724E-7
++PPCLM = -1.97766E-13 PDIBLC1 = 0 PDIBLC2 = 5.801323E-3
++LPDIBLC2= -1.81964E-9 WPDIBLC2= -5.853396E-9 PPDIBLC2= 2.957545E-15
++PDIBLCB = 0.1921199 DROUT = 0 PSCBE1 = 7.19E8
++PSCBE2 = 1E-20 PVAG = 0 DELTA = 0.01
++ALPHA0 = 0 BETA0 = 30 KT1 = -0.3248987
++LKT1 = -1.160393E-8 WKT1 = 4.153356E-8 PKT1 = -4.62347E-15
++KT2 = -0.0367632 AT = 1E4 UTE = -1.04
++UA1 = 3.992421E-10 UB1 = -9.23294E-19 LUB1 = -5.28718E-26
++WUB1 = -6.13069E-26 PUB1 = 1.503674E-32 UC1 = -1.00699E-12
++KT1L = 0 PRT = 0 CJ = 1.931092e-3
++MJ = 0.4812153 PB = 0.9134669 CJSW = 2.232277e-10
++MJSW = 0.3237595 PBSW = 0.9134669 CJSWG = 1.607088e-10
++MJSWG = 0.3237595 PBSWG = 0.9134669
++RSH = 3.5
++CGDO = 2.68e-10 CGSO = 2.68e-10
++CAPMOD = 2
++XPART = 1
++CF = 0 XTI = 3
++JS = 3E-7
++JSW = 5E-12
+
+**.... FINISHED INCLUDING: ./proj1/process.models
+**
+.OPTIONS TEMP=25
+VSLEW_CONTROL VSLEW 0 (PULSE 0 1 0 1e-09)
+EVLOGIC VRAMP 0 VSLEW 0 2.5
+VDDPOWER VDD VRAMP DC 0
+VARACTOR_V VARACTOR_V 0 DC 2.5
+.SAVE vddpower#branch
+.SAVE vdd
+.SAVE varactor_v
+.TRAN 0.02n 100n 0n 0.5n
+.END
diff --git a/Windows/spice/examples/tclspice/tcl-testbench2/tcl-testbench2.sh b/Windows/spice/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
new file mode 100644
index 00000000..458e903d
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench2/tcl-testbench2.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# -*- mode: tcl -*- \
+ exec wish -f "$0" ${1+"$@"}
+
+package require BLT
+load ../../../src/.libs/libspice.so
+namespace import blt::*
+
+wm title . "Vector Test script"
+wm geometry . 800x600+40+40
+pack propagate . false
+
+stripchart .chart
+pack .chart -side top -fill both -expand true
+.chart axis configure x -title "Time"
+
+
+# Create a vector (and call it $vector)
+#vector create v1
+spice::source example.cir
+spice::bg run
+
+after 1000
+
+vector create a0
+vector create b0
+vector create a1
+vector create b1
+vector create stime
+proc bltupdate {} {
+ #puts [spice::spice_data]
+ spice::spicetoblt a0 a0
+ spice::spicetoblt b0 b0
+ spice::spicetoblt a1 a1
+ spice::spicetoblt b1 b1
+ spice::spicetoblt time stime
+ #puts $spice::lastitercount
+ after 100 bltupdate
+}
+bltupdate
+
+
+
+.chart element create a0 -color red -xdata stime -ydata a0
+.chart element create b0 -color blue -xdata stime -ydata b0
+.chart element create a1 -color yellow -xdata stime -ydata a1
+.chart element create b1 -color black -xdata stime -ydata b1
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench3/FB14.cir b/Windows/spice/examples/tclspice/tcl-testbench3/FB14.cir
new file mode 100644
index 00000000..c91931a4
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench3/FB14.cir
@@ -0,0 +1,458 @@
+* gnetlist -g spice-sdb -o tmp.lst FB14_batterie.sch
+*********************************************************
+* Spice file generated by gnetlist *
+* spice-sdb version 12.27.2005 by SDB -- *
+* provides advanced spice netlisting capability. *
+* Documentation at http://www.brorson.com/gEDA/SPICE/ *
+*********************************************************
+*vvvvvvvv Included SPICE model from models/tl431.cir vvvvvvvv
+* modele du TL431
+.subckt TL431-R REFIN ANODE CATHODE
+Q8 Q2_C Q2_C R4_N 0 P1
+Q9 CATHODE Q7_C Q9_E 0 n1
+R8 Q4_E ANODE 800
+R9 Q2_E R9_N 4k
+Q10 CATHODE R6_P ANODE 0 n1 5
+Q11 Q7_C R10_P ANODE 0 n1
+*.nodeset R3_N 1
+C2 R9_N C2_N 20p
+R10 R10_P R1_N 1k
+C1 CATHODE Q7_C 20p
+D1 ANODE Q7_C DIODE
+D2 ANODE CATHODE DIODE
+R4 CATHODE R4_N 800
+Q2 Q2_C Q1_E Q2_E 0 n1
+Q3 R9_N C2_N ANODE 0 n1
+R5 CATHODE R5_N 800
+R6 R6_P Q9_E 150
+Q1 CATHODE REFIN Q1_E 0 n1
+R7 ANODE R6_P 10k
+Q6 Q7_C Q7_C REFIN 0 n1
+Q7 Q7_C Q2_C R5_N 0 P1
+R1 R3_N R1_N 2.4k
+R2 R3_N C2_N 7.2k
+Q4 C2_N R1_N Q4_E 0 n1
+Q5 R1_N R1_N ANODE 0 n1
+R3 Q1_E R3_N 3.28k
+.model p1 pnp bf=50
+.model n1 npn bf=100 tf=2n cjc=1p is=5e-18 NF=1.07
+.model diode d rs=1 cjo=2p
+.ends
+*^^^^^^^^ End of included SPICE model from models/tl431.cir ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/irf4905.spi vvvvvvvv
+.SUBCKT irf4905 1 2 3
+**************************************
+* Model Generated by MODPEX *
+*Copyright(c) Symmetry Design Systems*
+* All Rights Reserved *
+* UNPUBLISHED LICENSED SOFTWARE *
+* Contains Proprietary Information *
+* Which is The Property of *
+* SYMMETRY OR ITS LICENSORS *
+*Commercial Use or Resale Restricted *
+* by Symmetry License Agreement *
+**************************************
+* Model generated on Jun 19, 96
+* Model format: SPICE3
+* Symmetry POWER MOS Model (Version 1.0)
+* External Node Designations
+* Node 1 -> Drain
+* Node 2 -> Gate
+* Node 3 -> Source
+M1 9 7 8 8 MM L=100u W=100u
+* Default values used in MM:
+* The voltage-dependent capacitances are
+* not included. Other default values are:
+* RS=0 RD=0 LD=0 CBD=0 CBS=0 CGBO=0
+.MODEL MM PMOS LEVEL=1 IS=1e-32
++VTO=-3.53713 LAMBDA=0.00549383 KP=23.3701
++CGSO=2.84439e-05 CGDO=1e-11
+RS 8 3 0.0101265
+D1 1 3 MD
+.MODEL MD D IS=1.29014e-08 RS=0.00297795 N=1.46717 BV=55
++IBV=0.00025 EG=1.2 XTI=4 TT=0
++CJO=3.56968e-09 VJ=1.17553 M=0.500933 FC=0.5
+RDS 3 1 2.2e+06
+RD 9 1 0.0001
+RG 2 7 6
+D2 5 4 MD1
+* Default values used in MD1:
+* RS=0 EG=1.11 XTI=3.0 TT=0
+* BV=infinite IBV=1mA
+.MODEL MD1 D IS=1e-32 N=50
++CJO=4.83772e-09 VJ=0.625334 M=0.543532 FC=1e-08
+D3 5 0 MD2
+* Default values used in MD2:
+* EG=1.11 XTI=3.0 TT=0 CJO=0
+* BV=infinite IBV=1mA
+.MODEL MD2 D IS=1e-10 N=0.4 RS=3e-06
+RL 5 10 1
+FI2 7 9 VFI2 -1
+VFI2 4 0 0
+EV16 10 0 9 7 1
+CAP 11 10 6.08035e-09
+FI1 7 9 VFI1 -1
+VFI1 11 6 0
+RCAP 6 10 1
+D4 6 0 MD3
+* Default values used in MD3:
+* EG=1.11 XTI=3.0 TT=0 CJO=0
+* RS=0 BV=infinite IBV=1mA
+.MODEL MD3 D IS=1e-10 N=0.4
+.ENDS
+
+*^^^^^^^^ End of included SPICE model from models/irf4905.spi ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/LM2902.MOD vvvvvvvv
+*//////////////////////////////////////////////////////////////////////
+* (C) National Semiconductor, Inc.
+* Models developed and under copyright by:
+* National Semiconductor, Inc.
+
+*/////////////////////////////////////////////////////////////////////
+* Legal Notice: This material is intended for free software support.
+* The file may be copied, and distributed; however, reselling the
+* material is illegal
+
+*////////////////////////////////////////////////////////////////////
+* For ordering or technical information on these models, contact:
+* National Semiconductor's Customer Response Center
+* 7:00 A.M.--7:00 P.M. U.S. Central Time
+* (800) 272-9959
+* For Applications support, contact the Internet address:
+* amps-apps@galaxy.nsc.com
+
+*//////////////////////////////////////////////////////////
+*LM2902 QUAD OPERATIONAL AMPLIFIER MACRO-MODEL
+*//////////////////////////////////////////////////////////
+*
+* connections: non-inverting input
+* | inverting input
+* | | positive power supply
+* | | | negative power supply
+* | | | | output
+* | | | | |
+* | | | | |
+.SUBCKT LM2902/NS 1 2 99 50 28
+*
+*Features:
+*Eliminates need for dual supplies
+*Large DC voltage gain = 100dB
+*High bandwidth = 1MHz
+*Low input offset voltage = 2mV
+*Wide supply range = +-1.5V to +-16V
+*
+*NOTE: Model is for single device only and simulated
+* supply current is 1/4 of total device current.
+* Output crossover distortion with dual supplies
+* is not modeled.
+*
+****************INPUT STAGE**************
+*
+IOS 2 1 5N
+*^Input offset current
+R1 1 3 500K
+R2 3 2 500K
+I1 99 4 100U
+R3 5 50 517
+R4 6 50 517
+Q1 5 2 4 QX
+Q2 6 7 4 QX
+*Fp2=1.2 MHz
+C4 5 6 128.27P
+*
+***********COMMON MODE EFFECT***********
+*
+I2 99 50 75U
+*^Quiescent supply current
+EOS 7 1 POLY(1) 16 49 2E-3 1
+*Input offset voltage.^
+R8 99 49 60K
+R9 49 50 60K
+*
+*********OUTPUT VOLTAGE LIMITING********
+V2 99 8 1.63
+D1 9 8 DX
+D2 10 9 DX
+V3 10 50 .635
+*
+**************SECOND STAGE**************
+*
+EH 99 98 99 49 1
+G1 98 9 POLY(1) 5 6 0 9.8772E-4 0 .3459
+*Fp1=7.86 Hz
+R5 98 9 101.2433MEG
+C3 98 9 200P
+*
+***************POLE STAGE***************
+*
+*Fp=2 MHz
+G3 98 15 9 49 1E-6
+R12 98 15 1MEG
+C5 98 15 7.9577E-14
+*
+*********COMMON-MODE ZERO STAGE*********
+*
+*Fpcm=10 KHz
+G4 98 16 3 49 5.6234E-8
+L2 98 17 15.9M
+R13 17 16 1K
+*
+**************OUTPUT STAGE**************
+*
+F6 50 99 POLY(1) V6 300U 1
+E1 99 23 99 15 1
+R16 24 23 17.5
+D5 26 24 DX
+V6 26 22 .63V
+R17 23 25 17.5
+D6 25 27 DX
+V7 22 27 .63V
+V5 22 21 0.27V
+D4 21 15 DX
+V4 20 22 0.27V
+D3 15 20 DX
+L3 22 28 500P
+RL3 22 28 100K
+*
+***************MODELS USED**************
+*
+.MODEL DX D(IS=1E-15)
+.MODEL QX PNP(BF=1.111E3)
+*
+.ENDS
+*$
+*^^^^^^^^ End of included SPICE model from models/LM2902.MOD ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/bas70.mod vvvvvvvv
+*
+.SUBCKT BAS70 1 3
+* The Resistor R1 does not reflect
+* a physical device. Instead it
+* improves modeling in the reverse
+* mode of operation.
+R1 1 3 1.409E+09
+D1 1 3 modBAS70
+.MODEL modBAS70 D(
++ IS = 3.22E-09
++ N = 1.018
++ BV = 77
+*+ IBV = 1.67E-07
++ IBV = 10E-06
++ RS = 20.89
++ CJO = 1.655E-12
++ VJ = 0.349
++ M = 0.3583
++ FC = 0.5
++ TT = 0
++ EG = 0.69
++ XTI = 2)
+.ENDS
+*
+*^^^^^^^^ End of included SPICE model from models/bas70.mod ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/BC547B.spi vvvvvvvv
+*
+.MODEL QBC547B NPN(
++ IS=2.39E-14
++ NF=1.008
++ ISE=3.545E-15
++ NE=1.541
++ BF=294.3
++ IKF=0.1357
++ VAF=63.2
++ NR=1.004
++ ISC=6.272E-14
++ NC=1.243
++ BR=7.946
++ IKR=0.1144
++ VAR=25.9
++ RB=1
++ IRB=1E-06
++ RBM=1
++ RE=0.4683
++ RC=0.85
++ XTB=0
++ EG=1.11
++ XTI=3
++ CJE=1.358E-11
++ VJE=0.65
++ MJE=0.3279
++ TF=4.391E-10
++ XTF=120
++ VTF=2.643
++ ITF=0.7495
++ PTF=0
++ CJC=3.728E-12
++ VJC=0.3997
++ MJC=0.2955
++ XCJC=0.6193
++ TR=1E-32
++ CJS=0
++ VJS=0.75
++ MJS=0.333
++ FC=0.9579 )
+*
+*^^^^^^^^ End of included SPICE model from models/BC547B.spi ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/LM293.5_1 vvvvvvvv
+* LM293 VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
+* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 14:17
+* REV (N/A)
+* CONNECTIONS: NON-INVERTING INPUT
+* | INVERTING INPUT
+* | | POSITIVE POWER SUPPLY
+* | | | NEGATIVE POWER SUPPLY
+* | | | | OPEN COLLECTOR OUTPUT
+* | | | | |
+.SUBCKT LM293 1 2 3 4 5
+*
+ F1 9 3 V1 1
+ IEE 3 7 DC 100.0E-6
+ VI1 21 1 DC .75
+ VI2 22 2 DC .75
+ Q1 9 21 7 QIN
+ Q2 8 22 7 QIN
+ Q3 9 8 4 QMO
+ Q4 8 8 4 QMI
+.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
+.MODEL QMI NPN(IS=800.0E-18 BF=1002)
+.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
+ E1 10 4 9 4 1
+ V1 10 11 DC 0
+ Q5 5 11 4 QOC
+.MODEL QOC NPN(IS=800.0E-18 BF=20.29E3 CJC=1E-15 TF=942.6E-12 TR=543.8E-9)
+ DP 4 3 modDX
+ RP 3 4 46.3E3
+.MODEL modDX D(IS=800.0E-18)
+*
+.ENDS
+
+*^^^^^^^^ End of included SPICE model from models/LM293.5_1 ^^^^^^^^
+*
+*vvvvvvvv Included SPICE model from models/NTD18N06L.REV0.SP3 vvvvvvvv
+.SUBCKT ntd18n06l 1 2 3
+**************************************
+* Model Generated by MODPEX *
+*Copyright(c) Symmetry Design Systems*
+* All Rights Reserved *
+* UNPUBLISHED LICENSED SOFTWARE *
+* Contains Proprietary Information *
+* Which is The Property of *
+* SYMMETRY OR ITS LICENSORS *
+*Commercial Use or Resale Restricted *
+* by Symmetry License Agreement *
+**************************************
+* Model generated on Aug 3, 04
+* MODEL FORMAT: SPICE3
+* Symmetry POWER MOS Model (Version 1.0)
+* External Node Designations
+* Node 1 -> Drain
+* Node 2 -> Gate
+* Node 3 -> Source
+M1 9 7 8 8 MM L=100u W=100u
+* Default values used in MM:
+* The voltage-dependent capacitances are
+* not included. Other default values are:
+* RS=0 RD=0 LD=0 CBD=0 CBS=0 CGBO=0
+.MODEL MM NMOS LEVEL=1 IS=1e-32
++VTO=1.98948 LAMBDA=0 KP=21.272
++CGSO=4.18085e-06 CGDO=8.56633e-08
+RS 8 3 0.0375073
+D1 3 1 MD
+.MODEL MD D IS=8.82716e-09 RS=0.00616994 N=1.5 BV=60
++IBV=0.00025 EG=1 XTI=2.2423 TT=0
++CJO=5.77207e-10 VJ=0.656334 M=0.448458 FC=0.5
+RDS 3 1 2.4e+11
+RD 9 1 0.0001
+RG 2 7 17.1584
+D2 4 5 MD1
+* Default values used in MD1:
+* RS=0 EG=1.11 XTI=3.0 TT=0
+* BV=infinite IBV=1mA
+.MODEL MD1 D IS=1e-32 N=50
++CJO=6.54462e-10 VJ=1.69471 M=0.891807 FC=1e-08
+D3 0 5 MD2
+* Default values used in MD2:
+* EG=1.11 XTI=3.0 TT=0 CJO=0
+* BV=infinite IBV=1mA
+.MODEL MD2 D IS=1e-10 N=0.400114 RS=3e-06
+RL 5 10 1
+FI2 7 9 VFI2 -1
+VFI2 4 0 0
+EV16 10 0 9 7 1
+CAP 11 10 6.54462e-10
+FI1 7 9 VFI1 -1
+VFI1 11 6 0
+RCAP 6 10 1
+D4 0 6 MD3
+* Default values used in MD3:
+* EG=1.11 XTI=3.0 TT=0 CJO=0
+* RS=0 BV=infinite IBV=1mA
+.MODEL MD3 D IS=1e-10 N=0.400114
+.ENDS ntd18n06l
+
+*^^^^^^^^ End of included SPICE model from models/NTD18N06L.REV0.SP3 ^^^^^^^^
+*
+*============== Begin SPICE netlist of main design ============
+X10 iimage vertsup Vcc 0 ledverte LM293
+R20 vmbatm 1 10k
+*.INCLUDE models/NTD18N06L.REV0.SP3
+*.INCLUDE models/LM293.5_1
+R33 Imbat V9p 100
+*.INCLUDE models/BC547B.spi
+R32 V9p 0 10k
+*.INCLUDE models/bas70.mod
+R31 ledverte Vcc 22k
+*.INCLUDE models/LM2902.MOD
+R30 ledrouge Vcc 22k
+*.INCLUDE models/irf4905.spi
+*.INCLUDE models/tl431.cir
+Vbat 2 vmbatm DC 9V
+V3 3 0 DC 6V
+R? 0 Vcc 2.2k
+R19 vmbat Vs2 22k
+V1 Vcc 0 DC 26V
+R18 Vs2 Vcc 2.2k
+R17 vref2 0 430
+R16 v7m Vs2 100k
+X9 V9p V9m Vcc 0 Iimage LM2902/NS
+R15 iimage v7m 100
+R14 vmbat imbat 0.1
+X8 vcc 1 BAS70
+R9 Vcc vref1 2.2k
+R29 0 vertsup 1K
+X7 vref2 v7m Vcc 0 Vs2 LM293
+R8 V2p Vs2 100k
+R13 Vcc vref_temp 2.2k
+R28 vertsup ledrouge 22k
+X6 Vcc Vs2 imbat ntd18n06l
+R7 V2p Vimage 1k
+R12 0 Vtest_temp 6.05k
+R27 rougesup rougeinf 20k
+X5 0 1 vmbatm ntd18n06l
+R6 vref2 Vtest1 660
+R11 Vtest_temp vref_temp 10k
+R26 0 rougeinf 2.2k
+R10 Vtest_temp vref_temp 9.387k
+X4 Vtest1 0 vref1 TL431-R
+R5 Vtest1 vref1 2.83k
+R25 3 rougesup 2.2k
+X3 Vtest_temp 0 vref_temp TL431-R
+R4 0 v1p 22k
+Vvcc cmd_buck 0 DC 0V
+R24 V9m Iimage 10k
+X2 vref_temp V2p Vcc 0 Vs2 LM293
+R3 V1m Vimage 22k
+X13 ledrouge 4 BAS70
+R23 Vmbat V9m 100
+X1 v1p V1m Vcc 0 Vimage LM2902/NS
+R2 vref1 V1m 22k
+Rbat 2 vmbat 100
+X12 vimage rougeinf Vcc 0 4 LM293
+R22 Vmbatm V1m 22k
+R1 vmbat v1p 22k
+X11 rougesup vimage Vcc 0 4 LM293
+R21 0 v1p 22k
+.end
diff --git a/Windows/spice/examples/tclspice/tcl-testbench3/differentiate.tcl b/Windows/spice/examples/tclspice/tcl-testbench3/differentiate.tcl
new file mode 100644
index 00000000..2356cd1d
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench3/differentiate.tcl
@@ -0,0 +1,201 @@
+# differentiate.tcl --
+# Numerical differentiation
+#
+
+namespace eval ::math::calculus {
+}
+namespace eval ::math::optimize {
+}
+
+# deriv --
+# Return the derivative of a function at a given point
+# Arguments:
+# func Name of a procedure implementing the function
+# point Coordinates of the point
+# scale (Optional) the scale of the coordinates
+# Result:
+# List representing the gradient vector at the given point
+# Note:
+# The scale is necessary to create a proper step in the
+# coordinates. The derivative is estimated using central
+# differences.
+# The function may have an arbitrary number of arguments,
+# for each the derivative is determined - this results
+# in a list of derivatives rather than a single value.
+# (No provision is made for the function to be a
+# vector function! So, second derivatives are not
+# possible)
+#
+proc ::math::calculus::deriv {func point {scale {}} } {
+
+ set epsilon 1.0e-12
+ set eps2 [expr {sqrt($epsilon)}]
+
+ #
+ # Determine a scale
+ #
+ foreach c $point {
+ if { $scale == {} } {
+ set scale [expr {abs($c)}]
+ } else {
+ if { $scale < abs($c) } {
+ set scale [expr {abs($c)}]
+ }
+ }
+ }
+ if { $scale == 0.0 } {
+ set scale 1.0
+ }
+
+ #
+ # Check the number of coordinates
+ #
+ if { [llength $point] == 1 } {
+ set v1 [$func [expr {$point+$eps2*$scale}]]
+ set v2 [$func [expr {$point-$eps2*$scale}]]
+ return [expr {($v1-$v2)/(2.0*$eps2*$scale)}]
+ } else {
+ set result {}
+ set idx 0
+ foreach c $point {
+ set c1 [expr {$c+$eps2*$scale}]
+ set c2 [expr {$c-$eps2*$scale}]
+
+ set v1 [eval $func [lreplace $point $idx $idx $c1]]
+ set v2 [eval $func [lreplace $point $idx $idx $c2]]
+
+ lappend result [expr {($v1-$v2)/(2.0*$eps2*$scale)}]
+ incr idx
+ }
+ return $result
+ }
+}
+
+# auxiliary functions --
+#
+proc ::math::optimize::unitVector {vector} {
+ set length 0.0
+ foreach c $vector {
+ set length [expr {$length+$c*$c}]
+ }
+ scaleVector $vector [expr {1.0/sqrt($length)}]
+}
+proc ::math::optimize::scaleVector {vector scale} {
+ set result {}
+ foreach c $vector {
+ lappend result [expr {$c*$scale}]
+ }
+ return $result
+}
+proc ::math::optimize::addVector {vector1 vector2} {
+ set result {}
+ foreach c1 $vector1 c2 $vector2 {
+ lappend result [expr {$c1+$c2}]
+ }
+ return $result
+}
+
+# minimumSteepestDescent --
+# Find the minimum of a function via steepest descent
+# (unconstrained!)
+# Arguments:
+# func Name of a procedure implementing the function
+# point Coordinates of the starting point
+# eps (Optional) measure for the accuracy
+# maxsteps (Optional) maximum number of steps
+# Result:
+# Coordinates of a point near the minimum
+#
+proc ::math::optimize::minimumSteepestDescent {func point {eps 1.0e-5} {maxsteps 100} } {
+
+ set factor 100
+ set nosteps 0
+ if { [llength $point] == 1 } {
+ while { $nosteps < $maxsteps } {
+ set fvalue [$func $point]
+ set gradient [::math::calculus::deriv $func $point]
+ if { $gradient < 0.0 } {
+ set gradient -1.0
+ } else {
+ set gradient 1.0
+ }
+ set found 0
+ set substeps 0
+ while { $found == 0 && $substeps < 3 } {
+ set newpoint [expr {$point-$factor*$gradient}]
+ set newfval [$func $newpoint]
+
+ #puts "factor: $factor - point: $point"
+ #
+ # Check that the new point has a lower value for the
+ # function. Can we increase the factor?
+ #
+ #
+ if { $newfval < $fvalue } {
+ set point $newpoint
+
+#
+# This failed with sin(x), x0 = 1.0
+# set newpoint2 [expr {$newpoint-$factor*$gradient}]
+# set newfval2 [$func $newpoint2]
+# if { $newfval2 < $newfval } {
+# set factor [expr {2.0*$factor}]
+# set point $newpoint2
+# }
+ set found 1
+ } else {
+ set factor [expr {$factor/2.0}]
+ }
+
+ incr substeps
+ }
+
+ #
+ # Have we reached convergence?
+ #
+ if { abs($factor*$gradient) < $eps } {
+ break
+ }
+ incr nosteps
+ }
+ } else {
+ while { $nosteps < $maxsteps } {
+ set fvalue [eval $func $point]
+ set gradient [::math::calculus::deriv $func $point]
+ set gradient [unitVector $gradient]
+
+ set found 0
+ set substeps 0
+ while { $found == 0 && $nosteps < $maxsteps } {
+ set newpoint [addVector $point [scaleVector $gradient -$factor]]
+ set newfval [eval $func $newpoint]
+
+ #puts "factor: $factor - point: $point"
+ #
+ # Check that the new point has a lower value for the
+ # function. Can we increase the factor?
+ #
+ #
+ if { $newfval < $fvalue } {
+ set point $newpoint
+ set found 1
+ } else {
+ set factor [expr {$factor/2.0}]
+ }
+
+ incr nosteps
+ }
+
+ #
+ # Have we reached convergence?
+ #
+ if { abs($factor) < $eps } {
+ break
+ }
+ incr nosteps
+ }
+ }
+
+ return $point
+}
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench3/tcl-testbench3.sh b/Windows/spice/examples/tclspice/tcl-testbench3/tcl-testbench3.sh
new file mode 100644
index 00000000..e440d8d1
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench3/tcl-testbench3.sh
@@ -0,0 +1,125 @@
+#!/bin/sh
+# -*- mode: tcl -*- \
+ exec wish -f "$0" ${1+"$@"}
+
+package require BLT
+load ../../../src/.libs/libspice.so
+source differentiate.tcl
+spice::codemodel ../../../src/xspice/icm/spice2poly/spice2poly.cm
+proc temperatures_calc {temp_inf temp_sup points} {
+ set tstep [ expr " ( $temp_sup - $temp_inf ) / $points " ]
+ set t $temp_inf
+ set temperatures ""
+ for { set i 0 } { $i < $points } { incr i } {
+ set t [ expr { $t + $tstep } ]
+ set temperatures "$temperatures $t"
+ }
+ return $temperatures
+}
+
+proc thermistance_calc { res B points } {
+ set tzero 273.15
+ set tref 25
+ set thermistance ""
+ foreach t $points {
+ set res_temp [expr " $res * exp ( $B * ( 1 / ($tzero + $t) - 1 / ( $tzero + $tref ) ) ) " ]
+ set thermistance "$thermistance $res_temp"
+ }
+ return $thermistance
+}
+
+proc tref_calc { points } {
+ set tref ""
+ foreach t $points {
+ set tref " $tref [ expr " 6 * (2.275-0.005*($t - 20) ) - 9 " ] "
+ }
+ return $tref
+}
+
+proc iteration { t } {
+ set tzero 273.15
+ spice::alter r11=[ thermistance_calc 10000 3900 $t ]
+ #spice::set temp = [ expr " $tzero + $t " ]
+ spice::op
+ spice::vectoblt vref_temp tref_tmp
+ spice::destroy all
+ return [ tref_tmp range 0 0 ]
+}
+
+proc cost_square { r10 r12 } {
+ tref_blt length 0
+
+ spice::alter r10=$r10
+ spice::alter r12=$r12
+
+ foreach point [ temperatures_blt range 0 [ expr " [temperatures_blt length ] - 1" ] ] {
+ tref_blt append [ iteration $point ]
+ }
+
+ set result [ blt::vector expr " sum(( tref_blt - expected_blt )^2 )" ]
+ puts "result square : r10 = $r10 r12 = $r12 gives $result"
+
+ return $result
+}
+
+proc cost_sup { r10 r12 } {
+ tref_blt length 0
+
+ spice::alter r10=$r10
+ spice::alter r12=$r12
+
+ foreach point [ temperatures_blt range 0 [ expr " [temperatures_blt length ] - 1" ] ] {
+ tref_blt append [ iteration $point ]
+ }
+
+ set result [ blt::vector expr " max(sqrt(( tref_blt - expected_blt )^2 ))" ]
+ puts "result sup : $result"
+ puts "result sup : r10 = $r10 r12 = $r12 gives $result"
+
+ return $result
+}
+
+proc disp_curve { r10 r12 } {
+.g configure -title "Valeurs optimales: R10 = $r10 R12 = $r12"
+}
+
+#
+# Optimisation
+#
+
+blt::vector create tref_tmp
+blt::vector create tref_blt
+blt::vector create expected_blt
+blt::vector create temperatures_blt
+temperatures_blt append [ temperatures_calc -25 75 30 ]
+expected_blt append [ tref_calc [temperatures_blt range 0 [ expr " [ temperatures_blt length ] - 1" ] ] ]
+blt::graph .g
+pack .g -side top -fill both -expand true
+.g element create real -pixels 4 -xdata temperatures_blt -ydata tref_blt
+.g element create expected -fill red -pixels 0 -dashes dot -xdata temperatures_blt -ydata expected_blt
+
+spice::source FB14.cir
+# point1 max iteration is the last argument
+set r10r12 [ ::math::optimize::minimumSteepestDescent cost_square { 10000 10000 } 1.9 20 ]
+puts "$r10r12 "
+regexp {([0-9.]*) ([0-9.]*)} $r10r12 r10r12 r10 r12
+puts "result square with : r10 = $r10 r12 = $r12 "
+set r10r12 [ ::math::optimize::minimumSteepestDescent cost_sup " $r10 $r12 " 0.05 20 ]
+puts "$r10r12 "
+regexp {([0-9.]*) ([0-9.]*)} $r10r12 r10r12 r10 r12
+puts "result sup with : r10 = $r10 r12 = $r12 "
+
+
+#
+# Results
+#
+
+
+spice::alter r10=$r10
+spice::alter r12=$r12
+foreach point [ temperatures_blt range 0 [ expr " [temperatures_blt length ] - 1" ] ] {
+ tref_blt append [ iteration $point ]
+}
+disp_curve $r10 $r12
+
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench4/bltGraph.tcl b/Windows/spice/examples/tclspice/tcl-testbench4/bltGraph.tcl
new file mode 100644
index 00000000..07eb942f
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench4/bltGraph.tcl
@@ -0,0 +1,486 @@
+
+proc Blt_ActiveLegend { graph } {
+ $graph legend bind all <Enter> [list blt::ActivateLegend $graph ]
+ $graph legend bind all <Leave> [list blt::DeactivateLegend $graph]
+ $graph legend bind all <ButtonPress-1> [list blt::HighlightLegend $graph]
+}
+
+proc Blt_Crosshairs { graph } {
+ blt::Crosshairs $graph
+}
+
+proc Blt_ZoomStack { graph } {
+ blt::ZoomStack $graph
+}
+
+proc Blt_PrintKey { graph } {
+ blt::PrintKey $graph
+}
+
+proc Blt_ClosestPoint { graph } {
+ blt::ClosestPoint $graph
+}
+
+#
+# The following procedures that reside in the "blt" namespace are
+# supposed to be private.
+#
+
+proc blt::ActivateLegend { graph } {
+ set elem [$graph legend get current]
+ $graph legend activate $elem
+}
+proc blt::DeactivateLegend { graph } {
+ set elem [$graph legend get current]
+ $graph legend deactivate $elem
+}
+
+proc blt::HighlightLegend { graph } {
+ set elem [$graph legend get current]
+ set relief [$graph element cget $elem -labelrelief]
+ if { $relief == "flat" } {
+ $graph element configure $elem -labelrelief raised
+ $graph element activate $elem
+ } else {
+ $graph element configure $elem -labelrelief flat
+ $graph element deactivate $elem
+ }
+}
+
+proc blt::Crosshairs { graph { event "Any-Motion" } } {
+ $graph crosshairs on
+ bind bltCrosshairs <$event> {
+ %W crosshairs configure -position @%x,%y
+ }
+ $graph crosshairs configure -color red
+ blt::AddBindTag $graph bltCrosshairs
+}
+
+proc blt::InitStack { graph } {
+ global zoomInfo
+ set zoomInfo($graph,interval) 100
+ set zoomInfo($graph,afterId) 0
+ set zoomInfo($graph,A,x) {}
+ set zoomInfo($graph,A,y) {}
+ set zoomInfo($graph,B,x) {}
+ set zoomInfo($graph,B,y) {}
+ set zoomInfo($graph,stack) {}
+ set zoomInfo($graph,corner) A
+}
+
+proc blt::ZoomStack { graph {start "ButtonPress-1"} {reset "ButtonPress-3"} } {
+ global zoomInfo zoomMod
+
+ blt::InitStack $graph
+
+ if { [info exists zoomMod] } {
+ set modifier $zoomMod
+ } else {
+ set modifier ""
+ }
+ bind bltZoomGraph <${modifier}${start}> { blt::SetZoomPoint %W %x %y }
+ bind bltZoomGraph <${modifier}${reset}> {
+ if { [%W inside %x %y] } {
+ blt::ResetZoom %W
+ }
+ }
+ blt::AddBindTag $graph bltZoomGraph
+}
+
+proc blt::PrintKey { graph {event "Shift-ButtonRelease-3"} } {
+ bind bltPrintGraph <$event> { Blt_PostScriptDialog %W }
+ blt::AddBindTag $graph bltPrintGraph
+}
+
+proc blt::ClosestPoint { graph {event "Control-ButtonPress-2"} } {
+ bind bltClosestPoint <$event> {
+ blt::FindElement %W %x %y
+ }
+ blt::AddBindTag $graph bltClosestPoint
+}
+
+proc blt::AddBindTag { graph name } {
+ set oldtags [bindtags $graph]
+ if { [lsearch $oldtags $name] < 0 } {
+ bindtags $graph [concat $name $oldtags]
+ }
+}
+
+proc blt::FindElement { graph x y } {
+ if ![$graph element closest $x $y info -interpolate yes] {
+ beep
+ return
+ }
+ # --------------------------------------------------------------
+ # find(name) - element Id
+ # find(index) - index of closest point
+ # find(x) find(y) - coordinates of closest point
+ # or closest point on line segment.
+ # find(dist) - distance from sample coordinate
+ # --------------------------------------------------------------
+ set markerName "bltClosest_$info(name)"
+ catch { $graph marker delete $markerName }
+ $graph marker create text -coords { $info(x) $info(y) } \
+ -name $markerName \
+ -text "$info(name): $info(dist)\nindex $info(index)" \
+ -font *lucida*-r-*-10-* \
+ -anchor center -justify left \
+ -yoffset 0 -bg {}
+
+ set coords [$graph invtransform $x $y]
+ set nx [lindex $coords 0]
+ set ny [lindex $coords 1]
+
+ $graph marker create line -coords "$nx $ny $info(x) $info(y)" \
+ -name line.$markerName
+
+ blt::FlashPoint $graph $info(name) $info(index) 10
+ blt::FlashPoint $graph $info(name) [expr $info(index) + 1] 10
+}
+
+proc blt::FlashPoint { graph name index count } {
+ if { $count & 1 } {
+ $graph element deactivate $name
+ } else {
+ $graph element activate $name $index
+ }
+ incr count -1
+ if { $count > 0 } {
+ after 200 blt::FlashPoint $graph $name $index $count
+ update
+ } else {
+ eval $graph marker delete [$graph marker names "bltClosest_*"]
+ }
+}
+
+proc blt::GetCoords { graph x y index } {
+ global zoomInfo
+ if { [$graph cget -invertxy] } {
+ set zoomInfo($graph,$index,x) $y
+ set zoomInfo($graph,$index,y) $x
+ } else {
+ set zoomInfo($graph,$index,x) $x
+ set zoomInfo($graph,$index,y) $y
+ }
+}
+
+proc blt::MarkPoint { graph index } {
+ global zoomInfo
+ set x [$graph xaxis invtransform $zoomInfo($graph,$index,x)]
+ set y [$graph yaxis invtransform $zoomInfo($graph,$index,y)]
+ set marker "zoomText_$index"
+ set text [format "x=%.4g\ny=%.4g" $x $y]
+
+ if [$graph marker exists $marker] {
+ $graph marker configure $marker -coords { $x $y } -text $text
+ } else {
+ $graph marker create text -coords { $x $y } -name $marker \
+ -font *lucida*-r-*-10-* \
+ -text $text -anchor center -bg {} -justify left
+ }
+}
+
+proc blt::DestroyZoomTitle { graph } {
+ global zoomInfo
+
+ if { $zoomInfo($graph,corner) == "A" } {
+ catch { $graph marker delete "zoomTitle" }
+ }
+}
+
+proc blt::PopZoom { graph } {
+ global zoomInfo
+
+ set zoomStack $zoomInfo($graph,stack)
+ if { [llength $zoomStack] > 0 } {
+ set cmd [lindex $zoomStack 0]
+ set zoomInfo($graph,stack) [lrange $zoomStack 1 end]
+ eval $cmd
+ blt::ZoomTitleLast $graph
+ busy hold $graph
+ update
+ after 2000 "blt::DestroyZoomTitle $graph"
+ busy release $graph
+ } else {
+ catch { $graph marker delete "zoomTitle" }
+ }
+}
+
+# Push the old axis limits on the stack and set the new ones
+
+proc blt::PushZoom { graph } {
+ global zoomInfo
+ eval $graph marker delete [$graph marker names "zoom*"]
+ if { [info exists zoomInfo($graph,afterId)] } {
+ after cancel $zoomInfo($graph,afterId)
+ }
+ set x1 $zoomInfo($graph,A,x)
+ set y1 $zoomInfo($graph,A,y)
+ set x2 $zoomInfo($graph,B,x)
+ set y2 $zoomInfo($graph,B,y)
+
+ if { ($x1 == $x2) || ($y1 == $y2) } {
+ # No delta, revert to start
+ return
+ }
+ set cmd {}
+ foreach margin { xaxis yaxis x2axis y2axis } {
+ foreach axis [$graph $margin use] {
+ set min [$graph axis cget $axis -min]
+ set max [$graph axis cget $axis -max]
+ set c [list $graph axis configure $axis -min $min -max $max]
+ append cmd "$c\n"
+ }
+ }
+ set zoomInfo($graph,stack) [linsert $zoomInfo($graph,stack) 0 $cmd]
+
+ busy hold $graph
+ # This update lets the busy cursor take effect.
+ update
+
+ foreach margin { xaxis x2axis } {
+ foreach axis [$graph $margin use] {
+ set min [$graph axis invtransform $axis $x1]
+ set max [$graph axis invtransform $axis $x2]
+ if { $min!=$max } {
+ if { $min > $max } {
+ $graph axis configure $axis -min $max -max $min
+ } else {
+ $graph axis configure $axis -min $min -max $max
+ }
+ }
+ }
+ }
+ foreach margin { yaxis y2axis } {
+ foreach axis [$graph $margin use] {
+ set min [$graph axis invtransform $axis $y1]
+ set max [$graph axis invtransform $axis $y2]
+ if { $min!=$max } {
+ if { $min > $max } {
+ $graph axis configure $axis -min $max -max $min
+ } else {
+ $graph axis configure $axis -min $min -max $max
+ }
+ }
+ }
+ }
+ # This "update" forces the graph to be redrawn
+ update
+
+ busy release $graph
+}
+
+#
+# This routine terminates either an existing zoom, or pops back to
+# the previous zoom level (if no zoom is in progress).
+#
+
+proc blt::ResetZoom { graph } {
+ global zoomInfo
+
+ if { ![info exists zoomInfo($graph,corner)] } {
+ blt::InitStack $graph
+ }
+ eval $graph marker delete [$graph marker names "zoom*"]
+
+ if { $zoomInfo($graph,corner) == "A" } {
+ # Reset the whole axis
+ blt::PopZoom $graph
+ } else {
+ global zoomMod
+
+ if { [info exists zoomMod] } {
+ set modifier $zoomMod
+ } else {
+ set modifier "Any-"
+ }
+ set zoomInfo($graph,corner) A
+ bind $graph <${modifier}Motion> { }
+ }
+}
+
+option add *zoomTitle.font -*-helvetica-medium-R-*-*-18-*-*-*-*-*-*-*
+option add *zoomTitle.shadow yellow4
+option add *zoomTitle.foreground yellow1
+option add *zoomTitle.coords "-Inf Inf"
+
+proc blt::ZoomTitleNext { graph } {
+ global zoomInfo
+ set level [expr [llength $zoomInfo($graph,stack)] + 1]
+ if { [$graph cget -invertxy] } {
+ set coords "-Inf -Inf"
+ } else {
+ set coords "-Inf Inf"
+ }
+ $graph marker create text -name "zoomTitle" -text "Zoom #$level" \
+ -coords $coords -bindtags "" -anchor nw
+}
+
+proc blt::ZoomTitleLast { graph } {
+ global zoomInfo
+
+ set level [llength $zoomInfo($graph,stack)]
+ if { $level > 0 } {
+ $graph marker create text -name "zoomTitle" -anchor nw \
+ -text "Zoom #$level"
+ }
+}
+
+proc blt::SetZoomPoint { graph x y } {
+ global zoomInfo zoomMod
+ if { ![info exists zoomInfo($graph,corner)] } {
+ blt::InitStack $graph
+ }
+ blt::GetCoords $graph $x $y $zoomInfo($graph,corner)
+ if { [info exists zoomMod] } {
+ set modifier $zoomMod
+ } else {
+ set modifier "Any-"
+ }
+ if { $zoomInfo($graph,corner) == "A" } {
+ if { ![$graph inside $x $y] } {
+ return
+ }
+ # First corner selected, start watching motion events
+
+ #blt::MarkPoint $graph A
+ blt::ZoomTitleNext $graph
+
+ bind $graph <${modifier}Motion> {
+ blt::GetCoords %W %x %y B
+ #blt::MarkPoint $graph B
+ blt::Box %W
+ }
+ set zoomInfo($graph,corner) B
+ } else {
+ # Delete the modal binding
+ bind $graph <${modifier}Motion> { }
+ blt::PushZoom $graph
+ set zoomInfo($graph,corner) A
+ }
+}
+
+option add *zoomOutline.dashes 4
+option add *zoomTitle.anchor nw
+option add *zoomOutline.lineWidth 2
+option add *zoomOutline.xor yes
+
+proc blt::MarchingAnts { graph offset } {
+ global zoomInfo
+
+ incr offset
+ if { [$graph marker exists zoomOutline] } {
+ $graph marker configure zoomOutline -dashoffset $offset
+ set interval $zoomInfo($graph,interval)
+ set id [after $interval [list blt::MarchingAnts $graph $offset]]
+ set zoomInfo($graph,afterId) $id
+ }
+}
+
+proc blt::Box { graph } {
+ global zoomInfo
+
+ if { $zoomInfo($graph,A,x) > $zoomInfo($graph,B,x) } {
+ set x1 [$graph xaxis invtransform $zoomInfo($graph,B,x)]
+ set y1 [$graph yaxis invtransform $zoomInfo($graph,B,y)]
+ set x2 [$graph xaxis invtransform $zoomInfo($graph,A,x)]
+ set y2 [$graph yaxis invtransform $zoomInfo($graph,A,y)]
+ } else {
+ set x1 [$graph xaxis invtransform $zoomInfo($graph,A,x)]
+ set y1 [$graph yaxis invtransform $zoomInfo($graph,A,y)]
+ set x2 [$graph xaxis invtransform $zoomInfo($graph,B,x)]
+ set y2 [$graph yaxis invtransform $zoomInfo($graph,B,y)]
+ }
+ set coords { $x1 $y1 $x2 $y1 $x2 $y2 $x1 $y2 $x1 $y1 }
+ if { [$graph marker exists "zoomOutline"] } {
+ $graph marker configure "zoomOutline" -coords $coords
+ } else {
+ set X [lindex [$graph xaxis use] 0]
+ set Y [lindex [$graph yaxis use] 0]
+ $graph marker create line -coords $coords -name "zoomOutline" \
+ -mapx $X -mapy $Y
+ set interval $zoomInfo($graph,interval)
+ set id [after $interval [list blt::MarchingAnts $graph 0]]
+ set zoomInfo($graph,afterId) $id
+ }
+}
+
+
+proc Blt_PostScriptDialog { graph } {
+ global POSTSCRIPTWINDOW
+ global POSTSCRIPTGRAPH
+ set top $graph.top
+ toplevel $top
+ wm title $top "Postscript out"
+ set POSTSCRIPTWINDOW $top
+ set POSTSCRIPTGRAPH $graph
+ foreach var { center landscape maxpect preview decorations padx
+ pady paperwidth paperheight width height colormode } {
+ global $graph.$var
+ set $graph.$var [$graph postscript cget -$var]
+ }
+ set row 1
+ set col 0
+ label $top.title -text "PostScript Options"
+ blt::table $top $top.title -cspan 7
+ foreach bool { center landscape maxpect preview decorations } {
+ set w $top.$bool-label
+ label $w -text "-$bool" -font *courier*-r-*12*
+ blt::table $top $row,$col $w -anchor e -pady { 2 0 } -padx { 0 4 }
+ set w $top.$bool-yes
+ global $graph.$bool
+ radiobutton $w -text "yes" -variable $graph.$bool -value 1
+ blt::table $top $row,$col+1 $w -anchor w
+ set w $top.$bool-no
+ radiobutton $w -text "no" -variable $graph.$bool -value 0
+ blt::table $top $row,$col+2 $w -anchor w
+ incr row
+ }
+ label $top.modes -text "-colormode" -font *courier*-r-*12*
+ blt::table $top $row,0 $top.modes -anchor e -pady { 2 0 } -padx { 0 4 }
+ set col 1
+ foreach m { color greyscale } {
+ set w $top.$m
+ radiobutton $w -text $m -variable $graph.colormode -value $m
+ blt::table $top $row,$col $w -anchor w
+ incr col
+ }
+ set row 1
+ frame $top.sep -width 2 -bd 1 -relief sunken
+ blt::table $top $row,3 $top.sep -fill y -rspan 6
+ set col 4
+ foreach value { padx pady paperwidth paperheight width height } {
+ set w $top.$value-label
+ label $w -text "-$value" -font *courier*-r-*12*
+ blt::table $top $row,$col $w -anchor e -pady { 2 0 } -padx { 0 4 }
+ set w $top.$value-entry
+ global $graph.$value
+ entry $w -textvariable $graph.$value -width 8
+ blt::table $top $row,$col+1 $w -cspan 2 -anchor w -padx 8
+ incr row
+ }
+ blt::table configure $top c3 -width .125i
+ button $top.cancel -text "Cancel" -command "destroy $top"
+ blt::table $top $row,0 $top.cancel -width 1i -pady 2 -cspan 3
+ button $top.reset -text "Reset" -command "destroy $top"
+ #blt::table $top $row,1 $top.reset -width 1i
+ button $top.print -text "Print" -command {blt::ResetPostScript $POSTSCRIPTGRAPH; destroy $POSTSCRIPTWINDOW }
+ blt::table $top $row,4 $top.print -width 1i -pady 2 -cspan 2
+}
+
+proc blt::ResetPostScript { graph } {
+ foreach var { center landscape maxpect preview decorations padx
+ pady paperwidth paperheight width height colormode } {
+ global $graph.$var
+ set old [$graph postscript cget -$var]
+ if { [catch {$graph postscript configure -$var [set $graph.$var]}] != 0 } {
+ $graph postscript configure -$var $old
+ set $graph.$var $old
+ }
+ }
+ set types {{"Postscript File" {.ps} } {"Encapsulated Postscript File" {.eps} }};
+ set PSFILE [tk_getSaveFile -filetypes $types -parent . -initialfile Untitled -defaultextension .ps]
+ if {[string length $PSFILE]!=0} {
+ $graph postscript output $PSFILE
+ }
+}
diff --git a/Windows/spice/examples/tclspice/tcl-testbench4/example.cir b/Windows/spice/examples/tclspice/tcl-testbench4/example.cir
new file mode 100644
index 00000000..b5aeaf42
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench4/example.cir
@@ -0,0 +1,583 @@
+TITLE: proj1 - Rotary Traveling Wave Oscillator
+
+
+VDD0 VDD0 VDD DC 0
+VSS0 VSS0 0 DC 0
+VDD_A0 VDD_A0 VDD0 DC 0
+VSS_A0 VSS_A0 VSS0 DC 0
+VDD_B0 VDD_B0 VDD0 DC 0
+VSS_B0 VSS_B0 VSS0 DC 0
+LA0 A0 LCA0 3.69030941553353e-11
+RA0 LCA0 A1 0.266535044422507
+LB0 B0 LCB0 3.69030941553353e-11
+RB0 LCB0 B1 0.266535044422507
+C0 A1 B1 2.50418376625721e-14
+MNA0 B0 A0 VSS_B0 VSS_B0 Nmod L=2.53696435353243e-07 W=
++4.24857778403814e-05 AD=3.125e-11 AS=3.125e-11 PD=
++8.49715556807627e-05 PS=8.49715556807627e-05 NQSMOD=1
+MPA0 B0 A0 VDD_B0 VDD_B0 Pmod L=2.55343565546106e-07 W=
++0.000101772203908557 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203544407817114 PS=0.000203544407817114 NQSMOD=1
+MNB0 A0 B0 VSS_A0 VSS_A0 Nmod L=2.53941602497219e-07 W=
++4.10652659629401e-05 AD=3.125e-11 AS=3.125e-11 PD=
++8.21305319258802e-05 PS=8.21305319258802e-05 NQSMOD=1
+MPB0 A0 B0 VDD_A0 VDD_A0 Pmod L=2.52010168145607e-07 W=
++0.000103533977891464 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207067955782928 PS=0.000207067955782928 NQSMOD=1
+LA1 A1 LCA1 3.69030941553353e-11
+RA1 LCA1 A2 0.266535044422507
+LB1 B1 LCB1 3.69030941553353e-11
+RB1 LCB1 B2 0.266535044422507
+C1 A2 B2 2.50418376625721e-14
+MNA1 B1 A1 0 0 Nmod L=2.52370578161099e-07 W=4.12246995102289e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.24493990204578e-05 PS=
++8.24493990204578e-05 NQSMOD=1
+MPA1 B1 A1 VDD VDD Pmod L=2.45709468983316e-07 W=0.000103710764679465
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207421529358929 PS=
++0.000207421529358929 NQSMOD=1
+MNB1 A1 B1 0 0 Nmod L=2.48115895523017e-07 W=4.26306134285554e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.52612268571108e-05 PS=
++8.52612268571108e-05 NQSMOD=1
+MPB1 A1 B1 VDD VDD Pmod L=2.55265156192223e-07 W=0.000102043840486507
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000204087680973014 PS=
++0.000204087680973014 NQSMOD=1
+LA2 A2 LCA2 3.69030941553353e-11
+RA2 LCA2 A3 0.266535044422507
+LB2 B2 LCB2 3.69030941553353e-11
+RB2 LCB2 B3 0.266535044422507
+C2 A3 B3 2.50418376625721e-14
+MNA2 B2 A2 0 0 Nmod L=2.53484220592882e-07 W=4.16915225420459e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.33830450840917e-05 PS=
++8.33830450840917e-05 NQSMOD=1
+MPA2 B2 A2 VDD VDD Pmod L=2.44256748076514e-07 W=0.00010549295960702
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000210985919214039 PS=
++0.000210985919214039 NQSMOD=1
+MNB2 A2 B2 0 0 Nmod L=2.48805892712811e-07 W=4.15734692647458e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.31469385294916e-05 PS=
++8.31469385294916e-05 NQSMOD=1
+MPB2 A2 B2 VDD VDD Pmod L=2.54004987710956e-07 W=0.00010229621219808
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020459242439616 PS=
++0.00020459242439616 NQSMOD=1
+LA3 A3 LCA3 3.69030941553353e-11
+RA3 LCA3 A4 0.266535044422507
+LB3 B3 LCB3 3.69030941553353e-11
+RB3 LCB3 B4 0.266535044422507
+C3 A4 B4 2.50418376625721e-14
+MNA3 B3 A3 0 0 Nmod L=2.54307430347219e-07 W=4.11339076756089e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22678153512179e-05 PS=
++8.22678153512179e-05 NQSMOD=1
+MPA3 B3 A3 VDD VDD Pmod L=2.52369109463781e-07 W=0.000103371681055656
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206743362111311 PS=
++0.000206743362111311 NQSMOD=1
+MNB3 A3 B3 0 0 Nmod L=2.4960708801709e-07 W=4.21794611046917e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.43589222093833e-05 PS=
++8.43589222093833e-05 NQSMOD=1
+MPB3 A3 B3 VDD VDD Pmod L=2.53834779766428e-07 W=0.000105556314711602
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000211112629423204 PS=
++0.000211112629423204 NQSMOD=1
+LA4 A4 LCA4 3.69030941553353e-11
+RA4 LCA4 A5 0.266535044422507
+LB4 B4 LCB4 3.69030941553353e-11
+RB4 LCB4 B5 0.266535044422507
+C4 A5 B5 2.50418376625721e-14
+MNA4 B4 A4 0 0 Nmod L=2.48091656083177e-07 W=4.11207568141106e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22415136282211e-05 PS=
++8.22415136282211e-05 NQSMOD=1
+MPA4 B4 A4 VDD VDD Pmod L=2.47723605289033e-07 W=0.000103463392309261
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206926784618522 PS=
++0.000206926784618522 NQSMOD=1
+MNB4 A4 B4 0 0 Nmod L=2.49254771880382e-07 W=4.25122425012226e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.50244850024452e-05 PS=
++8.50244850024452e-05 NQSMOD=1
+MPB4 A4 B4 VDD VDD Pmod L=2.49689766979065e-07 W=0.000103227993619608
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206455987239216 PS=
++0.000206455987239216 NQSMOD=1
+LA5 A5 LCA5 3.69030941553353e-11
+RA5 LCA5 A6 0.266535044422507
+LB5 B5 LCB5 3.69030941553353e-11
+RB5 LCB5 B6 0.266535044422507
+C5 A6 B6 2.50418376625721e-14
+MNA5 B5 A5 0 0 Nmod L=2.53960031106522e-07 W=4.1129961792588e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.22599235851759e-05 PS=
++8.22599235851759e-05 NQSMOD=1
+MPA5 B5 A5 VDD VDD Pmod L=2.47418707088064e-07 W=0.000101621693062467
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000203243386124935 PS=
++0.000203243386124935 NQSMOD=1
+MNB5 A5 B5 0 0 Nmod L=2.49659687529522e-07 W=4.2524931640785e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.50498632815701e-05 PS=
++8.50498632815701e-05 NQSMOD=1
+MPB5 A5 B5 VDD VDD Pmod L=2.46328059754468e-07 W=0.000102061546065548
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000204123092131096 PS=
++0.000204123092131096 NQSMOD=1
+LA6 A6 LCA6 3.69030941553353e-11
+RA6 LCA6 A7 0.266535044422507
+LB6 B6 LCB6 3.69030941553353e-11
+RB6 LCB6 B7 0.266535044422507
+C6 A7 B7 2.50418376625721e-14
+MNA6 B6 A6 0 0 Nmod L=2.54326804653788e-07 W=4.17332976706085e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.34665953412171e-05 PS=
++8.34665953412171e-05 NQSMOD=1
+MPA6 B6 A6 VDD VDD Pmod L=2.48727427835127e-07 W=0.000103244611103459
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000206489222206918 PS=
++0.000206489222206918 NQSMOD=1
+MNB6 A6 B6 0 0 Nmod L=2.49697035135609e-07 W=4.23570035518e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.47140071036001e-05 PS=
++8.47140071036001e-05 NQSMOD=1
+MPB6 A6 B6 VDD VDD Pmod L=2.48995485890626e-07 W=0.000103695454759978
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207390909519956 PS=
++0.000207390909519956 NQSMOD=1
+LA7 A7 LCA7 3.69030941553353e-11
+RA7 LCA7 A8 0.266535044422507
+LB7 B7 LCB7 3.69030941553353e-11
+RB7 LCB7 B8 0.266535044422507
+C7 A8 B8 2.50418376625721e-14
+MNA7 B7 A7 0 0 Nmod L=2.53418975114981e-07 W=4.06421756574473e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.12843513148946e-05 PS=
++8.12843513148946e-05 NQSMOD=1
+MPA7 B7 A7 VDD VDD Pmod L=2.4471861043622e-07 W=0.000104600862141835
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020920172428367 PS=
++0.00020920172428367 NQSMOD=1
+MNB7 A7 B7 0 0 Nmod L=2.50159056393584e-07 W=4.06845582724173e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.13691165448345e-05 PS=
++8.13691165448345e-05 NQSMOD=1
+MPB7 A7 B7 VDD VDD Pmod L=2.55032245177227e-07 W=0.000106482118141681
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000212964236283363 PS=
++0.000212964236283363 NQSMOD=1
+LA8 A8 LCA8 3.69030941553353e-11
+RA8 LCA8 A9 0.266535044422507
+LB8 B8 LCB8 3.69030941553353e-11
+RB8 LCB8 B9 0.266535044422507
+C8 A9 B9 2.50418376625721e-14
+MNA8 B8 A8 0 0 Nmod L=2.45729547191971e-07 W=4.18266198665335e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.3653239733067e-05 PS=8.3653239733067e-05
++NQSMOD=1
+MPA8 B8 A8 VDD VDD Pmod L=2.45156004861421e-07 W=0.000101593205477244
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000203186410954489 PS=
++0.000203186410954489 NQSMOD=1
+MNB8 A8 B8 0 0 Nmod L=2.49014342219656e-07 W=4.14314219478801e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.28628438957603e-05 PS=
++8.28628438957603e-05 NQSMOD=1
+MPB8 A8 B8 VDD VDD Pmod L=2.50396673007567e-07 W=0.000103029640740115
++AD=7.8125e-11 AS=7.8125e-11 PD=0.00020605928148023 PS=
++0.00020605928148023 NQSMOD=1
+LA9 A9 LCA9 3.69030941553353e-11
+RA9 LCA9 A10 0.266535044422507
+LB9 B9 LCB9 3.69030941553353e-11
+RB9 LCB9 B10 0.266535044422507
+C9 A10 B10 2.50418376625721e-14
+MNA9 B9 A9 0 0 Nmod L=2.51066307645916e-07 W=4.17044186844862e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.34088373689724e-05 PS=
++8.34088373689724e-05 NQSMOD=1
+MPA9 B9 A9 VDD VDD Pmod L=2.4945438501494e-07 W=0.000104601836030031
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000209203672060063 PS=
++0.000209203672060063 NQSMOD=1
+MNB9 A9 B9 0 0 Nmod L=2.56178041422984e-07 W=4.17990098329256e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.35980196658511e-05 PS=
++8.35980196658511e-05 NQSMOD=1
+MPB9 A9 B9 VDD VDD Pmod L=2.5274010042983e-07 W=0.000103578149162769
++AD=7.8125e-11 AS=7.8125e-11 PD=0.000207156298325537 PS=
++0.000207156298325537 NQSMOD=1
+LA10 A10 LCA10 3.69030941553353e-11
+RA10 LCA10 A11 0.266535044422507
+LB10 B10 LCB10 3.69030941553353e-11
+RB10 LCB10 B11 0.266535044422507
+C10 A11 B11 2.50418376625721e-14
+MNA10 B10 A10 0 0 Nmod L=2.45772611943267e-07 W=4.24345922952649e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.48691845905299e-05 PS=
++8.48691845905299e-05 NQSMOD=1
+MPA10 B10 A10 VDD VDD Pmod L=2.55544710347746e-07 W=
++0.000105625826497323 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211251652994645 PS=0.000211251652994645 NQSMOD=1
+MNB10 A10 B10 0 0 Nmod L=2.55886308364338e-07 W=4.0850956346516e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.17019126930321e-05 PS=
++8.17019126930321e-05 NQSMOD=1
+MPB10 A10 B10 VDD VDD Pmod L=2.44778614470725e-07 W=
++0.000105511594248206 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211023188496411 PS=0.000211023188496411 NQSMOD=1
+LA11 A11 LCA11 3.69030941553353e-11
+RA11 LCA11 A12 0.266535044422507
+LB11 B11 LCB11 3.69030941553353e-11
+RB11 LCB11 B12 0.266535044422507
+C11 A12 B12 2.50418376625721e-14
+MNA11 B11 A11 0 0 Nmod L=2.4768739676619e-07 W=4.14724461551725e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.29448923103449e-05 PS=
++8.29448923103449e-05 NQSMOD=1
+MPA11 B11 A11 VDD VDD Pmod L=2.46276216123912e-07 W=
++0.000101782633723501 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203565267447002 PS=0.000203565267447002 NQSMOD=1
+MNB11 A11 B11 0 0 Nmod L=2.54985612770668e-07 W=4.24608643314108e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.49217286628216e-05 PS=
++8.49217286628216e-05 NQSMOD=1
+MPB11 A11 B11 VDD VDD Pmod L=2.45772463970764e-07 W=
++0.000106109588792745 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00021221917758549 PS=0.00021221917758549 NQSMOD=1
+LA12 A12 LCA12 3.69030941553353e-11
+RA12 LCA12 A13 0.266535044422507
+LB12 B12 LCB12 3.69030941553353e-11
+RB12 LCB12 B13 0.266535044422507
+C12 A13 B13 2.50418376625721e-14
+MNA12 B12 A12 0 0 Nmod L=2.45480481009462e-07 W=4.20858793029857e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.41717586059714e-05 PS=
++8.41717586059714e-05 NQSMOD=1
+MPA12 B12 A12 VDD VDD Pmod L=2.48462320158069e-07 W=
++0.00010650127744954 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00021300255489908 PS=0.00021300255489908 NQSMOD=1
+MNB12 A12 B12 0 0 Nmod L=2.51992945030792e-07 W=4.17981435096244e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.35962870192489e-05 PS=
++8.35962870192489e-05 NQSMOD=1
+MPB12 A12 B12 VDD VDD Pmod L=2.49941922576661e-07 W=
++0.0001044851795426 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208970359085199 PS=0.000208970359085199 NQSMOD=1
+LA13 A13 LCA13 3.69030941553353e-11
+RA13 LCA13 A14 0.266535044422507
+LB13 B13 LCB13 3.69030941553353e-11
+RB13 LCB13 B14 0.266535044422507
+C13 A14 B14 2.50418376625721e-14
+MNA13 B13 A13 0 0 Nmod L=2.51146190542173e-07 W=4.23276196447018e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.46552392894035e-05 PS=
++8.46552392894035e-05 NQSMOD=1
+MPA13 B13 A13 VDD VDD Pmod L=2.46359362747576e-07 W=
++0.00010249565409785 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.0002049913081957 PS=0.0002049913081957 NQSMOD=1
+MNB13 A13 B13 0 0 Nmod L=2.44656485453628e-07 W=4.11044634633624e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.22089269267248e-05 PS=
++8.22089269267248e-05 NQSMOD=1
+MPB13 A13 B13 VDD VDD Pmod L=2.56119611942636e-07 W=
++0.0001064085618438 AD=7.8125e-11 AS=7.8125e-11 PD=0.0002128171236876
++PS=0.0002128171236876 NQSMOD=1
+LA14 A14 LCA14 3.69030941553353e-11
+RA14 LCA14 A15 0.266535044422507
+LB14 B14 LCB14 3.69030941553353e-11
+RB14 LCB14 B15 0.266535044422507
+C14 A15 B15 2.50418376625721e-14
+MNA14 B14 A14 0 0 Nmod L=2.47663439668801e-07 W=4.20889991075918e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.41779982151835e-05 PS=
++8.41779982151835e-05 NQSMOD=1
+MPA14 B14 A14 VDD VDD Pmod L=2.51252450429323e-07 W=
++0.000103622229824819 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207244459649638 PS=0.000207244459649638 NQSMOD=1
+MNB14 A14 B14 0 0 Nmod L=2.5044796612668e-07 W=4.24685059762319e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.49370119524638e-05 PS=
++8.49370119524638e-05 NQSMOD=1
+MPB14 A14 B14 VDD VDD Pmod L=2.4786360459861e-07 W=
++0.000104258615459431 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208517230918863 PS=0.000208517230918863 NQSMOD=1
+LA15 A15 LCA15 3.69030941553353e-11
+RA15 LCA15 A16 0.266535044422507
+LB15 B15 LCB15 3.69030941553353e-11
+RB15 LCB15 B16 0.266535044422507
+C15 A16 B16 2.50418376625721e-14
+MNA15 B15 A15 0 0 Nmod L=2.5213362488047e-07 W=4.26610931467994e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.53221862935989e-05 PS=
++8.53221862935989e-05 NQSMOD=1
+MPA15 B15 A15 VDD VDD Pmod L=2.44411053097269e-07 W=
++0.000104344399065411 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208688798130821 PS=0.000208688798130821 NQSMOD=1
+MNB15 A15 B15 0 0 Nmod L=2.44947739168727e-07 W=4.18061319080677e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.36122638161354e-05 PS=
++8.36122638161354e-05 NQSMOD=1
+MPB15 A15 B15 VDD VDD Pmod L=2.45133067349567e-07 W=
++0.000103673770597555 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00020734754119511 PS=0.00020734754119511 NQSMOD=1
+LA16 A16 LCA16 3.69030941553353e-11
+RA16 LCA16 A17 0.266535044422507
+LB16 B16 LCB16 3.69030941553353e-11
+RB16 LCB16 B17 0.266535044422507
+C16 A17 B17 2.50418376625721e-14
+MNA16 B16 A16 0 0 Nmod L=2.5558903414348e-07 W=4.23651981762607e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.47303963525215e-05 PS=
++8.47303963525215e-05 NQSMOD=1
+MPA16 B16 A16 VDD VDD Pmod L=2.46968507923118e-07 W=
++0.000101577430536373 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203154861072746 PS=0.000203154861072746 NQSMOD=1
+MNB16 A16 B16 0 0 Nmod L=2.52441475326891e-07 W=4.0963445615255e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.192689123051e-05 PS=
++8.192689123051e-05 NQSMOD=1
+MPB16 A16 B16 VDD VDD Pmod L=2.49958772476576e-07 W=
++0.000102341104143712 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204682208287424 PS=0.000204682208287424 NQSMOD=1
+LA17 A17 LCA17 3.69030941553353e-11
+RA17 LCA17 A18 0.266535044422507
+LB17 B17 LCB17 3.69030941553353e-11
+RB17 LCB17 B18 0.266535044422507
+C17 A18 B18 2.50418376625721e-14
+MNA17 B17 A17 0 0 Nmod L=2.46623947628415e-07 W=4.07033737509309e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.14067475018618e-05 PS=
++8.14067475018618e-05 NQSMOD=1
+MPA17 B17 A17 VDD VDD Pmod L=2.52274212428759e-07 W=
++0.000105423152156798 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000210846304313596 PS=0.000210846304313596 NQSMOD=1
+MNB17 A17 B17 0 0 Nmod L=2.51233452024547e-07 W=4.12815452669714e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.25630905339429e-05 PS=
++8.25630905339429e-05 NQSMOD=1
+MPB17 A17 B17 VDD VDD Pmod L=2.49324495416238e-07 W=
++0.000104142717459091 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208285434918183 PS=0.000208285434918183 NQSMOD=1
+LA18 A18 LCA18 3.69030941553353e-11
+RA18 LCA18 A19 0.266535044422507
+LB18 B18 LCB18 3.69030941553353e-11
+RB18 LCB18 B19 0.266535044422507
+C18 A19 B19 2.50418376625721e-14
+MNA18 B18 A18 0 0 Nmod L=2.52038203439398e-07 W=4.17044670825126e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.34089341650252e-05 PS=
++8.34089341650252e-05 NQSMOD=1
+MPA18 B18 A18 VDD VDD Pmod L=2.46465042965348e-07 W=
++0.000102305682920291 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204611365840582 PS=0.000204611365840582 NQSMOD=1
+MNB18 A18 B18 0 0 Nmod L=2.45695550122768e-07 W=4.2510656912981e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.50213138259621e-05 PS=
++8.50213138259621e-05 NQSMOD=1
+MPB18 A18 B18 VDD VDD Pmod L=2.56212134001568e-07 W=
++0.000101696358889307 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000203392717778614 PS=0.000203392717778614 NQSMOD=1
+LA19 A19 LCA19 3.69030941553353e-11
+RA19 LCA19 A20 0.266535044422507
+LB19 B19 LCB19 3.69030941553353e-11
+RB19 LCB19 B20 0.266535044422507
+C19 A20 B20 2.50418376625721e-14
+MNA19 B19 A19 0 0 Nmod L=2.46298724559332e-07 W=4.26183323927543e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.52366647855085e-05 PS=
++8.52366647855085e-05 NQSMOD=1
+MPA19 B19 A19 VDD VDD Pmod L=2.53903413760174e-07 W=
++0.000103580270078538 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000207160540157077 PS=0.000207160540157077 NQSMOD=1
+MNB19 A19 B19 0 0 Nmod L=2.4541336381424e-07 W=4.1471197163819e-05 AD=
++3.125e-11 AS=3.125e-11 PD=8.2942394327638e-05 PS=8.2942394327638e-05
++NQSMOD=1
+MPB19 A19 B19 VDD VDD Pmod L=2.51953325753565e-07 W=
++0.0001019745929959 AD=7.8125e-11 AS=7.8125e-11 PD=0.0002039491859918
++PS=0.0002039491859918 NQSMOD=1
+LA20 A20 LCA20 3.69030941553353e-11
+RA20 LCA20 A21 0.266535044422507
+LB20 B20 LCB20 3.69030941553353e-11
+RB20 LCB20 B21 0.266535044422507
+C20 A21 B21 2.50418376625721e-14
+MNA20 B20 A20 0 0 Nmod L=2.55318350883171e-07 W=4.2257523363596e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.4515046727192e-05 PS=
++8.4515046727192e-05 NQSMOD=1
+MPA20 B20 A20 VDD VDD Pmod L=2.50733395598687e-07 W=
++0.000105848300738233 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211696601476467 PS=0.000211696601476467 NQSMOD=1
+MNB20 A20 B20 0 0 Nmod L=2.53961238224852e-07 W=4.07467605160825e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.1493521032165e-05 PS=
++8.1493521032165e-05 NQSMOD=1
+MPB20 A20 B20 VDD VDD Pmod L=2.52173406118976e-07 W=
++0.000104205251139887 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000208410502279773 PS=0.000208410502279773 NQSMOD=1
+LA21 A21 LCA21 3.69030941553353e-11
+RA21 LCA21 A22 0.266535044422507
+LB21 B21 LCB21 3.69030941553353e-11
+RB21 LCB21 B22 0.266535044422507
+C21 A22 B22 2.50418376625721e-14
+MNA21 B21 A21 0 0 Nmod L=2.46323292867561e-07 W=4.1601573531982e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.32031470639639e-05 PS=
++8.32031470639639e-05 NQSMOD=1
+MPA21 B21 A21 VDD VDD Pmod L=2.54613442115316e-07 W=
++0.000104931161465525 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.00020986232293105 PS=0.00020986232293105 NQSMOD=1
+MNB21 A21 B21 0 0 Nmod L=2.55836584454404e-07 W=4.10424160274173e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.20848320548346e-05 PS=
++8.20848320548346e-05 NQSMOD=1
+MPB21 A21 B21 VDD VDD Pmod L=2.54709741956022e-07 W=
++0.000102062091080516 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000204124182161031 PS=0.000204124182161031 NQSMOD=1
+LA22 A22 LCA22 3.69030941553353e-11
+RA22 LCA22 A23 0.266535044422507
+LB22 B22 LCB22 3.69030941553353e-11
+RB22 LCB22 B23 0.266535044422507
+C22 A23 B23 2.50418376625721e-14
+MNA22 B22 A22 0 0 Nmod L=2.54430620981417e-07 W=4.19307535657001e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.38615071314001e-05 PS=
++8.38615071314001e-05 NQSMOD=1
+MPA22 B22 A22 VDD VDD Pmod L=2.46694525572975e-07 W=
++0.000103108817734331 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000206217635468663 PS=0.000206217635468663 NQSMOD=1
+MNB22 A22 B22 0 0 Nmod L=2.4991048194413e-07 W=4.12343575509987e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.24687151019974e-05 PS=
++8.24687151019974e-05 NQSMOD=1
+MPB22 A22 B22 VDD VDD Pmod L=2.53435790976082e-07 W=
++0.000105540213369592 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000211080426739185 PS=0.000211080426739185 NQSMOD=1
+LA23 A23 LCA23 3.69030941553353e-11
+RA23 LCA23 A24 0.266535044422507
+LB23 B23 LCB23 3.69030941553353e-11
+RB23 LCB23 B24 0.266535044422507
+C23 A24 B24 2.50418376625721e-14
+MNA23 B23 A23 0 0 Nmod L=2.47985427798248e-07 W=4.14939059451511e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.29878118903023e-05 PS=
++8.29878118903023e-05 NQSMOD=1
+MPA23 B23 A23 VDD VDD Pmod L=2.50625862917368e-07 W=
++0.000104857443713713 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000209714887427425 PS=0.000209714887427425 NQSMOD=1
+MNB23 A23 B23 0 0 Nmod L=2.48906363214973e-07 W=4.09072154111792e-05
++AD=3.125e-11 AS=3.125e-11 PD=8.18144308223583e-05 PS=
++8.18144308223583e-05 NQSMOD=1
+MPB23 A23 B23 VDD VDD Pmod L=2.544246792556e-07 W=
++0.000106667496188909 AD=7.8125e-11 AS=7.8125e-11 PD=
++0.000213334992377817 PS=0.000213334992377817 NQSMOD=1
+RCROSS1 A0 B24 0.001
+RCROSS2 B0 A24 0.001
+
+.SAVE VDD0
+.SAVE VSS0
+.SAVE VDD_A0
+.SAVE VSS_A0
+.SAVE VDD_B0
+.SAVE VSS_B0
+.SAVE A0 B0 LA0#branch LB0#branch A1 B1 LA1#branch LB1#branch A2 B2
++LA2#branch LB2#branch A3 B3 LA3#branch LB3#branch A4 B4 LA4#branch
++LB4#branch A5 B5 LA5#branch LB5#branch A6 B6 LA6#branch LB6#branch
++A7 B7 LA7#branch LB7#branch A8 B8 LA8#branch LB8#branch A9 B9
++LA9#branch LB9#branch A10 B10 LA10#branch LB10#branch A11 B11
++LA11#branch LB11#branch A12 B12 LA12#branch LB12#branch A13 B13
++LA13#branch LB13#branch A14 B14 LA14#branch LB14#branch A15 B15
++LA15#branch LB15#branch A16 B16 LA16#branch LB16#branch A17 B17
++LA17#branch LB17#branch A18 B18 LA18#branch LB18#branch A19 B19
++LA19#branch LB19#branch A20 B20 LA20#branch LB20#branch A21 B21
++LA21#branch LB21#branch A22 B22 LA22#branch LB22#branch A23 B23
++LA23#branch LB23#branch
+
+
+**
+**INCLUDING FILE: ./proj1/process.models....
+*
+* Typical N Typical P - from process corners (taken from tsmc025_corners.bsim3 fron NCSU)
+*
+* TSMC 0.25u 5M 1P process. 2.5V transistor models
+
+
+.MODEL Nmod NMOS LEVEL=8
++TNOM = 25
++VERSION = 3.2.2 TOX = 5.8e-9
++XJ = 1E-07 NCH = 2.354946E+17 LLN = 1
++LWN = 1 WLN = 1 WWN = 1
++LINT = 1.76E-08 WINT = 6.75E-09 MOBMOD = 1
++BINUNIT = 2 DWG = 0 DWB = 0
++VTH0 = 0.4321336 LVTH0 = 2.081814E-08 WVTH0 = -5.470342E-11
++PVTH0 = -6.721795E-16 K1 = 0.3281252 LK1 = 9.238362E-08
++WK1 = 2.878255E-08 PK1 = -2.426481E-14 K2 = 0.0402824
++LK2 = -3.208392E-08 WK2 = -1.154091E-08 PK2 = 9.192045E-15
++K3 = 0 DVT0 = 0 DVT1 = 0
++DVT2 = 0 DVT0W = 0 DVT1W = 0
++DVT2W = 0 NLX = 0 W0 = 0
++K3B = 0 VSAT = 7.586954E+04 LVSAT = 3.094656E-03
++WVSAT = -1.747416E-03 PVSAT = 8.820956E-10 UA = 8.924498E-10
++LUA = -1.511745E-16 WUA = -3.509821E-17 PUA = -3.08778E-23
++UB = 8.928832E-21 LUB = -1.655745E-27 WUB = -2.03282E-27
++PUB = 3.4578E-34 UC = -1.364265E-11 LUC = 1.170473E-17
++WUC = -1.256705E-18 PUC = -6.249644E-24 RDSW = 447.8871
++PRWB = 0 PRWG = 0 WR = 0.99
++U0 = 0.06005258 LU0 = -6.31976E-09 WU0 = -8.819531E-09
++PU0 = 3.57209E-15 A0 = -1.468837 LA0 = 6.419548E-07
++WA0 = 5.512414E-07 PA0 = -9.222928E-14 KETA = -0.04922795
++LKETA = 2.360844E-08 WKETA = 1.560385E-08 PKETA = -5.98377E-15
++A1 = 0.02659908 LA1 = -6.511454E-09 A2 = 1
++AGS = -4.01637 LAGS = 1.090294E-06 WAGS = 1.162021E-06
++PAGS = -3.108579E-13 B0 = 0 B1 = 0
++VOFF = -0.1829426 LVOFF = 9.941631E-09 WVOFF = 1.568082E-08
++PVOFF = -2.832958E-15 NFACTOR = 0.6790636 LNFACTOR= 3.454948E-08
++WNFACTOR= 1.501016E-07 PNFACTOR= -2.955591E-14 CIT = 2.218499E-04
++LCIT = -1.076934E-10 WCIT = -3.286884E-10 PCIT = 1.658928E-16
++CDSC = 0 CDSCB = 0 CDSCD = 0
++ETA0 = 1.215578E-04 LETA0 = -1.037758E-11 WETA0 = -3.030225E-11
++PETA0 = 1.529658E-17 ETAB = 3.548681E-03 LETAB = -1.791374E-09
++WETAB = -6.897268E-10 PETAB = 3.481742E-16 DSUB = 0
++PCLM = 3.583838 PDIBLC1 = 0 PDIBLC2 = 5.379674E-03
++LPDIBLC2= 7.808481E-09 WPDIBLC2= 5.516945E-10 PPDIBLC2= -2.784957E-16
++PDIBLCB = -0.1229374 LPDIBLCB= 4.956215E-08 WPDIBLCB= 3.299946E-08
++PPDIBLCB= -9.624918E-15 DROUT = 0 PSCBE1 = 4.472639E+08
++LPSCBE1 = 28.64041 WPSCBE1 = 15.7154 PPSCBE1 = -7.933138E-06
++PSCBE2 = 1.842585E-06 LPSCBE2 = 2.871008E-12 WPSCBE2 = 2.579183E-12
++PPSCBE2 = -1.301972E-18 PVAG = -2.015254E-03 LPVAG = 1.017757E-09
++WPVAG = 3.07622E-10 PPVAG = -1.55418E-16 DELTA = -0.02862256
++LDELTA = 1.492454E-08 WDELTA = -6.71663E-09 PDELTA = 3.407521E-15
++ALPHA0 = 0 BETA0 = 30 KT1 = -0.2579945
++LKT1 = -1.664895E-08 WKT1 = -1.633463E-08 PKT1 = 3.755864E-15
++KT2 = -0.05347481 LKT2 = 8.244731E-09 WKT2 = 1.13705E-09
++PKT2 = -1.240924E-15 AT = -1.132632E+04 LAT = 6.469047E-03
++WAT = 6.829220E-04 PAT = -4.154249E-10 UTE = -2.309089
++LUTE = 1.662427E-07 WUTE = 1.244801E-07 PUTE = -5.627924E-14
++UA1 = -3.461758E-10 LUA1 = 1.747495E-16 WUA1 = -1.42065E-16
++PUA1 = 7.171442E-23 UB1 = 0 UC1 = -2.38157E-12
++LUC1 = -2.895726E-18 WUC1 = -1.990052E-17 PUC1 = 1.004497E-23
++KT1L = 0 PRT = -1E-18 CJ = 2.024128E-3
++MJ = 0.4960069 PB = 0.9173808 CJSW = 2.751528E-10
++MJSW = 0.443145 PBSW = 0.9173808 CJSWG = 2.135064E-10
++MJSWG = 0.443145 PBSWG = 0.9173808
++RSH = 4.5
++XTI = 3
++CGDO = 3.11E-10 CGSO = 3.11E-10 CAPMOD = 2
++XPART = 1 CF = 0
++JS = 1E-06
++JSW = 5E-11
+
+
+
+.MODEL Pmod PMOS LEVEL=8
++VERSION = 3.2.2
++TNOM = 25 TOX = 5.8e-9
++XJ = 1E-7 NCH = 4.1589E17
++LLN = 1 LWN = 1 WLN = 1
++WWN = 1 LINT = 1.2365E-8 WINT = 7.8E-9
++MOBMOD = 1 BINUNIT = 2 DWG = 0
++DWB = 0 VTH0 = -0.6236538 LVTH0 = 2.649834E-8
++WVTH0 = 3.214189E-8 PVTH0 = -3.22268E-15 K1 = 0.4198155
++LK1 = 5.770498E-8 WK1 = 5.577151E-8 PK1 = -2.81684E-14
++K2 = 0.0429467 LK2 = -2.296405E-8 WK2 = -1.355302E-8
++PK2 = 6.848271E-15 K3 = 0 DVT0 = 0
++DVT1 = 0 DVT2 = 0 DVT0W = 0
++DVT1W = 0 DVT2W = 0 NLX = 0
++W0 = 0 K3B = 0 VSAT = 1.443912E5
++LVSAT = -7.688012E-4 WVSAT = -6.083648E-3 PVSAT = 2.186471E-10
++UA = 1.846811E-9 LUA = -3.27694E-16 WUA = -2.82106E-16
++PUA = 7.180233E-23 UB = -7.84535E-19 LUB = 4.772849E-25
++WUB = 2.599205E-25 PUB = -1.46530E-31 UC = -1.75560E-10
++LUC = 3.360832E-17 WUC = 1.504425E-17 PUC = -1.30556E-23
++RDSW = 1.03E3 PRWB = 0 PRWG = 0
++WR = 1 U0 = 0.0136443 LU0 = -7.22084E-10
++WU0 = -1.088554E-9 PU0 = 2.730854E-16 A0 = 0.1071803
++LA0 = 4.64252E-7 WA0 = 5.383179E-7 PA0 = -1.32033E-13
++KETA = -4.943762E-3 LKETA = -3.565304E-9 WKETA = -5.226247E-9
++PKETA = 2.640665E-15 A1 = 0 A2 = 0.4
++AGS = 0.1664005 LAGS = 1.19106E-7 WAGS = 5.29237E-8
++PAGS = -2.67304E-14 B0 = 0 B1 = 0
++VOFF = -0.0592623 LVOFF = -1.96686E-8 WVOFF = -1.486398E-8
++PVOFF = 7.510321E-15 NFACTOR = 0.8588103 LNFACTOR= -1.158881E-7
++WNFACTOR= 1.210664E-8 PNFACTOR= -6.11712E-15 CIT = 6.439495E-5
++LCIT = 2.916437E-10 WCIT = -3.11284E-11 PCIT = 1.572825E-17
++CDSC = 0 CDSCB = 0 CDSCD = 0
++ETA0 = -3.819468E-3 LETA0 = 2.155422E-9 WETA0 = 8.235612E-10
++PETA0 = -4.16037E-16 ETAB = 1.334637E-3 LETAB = -7.93631E-10
++WETAB = 5.284657E-11 PETAB = -2.68353E-17 DSUB = 0
++PCLM = 0.1098002 LPCLM = 6.874263E-7 WPCLM = 6.724724E-7
++PPCLM = -1.97766E-13 PDIBLC1 = 0 PDIBLC2 = 5.801323E-3
++LPDIBLC2= -1.81964E-9 WPDIBLC2= -5.853396E-9 PPDIBLC2= 2.957545E-15
++PDIBLCB = 0.1921199 DROUT = 0 PSCBE1 = 7.19E8
++PSCBE2 = 1E-20 PVAG = 0 DELTA = 0.01
++ALPHA0 = 0 BETA0 = 30 KT1 = -0.3248987
++LKT1 = -1.160393E-8 WKT1 = 4.153356E-8 PKT1 = -4.62347E-15
++KT2 = -0.0367632 AT = 1E4 UTE = -1.04
++UA1 = 3.992421E-10 UB1 = -9.23294E-19 LUB1 = -5.28718E-26
++WUB1 = -6.13069E-26 PUB1 = 1.503674E-32 UC1 = -1.00699E-12
++KT1L = 0 PRT = 0 CJ = 1.931092e-3
++MJ = 0.4812153 PB = 0.9134669 CJSW = 2.232277e-10
++MJSW = 0.3237595 PBSW = 0.9134669 CJSWG = 1.607088e-10
++MJSWG = 0.3237595 PBSWG = 0.9134669
++RSH = 3.5
++CGDO = 2.68e-10 CGSO = 2.68e-10
++CAPMOD = 2
++XPART = 1
++CF = 0 XTI = 3
++JS = 3E-7
++JSW = 5E-12
+
+**.... FINISHED INCLUDING: ./proj1/process.models
+**
+.OPTIONS TEMP=25
+VSLEW_CONTROL VSLEW 0 (PULSE 0 1 0 1e-09)
+EVLOGIC VRAMP 0 VSLEW 0 2.5
+VDDPOWER VDD VRAMP DC 0
+VARACTOR_V VARACTOR_V 0 DC 2.5
+
+.TRAN 0.02n 100n 0n 0.5n
+.END
diff --git a/Windows/spice/examples/tclspice/tcl-testbench4/selectfromlist.tcl b/Windows/spice/examples/tclspice/tcl-testbench4/selectfromlist.tcl
new file mode 100644
index 00000000..9deb5c0b
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench4/selectfromlist.tcl
@@ -0,0 +1,55 @@
+namespace eval selectionwindow {
+ variable selectionvalue
+ variable selectionwindow
+}
+
+proc selectionwindow::selectfromlist { window title selectionlist args } {
+ variable selectionvalue
+ variable selectionwindow
+ if { [winfo exists $window] } {
+ raise $window;
+ return [lindex $selectionlist 0]
+ }
+ set selectionwindow $window
+ toplevel $selectionwindow
+ wm geometry $selectionwindow +200+200
+ focus -force $selectionwindow
+ wm title $selectionwindow $title
+ set maxstrlength [expr [string length $title]+12]
+
+ if { [llength $selectionlist]==0 } { destroy $selectionwindow; return {} }
+
+ foreach elem $selectionlist {
+ if { [string length $elem]>$maxstrlength } {
+ set maxstrlength [string length $elem]
+ }
+ }
+
+ scrollbar $selectionwindow.scroll -command "$selectionwindow.listbox yview"
+ eval "listbox $selectionwindow.listbox -yscroll \"$selectionwindow.scroll set\" \
+ -width $maxstrlength -height 10 -setgrid 1 $args"
+ pack $selectionwindow.listbox $selectionwindow.scroll -side left -fill y -expand 1
+ foreach elem $selectionlist {
+ $selectionwindow.listbox insert end $elem
+ }
+ bind $selectionwindow.listbox <Double-1> {
+ namespace eval selectionwindow {
+ set selectionvalue [selection get]
+ destroy $selectionwindow
+ }
+ }
+ tkwait window $selectionwindow
+
+ if { [info exists selectionvalue] } {
+ return $selectionvalue
+ } else {
+ if { [llength $selectionlist] != 0 } {
+ return [lindex $selectionlist 0]
+ } else {
+ return ""
+ }
+ }
+}
+
+# puts [selectionwindow::selectfromlist .demo "Wähle Frucht" { Apfel Birne Zitrone dsfsdfdsfdsfdsfsdfds}]
+
diff --git a/Windows/spice/examples/tclspice/tcl-testbench4/tcl-testbench4.sh b/Windows/spice/examples/tclspice/tcl-testbench4/tcl-testbench4.sh
new file mode 100644
index 00000000..810db8d7
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench4/tcl-testbench4.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec wish vspicechart.tcl example.cir
diff --git a/Windows/spice/examples/tclspice/tcl-testbench4/vspicechart.tcl b/Windows/spice/examples/tclspice/tcl-testbench4/vspicechart.tcl
new file mode 100644
index 00000000..810c2e74
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl-testbench4/vspicechart.tcl
@@ -0,0 +1,250 @@
+############ spice chart program ###########
+############ programmer: stephan thiel ###########
+############ thiel@mikro.ee.tu-berlin.de ###########
+############ (c) 2008 Berlin, Germany ###########
+############ Don't trust any version ###########
+############ before 1.0 ###########
+
+
+package require BLT
+load "../../../src/.libs/libspice.so"
+
+source selectfromlist.tcl
+source bltGraph.tcl
+
+namespace import blt::*
+
+wm title . "vspicechart 0.01"
+wm geometry . 800x450+40+40
+pack propagate . false
+
+set globals(colors) { red green blue orange yellow white gray lightblue pink darkblue \
+ lightred lightgray darkgray darkblue darkgreen darkred violet salmon \
+ gray100 gold SeaGreen RoyalBlue RosyBrown orchid MintCream magenta LimeGreen \
+ gray33 DeepSkyBlue DarkGoldenrod chocolate gray77 aquamarine brown coral \
+ DarkOliveGreen DarkOrange DarkSlateGray gray99 HotPink IndianRed LemonChiffon \
+ LightSteelBlue PaleGreen peru sienna seashell SpringGreen tomato wheat WhiteSmoke}
+
+
+proc replacechar { str pat pat1} {
+ set erg ""
+ for { set i 0 } { $i < [string length $str] } {incr i 1 } {
+ if { [ string index $str $i ] == $pat } {
+ append erg $pat1
+ } else {
+ append erg [string index $str $i ]
+ }
+ }
+ return $erg
+}
+
+
+proc realtostr { r } {
+ set b [ expr abs($r) ]
+ set mul 1e-18
+ set prefix a
+ if { $b > 9.9999999999e-16 } {
+ set mul 1e15
+ set prefix f
+ }
+ if { $b > 9.9999999999e-13 } {
+ set mul 1e12
+ set prefix p
+ }
+ if { $b > 9.9999999999e-10 } {
+ set mul 1e9
+ set prefix n
+ }
+ if { $b > 9.9999999999e-7 } {
+ set mul 1e6
+ set prefix u
+ }
+ if { $b > 9.9999999999e-4 } {
+ set mul 1e3
+ set prefix m
+ }
+
+ if { $b > 0.999999999999999 } {
+ set mul 1
+ set prefix ""
+ }
+
+ if { $b > 999 } {
+ set mul 1e-3
+ set prefix K
+ }
+
+ if { $b > 9.999999999e5 } {
+ set mul 1e-6
+ set prefix MEG
+ }
+ if { $b > 9.9999999999e8 } {
+ set mul 1e-9
+ set prefix G
+ }
+ if { $b > 9.99999999999e11 } {
+ set mul 1e-12
+ set prefix T
+ }
+ set str [ format "%1.8g$prefix" [expr $r*$mul] ]
+ if { $str=="0a" } { set str "0" }
+ return $str
+}
+
+proc realtostr1 { elem r } {
+ scan $r "%f" erg
+ return [ realtostr $erg ]
+}
+
+set globals(signals) {};
+
+proc readconfigfile { } {
+ global globals
+ global const
+ if { [file exists $globals(CONFIGFILE)] } {
+ set fid [open $globals(CONFIGFILE) r]
+ while { ![eof $fid] } {
+ gets $fid tempstring
+ if { [string first "PACK-PATH=" $tempstring]==0 } {
+ scan $tempstring "PACK-PATH=%s" globals(PACK-PATH)
+ }
+ if { [string first "SIMULATOR=" $tempstring]==0 } {
+ scan $tempstring "SIMULATOR=%s" globals(SIMULATOR)
+ }
+ }
+ close $fid
+ } else {
+ set globals(PACK-PATH) ""
+ set globals(SIMULATOR) "INTERNAL"
+ }
+}
+
+proc select_vector { } {
+ global globals
+ set thissignals [spice::spice_data]
+ set signals {}
+ foreach sig $thissignals {
+ if { [lindex $sig 0] != "time" } {
+ lappend signals [lindex $sig 0]
+ }
+ }
+ set selectedsignal [selectionwindow::selectfromlist .select "Select Signal" $signals ]
+ if { ( [string trim $selectedsignal] != "") && ([lsearch -exact $globals(signals) $selectedsignal] == -1) } {
+ eval "$globals(LSELECTEDSIGNALS) insert end $selectedsignal"
+ vector create [replacechar $selectedsignal "\#" "_"]
+ }
+}
+
+
+proc start_new_sel { } {
+ global globals
+
+ set elemlist [ eval "$globals(chart0) element show" ]
+ for { set j 0 } {$j < [llength $elemlist] } {incr j 1} {
+ $globals(chart0) element delete [lindex $elemlist $j ]
+ }
+
+ set i 0
+ foreach sig $globals(signals) {
+ set nsig [replacechar $sig "\#" "_"]
+ vector create $nsig
+ spice::spicetoblt $sig $nsig
+
+ $globals(chart0) element create $sig -color [lindex $globals(colors) $i] -xdata stime -ydata $nsig -symbol none
+ incr i 1
+ }
+}
+
+
+proc delete_selected { } {
+ global globals
+ set elem [$globals(LSELECTEDSIGNALS) curselection]
+ if { $elem != "" } {
+ $globals(LSELECTEDSIGNALS) delete $elem
+ }
+}
+
+
+
+set filename [ lindex $argv 0]
+
+if { [file exists $filename ] } {
+ spice::source $filename
+ spice::bg run
+
+after 1000
+
+
+
+frame .f1
+pack .f1 -side left -expand true -fill both
+
+listbox .f1.blistbox -listvariable globals(signals)
+pack .f1.blistbox -side top -fill both -expand true
+
+set globals(LSELECTEDSIGNALS) .f1.blistbox
+
+
+button .f1.baddvec -text "Select Vector" -command "select_vector"
+pack .f1.baddvec -side top -fill x -expand true
+
+button .f1.bdelvec -text "Delete Vector" -command "delete_selected"
+pack .f1.bdelvec -side top -fill x -expand true
+
+button .f1.bstartsel -text "Start with new selection" -command start_new_sel
+pack .f1.bstartsel -side top -fill x -expand true
+
+
+button .f1.simstop -text "Simulation Stop" -command "spice::stop"
+pack .f1.simstop -side top -fill x -expand true
+
+button .f1.simresume -text "Simulation Resume" -command "spice::bg resume"
+pack .f1.simresume -side top -fill x -expand true
+
+
+button .f1.bexit -text "Exit" -command "exit"
+pack .f1.bexit -side top -fill x -expand true
+
+
+frame .f2
+pack .f2 -side left -expand true -fill both
+
+stripchart .f2.chart
+pack .f2.chart -side top -fill both -expand true
+.f2.chart axis configure x -title "Time in s"
+
+
+.f2.chart grid configure -hide no
+Blt_ZoomStack .f2.chart
+Blt_Crosshairs .f2.chart
+Blt_ClosestPoint .f2.chart
+Blt_PrintKey .f2.chart
+Blt_ActiveLegend .f2.chart
+.f2.chart crosshairs configure -color lightblue
+
+.f2.chart axis configure x -command realtostr1
+.f2.chart axis configure y -command realtostr1
+
+set globals(chart0) .f2.chart
+
+
+
+ vector create stime
+
+
+ proc bltupdate {} {
+ global globals
+
+ spice::spicetoblt time stime
+ foreach sig $globals(signals) {
+ set nsig [replacechar $sig "\#" "_"]
+ spice::spicetoblt $sig $nsig
+ }
+
+ after 100 bltupdate
+ }
+ bltupdate
+
+} else {
+ exit;
+}
diff --git a/Windows/spice/examples/tclspice/tcl/diffpair.cir b/Windows/spice/examples/tclspice/tcl/diffpair.cir
new file mode 100644
index 00000000..c926364f
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl/diffpair.cir
@@ -0,0 +1,29 @@
+simple differential pair - CM and DM dc sensitivity
+
+* Models:
+.model qnl npn(bf=80 rb=100 ccs=2pf tf=0.3ns tr=6ns cje=3pf cjc=2pf va=50)
+.model qnr npn(bf=80 rb=100 ccs=2pf tf=0.3ns tr=6ns cje=3pf cjc=2pf va=50)
+
+* Circuit description:
+q1 4 2 6 qnr
+q2 5 3 6 qnl
+rs1 11 2 1k
+rs2 3 1 1k
+rc1 4 8 10k
+rc2 5 8 10k
+q3 7 7 9 qnl
+q4 6 7 9 qnr
+rbias 7 8 20k
+
+* Inputs/Supplies:
+vcm 1 0 dc 0 sin(0 0.1 5meg) ac 1
+vdm 1 11 dc 0 sin(0 0.1 5meg) ac 1
+vcc 8 0 12
+vee 9 0 -12
+
+* Analysys:
+.tf v(5) vcm
+.tf v(5) vdm
+.sens v(5,4)
+
+.end
diff --git a/Windows/spice/examples/tclspice/tcl/test_vectoblt.sh b/Windows/spice/examples/tclspice/tcl/test_vectoblt.sh
new file mode 100644
index 00000000..28f04b96
--- /dev/null
+++ b/Windows/spice/examples/tclspice/tcl/test_vectoblt.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# -*- mode: tcl -*- \
+ exec wish -f "$0" ${1+"$@"}
+
+package require BLT
+load ../../../src/.libs/libspice.so
+
+spice::source "diffpair.cir"
+spice::op
+spice::let Vd = V(5) - V(4)
+blt::vector create imag
+blt::vector create real
+
+set ok 0
+###################
+puts " Vd is a real vector of length 1"
+###################
+#too many arguments
+if {[catch {spice::vectoblt raul ibrahim ector karim} erreur] != 0} {puts "ERROR EXPECTED: TEST 1 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 1 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable argument
+if {[catch {spice::vectoblt raul ibrahim ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 2 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 2 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable blt vector
+if {[catch {spice::vectoblt Vd ibrahim} erreur] != 0} {puts "ERROR EXPECTED: TEST 3 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 3 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#real part affectation
+if {[catch {spice::vectoblt Vd real} erreur] == 0} {puts "NO ERROR IN AFFECTATION. TEST 4 OK:\n\t (Blank line)"; set ok [expr {$ok + 1}]} else {puts "TEST 4 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable blt vector (2 vectors)
+if {[catch {spice::vectoblt Vd ibrahim ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 5 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 5 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable imaginary vector
+if {[catch {spice::vectoblt Vd real ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 6 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 6 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#real and imaginary part affectation
+if {[catch {spice::vectoblt Vd real imag} erreur] == 0} {puts "NO ERROR IN AFFECTATION. TEST 7 OK:\n\t (Blank line)"; set ok [expr {$ok + 1}]} else {puts "TEST 7 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#all good vectors, but another argument invited himself
+if {[catch {spice::vectoblt Vd real imag karim} erreur] != 0} {puts "ERROR EXPECTED: TEST 8 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 8 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+
+###################
+puts " Vd is a complex vector of length 10"
+###################
+spice::op
+spice::ac dec 10 100 1000
+spice::let Vd = V(5) - V(4)
+#too many arguments
+if {[catch {spice::vectoblt raul ibrahim ector karim} erreur] != 0} {puts "ERROR EXPECTED: TEST 1 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 1 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable argument
+if {[catch {spice::vectoblt raul ibrahim ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 2 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 2 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable blt vector
+if {[catch {spice::vectoblt Vd ibrahim} erreur] != 0} {puts "ERROR EXPECTED: TEST 3 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 3 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#real part affectation
+if {[catch {spice::vectoblt Vd real} erreur] == 0} {puts "NO ERROR IN AFFECTATION. TEST 4 OK:\n\t (Blank line)"; set ok [expr {$ok + 1}]} else {puts "TEST 4 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable blt vector (2 vectors)
+if {[catch {spice::vectoblt Vd ibrahim ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 5 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 5 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#no acceptable imaginary vector
+if {[catch {spice::vectoblt Vd real ector} erreur] != 0} {puts "ERROR EXPECTED: TEST 6 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 6 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#real and imaginary part affectation
+if {[catch {spice::vectoblt Vd real imag} erreur] == 0} {puts "NO ERROR IN AFFECTATION. TEST 7 OK:\n\t (Blank line)"; set ok [expr {$ok + 1}]} else {puts "TEST 7 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+#all good vectors, but another argument invited himself
+if {[catch {spice::vectoblt Vd real imag karim} erreur] != 0} {puts "ERROR EXPECTED: TEST 8 OK:\n\t$erreur"; set ok [expr {$ok + 1}]} else {puts "TEST 8 ERROR\n\t Test 1 should return TCL_ERROR, but it does not"}
+
+puts "\n\n"
+if {$ok == 16} {puts "spice::vectoblt OK ($ok/16 tests ok)"} else {puts "spice::vectoblt KO:\n\t$ok/16 tests ok"}