This is an ngspice question more than an xschem qu...
# xschem
j
This is an ngspice question more than an xschem question. I apologise in advance if it's more appropriate to post on ngspice-users mailing list but I thought I'd have a go here since xschem and ngspice have a fairly close relationship. I'm trying to loop over some tran simulations, each time measuring a frequency and storing away a couple of vectors to eventually plot in the xschem UI. I've attached my spice script (without full netlist) containing the control section. I think that I've followed the advice in the control structure tutorial correctly but executing the script yields "When creating a new vector, it cannot be indexed.", presumably due to the "let" prefix on line "let vecvctl[index] = varvctl" ... I suspect something to do with the dynamic context of where the vectors are being created (the const plot for the initial creation?). Any ideas of how to debug this?
s
This is tricky but doable. I have prepared an example where I want a graph showing delay vs transistor width of a simple circuit where a pmos charges a capacitor. In the image the upper graph shows the delay of 'b' signal reaching 2.5V at various transistor widths (2, 3, 4, ...)
j
Thanks for all the tips. I'm nearly there now. I notice that part of the solution is to override the sim_type=dc in the xschem plot which I've done but I still see 'time' in the bottom left corner of the graph. I've attached updated script and xschem graph directives. I'm still not sure what's wrong as I can see what I think are the correct vectors being produced in my ngspice plot and can plot from ngspice - the problem must be with my xschem graph... Any ideas?
s
set the curplotname to "`DC transfer characteristic`". Xschem uses that information to get the right section of data. so you can simply set graph
sim_type
to "`dc`" . (
dc
is a short abbreviation, together with
tran
,
ac
,
noise
,
dc
,
op
that xschem maps to "DC transfer characteristic", "Transient analysis" and so on). Otherwise tou can set curplotname to "`foo`" and set
sim_type
to
foo
.
j
I see. Got it. Thanks very much.