| 
      
      
      From: Stefan J. <ste...@mu...> - 2003-07-14 08:36:20
      
     | 
| Stuart, On Sat, 2003-07-12 at 19:11, Stuart Brorson wrote: > Greetings, Stefan and Tclspicers -- > > Here are a few random notes and observations which may be of interest > to the community. > One funny note: When building tclspice, I find that I have to > first build regular ngspice, and then build tclspice afterwards. > That is, my build procedure is: > > ./configure --enable-xspice > make && make install > (makes regular ngspice) > > ./configure --enable-experimental --enable-tclspice --enable-xspice > make && make install > (makes tclspice) > For tclspice use make tcl && make install-tcl also the ./configure statement should be --enable-tcl These are the same commands as for the magic VLSI tool, which is why it is so. I really should fix this up to make it more standardised. > > 2. [...] However, there is one small problem: tclspice has a memory leak. [...] I should really spend a week of my time some day and fix the most serious ones. I will take a look at the one you found. > 3. Rather than try fixing the memory leak problem, I have developed a > work-around. It is an ugly hack, but it allows me to acheive my > goal of doing circuit optimizations. I have written my optimizer > to save its state into a file after every analysis. When the > optimizer starts up, it reads the last state from the file, and > starts doing the analysis from that point. The optimizer program > also stores the best circuit parameters found so far into another > file, and also reads these into the program when starting up. At Multigig we ran into the same problem, so after each simulation tclspice was restarted. Also the main program code ran in another Tcl script, using interprocess communication via Tcl/Tk's send command to talk to each other! The leaks need fixing ... > 4. Stefan, I have a suggestion: It would be nice if the analysis > functions like "spice::tran" or "spice::ac" returned a return code > like "0 = success, 1 = failure", or something. try it . . . . I have looked at making the Tcl -> spice command dispatcher return errors and return values to the Tcl environment. But the problem is that the ngspice commands are of the type "void command(wordlist *)" thus return no value. A complete way of doing this to work for all commands neatly is a lot of work, and thus I didn't do it, as there is little gain. A hack could be done; a global tcl return value could be held and insert code in strategic places to manipulate it. Thanks for your input, Stefan -- Stefan Jones <ste...@mu...> Multigig Ltd |