[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: problem spice aop



Flo,

I have edited your schematic and successfully netlisted it.  I attach
the modified schematic, lm741.mod, and the netlist output.net file
below.  The problem may be in a couple of places.  Here are some more
suggestions:   

1.  You need to make the model-name (and/or value) attribute *exactly*
match the name of the .subckt.  That is, you need to make
model-name=LM741/NS for SPICE simulation to work.  Netlisting should
have been OK, but you will have a problem when you try to run a SPICE
simulator (e.g. ngspice).

2.  I can successfully netlist using a dummy lm741.mod file (see
below).  Please try my dummy .mod file and see if you can netlist.  I
suspect that there is some problem in your lm741.mod file 'cause you
get the error at the point where the program tries to read this file.

3.  It's possible that you weren't able to open the lm741.mod file.
The error you get:

> ERROR: In procedure string-ref:
> ERROR: Argument out of range: 0

suggests to me that the Scheme fcn string-ref isn't being passed a
proper file name.  This might occur if "open-input-file" failed, and
returned a NIL value.  Then, this return code would be passed to
string-ref, which would barf. 

Please make sure that you are pointing to the right place for the
lm741.mod file in your schematic.  Also, make sure that the
permissions for lm741.mod are set so that you are allowed to read it.
(If gnetlist runs with a different user ID than you, please make sure
that gnetlist also has read permission to the file.)

4.  Finally, if these don't help, please post the lm741.mod file.

Stuart


-------------------------  Begin .sch file ----------------------
v 20030525
C 36600 59100 1 0 0 max4107-1.sym
{
T 36800 60200 5 10 1 1 0 0
refdes=X1
T 36600 59100 5 10 0 1 0 0
model-name=LM741/NS
T 37100 58900 5 10 1 1 0 0
file=/home/sdb/gEDA_Debug/lm741.mod
T 37500 59700 5 10 1 1 0 0
value=LM741/NS
}
C 36600 57000 1 0 0 resistor-1.sym
{
T 37000 57200 5 10 0 1 0 0
refdes=R1
T 37200 56800 5 10 1 1 0 0
value=240
T 36700 56800 5 10 0 1 0 0
model=RES
}
C 36200 58100 1 90 0 resistor-1.sym
{
T 35900 58600 5 10 1 1 180 0
refdes=R0
T 36200 58100 5 10 1 1 0 0
value=27
T 36200 57900 5 10 1 1 0 0
model=RES
}
N 36100 59000 36100 59300 4
N 36100 59300 36600 59300 4
N 36600 57100 36600 59300 4
N 37500 57100 38600 57100 4
N 38600 57100 38600 59500 4
C 37200 60400 1 0 0 capacitor-1.sym
{
T 37400 60900 5 10 0 1 0 0
refdes=C1
T 37200 60400 5 10 1 1 0 0
value=1000p
T 37200 60400 5 10 0 1 0 0
model=CAP
}
C 37200 60900 1 0 0 capacitor-1.sym
{
T 37400 61400 5 10 0 1 0 0
refdes=C0
T 37200 60900 5 10 1 1 0 0
value=0.1u
T 37200 60900 5 10 0 1 0 0
model=CAP
}
C 37100 58100 1 0 0 capacitor-1.sym
{
T 37300 58600 5 10 0 1 0 0
refdes=C2
T 37100 58100 5 10 1 1 0 0
value=1000p
T 37100 58100 5 10 0 1 0 0
model=CAP
}
C 37100 57500 1 0 0 capacitor-1.sym
{
T 37300 58000 5 10 0 1 0 0
refdes=C3
T 37100 57500 5 10 1 1 0 0
value=0.1u
T 37100 57500 5 10 0 1 0 0
model=CAP
}
C 38200 57400 1 0 0 gnd-1.sym
N 36900 57300 39100 57300 4
N 38300 58300 38000 58300 4
N 37100 57700 36900 57700 4
N 36900 58300 37100 58300 4
N 36900 57300 36900 58900 4
N 36900 58900 37100 58900 4
N 37100 58900 37100 59100 4
N 37100 60600 37200 60600 4
N 37100 61100 37200 61100 4
N 38100 61100 38200 61100 4
N 38200 60600 38100 60600 4
C 38100 60000 1 0 0 gnd-1.sym
N 38200 60300 38200 61100 4
C 36000 57600 1 0 0 gnd-1.sym
N 36100 57900 36100 58100 4
N 37600 59500 38600 59500 4
C 38600 60400 1 0 0 vdc-1.sym
{
T 39300 61050 5 10 1 1 0 0
refdes=Vcc
T 39300 60850 5 10 1 1 0 0
value=DC 5V
}
N 38900 61600 37100 61600 4
N 37100 59900 37100 61600 4
N 38900 60400 38200 60400 4
C 39200 57200 1 0 0 vdc-1.sym
{
T 39900 57850 5 10 1 1 0 0
refdes=Vee
T 39900 57650 5 10 1 1 0 0
value=DC 5V
}
N 39500 58400 38300 58400 4
N 38300 57700 38300 58400 4
N 38000 57700 38300 57700 4
N 39100 57300 39100 57200 4
N 39100 57200 39500 57200 4
N 36100 58000 35600 58000 4
N 35600 58000 35600 59700 4
N 35600 59700 36600 59700 4
-----------------   End .sch file --------------------

-----------------  Begin dummy lm741.mod file  ----------------
.SUBCKT LM741/NS    1   2  99  50  28
* This is a test subcircuit to see if gnetlist -g spice-sdb will
* handle Flo's schematic correctly.  I just tie all nets to ground
* through 100 ohm resistors.
R1 1 0 100
R2 2 0 100
R99 99 0 100
R50 50 0 100
R28 28 0 100
.ENDS
----------------------  End dummy lm741.mod file  ---------

----------------- Begin netlister output.net file --------
*********************************************************
* Spice file generated by gnetlist                      *
* spice-sdb version 3.31.2003 by SDB --                 *
* provides advanced spice netlisting capability.        *
* Documentation at http://www.brorson.com/gEDA/SPICE/   *
*********************************************************
Vee 0 3 DC 5V
Vcc 4 0 DC 5V
C3 3 0 0.1u 
C2 3 0 1000p 
C0 4 0 0.1u 
C1 4 0 1000p 
R0 0 1 27 
R1 1 2 240 
X1 2 1 0 4 3 LM741/NS 
.SUBCKT LM741/NS    1   2  99  50  28
* This is a test subcircuit to see if gnetlist -g spice-sdb will
* handle Flo's schematic correctly.  I just tie all nets to ground
* through 100 ohm resistors.
R1 1 0 100
R2 2 0 100
R99 99 0 100
R50 50 0 100
R28 28 0 100
.ENDS
.END
--------------- End output.net file -----------------


> 
> 	Hi,
> 
> 	Thanx for your help. I have tried to fix my netlist with your advice, but 
> without any result :-(
> 
> 	Thus, I post my gschem netlist (.sch) :

[. . . . .]

> 	And the result of the gnetlist command :
> jolitorax:[~/QAM16/gschem] > gnetlist -g spice-sdb -o test_aop.cir 
> test_aop.sch
> gEDA/gnetlist version 20030525
> gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more 
> details.
> This is free software, and you are welcome to redistribute it under certain
> conditions; please see the COPYING file for more details.
> 
> Loading schematic [test_aop.sch]
> Using SPICE backend by SDB -- Version of 3.31.2003
> schematic-type = normal schematic
> model-name = chematic
> Found independent voltage source.  Refdes = Vee
> Found independent voltage source.  Refdes = Vcc
> Found capacitor.  Refdes = C3
> Found capacitor.  Refdes = C2
> Found capacitor.  Refdes = C0
> Found capacitor.  Refdes = C1
> Found resistor.  Refdes = R0
> Found resistor.  Refdes = R1
> Found .subcircuit.  Refdes = X1
> ERROR: In procedure string-ref:
> ERROR: Argument out of range: 0
> jolitorax:[~/QAM16/gschem] >
> 
> 	I have found the description of the LM741 (I don't know the spice 
> description of the max4107). It begins with
> .SUBCKT LM741/NS    1   2  99  50  28
> 
> 	Any idea ? Thanx in advance,
> 
> 		FLO
> 
>