MAGIC Magic Mailing List
 
 

From: cfk (cfk AT pacbell DOT net)
Date: Thu Mar 27 2003 - 23:12:03 EST

  • Next message: cfk: "Re: [Ngspice-users] tclspice & magic"

    Well, I didnt do a whole lot of work this week, but I had fun reading Brent
    Welch's "Practical Programming in Tcl and Tk". I think I have figured out a
    few clues regarding tclspice.
    
    On the system under test, tclspice is compiled per the
    tclspice/source/tcl/README in the ./configure is invoked with
    "./configure --enable-tcl --enable-experimental --enable-xspice --disable-sh
    ared". After that a "make tcl tcl_install" puts a pkgIndex.tcl into
    /usr/lib/spice and a libspice.so into /usr/lib. Near as I can tell, these
    are the appropriate default directories, and this system is a straight RH8
    system.
    
    The invocation of "magic -w" creates a magic window, a tkcon and a tclspice
    graph that is blank. A "load /usr/lib/libspice" does get access to spice and
    I can spice an inverter extracted from magic with exttospice and plot it
    with ";spice::asciiplot v(out)", I just cant do a ";spice::plot v(out)" from
    within magic (works outside of magic with ngspice directly from a bash
    prompt, draws the output voltage with blt, no problem).
    
    Now it gets interesting. I can tell that the plot procedure in pkgIndex.tcl
    is being called as a consequence of the default loading of magic's tcl stuff
    even though magic knows nothing about spice at this point. It appears after
    reading mucho documentation that the tcl interpreter goes looking for all
    the "pkgIndex.tcl" files when it needs a procedure called for instance
    "plot". And there is one in ../spice/pkgIndex.tcl, and it is called.
    
    So, I recompiled magic without the plot module, still same effect. Next, I
    renamed the plot as xplot in pkgIndex.tcl and voila, no blank plot anymore.
    I also put a puts inside pkgIndex.tcl so I would be told it was executing,
    and it is executing when I think it is executing.
    
    Now, at this point, I to a "magic -w" and then "load /usr/lib/libspice", no
    plot, so far so good. Next, I do a ":spice::source test.cir", and the
    circuit is loaded within magic like, well, magic.
    
    I can do a ";spice::run", see the run finish on the bash terminal, and now,
    I try a ";spice::xplot v(out)" from within magic and alas, alack and all
    that other stuff, the blank graph appears, but no output voltage is plotted.
    
    So, I have to say there is some progress, but perhaps someone more
    knowledgeable about Tcl then my one week cram course could make a suggestion
    or two. In the meantime, back to reading the manual...
    
    Charles
    


  •  
     
    Questions? Contact Rajit Manohar
    cornell logo