|
Magic Mailing List |
|
From: Stefan Jones (stefan.jones AT multigig DOT com) Date: Fri Mar 28 2003 - 16:13:46 EST
On Fri, 2003-03-28 at 12:45, cfk wrote:
> Thank you Stefan, and a question. I can do a plot in out, but plot i(vdd)
> gets nowhere.
I take it you are trying to plot the current going though node Vdd, try
> Are there some special considerations to get some of the
> functions of spice from within the tkcon window that magic starts up with? I
> have to admit I am a bit of a newcomer to spice, being a programmer mostly
> for the last few years. This IC thing just has my imagination fired up and I
> want to understand as much as I possibly can.
Adding "package require spice" to your .magic file should work!
for more polished integration:
tclspice is basically the normal ngspice binary with all the commands
wrapped to TCL functions.
I also added some extra functions to export Tcl/BLT vectors either
though the plot interface or by name and array range (see
spice::spicetoblt command ).
The pretty graphics, the current plot command, is all done on the Tcl
side in the pkgIndex.tcl file.
Unfortunately the spice C source code uses printf quite a lot so the
output for most commands goes to the command line (not Tk console).
There is a quick fix by doing:
#undef printf
#define printf my_printf
int my_printf() {
/* Some C code which writes the output to Tcl though the Tcl puts
command */
}
in some header file. The Tcl_interp will need to be stored somewhere so
it can be used by my_printf for calling Tcl_Eval.
Also some checks will need to made so when spice is running in a thread
it doesn't use the interp otherwise a race will occur.
I hope this is what you are after,
Stefan
--
Stefan Jones <stefan.jones AT multigig DOT com>
Multigig Ltd
|
|
|
|