<@U01819B63HP> `xschem` feature idea: How about adding (besides the waveform viewer) a kind of “simu...
h
@Stefan Schippers
xschem
feature idea: How about adding (besides the waveform viewer) a kind of “simulation datasheet”? Like a table that I can fill with expressions that evaluate simulation data (like waveforms) and just give me a value? This would allow complex simulation scenarios straight out of xschem (using the .control flow of
ngspice
), and alleviates the need of looking at graphs. I assume we could use Tcl expressions for this? (as long as we can get sim data into a Tcl variable).
s
I think this is easily doable. What makes the difference is the UI implementation. XSchem has a '`xschem raw_query`' function that returns a list of al simulated points or a specific point in the simulation of a given circuit variable (if it is saved in the simulation output raw file). There are some quirks however. For example in a transient run time steps are not uniform. Even for calculating an average value of a waveform you must get each variable value associated with each time value and do the proper integration. You can not for instance add all points and divide by the number of points. Other analyses (DC, AC) usually have constant steps, In a transient run if a node
led
is saved you get the necessary values by doing:
Copy code
set led [xschem raw_query values led]
set time [xschem raw_query values time]
foreach x $time y $led { #do whatever calculation with x and y}
Doing other calculations, like finding the max value, or the time when a signal goes high is quite simple, but I need to think on the GUI implementation to make this available to users without writing (small) tcl routines.