From: James J. <jam...@go...> - 2013-10-30 11:42:25
|
Hi, I've just found QUCS and I'm very impressed with it so far. I'm trying to import a manufacturer's SPICE model to use in my simulations, but I'm not having much joy. The macromodel I am attempting to use is shown below [1]. To use it in the SPICE -> QUCS translator, I have just stripped off the .SUBCKT and .ENDS commands (and added a .END), and used the QUCs dialog to connect up the nets listed as pins in the .SUBCKT statement. QUCS doesn't complain when reading the modified netlist. When attempting to run the simulation, however, I get an error: "line 46: syntax error, unexpected REAL, expecting Identifier or ScaleOrUnit" Looking at the generated netlist (below, [2]), this line appears to be where QUCS is using the translated component: L46: Sub:4301_RMS _net0 _net1 gnd _net2 _net3 RMSOut _net4 _net5 Type="n4301_RMS_spice_txt" I'm wondering if anybody can comment on what's going on here? I have attached the modified component SPICE netlist, and my simple test schematic. Many thanks, James. [1] * ==================================== * THAT4301 RMS Macromodel * REV 01 1/9/98 * REV 02 6/9/98 * REV 03 11/9/98 * connections: input current * | timing current * | | timing capacitor * | | | output current * | | | | negative power supply * | | | | | positive power supply * | | | | | | ground * | | | | | | | .SUBCKT 4301RMS_THAT IN IT CT OUT V- V+ GND * I_bias V+ IN 100p I_I1 V+ 1 DC .000120 AC 0 V_V2 2 3 DC .61 AC 0 V_V3 4 GND DC .65 AC 0 E_E1 5 GND GND gmout 1 G_G1 GND gmout 6 7 .001 R_R1 5 2 100 R_R2 In 8 500 R_R3 In 9 500 J_J1 7 In 10 jp4301rm J_J2 6 GND 11 jp4301rm R_R4 V- 7 1k R_R5 V- 6 1k R_R6 10 1 400 R_R7 11 1 400 C_C1 7 6 10p R_R8 GND gmout 100000k C_C2 V- gmout 11p F_F1 Ct V- VF_F1 1.1 VF_F1 GND It 0V F_F2 GND 13 VF_F2 1 VF_F2 4 12 0V Q_Q11 14 14 Ct qn4301rm E_E2 14 GND 13 GND 1 E_E3 out GND Ct 15 1 Q_Q19 12 12 16 qn4301rm Q_Q20 16 9 3 qn4301rm Q_Q21 In 8 3 qn4301rm Q_Q22 12 2 In qn4301rm Q_Q26 gmout gmout V+ qn4301rm Q_Q27 V- V- gmout qn4301rm Q_Q23 13 13 17 qn4301rm Q_Q24 17 17 GND qn4301rm Q_Q25 15 15 GND qn4301rm I_I2 V+ 15 DC 8.2u AC 0 .model qn4301rm npn(bf=250 vaf=95 re=4) .MODEL jp4301rm PJF(VTO=-1.46 BETA=1.67E-4 IS=10E-14) .ENDS [2] # Qucs 0.0.17 /Users/jamesjackson/.qucs/Phaseamp_prj/RMS Test.sch .Def:n4301_RMS_spice_txt _netIN _netVP _netGND _netIT _netCT _netOUT _netVN _ref Iac:I_I1 _net1 _netVP I="0" Vac:V_V2 _net2 _cnet1 U="0" Vac:V_V3 _net4 _cnet0 U="0" Iac:I_I2 _net15 _netVP I="0" Idc:I_I2 _net15 _netVP I="8.2u" BJT:Q_Q25 _net15 _net15 _netGND _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q24 _net17 _net17 _netGND _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q23 _net13 _net13 _net17 _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q27 _netVN _netVN _netGMOUT _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q26 _netGMOUT _netGMOUT _netVP _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q22 _net2 _net12 _netIN _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q21 _net8 _netIN _net3 _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q20 _net9 _net16 _net3 _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" BJT:Q_Q19 _net12 _net12 _net16 _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" VCVS:E_E3 _netCT _netOUT _netGND _net15 G="1" VCVS:E_E2 _net13 _net14 _netGND _netGND G="1" BJT:Q_Q11 _net14 _net14 _netCT _ref Type="npn" Bf="250" Vaf="95" Re="4" Is="1e-16" Nf="1" Nr="1" Ikf="0" Ikr="0" Var="0" Ise="0" Ne="1.5" Isc="0" Nc="2" Br="1" Rbm="0" Irb="0" Cje="0" Vje="0.75" Mje="0.33" Cjc="0" Vjc="0.75" Mjc="0.33" Xcjc="1" Cjs="0" Vjs="0.75" Mjs="0" Fc="0.5" Vtf="0" Tf="0" Xtf="0" Itf="0" Tr="0" Vdc:VF_F2 _cnet2 _net12 U="0V" CCCS:F_F2 _net4 _netGND _net13 _cnet2 G="1" Vdc:VF_F1 _cnet3 _netIT U="0V" CCCS:F_F1 _netGND _netCT _netVN _cnet3 G="1.1" C:C_C2 _netVN _netGMOUT C="11p" R:R_R8 _netGND _netGMOUT R="100000k" C:C_C1 _net7 _net6 C="10p" R:R_R7 _net11 _net1 R="400" R:R_R6 _net10 _net1 R="400" R:R_R5 _netVN _net6 R="1k" R:R_R4 _netVN _net7 R="1k" JFET:J_J2 _netGND _net6 _net11 Type="pfet" Vt0="-1.46" Beta="0.000167" Is="1e-13" N="1" Lambda="0" M="0.5" Pb="1" Fc="0.5" Cgs="0" Cgd="0" JFET:J_J1 _netIN _net7 _net10 Type="pfet" Vt0="-1.46" Beta="0.000167" Is="1e-13" N="1" Lambda="0" M="0.5" Pb="1" Fc="0.5" Cgs="0" Cgd="0" R:R_R3 _netIN _net9 R="500" R:R_R2 _netIN _net8 R="500" R:R_R1 _net5 _net2 R="100" VCCS:G_G1 _net6 _netGND _netGMOUT _net7 G="0.001" VCVS:E_E1 _netGND _net5 _netGND _netGMOUT G="1" Vdc:V_V3 _cnet0 _netGND U="0.65" Vdc:V_V2 _cnet1 _net3 U="0.61" Idc:I_I1 _net1 _netVP I="0.00012" Idc:I_BIAS _netIN _netVP I="100p" .Def:End Sub:4301_RMS _net0 _net1 gnd _net2 _net3 RMSOut _net4 _net5 Type="n4301_RMS_spice_txt" Vdc:V2 _net1 gnd U="7.5 V" Vdc:V3 gnd _net4 U="7.5 V" R:R2 _net2 _net4 R="2 MOhm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85" C:C2 _net3 gnd C="1 pF" V="" .TR:TR1 Type="lin" Start="0" Stop="10 ms" Points="1000" IntegrationMethod="Trapezoidal" Order="2" InitialStep="1 ns" MinStep="1e-16" MaxIter="150" reltol="0.001" abstol="1 pA" vntol="1 uV" Temp="26.85" LTEreltol="1e-3" LTEabstol="1e-6" LTEfactor="1" Solver="CroutLU" relaxTSR="no" initialDC="yes" MaxStep="0" R:R1 _net6 _net0 R="50 Ohm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85" C:C1 _net7 _net6 C="1 pF" V="" Vac:V1 _net7 gnd U="200 mV" f="1 kHz" Phase="0" Theta="0" |