Re: gEDA-user: ngspice subckt problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 al davis wrote: > [Spice differences and troubles ...] > > If you want to use Gnucap, I will help you make it work. It > will help me, by having a set of real files that somebody is > using. Thank you for that offer. Today I picked some old machine of the doorstopper class (P3 800 MHz), installed Debian 4.0 on it and compiled gnucap successfully. So I'm ready by now :) I guess reading the gnucap documentation is a good starting point for me. >> The background of why I now want to use ngspice is that I >> want to play with the parameters a little bit to get out the >> maximum possible output voltage swing. (This circuit is >> intended for scope tube deflection.) => Lots of simulation >> runs. >> So one needs some sort of scriptable spice environment, for >> example a UNIX command line program :) > > That's another place where they are all different. > > NGspice doesn't offer much in this regard. Gnucap offers much > more in being scriptable and ability to play with parameters. > > Gnucap lets you make arbitrary changes to the circuit > interactively, so doing a bunch of "what-if's" is actually very > easy. It also will give you a lot more info about your > circuit, but only if you ask. Changing the circuit interactively is really cool, so one doesn't have to launch the program over again and again ... Christoph -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIpdWOWo2QgtqY4K8RAplaAKCeOvTS/xvRjfu0MArAzDGIRDAz1gCdGWnq U07iiNFySEyd2Y3nwjTmKWM= =Fujb -END PGP SIGNATURE- ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
On Thursday 14 August 2008, Christoph Lechner wrote: > Hmm, looks like the g++ compiler of Debian 3.1 (still running > that fairly 'mature' distro :) can't handle the source code > of gnucap. Looks like the code of gnucap triggers some bug in > the really old g++ version that shipped with Debian 3.1. > > g++ dies with > make[2]: Entering directory > `/loc_files/ngspice-build/gnucap-2008-05-27/src' g++ > -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -g -O2 -MT d_mos8.o -MD > -MP -MF .deps/d_mos8.Tpo -c -o d_mos8.o d_mos8.cc > > cc1plus: out of memory allocating 2653014200 bytes after a > total of 24993792 bytes Known compiler bug. It's the optimizer. Turn off optimization and it should work. Since you are not using that model, you could leave it out. Just edit the makefile to remove "d_mos8.model" . If you are using Debian, you could just "apt-get install gnucap" but the some of the features you want are only in the development version. The latest is 2008-08-10. Still, it won't read your file as is, as I said in another mail. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
On Thursday 14 August 2008, Christoph Lechner wrote: > I'm just trying to use my spice model in ngspice. > LTspice/SwitcherCad from Linear Technology runs it like a > charm. > > If I run ngspice I get some error messages: > Too few parameters for subcircuit type "12at7" (instance: > x102) Too few parameters for subcircuit type "12at7" > (instance: x101) One of the problems with Spice format simulators is that they are all different. It all goes back to Berkeley Spice-2 -- then deviates from there. Every derivative of Spice has developed in its own way. One adds a feature, and another adds the feature too, but a little different. Every new feature makes some nuance that used to work not work. Keep this up for 30 years . The makers of commercial simulators can afford to hire a bunch of programmers to chase and clone the competition's new features. The free ones don't have the resources for this, unless users step in. What you have is a file written with a bunch of those proprietary extensions. At a glance I see ... -- the semicolon -- ".param" statement -- passing parameters to a subckt -- the syntax for defining the default subckt parameters -- addition of models -- the existance of behavioral expressions -- syntax differences for the behavioral expressions So, fix one, you still have a dozen to go. This is one of the reasons the experts are pushing for a change away from the Spice format. Still, we have lots of legacy code. If you want to use Gnucap, I will help you make it work. It will help me, by having a set of real files that somebody is using. > The background of why I now want to use ngspice is that I > want to play with the parameters a little bit to get out the > maximum possible output voltage swing. (This circuit is > intended for scope tube deflection.) => Lots of simulation > runs. > So one needs some sort of scriptable spice environment, for > example a UNIX command line program :) That's another place where they are all different. NGspice doesn't offer much in this regard. Gnucap offers much more in being scriptable and ability to play with parameters. Gnucap lets you make arbitrary changes to the circuit interactively, so doing a bunch of "what-if's" is actually very easy. It also will give you a lot more info about your circuit, but only if you ask. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stuart Brorson wrote: > Alternately, why don't you grab the latest Gnucap? Al (the main > developer) updates the release tarball quite regularly. Hmm, looks like the g++ compiler of Debian 3.1 (still running that fairly 'mature' distro :) can't handle the source code of gnucap. Looks like the code of gnucap triggers some bug in the really old g++ version that shipped with Debian 3.1. g++ dies with make[2]: Entering directory `/loc_files/ngspice-build/gnucap-2008-05-27/src' g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -g -O2 -MT d_mos8.o -MD -MP -MF .deps/d_mos8.Tpo -c -o d_mos8.o d_mos8.cc cc1plus: out of memory allocating 2653014200 bytes after a total of 24993792 bytes So I'll have to wait until Monday ... regards Christoph -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIpJMLWo2QgtqY4K8RApr4AKCS/WznTc80MMLdK8/wx9HUBIlCvwCeLGMH Z81UKHShVyM4jnlix06vM5k= =dqn5 -END PGP SIGNATURE- ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
> OK, I'm not that familiar with the Spice subcircuit syntax. Actually I > considered Spice as some sort of black-box. If you want to successfully use ngspice, you're best off reading up on SPICE syntax and usage. It's not a black box yet, and while manual intervention is not always necessary, it still has enough problems that if you don't know about SPICE, then you'll probably be lost. > Or do I need some developer version, as the one I used is about 3 years old? Perhaps. The developer version has lots of good stuff in it. The project should really release a new tarball. Alternately, why don't you grab the latest Gnucap? Al (the main developer) updates the release tarball quite regularly. Stuart ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Werner Hoch wrote: > Hi Christroph, Hi Werner, > On Donnerstag, 14. August 2008, Christoph Lechner wrote: >> Uploaded this file as well >> http://www.cl-projects.de/projects/sc/triode2-stripped-down.cir > > You're .SUBCKT line is longer: > .SUBCKT 12AT7 1 2 3 > + PARAMS: MU=60 EX=1.35 KG1=460 KP=300 KVB=300 RGI=2000 > + CCG=2.3P CGP=2.2P CCP=1.0P > > The lines beginning with '+' are part of the subcircuit definition. OK, I'm not that familiar with the Spice subcircuit syntax. Actually I considered Spice as some sort of black-box. > These are parameters of the subcircuit. ngspice can not simulate such > subcircuits by default. > > You have to build ngspice with the configuration > option --enable-numparam. Have tried this, but it didn't help me either. I ran ./configure --prefix=/opt/ngspice --enable-numparam --enable-xgraph to configure the new Spice installation. Then I did the usual 'make' and 'make install' stuff. The tarball I downloaded is "ng-spice-rework-17.tar.gz", dated 2005-08-30. I'm also sure that I run the right ngspice binary in /opt/ngspice, because I can only run 'ngspice' on my command line when I add /opt/ngspice/bin to my path. Or do I need some developer version, as the one I used is about 3 years old? regards Christoph -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIpIUhWo2QgtqY4K8RAijkAJsFuihrdebvczi205ZbuXiApkli5wCghcQ1 B9gS1gjPxlnbb+DgoVvR4nE= =w2iL -END PGP SIGNATURE- ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
Hi Christroph, On Donnerstag, 14. August 2008, Christoph Lechner wrote: > Uploaded this file as well > http://www.cl-projects.de/projects/sc/triode2-stripped-down.cir You're .SUBCKT line is longer: .SUBCKT 12AT7 1 2 3 + PARAMS: MU=60 EX=1.35 KG1=460 KP=300 KVB=300 RGI=2000 + CCG=2.3P CGP=2.2P CCP=1.0P The lines beginning with '+' are part of the subcircuit definition. These are parameters of the subcircuit. ngspice can not simulate such subcircuits by default. You have to build ngspice with the configuration option --enable-numparam. Regards Werner ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stuart Brorson wrote: >> If I run ngspice I get some error messages: >> Too few parameters for subcircuit type "12at7" (instance: x102) >> Too few parameters for subcircuit type "12at7" (instance: x101) >> >> The 12at7 subcircuit model is a triode model by Norman Koren: >> http://www.normankoren.com/Audio/Tubemodspice_article.html >> >> It appears to me that the offending line in the spice file is >> X102 vplate2 vg2 vcat 12AT7 >> The subcircuit in the model file begin with >> .SUBCKT 12AT7 1 2 3 ; P G C > > I believe that the ";" to start a comment is a syntax from PSpice > which is undefined in ngspice. Please remove the "; P G C" stuff and > try again. This didn't help. Removed all the comments beginning with ";" and also removed all unused tube models. Uploaded this file as well http://www.cl-projects.de/projects/sc/triode2-stripped-down.cir regards Christoph -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIpGhGWo2QgtqY4K8RAjAeAJ4sty6jUiLab07o93fmVQELLXdLYQCgq3H7 LBECGYYHbnIdPWMqrprKSm4= =Vd+i -END PGP SIGNATURE- ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice subckt problems
> If I run ngspice I get some error messages: > Too few parameters for subcircuit type "12at7" (instance: x102) > Too few parameters for subcircuit type "12at7" (instance: x101) > > The 12at7 subcircuit model is a triode model by Norman Koren: > http://www.normankoren.com/Audio/Tubemodspice_article.html > > It appears to me that the offending line in the spice file is > X102 vplate2 vg2 vcat 12AT7 > The subcircuit in the model file begin with > .SUBCKT 12AT7 1 2 3 ; P G C I believe that the ";" to start a comment is a syntax from PSpice which is undefined in ngspice. Please remove the "; P G C" stuff and try again. Stuart ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
gEDA-user: ngspice subckt problems
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, (this is actually a ngspice posting, so maybe it's off-topic?) I'm just trying to use my spice model in ngspice. LTspice/SwitcherCad from Linear Technology runs it like a charm. The .cir file was created from my gschem schematics file by running "gnetlist -g spice-sdb -o triode2.cir triode2.sch". getnetlist -g drc2 runs without any error message in the DRC file. It only prints some warnings: NOTE: Found pins without the 'pintype' attribute: X102:1 X102:2 X101:1 X102:3 X101:3 X101:2 But I don't believe that these have something to do with my problem. If I run ngspice I get some error messages: Too few parameters for subcircuit type "12at7" (instance: x102) Too few parameters for subcircuit type "12at7" (instance: x101) The 12at7 subcircuit model is a triode model by Norman Koren: http://www.normankoren.com/Audio/Tubemodspice_article.html It appears to me that the offending line in the spice file is X102 vplate2 vg2 vcat 12AT7 The subcircuit in the model file begin with .SUBCKT 12AT7 1 2 3 ; P G C So I really don't know where's the problem :( For the curious: PDF of the schematic http://www.cl-projects.de/projects/sc/triode2.pdf .cir file working fine in LTSpice http://www.cl-projects.de/projects/sc/triode2.cir The background of why I now want to use ngspice is that I want to play with the parameters a little bit to get out the maximum possible output voltage swing. (This circuit is intended for scope tube deflection.) => Lots of simulation runs. So one needs some sort of scriptable spice environment, for example a UNIX command line program :) What's wrong? regards, Christoph -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIpGRjWo2QgtqY4K8RAvWuAJ9PG1fKawvcTjNb1cTB63qiHcqsIACgikB8 l/SC50rXyXfurqFFZMPS5mQ= =8DpZ -END PGP SIGNATURE- ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user