|
From: Piotr Z. <pza...@gm...> - 2013-05-29 09:10:48
|
Hello A have a subcircuit with models. If I put models before subckt, everything are ok. But when I put them inside subcircuit, a problem appear. I get something like that: ------------- ngspice -r sym-2.raw -b sym-2.net Circuit: * gnetlist --nomunge -s -g spice-sdb -o sym-2.net sym-2.sch Error on line 0 : m.x1.maux x1.g2 x1.c x1.a x1.a sw Unable to find definition of model sw - default assumed Error on line 0 : m.x1.maux2 x1.b x1.d x1.g2 x1.g2 sw Unable to find definition of model sw - default assumed Error on line 0 : m.x2.maux x2.g2 x2.c x2.a x2.a sw Unable to find definition of model sw - default assumed Error on line 0 : m.x2.maux2 x2.b x2.d x2.g2 x2.g2 sw Unable to find definition of model sw - default assumed Error on line 0 : m.x3.maux x3.g2 x3.c x3.a x3.a sw Unable to find definition of model sw - default assumed Error on line 0 : m.x3.maux2 x3.b x3.d x3.g2 x3.g2 sw Unable to find definition of model sw - default assumed Error on line 0 : m.x4.maux x4.g2 x4.c x4.a x4.a sw Unable to find definition of model sw - default assumed Error on line 0 : m.x4.maux2 x4.b x4.d x4.g2 x4.g2 sw Unable to find definition of model sw - default assumed Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Warning: x4:dgd: grading coefficient too large, limited to 0.9 Warning: x3:dgd: grading coefficient too large, limited to 0.9 Warning: x2:dgd: grading coefficient too large, limited to 0.9 Warning: x1:dgd: grading coefficient too large, limited to 0.9 Warning: v6: no DC value, transient time 0 value used Warning: v5: no DC value, transient time 0 value used Warning: v3: no DC value, transient time 0 value used Warning: v2: no DC value, transient time 0 value used No. of Data Columns : 110 Initial Transient Solution -------------------------- Node Voltage ---- ------- 3 0 5 0 <...> ------------- When models are before the subckt, I get this: ------------- ngspice -r sym-2.raw -b sym-2.net Circuit: * gnetlist --nomunge -s -g spice-sdb -o sym-2.net sym-2.sch Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Warning: dgd: grading coefficient too large, limited to 0.9 Warning: v6: no DC value, transient time 0 value used Warning: v5: no DC value, transient time 0 value used Warning: v3: no DC value, transient time 0 value used Warning: v2: no DC value, transient time 0 value used No. of Data Columns : 110 Initial Transient Solution -------------------------- Node Voltage ---- ------- 3 0 5 0 <...> ------------- IMHO ok. I check usage of .MODEL in manual and everything sims to be ok. It shoud work in subckt. It is intentional or only a bag? Maybe I made something wrong? I know, that there are only a problem with third usage on NMOS, but why? ----------------------------------------------------------------------------------------------- <sym-2.sch> * gnetlist --nomunge -s -g spice-sdb -o sym-2.net sym-2.sch B1 3 5 V=I(V1)*{K} C1 14 0 500 IC=28.0 C2 8 0 500 IC=14.0 C3 c1 0 360000 IC=12 C4 1 aku 36 IC=0 L1 2 3 0.00001 IC=0 L2 5 6 0.00001 IC=0 R1 14 sc 0.002 R2 15 pp2 0.2 R22 10 gx1 0.2 R3 8 sc 0.002 R4 c1 1 0.003 R5 1 aku 0.003 R6 4 2 10.005 R7 7 6 0.005 V1 sc vpc 0 V10 7 0 0 V12 9 4 0 V2 10 0 pulse (0 1 70ns 20ns 25ns 200ns 500ns) V3 13 0 pulse (0 1 270ns 20ns 25ns 200ns 500ns) V4 pp1 15 0 V5 12 0 pulse (0 1 270ns 20ns 25ns 200ns 500ns) V6 11 0 pulse (0 1 70ns 20ns 25ns 200ns 500ns) V7 sc scr1 0 V8 scr1 9 0 V9 aku 9 0 X1 vpc gx1 pp1 IPA90R1K2C3_L0 X2 pp1 13 0 IPA90R1K2C3_L0 X3 vpc 12 pp2 IPA90R1K2C3_L0 X4 pp2 11 0 IPA90R1K2C3_L0 .TRAN 10ns 200us 0 100ns UIC .INCLUDE Infineon_CoolMOS_C3_900V.lib .PARAM K=0.000072 .end <Infineon_CoolMOS_C3_900V.lib> * *outside subckt* *.MODEL DMOS NMOS ( KP= 8.512 VTO=3.4 THETA=0 VMAX=1.5e5 ETA=0 LEVEL=3) *.MODEL MVDR NMOS (KP=13.17 VTO=-1 LAMBDA=0.1) *.MODEL Dbt D (BV=900 M=0.55 CJO=1.38n VJ=0.5V) *.MODEL DBODY D (IS=0.6p N=1.02 RS=22u EG=1.12 TT=2u) *.MODEL sw NMOS (VTO=0 KP=10 LEVEL=1) *.MODEL DGD D (M=1.2 CJO=1.9n VJ=0.5) .SUBCKT IPA90R1K2C3_L0 drain gate source Lg gate g1 7n Ld drain d1 3n Ls source s1 7n Rs s1 s2 3m Rg g1 g2 1.3 M1 d2 g2 s2 s2 DMOS L=1u W=1u Rd d2 d1a 0.915 TC=12m Mr d1 d2a d1a d1a MVDR W=1u L=1u Rx d2a d1a 1m Cds1 s2 d2 15.3p Dbd s2 d2 Dbt Dbody s2 21 DBODY Rdiode d1 21 12.25m TC=2m Maux g2 c a a sw Maux2 b d g2 g2 sw Eaux c a d2 g2 1 Eaux2 d g2 d2 g2 -1 Cox b d2 1.9n Rpar b d2 1Meg Dgd a d2 DGD Rpar2 d2 a 10Meg Cgs g2 s2 0.7n *inside subckt* .MODEL DMOS NMOS ( KP= 8.512 VTO=3.4 THETA=0 VMAX=1.5e5 ETA=0 LEVEL=3) .MODEL MVDR NMOS (KP=13.17 VTO=-1 LAMBDA=0.1) .MODEL Dbt D (BV=900 M=0.55 CJO=1.38n VJ=0.5V) .MODEL DBODY D (IS=0.6p N=1.02 RS=22u EG=1.12 TT=2u) .MODEL sw NMOS (VTO=0 KP=10 LEVEL=1) .MODEL DGD D (M=1.2 CJO=1.9n VJ=0.5) .ENDS IPA90R1K2C3_L0 ---------------- $ ./configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info --disable-debug --with-readline=yes --enable-xgraph --enable-xspice --enable-cider --enable-dot-global --enable-intnoise --enable-numparam --enable-shared --disable-static --build=i486-slackware-linux Thanks for advice, PZ |