<@U01819B63HP> <@U016EM8L91B> Is there a way to ca...
# xschem
h
@Stefan Schippers @Tim Edwards Is there a way to cast a variable into a filename? I want to do a parametric
ngspice
simulation and save each run into a separate file. In essence, I want a smoother implementation of this linear code as a loop:
Copy code
alter vg 0.0
dc vd 0 1.8 10e-3
wrdata test_nmos_0p0.txt i(vids)

alter vg 0.2
dc vd 0 1.8 10e-3
wrdata test_nmos_0p2.txt i(vids)

alter vg 0.4
dc vd 0 1.8 10e-3
wrdata test_nmos_0p4.txt i(vids)
t
I don't know. I've always done that by creating a "template" SPICE file with some name for the file like
FILENAME.txt
(and similarly for all the parameters that differ between runs) and then running a preprocessor that generates a multitude of netlists and runs ngspice on all of them. That system was implemented on the Efabless platform as "CACE" (Circuit Automatic Characterization Engine). I dumped all that code into open_pdks where it can be found under the
runtime/
directory. However, I have not made any attempt to get it up and running as a standalone application, so I expect there are still references to things that only make sense in the context of the Efabless environment (assuming it runs at all).
h
OK, that sounds like a Python wrapper job then. I had hopes that this would somehow work ngspice-native