2016-07-12 2 views
1

Wie die modifizierten Gerätemodellparameter (wie W, L, Tox) während der Monte-Carlo-Iterationsschleife an die Teilschaltung übergeben werden?NGSpice Monte Marlo Analyse, wie die Parameter an die Teilschaltung übergeben?

-Tool Version:

[[email protected] inverter]$ ngspice -v 
ngspice compiled from ngspice revision 23 
Written originally by Berkeley University 
Currently maintained by the NGSpice Project 

Copyright (C) 1985-1996, The Regents of the University of California 
Copyright (C) 1999-2008, The NGSpice Project 
[[email protected] inverter]$ uname -a 
Linux E7440.DELL 4.4.13-200.fc22.x86_64 #1 SMP Wed Jun 8 15:59:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 
[[email protected] inverter]$ 

Testfall:

Hier ist eine kleine eigenständige Testfall, der das Problem demonstriert; Durchführen einer Monte-Carlo-Analyse an einem einfachen Invertergate durch Variieren der Breite und Länge des Transistorkanals.

SPICE3 file 

.GLOBAL VDD VBP 
V0DD VDD 0 1.1 
V0BP VBP 0 1.1 
.GLOBAL VSS VBN 
V0SS VSS 0 0.0 
V0BN VBN 0 0.0 

X1 VDD VSS VBP VBN X A INV1 

V1 A 0 DC 0 PWL(2501.80p 1.10 2503.02p 1.10 2504.24p 1.10 2505.46p 1.10 2506.68p 1.10 2507.90p 1.09 2509.12p 1.09 2510.34p 1.09 2511.56p 1.09 2512.78p 1.08 2514.00p 1.07 2515.22p 1.06 2516.44p 1.05 2517.66p 1.03 2518.88p 1.01 2520.10p 0.98 2521.32p 0.94 2522.54p 0.88 2523.76p 0.79 2524.98p 0.67 2526.20p 0.55 2527.42p 0.43 2528.64p 0.31 2529.86p 0.22 2531.08p 0.16 2532.30p 0.12 2533.52p 0.09 2534.74p 0.07 2535.96p 0.05 2537.18p 0.04 2538.40p 0.03 2539.62p 0.02 2540.84p 0.01 2542.06p 0.01 2543.28p 0.01 2544.50p 0.01 2545.72p 0.00 2546.94p 0.00 2548.16p 0.00 2549.38p 0.00 2550.60p 0.00) 
C1 X 0 12.3f 

.OPTIONS NOACCT 

.control 
    save A X 
    let mc_runs = 25 
    let run = 0 
    set curplot = new 
    set plot_out = $curplot 

    define unif(nom, var) (nom + (nom*var) * sunif(0)) 
    define aunif(nom, avar) (nom + avar * sunif(0)) 
    define gauss(nom, var, sig) (nom + (nom*var)/sig * sgauss(0)) 
    define agauss(nom, avar, sig) (nom + avar/sig * sgauss(0)) 

    dowhile run <= mc_runs 
     alter @M1[W] = gauss(0.72u, 0.1, 3) 
     alter @M1[L] = gauss(0.18u, 0.1, 3) 
     alter @M2[W] = gauss(0.36u, 0.1, 3) 
     alter @M2[L] = gauss(0.18u, 0.1, 3) 

     tran 3p 3n 2n 

     set run ="$&run" 
     print run 

     linearize A X 
     set plot_tmp = $curplot 
     setplot $plot_out 
     if run=0 
      let time={$plot_tmp}.time 
      let vin={$plot_tmp}.A 
     end 
     let vout{$run}={$plot_tmp}.X 
     setplot $plot_tmp 
     let run = run + 1 
    end 
    plot {$plot_out}.allv 
.endc 

.END 

.MODEL NFET NMOS(LEVEL=14 VERSION=4.6.5) 
.MODEL PFET PMOS(LEVEL=14 VERSION=4.6.5) 

