From 4b8d5751226447e3c77412b0d2d324c3bc11993e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Fri, 27 Jan 2023 11:19:57 +0100 Subject: [PATCH] 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. --- src/frontend/inpcom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index b22900a99..d1291559b 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -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",