How do you typically view the output of Xyce?
# xyce
z
How do you typically view the output of Xyce?
m
z
Based on my Google-ling, this seems to be the only choice other than viewing the raw file content directly...
Thank you for sharing 🙂
m
Yeah. I want something better and it would be a good project. There is still a patch for gtkwave which is nice but has never been merged. That browser is primarily digital but much nicer.
s
@Zeyi Wang xschem can also view raw file directly. There are some advantages, like the possibility to create bus bundles and display as digital busses, display math expressions on voltages/currents and annotate the voltage values at cursor position in the schematic. See picture examples. For instructions see manual pages: https://xschem.sourceforge.io/stefan/xschem_man/graphs.html#graphs and video tutorials: https://xschem.sourceforge.io/stefan/xschem_man/video_tutorials/xschem_graphs.mp4 and https://xschem.sourceforge.io/stefan/xschem_man/video_tutorials/live_annotation_with_b_cursor.mp4
1
🌍 1
z
Is there a way to export these visualizations from the command line?
s
@Zeyi Wang you can create a schematic with only graphs, and export these as svg or png. PS/PDF exporting is on the list but will take some time as postscript has a weird way to encapsulate image data. Doing with command line options is possible, although you need to specify some actions like loading theschematic file, loading the waveform .raw file, specify the aspect ratio of the exported image:
xschem --tcl 'set initial_geometry 700x900' --command 'xschem raw_read $netlist_dir/rom8k_ngspice.raw; xschem print svg ~/graphs.svg'  -q  .xschem/xschem_library/rom8k_graphs.sch
where: •
--tcl 'set initial_geometry 700x900'
sets the window dimensions (for svg only aspect ratio matters) •
--command 'xschem raw_read $netlist_dir/rom8k_ngspice.raw; xschem print svg ~/graphs.svg'
tells xschem to load the spice .raw filwe after loading the schematic, and then do a svg export. •
-q
tells xschem to exit after doing the export. you can add
xschem toggle_colorscheme
before doing the xschem print command to get a white background image.
1
e
We do plan to implement outputs for GTKWave as soon as we have time, FYI.
m
I wonder if someone can just write a raw->GTKwave utility for now
e
I’m sure someone could do that!
m
@Eric Keiter what format would you output for gtkwave?
e
Not sure. Do you have a recommendation?
m
And I guess transient is obvious, but other views are not so straight forward.
e
Ah. I mainly had transient in mind. When you said “format” I thought you mean things like binary vs. text file format, etc.
m
Yes, I only really care about transient. "GTKWave will read Verilog VCD/EVCD format files, as well as LXT, LXT2, VZT, FST, and GHW formats."
e
Regarding all those formats, at the moment TBD.
m
I'm not sure which ones are "real valued"
e
Ah
I’ll do a little digging …
m
I think there was work for lxt with a patch to ngspice to save that. https://sourceforge.net/p/ngspice/discussion/133842/thread/59577d13/
👍 1
e
Xyce has a feature that when you call it as a library, you can pass in an “outputter” object. That outputter is a derived class, and the user can write their own. One of our collaborators wrote such a class to output to GTKWave. I will be meeting with him soon and will probably get that class from him.
👍 1
🌍 1
Another detail is that we want to modify Xyce so that these outputter classes can be linked in as shared objects. So, the command line version of Xyce can use them as well.
👍 1
m
I'm looking for a spec of the LXT file format...
👍 1
s
vcd (compressed) files have the potential to store simulation data more efficiently than raw. If only one node changes value in a timestep of a 10k nodes circuit 10k nodes are saved in the raw file for that timestep. Xschem has a rawtovcd utility that transforms a raw file into a vcd file. If a
-v <voltage>
option is given signals are digitized, otherwise they will be saved as they appear in the raw file, as real values. I used this utility to view the digital part of a circuit, while using analog viewers for the analog part. gtkwave can display analog waves, but only in stacked mode as far as i know, so it can do the job but is not optimal. For digital signals / busses it works perfectly. In most of the cases i now use xschem's internal viewer as i can position the time cursor and see annotated values in the circuit.
👍 1
🌍 1
m
It seems like the stacked mode issue could be fixed... I was also thinking about a digitizing utility. rawtovcd is interesting.
LXT uses gzip compression so it is pretty efficient as well.
I can't find a specification for LXT though. Anyone know where it is?
s
vcd is uncompressed however you can pipe the rawtovcd converter output to gzip, gtkwave is able to open it.
@Matthew Guthaus the gtkwave user manual has the LXT file fomat specification in the appendix
👍 1
I think gtkwave provides a C api to create / read LXT files, so part of the low level and boring work might be already done.