.SUBCKT INV1 VDD VSS VBP VBN X A 
M1 X A VDD VBP pfet W=0.72u L=0.18u AD=3.6p PD=2.34p AS=3.6p PS=2.34p 
M2 X A VSS VBN nfet W=0.36u L=0.18u AD=1.8p PD=1.62p AS=1.8p PS=1.62p 
.ENDS 

Die SPICE Ausgabe folgt:

[[email protected] inverter]$ ngspice simulate_mc2.sp 
****** 
** ngspice-23 : Circuit level simulation program 
** The U. C. Berkeley CAD Group 
** Copyright 1985-1994, Regents of the University of California. 
** Please get your ngspice manual from http://ngspice.sourceforge.net/docs.html 
** Please file your bug-reports at http://ngspice.sourceforge.net/bugrep.html 
** Creation Date: Tue Jul 8 03:06:23 UTC 2014 
****** 

Circuit: simulation file 

Error: no such device or model name m1 
Error: no such device or model name m1 
Error: no such device or model name m2 
Error: no such device or model name m2 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 0.000000e+00 
Error: no such device or model name m1 
Error: no such device or model name m1 
Error: no such device or model name m2 
Error: no such device or model name m2 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 1.000000e+00 
Error: no such device or model name m1 
Error: no such device or model name m1 
Error: no such device or model name m2 
Error: no such device or model name m2 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 2.000000e+00 
Error: no such device or model name m1 
Error: no such device or model name m1 
Error: no such device or model name m2 
Error: no such device or model name m2 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00nce value : 2.55551e-09 

No. of Data Rows : 501 
run = 3.000000e+00 

Offensichtlich etwas mit dem Führen der Parameter auf die Teilschaltung schief geht. Ich habe auch versucht die folgende Syntax Variationen:

alter [email protected][W] = gauss(0.72u, 0.1, 3) 
alter X1:@M1[W] = gauss(0.72u, 0.1, 3) 
alter X1/@M1[W] = gauss(0.72u, 0.1, 3) 
alter @X1.M1[W] = gauss(0.72u, 0.1, 3) 
alter @X1:M1[W] = gauss(0.72u, 0.1, 3) 
alter @X1/M1[W] = gauss(0.72u, 0.1, 3) 
alter @[email protected][W] = gauss(0.72u, 0.1, 3) 
alter @X1:@M1[W] = gauss(0.72u, 0.1, 3) 
alter @X1/@M1[W] = gauss(0.72u, 0.1, 3) 
alter @X1[M1[W]] = gauss(0.72u, 0.1, 3) 
alter @X1(M1[W]) = gauss(0.72u, 0.1, 3) 
alter @X1{M1[W]} = gauss(0.72u, 0.1, 3) 

Nichts funktioniert ...


By the way, wenn ich die Teilschaltung Inhalt innerhalb des Haupt netlist bewegen, Simulation funktioniert ..

. Beispiel:

SPICE3 file 

.GLOBAL VDD VBP 
V0DD VDD 0 1.1 
V0BP VBP 0 1.1 
.GLOBAL VSS VBN 
V0SS VSS 0 0.0 
V0BN VBN 0 0.0 

M1 X A VDD VBP pfet W=0.72u L=0.18u AD=3.6p PD=2.34p AS=3.6p PS=2.34p 
M2 X A VSS VBN nfet W=0.36u L=0.18u AD=1.8p PD=1.62p AS=1.8p PS=1.62p 

