[ng-spice-bugs] Bug or misunderstanding (fwd)


To ng-spice-devel@ieee.ing.uniroma1.it
From Paolo Nenzi <pnenzi@ieee.ing.uniroma1.it>
Date Wed, 24 Jan 2001 22:09:33 +0100 (CET)
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 all,

Looking in my past mail I have discovered this email that I have probably
missed. I do not know the answer to his questions, can you answer ?

Thnaks,
Paolo

---------- Forwarded message ----------
Date: Fri, 29 Dec 2000 11:53:19 -0800 (PST)
From: "Robert D. Penny" <rob@saic.com>
Reply-To: ng-spice-bugs@ieee.ing.uniroma1.it
To: ng-spice bug reports <ng-spice-bugs@ieee.ing.uniroma1.it>
Subject: [ng-spice-bugs] Bug or misunderstanding

Hi,

I've noticed what looks like an inconsistency in the v_dims entry in the
dvec structure compared to the v_length entry.  It's possible I'm using
this field in a way that it was not intended but in case it is a genuine
bug I thought I'd fire off a report.
 
I'm writing a little utility, based on sconvert, to walk a spice rawfile
and dump the data in a variety of formats.  My initial need was to take
the endpoint of a transient analysis and write out the last entry in each
vector in the form of a .IC card for restarting the simulator. I'm now
writing sections that will output in formats suitable to be sucked into a
relational database (PostgreSQL in this case), Octave or Gnuplot. The
design I'm working on has 40,000 fets and about 2,500 nets so it's hard to
do this by hand.

I'm using some of the built in functions in the ng-spice source tree and
some of my own.  (I know that this might break in future ng-spice
releases.)

I use raw_read() in src/frontend/rawfile.c to pull in the plot data
structure from a spice rawfile.  The rawfile has an AC analysis, a
transient analysis, a noise spectral density and an integrated noise
curve.

My question relates to the use of the v_dims field in the dvec
structure.  My frequency domain analyses (noise and ac) were in the form
"DEC 10 100 1MEG", so you would expect 41 points in the data.  

The first dvec entry in the "Noise Spectral Density" plot looks like:

$9 = {v_name = 0x8067380 "frequency", v_type = 2, v_flags = 129, 
  v_realdata = 0x8237e70, v_compdata = 0x0, v_minsignal = 0, v_maxsignal = 0, 
  v_gridtype = GRID_XLOG, v_plottype = PLOT_LIN, v_length = 41, v_rlength = 
0, 
  v_outindex = 0, v_linestyle = 0, v_color = 0, v_defcolor = 0x0, 
  v_numdims = 1, v_dims = {41, 0, 0, 0, 0, 0, 0, 0}, v_plot = 0x8066f50, 
  v_next = 0x8236f00, v_link2 = 0x0, v_scale = 0x0}
(gdb) p *pl->pl_dvecs

The first dvec entry in the "Integrated Noise" plot looks like:

$10 = {v_name = 0x80886f0 "onoise_total_q:1:np_rc", v_type = 3, v_flags =129, 
  v_realdata = 0x80936f0, v_compdata = 0x0, v_minsignal = 0, v_maxsignal = 0, 
  v_gridtype = GRID_NONE, v_plottype = PLOT_LIN, v_length = 1, v_rlength = 0, 
  v_outindex = 0, v_linestyle = 0, v_color = 0, v_defcolor = 0x0, 
  v_numdims = 1, v_dims = {41, 0, 0, 0, 0, 0, 0, 0}, v_plot = 0x8066ee0, 
  v_next = 0x80aa800, v_link2 = 0x0, v_scale = 0x0}

Notice that even though the first v_dims entry is 41, the v_length entry
is 1.  The reality is that the vector is only of length 1.

So... what's the rule for using the v_dims entry?  Is it a bug or should I
ignore entries in v_dims if v_numdims=1 and rely solely on v_length?

Does anything in ng-spice ever produce more than a one dimensional vector
anyway?

Thanks, and I apologise if this is off topic for you.

-Rob Penny (robert.d.penny@saic.com)


Partial thread listing: