Browse Source

upon alter the trnoise or trrandom states get re-written.

so delete the old state first.
pre-master-46
Holger Vogt 8 years ago
parent
commit
aedd9d92ee
  1. 6
      src/spicelib/devices/vsrc/vsrcpar.c

6
src/spicelib/devices/vsrc/vsrcpar.c

@ -230,6 +230,9 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
if (here->VSRCfunctionOrder > 6 && RTSAM != 0.0) if (here->VSRCfunctionOrder > 6 && RTSAM != 0.0)
RTSEMT = here->VSRCcoeffs[6]; // RTS trap emission time RTSEMT = here->VSRCcoeffs[6]; // RTS trap emission time
/* after an 'alter' command to the TRNOISE voltage source the state gets re-written
with the new parameters. So free the old state first. */
trnoise_state_free(here->VSRCtrnoise_state);
here->VSRCtrnoise_state = here->VSRCtrnoise_state =
trnoise_state_init(NA, TS, NALPHA, NAMP, RTSAM, RTSCAPT, RTSEMT); trnoise_state_init(NA, TS, NALPHA, NAMP, RTSAM, RTSCAPT, RTSEMT);
} }
@ -256,6 +259,9 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
if (here->VSRCfunctionOrder > 4) if (here->VSRCfunctionOrder > 4)
PARAM2 = here->VSRCcoeffs[4]; // second parameter PARAM2 = here->VSRCcoeffs[4]; // second parameter
/* after an 'alter' command to the TRRANDOM voltage source the state gets re-written
with the new parameters. So free the old state first. */
tfree(here->VSRCtrrandom_state);
here->VSRCtrrandom_state = here->VSRCtrrandom_state =
trrandom_state_init(rndtype, TS, TD, PARAM1, PARAM2); trrandom_state_init(rndtype, TS, TD, PARAM1, PARAM2);
} }

Loading…
Cancel
Save