Add a user definable variable enable_noisy_r (for .spiceinit)

to enable noise calculation for all behavioral resistors.
May locally be switched off by instance parameter noisy=0
If enable_noisy_r is not set, noise simulation
may locally be enabled by instance parameter noisy=1.
This commit is contained in:
Holger Vogt 2023-01-27 11:19:57 +01:00
parent 167c708e69
commit 4b8d575122
1 changed files with 6 additions and 3 deletions

View File

@ -6015,11 +6015,14 @@ static void inp_compat(struct card *card)
/* evaluate m */
char* mstr = eval_m(cut_line, card->line);
/* white noise model by x2line, x3line, x4line
if instance parameter noisy=1 (or noise=1) is set */
bool rnoise = FALSE;
/* white noise model by x2line, x3line, x4line */
/* if variable enable_noisy_r is set */
bool rnoise = cp_getvar("enable_noisy_r", CP_BOOL, NULL, 0);
/* if instance parameter noisy=1 (or noise=1) is set */
if (strstr(cut_line, "noisy=1") || strstr(cut_line, "noise=1"))
rnoise = TRUE;
else if (strstr(cut_line, "noisy=0") || strstr(cut_line, "noise=0"))
rnoise = FALSE;
/* tc1, tc2, and m are enabled */
xline = tprintf("b%s %s %s i = v(%s, %s)/(%s) %s %s reciproctc=1 reciprocm=0",