For those of us who are Python users, I would like to highlight a new tool called PyQSPICE. It works with QSPICE’s command-line interface to load QSPICE simulation results into memory for plotting in Python.
This is an open-source project hosted on GitHub. It is not supported by the QSPICE team.
The main module has an explanation in front of each method.
Q:: How to tweak a parameter, run a sim and repeat/loop?
A:: This example is running 2 sims from one next list by changing the netlist “.cir” file with Python regular expression “re” module.
Q:: Why “SJIS” encoding, in the Python module?
A:: See this discussion. The QSPICE uses “Latin-1 Supplement” and many file-encoding judgement routines (checked a couple of standalone encoding detection programs) think it “Shift JIS”, with a probability view point. Just to avoid Python error message, I use the “SJIS” encoding and I know I’m dealing with a file of “Latin-1 Supplement”.
PyQSPICE is very good and I have used it already.
How do I print the dc operating points if I am using PyQSPICE?? I do not see that function in the PyQSPICE class and was hoping if you could please help with that? It will be a good starting point to see dc operating points of all nodes (and currents)
before the PSRR circuit is simulated (or any other AC sim is triggered)
I run a quick trial and I see PyQSPICE can support your “.OP” needs.
I’m on the road and please wait for me next week
I’ll delete this post when I update PyQSPICE for the “.OP”, by replacing my post with the detail how to handle “.OP” on PyQSPICE.
I believe I made an over commitment, it’s the Thanks-Giving week here in USA…Within Nov, I’ll try to get it updated for “.OP”.
thank you masashi! I look forward to your uprate on how to use .op within PyQSPICE and getting a text file with outputs printed for the operating point (just like what one can see in the terminal).
It supports .OP result reading. To make this happens, PyQSPICE now reads “.cir” netlist and extract nodes and elements. Not all elements implemented (logic gates, AD/DA converters), voltage nodes completely sandwiched by those elements will be ignored…for now.
Plot setting lines are consolidated into a method and now we can make our main code clean.
Only the code of “tests/50_OP” is clean for plotting, will update older “tests” examples step-by-step.
The example “tests/50_OP” is showing simple results but it is reading more info from the “.OP” run. Please try “print(df)” to see all the info this new version PyQSPICE reading.