Ngspice raw file output question: Hi all, I'm try...
# analog-design
Ngspice raw file output question: Hi all, I'm trying to use the -r flag in ngspice batch mode to specify a raw file to output the simulation results to. The thing is that although ngspice clearly acknowledges the path and file name I specify on the command line because it prints a message to the console detailing it as the binary raw file to output to it doesn't ever actually write a file. Can anyone help? Thanks
Thanks @Amro Tork I can get it to you later
If the file is not written it is probably because simulation was not started. If using ngspice in batch mode do not use
.control / .endc
constructs, write the simulation commands in the old legacy spice way:
.option savecurrents
.tran ... ...
also look at the .
file generated by ngspice in the directory ngspice is running. Warning and error messages go there.
That's interesting @Stephen Schippers but I run in batch mode all the time now using .control and my simulations always run fine but they only write to raw files when I explicitly use the write command from within .control
@Tom, you are right, even in batch mode ngspice runs simulation specified in a .control block, however no raw file is produced even if -r xxx.raw is given. If you remove the .control/.endc and write a plain .tran ... (or .dc ... or .ac ...) line then the raw file is generated. I use this command in general:
ngspice -b -r rawfile.raw -o outfile.out  circuit.spice
👍 2
Thank you very much @Stefan Schippers I will try that this evening
👍 1