Boris Murmann
03/29/2024, 7:03 PMChristoph Weiser
03/29/2024, 7:53 PMBoris Murmann
03/29/2024, 8:23 PMBoris Murmann
03/29/2024, 9:15 PMChristoph Weiser
03/30/2024, 8:48 AMStefan Schippers
03/31/2024, 12:09 AMic
file with wrnodev
, then running another simulation, including the ic
file and doing a op
analysis. The result matches the node values that where saved after the transient sim.
There is a caveat, however. When you resume simulation
you must set the dc value of all voltage / current sources to be equal to the values they had at the time the simulation was saved.
With reference to image below, where transient ic file was saved at 42ns, DC value of voltage sources for reset_b
, a
, b
must be set high and clk
must be set low, otherwise ngspice will not converge to the same ic state saved with wrnodev
.Stefan Schippers
03/31/2024, 12:16 AMBoris Murmann
03/31/2024, 1:47 AMBoris Murmann
03/31/2024, 2:14 AMLucas Daudt Franck
03/31/2024, 3:25 AM.include <wrnodev file>
.control
optran 0 0 0 0 0 uic
op
.endc
Boris Murmann
03/31/2024, 3:28 AMLucas Daudt Franck
03/31/2024, 3:40 AMBoris Murmann
03/31/2024, 4:02 AM*ictest
c1 v1 0 1e-12
r1 v1 0 1e9
.ic v(v1)=1
.control
optran 0 0 0 0 0 uic
op
print v(v1)
.endc
Boris Murmann
03/31/2024, 4:03 AMBoris Murmann
03/31/2024, 4:04 AMChristoph Weiser
03/31/2024, 7:54 AMStefan Schippers
03/31/2024, 11:16 AMBoris Murmann
03/31/2024, 7:21 PM* ic statements will come from tran op using wrnodev
.ic v(n1)=1
c1 n1 0 1e-12
r1 n1 0 1e9
r2 n2 0 1e3
* this is a 1 Ohm resistor when v(n1)=1
b2 n2 0 I=v(n2)*v(n1)
i2 n2 0 ac 1e-3 dc 0
.control
optran 0 0 0 0 0 uic
op
print v(n1)
ac lin 1 1 1
print vm(n2)
noise v(n2) i2 lin 1 1 1
print onoise_spectrum
.endc
For .ic v(n1)=0
the noise analysis gives 4 nV/rt-Hz, for .ic v(n1)=1
, it gives 4 pV/rt-Hz (due to 1 Ohm in parallel with 1 kOhm. As a sidenote, I initially tried using a switch (.model sw) as the controlled element for evaluating the state of v(n1), but it seems that switches don't work in AC analysis (always off?).Christoph Maier
04/01/2024, 3:07 PMChristoph Weiser
04/01/2024, 4:13 PM