I've been struggling with learning ngspice and could use some help. It's a bit different than the more popular LTSpice (which I don't use). I am using gschem for schematic capture, and gnetlist to generate the netlist.
Attached is a test circuit, just to learn how to create a model and generate a proper netlist for use with ngspice.
I 'include' a file named tlv27x.inc, which is a subcircuit taken from the TI datasheet, using a Spice include directive in the schematic . I'm using one opamp from the quad-opamp TLV274.
I generate the netlist with this statement;
No apparent problems so far.
I then run:
I can't figure out why vee isn't being recognized.
Then, why is it telling me tlv27x is an "unknown parameter"?.
In this partifcular case, the --nomunge option does not seem to make any difference - tried it both ways.
Here is test1.net:
And here is the contents of the include file tlv274.inc:
Can someone please clue me in what I am doing wrong?
Thanks,
Keith Ostertag
Attached is a test circuit, just to learn how to create a model and generate a proper netlist for use with ngspice.
I 'include' a file named tlv27x.inc, which is a subcircuit taken from the TI datasheet, using a Spice include directive in the schematic . I'm using one opamp from the quad-opamp TLV274.
I generate the netlist with this statement;
Rich (BB code):
keith@t520:~/gaf$ gnetlist -g spice-sdb --nomunge -I -o tes1.net test1.sch
Command line passed = gnetlist -g spice-sdb --nomunge -I -o tes1.net test1.sch
Loading schematic [/home/keith/gaf/test1.sch]
Using SPICE backend by SDB -- Version of 4.28.2007
schematic-type = normal schematic
keith@t520:~/gaf$
I then run:
Rich (BB code):
keith@t520:~/gaf$ ngspice test1.net
******
** ngspice-24 : 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: Sun Jun 17 07:51:27 UTC 2012
******
Circuit: * gnetlist -g spice-sdb --nomunge -i -o test1.net test1.sch
Error on line 14 : u8 1 2 vcc vee 2 tlv27x
Unable to find definition of model vee - default assumed
unknown parameter (tlv27x)
ngspice 2 ->
Then, why is it telling me tlv27x is an "unknown parameter"?.
In this partifcular case, the --nomunge option does not seem to make any difference - tried it both ways.
Here is test1.net:
Rich (BB code):
keith@t520:~/gaf$ cat test1.net
* gnetlist -g spice-sdb --nomunge -I -o test1.net test1.sch
*********************************************************
* Spice file generated by gnetlist *
* spice-sdb version 4.28.2007 by SDB -- *
* provides advanced spice netlisting capability. *
* Documentation at http://www.brorson.com/gEDA/SPICE/ *
*********************************************************
.INCLUDE tlv27x.inc
*============== Begin SPICE netlist of main design ============
.INCLUDE tlv27x.inc
Vin 3 0 ac 1 pulse( -1 1 1u 100n 100n 50u 100u)
R26 2 0 2K
R24 3 1 50
U8 1 2 Vcc Vee 2 tlv27x
Vee 0 Vee DC 1.5V
Vcc Vcc 0 DC 1.5V
.end
Rich (BB code):
*******************************
* Begin .SUBCKT model *
* This is for one section of the quad TLV274, taken from the datasheet
********************************
.SUBCKT tlv27x 1 2 3 4 5
*DEVICE=amp_tlv27x_highVdd,OP AMP,NJF,INT
* amp_tlv_27x_highVdd operational amplifier macromodel
* subcircuit updated using Model Editor release 9.1 on 05/15/00
* at 14:40 Model Editor is an OrCAD product.
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
*subckt amp_tlv27x_highVdd 1 2 3 4 5
* *** original name above!! *****************************
c1 11 12 457.48E−15
c2 6 7 5.0000E−12
css 10 99 1.1431E−12
dc 5 53 dy
de 54 5 dy
dlp 90 91 dx
dln 92 90 dx
dp 4 3 dx
egnd 99 0 poly(2) (3,0) (4,0) 0 .5 .5
fb 7 99 poly(5) vb vc ve vlp vln 0 176.02E6 −1E3 1E3 180E6 −180E6
ga 6 0 11 12 16.272E−6
gcm 0 6 10 99 6.8698E−9
iss 10 4 dc 1.3371E−6
hlim 90 0 vlim 1K
j1 11 2 10 jx1
J2 12 1 10 jx2
r2 6 9 100.00E3
rd1 3 11 61.456E3
rd2 3 12 61.456E3
ro1 8 5 10
ro2 7 99 10
rp 3 4 150.51E3
rss 10 99 149.58E6
vb 9 0 dc 0
vc 3 53 dc .78905
ve 54 4 dc .78905
vlim 7 8 dc 0
vlp 91 0 dc 14.200
vln 0 92 dc 14.200
.model dx D(Is=800.00E−18)
.model dy D(Is=800.00E−18 Rs=1m Cjo=10p)
.model jx1 NJF(Is=500.00E−15 Beta=198.03E−6 Vto=−1)
.model jx2 NJF(Is=500.00E−15 Beta=198.03E−6 Vto=−1)
.ends
Thanks,
Keith Ostertag
Attachments
-
70.2 KB Views: 62