outitf.c and the rawfile format


To "Ng-Spice-Devel (E-mail)" <ng-spice-devel@ieee.ing.uniroma1.it>
From "Gillespie, Alan" <Alan.Gillespie@analog.com>
Date Thu, 18 Jan 2001 11:04:13 -0000
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it


Hi Folks,

I did some more checking of that outitf.c file by running the
same source file in batch mode (which uses the routines in
outitf.c) and then in interactive mode using the "write"
command. The write command uses different file writing
routines, so I was able to compare the results.

The resulting files are slightly different in length, for two
reasons, it turns out. Firstly, the "Command : version 13"
line, which I mentioned in a previous email, does not appear
when you use the "write" command interactively. Secondly, when
running in batch mode, spice writes a "dummy" line in the header
for the "No. Points: nnnnnnnn" line and comes back later to fill
in the number of points in the simulation. When doing this, it
writes 8 spaces in the place where the number will eventually be.
But the "write" command already knows how many points there are
when it writes the file, so this line is written just the length
it need to be.

The difference in the file length can be accounted for with those
two explanations, but they can't be compared directly because the
variables seem to come out in different orders. But at least I
seem to be writing out the right amount of binary data per row,
and from viewing the results with gwave, I seem to have the buffer
"lined up" properly, so I think we can be reasonably confident
that the outitf.c I just posted is ok.

One thing I haven't got to the bottom of yet is that my fix for
removing all the "device#internal" nodes from the rawfile seems
to effect both the batch mode and the interactive file writing
routines. Hopefully that isn't a problem for anybody. That also
means that the device current hack should work interactively
as well. One thing I noticed is that when you run a long
simulation interactively, ngspice just sits there giving you
no clue what it's doing. Does anybody have any opinion about
me adding the reference variable value update to the screen
for interactive mode as well ?

Cheers,

Alan

Partial thread listing: