Temperature and other options
Hi all,
After spending some time playing with DDD, I hope to have discovered the
"option" bug that affects ngspice.
It all starts in the if_run() function. Yhis function is the one that
gets called when you ask for a "run/resume" or for an analysis (op, dc,
tran, etc.). If you look at the ft_curckt structure, you will discover
three set of members tht deals with options card:
ci_curTask , ci_curOpt (current active task)
ci_specTask, ci_specOpt (task for op,ac, etc)
ci_defTask, ci_defOpt (task for run/resume)
In the CVS code you will get:
+ desidered options from .options line and "set" command with the latter
overriding the former id doing a run/resume
+ standard option if asking esplicity for an analysis (op, ac, etc.),
regardless od the .ioptions card in the deck or the options given
with the "set" command.
The bug is that, after the set command is invoked, and the specTask
structure is modified, this is cleaned in with the if{} in the first
lines of if_run() and replaced with a new one. If you look at the option
related code: com_set(), cp_vset() and if_option(), you will discover
that changes are made only to ci_curOpt/Task, that, is simply a pointer to
specOpt/Task or defOpt/Task, depending on the simulation command
previously issued (run/resume or ac,dc, etc.)
To fix this we have first to decide how the code should work:
1) Should the run command and the explicit analysis commands share the
same set of options ?
2) Should the run command get only options from the .option line ?
3) Should the explicit analysis command get only the "set" options ?
I think that the best will be to:
*) output the current simulation options in the out file and on the
screen while in interactive mode (Alan, can you add these ?)
(com_option is a placeholder for a command that outputs simulations
variables if one want to know what he is doing during interactive
sessions).
*) run/resume commands should use the .option card with "set" commands
overriding.
*) explicit analysis commands shoud use only options set via the
intercative "set" command.
Let me know what you think,
Paolo
Partial thread listing: