From 4a222d74c12d8c986c6865292ef17cccba5cab80 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 22 Oct 2022 13:29:48 +0200 Subject: [PATCH 1/2] Update on author --- src/xspice/icm/analog/delay/ifspec.ifs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xspice/icm/analog/delay/ifspec.ifs b/src/xspice/icm/analog/delay/ifspec.ifs index e27d9ac9b..abe19354f 100644 --- a/src/xspice/icm/analog/delay/ifspec.ifs +++ b/src/xspice/icm/analog/delay/ifspec.ifs @@ -2,14 +2,15 @@ ================================================================================ ------------------------------------------------------------------------- - Copyright 2011 Thomas Sailer + Copyright 2021 + The ngspice team 3 - Clause BSD license (see COPYING or https://opensource.org/licenses/BSD-3-Clause) ------------------------------------------------------------------------- AUTHORS - 19 May 2011 Thomas Sailer + 12 June 2021 Holger Vogt SUMMARY From 8bcea45f1cef95bdced086757b8e99e36a1c6a32 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 22 Oct 2022 13:31:38 +0200 Subject: [PATCH 2/2] Add a guard on parameter 'position', limit to 1e-9 to 0.999999999 FIXME: the given parameter limits from ifspec.ifs are not recognized. --- src/xspice/icm/xtradev/potentiometer/cfunc.mod | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xspice/icm/xtradev/potentiometer/cfunc.mod b/src/xspice/icm/xtradev/potentiometer/cfunc.mod index 35bff7d12..8b9448c2d 100644 --- a/src/xspice/icm/xtradev/potentiometer/cfunc.mod +++ b/src/xspice/icm/xtradev/potentiometer/cfunc.mod @@ -18,6 +18,7 @@ AUTHORS MODIFICATIONS 19 June 1992 Jeffrey P. Murray + 22 October 2022 Holger Vogt SUMMARY @@ -131,6 +132,14 @@ void cm_potentiometer (ARGS) /* Retrieve frequently used parameters... */ position = PARAM(position); + + /* guard against 0 or 1 + FIXME: checking the parameter limits is not yet implemented */ + if (position <= 0) + position = 1e-9; + else if (position >= 1) + position = 0.999999999; + resistance = PARAM(r); /* Retrieve input voltages... */