|
From: Aldo R. <ar...@de...> - 2006-10-27 07:32:08
|
Hello everybody, I'm just new to ngspice, and after reading some documentation I was wondering how I may run parametric simulations, sweeping some circuital parameters. For example, in the netlist below I may want to sweep R_value and run a simulation for each value of the parameter, and display all the traces to the same plot. VIN 1 0 1 AC 1 RL 1 2 R_value CL 2 3 1u .AC DEC 10 1 10k Do you have any hints or suggestions? Thank you very much! Aldo |
|
From: Zhenyu Z. <z....@qm...> - 2006-10-27 11:23:34
|
Hi, You can find everything in the usermanual of ng-spice and if you want an interface named easy_spice should work for you Having fun Zhang On Fri, 2006-10-27 at 09:51 +0100, Aldo Romani wrote: > Hello everybody, > I'm just new to ngspice, and after reading some documentation I was > wondering how I may run parametric simulations, sweeping some circuital > parameters. For example, in the netlist below I may want to sweep > R_value and run a simulation for each value of the parameter, and > display all the traces to the same plot. > > VIN 1 0 1 AC 1 > RL 1 2 R_value > CL 2 3 1u > .AC DEC 10 1 10k > > > Do you have any hints or suggestions? Thank you very much! > Aldo > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users |
|
From: Aldo R. <ar...@de...> - 2006-10-27 17:33:34
|
Zhenyu Zhang wrote: > You can find everything in the usermanual of ng-spice and if you want an > interface named easy_spice should work for you That's exactly what I've been doing for several days :-) But in the manual I wasn't able to find any command which iterates AC simulations changing the component values and displaying all the waveforms together in the same graph (I know how to DC-sweep component parameters....) ....sorry..... if you have a more precise link to the manual page or command it would be very helpful. If I can't find a way to do it the only solution I foresee would be to write some kind of script which generates parametric netlists and executes simulations repeatedly........ I used to do the parametric simulation job with Eldo and Spectre simulators in the past, but at present I need to switch to open-source platforms. Thanks for the link to easy spice, but I need some command line, scriptable tool, which may run on Linux. Greetz, -A |
|
From: Thomas K. <tom...@gm...> - 2006-10-27 17:45:59
|
> If I can't find a way to do it the only solution I foresee would be to > write some kind of script which generates parametric netlists and > executes simulations repeatedly........ That's exactly what I do, using simple ksh,gawk or Perl scripts. What's nice about doing it this way is that I can do anything that I want; I'm not restricted to do whatever some GUI programmer decided was an appropriate way to do hardware design. With the command line approach, my hands are not tied. Tpm On 10/27/06, Aldo Romani <ar...@de...> wrote: > Zhenyu Zhang wrote: > > You can find everything in the usermanual of ng-spice and if you want an > > interface named easy_spice should work for you > > That's exactly what I've been doing for several days :-) > But in the manual I wasn't able to find any command which iterates AC > simulations changing the component values and displaying all the > waveforms together in the same graph (I know how to DC-sweep component > parameters....) ....sorry..... if you have a more precise link to the > manual page or command it would be very helpful. > > If I can't find a way to do it the only solution I foresee would be to > write some kind of script which generates parametric netlists and > executes simulations repeatedly........ > > > I used to do the parametric simulation job with Eldo and Spectre > simulators in the past, but at present I need to switch to open-source > platforms. Thanks for the link to easy spice, but I need some command > line, scriptable tool, which may run on Linux. > > Greetz, > -A > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users > |
|
From: Aldo R. <ar...@de...> - 2006-10-27 17:57:10
|
Thomas Knotts wrote: > > That's exactly what I do, using simple ksh,gawk or Perl scripts. > What's nice about doing it this way is that I can do anything that I > want; I'm not restricted to do whatever some GUI programmer decided > was an appropriate way to do hardware design. With the command line > approach, my hands are not tied. > Exactly!!! It musn't be a so bad idea, then!! I'd definitely suggest considering Tcl and Python too (and I was giving a try to TclSpice) I was just trying to discover if the parametric simulation feature I was looking for already exists in the simulator (don't want to reinvent useful and already-debugged features :-) Bye, -A |
|
From: Holger V. <hol...@un...> - 2006-10-29 09:15:50
Attachments:
res_ac.cir
|
Aldo, you may do this simulation with the ngspice internal scripting language ( see the attached file). One still has to figure out while R1 works, RL does not, and so on.... All tested on the Windows port of ngspice. In fact this capability of Spice is not documented very well. It may be o.k. firstly just to present more examples, only then one can create a HOW-TO. Regards Holger Aldo Romani schrieb: > Hello everybody, > I'm just new to ngspice, and after reading some documentation I was > wondering how I may run parametric simulations, sweeping some circuital > parameters. For example, in the netlist below I may want to sweep > R_value and run a simulation for each value of the parameter, and > display all the traces to the same plot. > > VIN 1 0 1 AC 1 > RL 1 2 R_value > CL 2 3 1u > .AC DEC 10 1 10k > > > Do you have any hints or suggestions? Thank you very much! > Aldo > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Ngspice-users mailing list > Ngs...@li... > https://lists.sourceforge.net/lists/listinfo/ngspice-users > > > |
|
From: Holger V. <hol...@un...> - 2006-10-29 10:52:33
|
Hello,
with this email I wanted to send an improved version of the previous
multiple AC analysis file. It should take into account the fact that if
you involve it withe "Source" command, older plots (starting with ac1,
ac2 ...) will be saved. Even the "destroy all" command will delete all
data, but not reset the plot counter (which is probably an error in both
original Spice and ngspice). So the new version remembers the names of
the last three plots and displays and stores them finally.
Unfortunately this file is o.k. only with DuSpice based on the original
Berkeley sources, but not with ngspice. The reason is a different
handling of the { } brackets within the script.
The output of the line starting with "echo" is
ac15 ac16 ac17
in DuSpice,
{ac15} {ac16} {ac17}
in ngspice.
Consequently ac15.V(2) will be plotted and written to the output file,
{ac15}.V(2) however not. If this behaviour is not a feature (for reasons
I do not know), but an error, please let me know, and I would look into
the sources, as time allows.
Regards
Holger
* Multiple AC analysis
* If you do not use a "fresh" ngspice, but load the current file with the
* "Source" command, the names of the old
* "plots" will remain, new "plots" after each ac are then named in sequence
* e.g. ac26 ac27 ac29. So we have to remember the most recent three plots.
VIN 1 0 dc 0 ac 1
RL 1 2 1k
CL 0 2 1u
*.AC DEC 10 1 10k
.control
*** first simulation with original R1 value (creates "plot" ac1, if a
fresh spice is used)
ac dec 10 1 10k
*** remember the name of the current "plot"
set dt1=$curplot
** change resistor value
* use lower case letters with the alter command!
alter rl = 2k
*** second simulation, creating ac2
ac dec 10 1 10k
*** remember the name of the current "plot"
set dt2=$curplot
** change resistor value
alter rl = 500
** creating ac3
ac dec 10 1 10k
*** remember the name of the current "plot"
set dt3=$curplot
** graphical output, using the three most recent "plots"
echo {$dt1} {$dt2} {$dt3}
plot {$dt1}.V(2) {$dt2}.V(2) {$dt3}.V(2)
** output to file
* path of output file has to be checked!
* In Windows it is the path of the executable
* one probably may set an environmetal variable
* V(2) is the output voltage of the RC circuit
write ac-result.out {$dt1}.V(2) {$dt2}.V(2) {$dt3}.V(2)
.endc
Aldo Romani schrieb:
> Hello everybody,
> I'm just new to ngspice, and after reading some documentation I was
> wondering how I may run parametric simulations, sweeping some circuital
> parameters. For example, in the netlist below I may want to sweep
> R_value and run a simulation for each value of the parameter, and
> display all the traces to the same plot.
>
> VIN 1 0 1 AC 1
> RL 1 2 R_value
> CL 2 3 1u
> .AC DEC 10 1 10k
>
>
> Do you have any hints or suggestions? Thank you very much!
> Aldo
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Ngspice-users mailing list
> Ngs...@li...
> https://lists.sourceforge.net/lists/listinfo/ngspice-users
>
>
>
|
|
From: Aldo R. <ar...@de...> - 2006-10-29 11:51:07
|
Thank you very much Holger for sharing your files!
I'm sure they contain very useful information. I'll try them as I get
back to my linux box at the office on monday.
Bye,
-A
Holger Vogt wrote:
> Hello,
>
> with this email I wanted to send an improved version of the previous
> multiple AC analysis file. It should take into account the fact that if
> you involve it withe "Source" command, older plots (starting with ac1,
> ac2 ...) will be saved. Even the "destroy all" command will delete all
> data, but not reset the plot counter (which is probably an error in both
> original Spice and ngspice). So the new version remembers the names of
> the last three plots and displays and stores them finally.
>
> Unfortunately this file is o.k. only with DuSpice based on the original
> Berkeley sources, but not with ngspice. The reason is a different
> handling of the { } brackets within the script.
>
> The output of the line starting with "echo" is
> ac15 ac16 ac17
> in DuSpice,
> {ac15} {ac16} {ac17}
> in ngspice.
>
> Consequently ac15.V(2) will be plotted and written to the output file,
> {ac15}.V(2) however not. If this behaviour is not a feature (for reasons
> I do not know), but an error, please let me know, and I would look into
> the sources, as time allows.
>
>
> Regards
>
> Holger
>
>
>
>
>
>
> * Multiple AC analysis
> * If you do not use a "fresh" ngspice, but load the current file with the
> * "Source" command, the names of the old
> * "plots" will remain, new "plots" after each ac are then named in sequence
> * e.g. ac26 ac27 ac29. So we have to remember the most recent three plots.
>
> VIN 1 0 dc 0 ac 1
> RL 1 2 1k
> CL 0 2 1u
>
>
> *.AC DEC 10 1 10k
>
> .control
>
> *** first simulation with original R1 value (creates "plot" ac1, if a
> fresh spice is used)
> ac dec 10 1 10k
> *** remember the name of the current "plot"
> set dt1=$curplot
> ** change resistor value
> * use lower case letters with the alter command!
> alter rl = 2k
> *** second simulation, creating ac2
> ac dec 10 1 10k
> *** remember the name of the current "plot"
> set dt2=$curplot
> ** change resistor value
> alter rl = 500
> ** creating ac3
> ac dec 10 1 10k
> *** remember the name of the current "plot"
> set dt3=$curplot
>
> ** graphical output, using the three most recent "plots"
> echo {$dt1} {$dt2} {$dt3}
> plot {$dt1}.V(2) {$dt2}.V(2) {$dt3}.V(2)
>
> ** output to file
> * path of output file has to be checked!
> * In Windows it is the path of the executable
> * one probably may set an environmetal variable
> * V(2) is the output voltage of the RC circuit
> write ac-result.out {$dt1}.V(2) {$dt2}.V(2) {$dt3}.V(2)
> .endc
>
>
> Aldo Romani schrieb:
>
>> Hello everybody,
>> I'm just new to ngspice, and after reading some documentation I was
>> wondering how I may run parametric simulations, sweeping some circuital
>> parameters. For example, in the netlist below I may want to sweep
>> R_value and run a simulation for each value of the parameter, and
>> display all the traces to the same plot.
>>
>> VIN 1 0 1 AC 1
>> RL 1 2 R_value
>> CL 2 3 1u
>> .AC DEC 10 1 10k
>>
>>
>> Do you have any hints or suggestions? Thank you very much!
>> Aldo
>>
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Ngspice-users mailing list
>> Ngs...@li...
>> https://lists.sourceforge.net/lists/listinfo/ngspice-users
>>
>>
>>
>>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Ngspice-users mailing list
> Ngs...@li...
> https://lists.sourceforge.net/lists/listinfo/ngspice-users
>
>
|
|
From: Holger V. <hol...@un...> - 2006-10-29 21:40:55
|
Hello all,
internal ngspice scripts could benefit from using { } brackets. They are
especially useful if you want to access different plots during script
handling (see my recent mail). Currently I have no success in replacing
{ } with any other token, which is supported in ngspice. Is there any
replacement?
In glob.c (file is much shorter than original spice3f5 version) I found
the statement
/* MW. Now only tilde is supported, {}*? don't work */ . Is there any
good reason for this? Should we try to reintroduce handling of {}*? ?
Holger
|