I did a comparison of the time needed to load a bi...
# xschem
s
I did a comparison of the time needed to load a big binary raw file (370MB) with xschem and the time needed to do the same thing with a python package I found, called spyci. This package only reads ascii files so I prepared an equivalent ascii raw file (1GB, ascii is less size efficient than binary). The result is that xschem reads the file in 0.9 seconds and takes slightly more RAM (384MB) than the size of the raw file. This is close to the time taken by ngspice itself to load the raw file (try
load poweramp.raw
at the ngspice prompt) The python package took more than 1' 40" to load the file and RAM utilization grew up close to 7.8GB while reading the file and shrunk down to 1.5GB after finishing the load operation. If you know other packages that read raw files let me know I will do more tests. So far IMHO the best way to examine a raw file and save selected data for post processing is ngspice itself:
Copy code
ngspice 232 -> load poweramp.raw
ngspice 233 -> set nobreak
ngspice 234 -> print v(outp) v(refp) > xxx
ngspice 235 -> exit
The
xxx
file looks like:
Copy code
** sch_path: /home/schippes/xschem-repo/trunk/xschem_library/examples/poweramp.sch
Transient Analysis  Sun Apr 21 00:11:46  2024
--------------------------------------------------------------------------------
Index   v(outp)         v(refp)
--------------------------------------------------------------------------------
0       4.185864e-11    4.083358e-09
1       4.569094e-11    4.452056e-09
2       5.402568e-11    5.234371e-09
3       7.516473e-11    7.009691e-09
4       1.399077e-10    1.107425e-08
...
...
An even better way to export data with ngspice is `wrdata`:
Copy code
ngspice 236 -> load poweramp.raw
ngspice 237 -> set wr_singlescale
ngspice 238 -> set wr_vecnames
ngspice 239 -> wrdata xxx v(outp) i(vcurrvpp) v(refp)
ngspice 240 -> exit
and the xxx file is clean with no junk comments, only the data. (credits to @Tim Edwards for wrdata method) the
xxx
file:
Copy code
time            v(outp)         i(vcurrvpp)     v(refp)
 2.00000000e-09  4.18586447e-11  9.99800050e-04  4.08335771e-09 
 2.16802293e-09  4.56909362e-11  1.08379330e-03  4.45205625e-09 
 2.50406879e-09  5.40256799e-11  1.25177699e-03  5.23437090e-09
 3.17616050e-09  7.51647284e-11  1.58772743e-03  7.00969105e-09
 4.52034393e-09  1.39907685e-10  2.25956059e-03  1.10742512e-08
 7.20871079e-09  3.95715337e-10  3.60295603e-03  2.03744789e-08
...
...
👍 1