Hi <@U01819B63HP>, thanks for developing xschem, I...
# xschem
s
Hi @Stefan Schippers, thanks for developing xschem, I really enjoy using it. Recently I began exploring the graph function and have the following two questions: 1. In your tutorial video

https://www.youtube.com/watch?v=bP9w3zm1qv4

you plot the power lines. I am trying to plot both VDD and GND in a graph (see image). VDD was no issue, but for GND ngspice returns "vector GND is not available or has zero length". 2. If I try to save all raw signals ("write inv.raw all") and load the raw file no data is shown and the scale is off when I press "f" on the horizontal bar. There is also an empty signal loaded (see image). When I write specific signals ("write v(din) v(out) v(vdd)") the graph function shows the correct signals. Attached are two binary encoded raw files inv_writeSome.raw and inv_writeAll.raw and their SPICE files. Any idea how to resolve these? Thanks!
Solving 1) Inspired by your comment in the xyce mailinglist: https://groups.google.com/g/xyce-users/c/w0Xkh6SS6tE by adding a 0v source and a wire label, the graph now shows both ground and vdd. 2) is still open.
s
@Steven Bos 0 or GND (they are the same thing in ngspice) are not saved. These are '0'. If you need a '0' reference in the graphs simply add this: "GND; 0" This creates an expression with label 'GND' and value 0 I use this trick to draw reference levels, like:
"VREF; vcc 2 /"
to draw aline at VCC/2. To save all signals do this:
.control
.save all
tran .... (or dc ... or ac ...)
write <schematic_name>.raw
.endc
save all should be before the analysis line (tran, ac, dc). If you need all device currents add a
.option savecurrents
outside (and before) the .control block.
s
That is a great tip! I added the gnd label.
I couldnt fix part 2 with your suggestions, With write all, as soon as i press 'f' in the horizontal bar, all data disappears, see my recording:
s
@Steven Bos I have created a 'test_inv.sch schematic that produces and identical netlist as yours (i have not drawn the circuit, i have pasted your netlist as text), ran simulation, loaded graphs all went fine. No waves disappear if i press 'f' and no empty node is present in the list. I see you load the .lib file from the open_pdks directory. This is not correct. After building open_pdks with
make
yous should do a
make intall
. This installs the pdk and the .lib file you need is there, under
..../share/pdk/sy130A/libs.tech/ngspice
. Numerous corrections are done in installed files.
s
@Stefan Schippers thank you very much! That was the issue.
image.png
s
@Steven Bos about the
"GND; 0"
trick to show a 0V level, the space in the quoted expression is very important. A space is used by xschem to detect an expression, like:
VREF;  VCC 2 /"
If you remove the space the
"GND;0"
is knot recognized as an expression. The reason is that (integer) numbers are valid spice nodes, so for example:
"TEST;5"
means "draw the waveform of node
5
,while: "`TEST: 5"` means "draw a line at y value `5`"
s
Check! Good to know that easy to overlook detail. The embedded graphing feature is very convenient, happy to skip the installation of yet another tool 😄
s
I ran myself into this problem. I entered some
"LEVEL;1"
and i didn't see any waveform, until i realized xschem was right, it was looking for a saved node named
1
. This is because for convenience you can reference (in xschem graphs) node names as
out
,
in
,
bias
in addition to
v(out)
,
v(in)
,
v(bias)
. The space is the best candidate do discriminate expressions from node names, since space is not allowed in node names. Most other characters are possible in the spice node syntax.
s
Ah that is also useful. I realize that learning more about the SPICE syntax parsing and execution will speed up my simulations (and put more confidence in my results). I am now exploring the use of parallel xyce since a simple 10 bit DAC simulation with ngspice took near 10 hours. Looking forward to switching to xyce in xschem, already found your instructions in the xyce channel.