Open infinitymdm opened 1 year ago
I've spent some time digging into this today. It seems to me that the Analysis
class should have a member dedicated to storing results of .meas
lines in spice simulations. But since the ngspice FFI doesn't seem to surface .meas
results except through ngspice_Command
run calls, the measurement results simply get dropped. Since the API doesn't surface them, the object doesn't make space to store them, and I as a user don't have access to the parameters I expect in my simulation.
One solution I can think of (at least when using the ngspice-shared backend, and not running ngspice in the background) is to parse the measurements out of the results returned by NgShared.exec_command('run')
. This isn't a pretty solution, but it should work for me for now.
The main problem I'm having is that I just don't know where to find the results of
.measure
calls after running a simulation using PySpice. I get pretty plots that show I'm reaching what should be my measurement triggers, but I don't know where to find the data captured by the.measure
call.Environment (OS, Python version, PySpice version, simulator)
Expected Behaviour
Results from
simulator.measure()
will be returned from themeasure()
call, or be accessible via__getitem__()
in the Waveform object after running the appropriate simulation (e.g. for.meas tran my_var_name [...]
, results should be accessible viaanalysis['my_var_name']
).Actual Behaviour
I can't find the results from
.measure()
calls anywhere. It's possible I'm just misunderstanding how this is meant to be used, but I also can't seem to find much documentation on this feature. Poring through the source code seems to indicate to me thatsimulator.analyses
should have an object containing the.measure
results, but I can't seem to find anything there either.Steps to reproduce the behaviour
Run
make
after setting up CharLib at commit f4bd88d8. See characterizer/char_comb.py for relevant code for setting up and running the spice simulation.