V1 A 0 DC 0 PWL(2501.80p 1.10 2503.02p 1.10 2504.24p 1.10 2505.46p 1.10 2506.68p 1.10 2507.90p 1.09 2509.12p 1.09 2510.34p 1.09 2511.56p 1.09 2512.78p 1.08 2514.00p 1.07 2515.22p 1.06 2516.44p 1.05 2517.66p 1.03 2518.88p 1.01 2520.10p 0.98 2521.32p 0.94 2522.54p 0.88 2523.76p 0.79 2524.98p 0.67 2526.20p 0.55 2527.42p 0.43 2528.64p 0.31 2529.86p 0.22 2531.08p 0.16 2532.30p 0.12 2533.52p 0.09 2534.74p 0.07 2535.96p 0.05 2537.18p 0.04 2538.40p 0.03 2539.62p 0.02 2540.84p 0.01 2542.06p 0.01 2543.28p 0.01 2544.50p 0.01 2545.72p 0.00 2546.94p 0.00 2548.16p 0.00 2549.38p 0.00 2550.60p 0.00) 
C1 X 0 12.3f 

.OPTIONS NOACCT 

.control 
    save A X 
    let mc_runs = 5 
    let run = 0 
    set curplot = new 
    set plot_out = $curplot 

    define unif(nom, var) (nom + (nom*var) * sunif(0)) 
    define aunif(nom, avar) (nom + avar * sunif(0)) 
    define gauss(nom, var, sig) (nom + (nom*var)/sig * sgauss(0)) 
    define agauss(nom, avar, sig) (nom + avar/sig * sgauss(0)) 

    dowhile run <= mc_runs 
     alter @M1[W] = gauss(0.72u, 0.1, 3) 
     alter @M1[L] = gauss(0.18u, 0.1, 3) 
     alter @M2[W] = gauss(0.36u, 0.1, 3) 
     alter @M2[L] = gauss(0.18u, 0.1, 3) 

     tran 3p 3n 2n 

     set run ="$&run" 
     print run 

     linearize A X 
     set plot_tmp = $curplot 
     setplot $plot_out 
     if run=0 
      let time={$plot_tmp}.time 
      let vin={$plot_tmp}.A 
     end 
     let vout{$run}={$plot_tmp}.X 
     setplot $plot_tmp 
     let run = run + 1 
    end 
    plot {$plot_out}.allv 
.endc 

.END 

.MODEL NFET NMOS(LEVEL=14 VERSION=4.6.5) 
.MODEL PFET PMOS(LEVEL=14 VERSION=4.6.5) 

Ergebnis:

[[email protected] inverter]$ ngspice simulate_mc1.sp 
****** 
** ngspice-23 : Circuit level simulation program 
** The U. C. Berkeley CAD Group 
** Copyright 1985-1994, Regents of the University of California. 
** Please get your ngspice manual from http://ngspice.sourceforge.net/docs.html 
** Please file your bug-reports at http://ngspice.sourceforge.net/bugrep.html 
** Creation Date: Tue Jul 8 03:06:23 UTC 2014 
****** 

Circuit: simulation file 

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 0.000000e+00 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 1.000000e+00 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00 

No. of Data Rows : 501 
run = 2.000000e+00 
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 

OpenMP: 2 threads are requested in BSIM4 
%100.00nce value : 2.52249e-09 

No. of Data Rows : 501 
run = 3.000000e+00 

Dies ist jedoch keine praktische Lösung. Ich möchte auch andere Zellen simulieren, aber das Kopieren der Inhalte verschiedener Unterschaltungen in die Hauptnetzliste ist umständlich und fehleranfällig.

Antwort

2

Darf ich die Diskussionsforen von ngspice empfehlen, um solche Fragen zu stellen? Eine viel schnellere Antwort wäre verfügbar gewesen, nicht zufällig, wie es hier passiert ist.

Nachdem Sie Ihre Eingabedatei interaktiv ausgeführt haben, geben Sie den Befehl 'listing expand' ein und Sie werden sehen, wie die Schaltungsstruktur nach der Erweiterung der Teilschaltung aussieht.

m1 hat sich zu m.x1.m1 entwickelt, m2 ist zu m.x1.m2 geworden. Der alter-Befehl wirkt auf die erweiterte Schaltung. Durch Ersetzen von m1 durch m.x1.m1 und m2 durch m.x1.m2 in den alter-Anweisungen erhalten Sie ein geeignetes Ergebnis.

Holger

Verwandte Themen