I'm working on Spice Mill to aid me in circuit analysis. Spice Mill focuses primarily on post processing ASCII raw files generated Ngspice. This is intended for my personal use, but I'm releasing it for anyone who's interested. Keep in mind that everything here is subject to change.
Here's a quick example on how to generate test data with Ngspice for use with Spice Mill. First you'll need to define a test circuit. For this example we'll use a sine signal:
Where the amplitude
.title Sine Wave
vs vout 0 sin(2.5, 2.5, 1k)
.tran 10u 10m
.end
We save this to a file named test.cir
and run the following command to generate the test data:
SPICE_ASCIIRAWFILE=1 ngspice -b -r test.raw test.cir
Ngspice should now write the simulation data to a file named test.raw
.
To plot the simulation results provided by an ASCII .raw file, run the following command:
python spicemill.py --raw <raw_file>
If no filename was given with the --raw
option, it defaults to data.raw
.
To plot specific variables, use the --vars
option. The variable names (v(vout)
and i(vs)
for example) should be separated by a semicolon ;
.
python spicemill.py --vars "<var_1>;<var_2>;<var_n>"