In most of spice simulator, there is command to save all node voltage after the initial operating point convergence calculation to avoid extensive calculation to find it when re-running a simulation : the syntax is directly in the proper format : .NODESET V(node001)=.. V(node002)=..
For exemple in XYCE or HSPICE, the syntax is :
.save TYPE=NODESET my_file_of_OP_voltage.txt
In LTspice, it is : .SAVEBIAS my_file_of_OP_voltage.txt
Optionally, a time can be specified if a transcient simulation is run to save the voltages at a given time.
It is so convenient for large circuit, that it would be nice to have the same feature in NGSPICE :)
Laurent
See manual chapter 17.5.100, command
wrnodev [ file ]
to be used in a .control section.
A typical control section might be
Last edit: Holger Vogt 2023-08-25
Hi Holger,
The commands works fine for the toplevel, I was looking for it at the chapter 15.2 about .nodeset and .ic : it would be nice to add a word about wrnodev in this chapter 15.2.
Also, the only nets voltage saved are the ones at toplevels, not those of the sub-circuits : how to save all nets voltage, even those inside the subckt, after the operating voltages calculation ?
Thank you, BRgds,
Laurent
A trivial example shows that the command can save subcircuit nodes:
produces the expected output:
But that is no solution to the problem. To be useful, the output file must be read by the netlist parser after subcircuit expansion, when nodes such as x1.inner have been made to exist. At first sight this is impossible, as .include is processed early, but I believe there is a way.
I have not tested this, but the event-node auto-bridge feature (manual 12.6) works by generating new lines of the netlist after parsing is complete and then parsing them, with results added to the original circuit. By setting certain variables (pre_set command) and adding a redundant digital device to the circuit, a .include line for the wrnodev output may be processed at the right time.
I do not suggest that this horrific kludge is a solution, but it does suggest one. Some parts of existing code might be adapted to make a new ".late_include" command that will do the right thing. A documentation requirement that late-included files contain only comments and ".ic" commands may be necessary.