Commit Graph

7833 Commits

Author SHA1 Message Date
Holger Vogt b9221a07a3 Fix a bug when evaluating -0.5^3.
Use code which has been up to now only applied with LT compatibility.
2026-04-11 14:12:52 +02:00
Holger Vogt afd4eb64ed Fix a bug introduced by yesterday's commit
8abfb5aeb0/
2026-04-07 22:25:27 +02:00
Holger Vogt 8abfb5aeb0 Remove unused ft_gidb
Add debug ft_shvecsearch
Make ft_codemodelerror more verbose.
2026-04-06 14:15:42 +02:00
Keith OHara 0638aaa160 Continue Newton iteration until currents settle.
For each type of device, a *convTest function determines if the
current through that device is converged within tolerance,
and sets CKTnoncon if the current is not yet converged.

ASCRconvTest() erroneously subtracted old current from old,
rather than old from new, when evaluating convergence.

Also, since at least 3f5, the calling function NIconvTest assumed
that the worker functions indicated non-convergence through their
return value, so was ignoring the reports of current nonconvergence.
2026-04-06 00:01:12 +02:00
Holger Vogt 55189b01fe Remove obsolete adms branch 2026-04-04 15:25:06 +02:00
Holger Vogt 864ee815bc Update VSRC and ISRC pulse sources
Enable PW=0, improve 'incomplete' pulse specifications

TR negative or 0 --> TR = ckt->CKTstep
TF negative or 0 --> TF = ckt->CKTstep
if PW not given, but TR and TF --> PW = 0
PW < 0 --> PW = ckt->CKTfinalTime
PER <= 0 --> PER = ckt->CKTfinalTime
2026-04-04 15:23:01 +02:00
Holger Vogt 18cbaad36c Revert "V Pulse delivers erratic outputs, when not parameterized properly."
This reverts commit 7159d6aa4b.
2026-04-04 13:50:43 +02:00
Holger Vogt 5eb1b0a510 Revert "Move comment"
This reverts commit dd2a5fd062.
2026-04-04 13:50:36 +02:00
Giles Atkinson ae4a05158b Ugly fix for failing MacOS builds on github: move parse-binon.y to the top.
BUILT_SOURCES seems not to work.
2026-04-01 09:53:34 +01:00
Giles Atkinson 82c91abea4 Discard all XSPICE event data when using "-b -r", as there is no way
to access it.  An initial step for FR #105: "Esave + rawfile".
2026-04-01 07:35:20 +01:00
Giles Atkinson e42a9e6b5c Fix excessive forcing to lower-case in pure script files.
Add string comparisons as protected commands so they can be case-sensitive.
2026-04-01 07:35:20 +01:00
Giles Atkinson 3586cbcbea Fix crash when a "*ng_script_with_params" script is called
from a control section.
2026-04-01 07:35:20 +01:00
Holger Vogt 499c1d3dca We develop towards ngspice-47 2026-03-30 16:08:41 +02:00
Holger Vogt 4feeb94b12 Improve error message, make fprintf independent from OS 2026-03-30 16:03:19 +02:00
Holger Vogt 96404e9939 Exclude memory check for Apple Silicon
Not yet working as getAvailableMemorySize delivers wrong values.
2026-03-30 16:00:32 +02:00
dwarning 33b53f9df6 diode: correct charge reporting for soft recovery option 2026-03-27 10:31:46 +01:00
Holger Vogt f227a3abd6 Prevent a crash with shared ngspice when memory is exhausted:
Add a pre-check if available memory is sufficient. If not, bail out.
2026-03-27 10:31:30 +01:00
Holger Vogt d93bc07c15 Prepare for ngspice-46 2026-03-25 13:59:09 +01:00
Holger Vogt cd14f85cde Remove ft_skywaterpdk, replace it by variable no_auto_braces 2026-03-25 13:33:52 +01:00
Holger Vogt aab3371f36 A memory leak occurs when command 'step' is followed by 'quit'
without having reached the final TSTOP.
New function DCtran_step_quit() removes the leak.
2026-03-25 13:33:17 +01:00
Holger Vogt 2d3e032a3f Remove memory leak. 2026-03-20 16:59:22 +01:00
Holger Vogt af67662a3f In case of transient simulation error, bail out when fft is called. 2026-03-20 16:59:11 +01:00
geraldfournier 65e5ccb7bb Make fft scaling independent from rounding behaviour for odd data.
Add a time slot to fft span.
2026-03-20 13:37:06 +01:00
dwarning b3a78b02cc Special Nyquist scaling only for even length.
Let nyquist bin not empty for odd vector
2026-03-20 13:33:39 +01:00
Ralf Habacker 278841972c Add command line support for the 'version [-s|-f]' command
With this commit the mentioned ngspice command(s) are
also available on the command line. See ngspice --help
for more information.
2026-03-20 10:58:48 +01:00
Holger Vogt 88895f1394 Parameter np=xx added. xx may be a number or auto2n.
If np is not set, 'linearize' behaves as usual, (TSTOP-TSTART)/TSTEP + 1.5
If np=<number>, integer <number> is used
If np=auto2n, the number of points is 2^n, close to (TSTOP-TSTART)/TSTEP.
2026-03-20 10:58:36 +01:00
dwarning a0bf7f7e8a Diode soft recovery model based on the idea of A. Buermen with iterated charge node for diffusion charge and model parameter Vp.
Small simplifications in AC model and capacitance reporting are made. No self-heating for this effect. Pole-Zero and distortion
analysis is not implemented for this model extension.
2026-03-20 10:58:16 +01:00
Holger Vogt 38ce7778b3 Update 2 to warning messages if osdi or code model files cannot be loaded 2026-03-20 10:57:37 +01:00
Holger Vogt 7d0dce0e70 Update to warning messages if osdi or code model files cannot be loaded 2026-03-20 10:57:23 +01:00
Holger Vogt b5112b18e5 FM and FC exchange place in the parameter sequence of SFFM voltage
and current source, to become compatible with standard SPICE.
Fixes bug 832.
2026-03-20 10:57:00 +01:00
Holger Vogt f86018afe9 Do not give up when non-existing fft window is chosen,
but issue a message and go on.
2026-03-20 10:43:44 +01:00
Enrique 7a76310b6b Added parameter numPeriod so that the user can select the number of fundamental frequency periods used in the detection of the fundamental frequency and its harmonics. This is usefull when trying to recover the fundamental frequency and its harmonics from a noisy signal, like the output of a DCDC converter 2026-03-20 10:40:15 +01:00
Holger Vogt c22d6c772d prepare for binning of N devices 2026-03-20 10:40:00 +01:00
Holger Vogt 973f3fd57c Improve th error message: add the failing option's name. 2026-03-20 10:39:35 +01:00
Holger Vogt fb501b5131 Prevent potential buffer s overflow by limiting the characters written.
Use vsnprintf instead of vsprintf.
2026-03-20 10:39:10 +01:00
Holger Vogt e613d5b8db Improve error message, no output of line string if not 'set ngdebug' 2026-03-20 10:38:51 +01:00
Holger Vogt 603089b29f Re-enable not setting lower case if commands from spinit or .spiceinit 2026-03-20 10:38:21 +01:00
Holger Vogt a165ab5c28 Allow Cd as a valid C reference designator for a capacitor,
i.e. lower-casing of node names,
by re-organizing the setting of lower cases in the netlist:
No lower-casing for cd only while in a .control section.
2026-03-20 10:37:42 +01:00
Holger Vogt 24008efc83 Improve error message. 2026-03-20 10:37:10 +01:00
Holger Vogt a92eea2dfb Add warning message if E or H poly source has multiplier m 2026-03-20 10:36:47 +01:00
Holger Vogt 48a37be31c Add parameter m (multiplier), while translating from G or F source
to code model spice2poly
2026-03-20 10:36:32 +01:00
Holger Vogt 5b39c73205 Add a parameter m (output multiplicator)
to spice2poly code model.
2026-03-20 10:36:00 +01:00
Holger Vogt d13cd984f4 Special treatment while spiltting multiple .param lines, if .param is a .func 2026-03-20 10:35:32 +01:00
Holger Vogt 7474cd70d0 Ignore .hdl and .biaswarn commands. 2026-03-20 10:34:45 +01:00
Holger Vogt dd2a5fd062 Move comment 2026-03-20 10:34:24 +01:00
Holger Vogt 7159d6aa4b V Pulse delivers erratic outputs, when not parameterized properly.
Update the pulse generation: negative TR, TF, PW, PER not possible,
get default values instead. 0 PW is allowed.

Defaults are:
TR negative or 0 --> TR = ckt->CKTstep
TF negative or 0 --> TF = ckt->CKTstep
PW < 0 --> PW = 0
PER <= 0 --> PER = TR + TF + PW */
2026-03-20 10:33:54 +01:00
Holger Vogt 527cc86969 Prepare for instance parameter 'dtemp', required by commercial PDKs.
Not yet support in the model, silently ignored.
2026-03-20 10:33:20 +01:00
Holger Vogt 96df01db06 Prepare for instance parameter 'dtemp', required by commercial PDKs.
Not yet support in the model, silently ignored.
2026-03-20 10:33:08 +01:00
Holger Vogt f8a4195e8e Prepare for instance parameter 'dtemp', required by commercial PDKs.
Not yet support in the model, silently ignored.
2026-03-20 10:32:54 +01:00
Holger Vogt 51e46d5e00 Prepare BSIM4.7 for instance flag dtemp
FIXME: The dtemp value is not yet linked to the model!
2026-03-20 10:32:46 +01:00
Holger Vogt 84f87aeafd Improve error message by adding the sourcing netlist line 2026-03-20 10:31:34 +01:00
Holger Vogt 3fcfc4b989 Improve error message 2026-03-20 10:30:01 +01:00
Holger Vogt 81d3812db0 Add a user-settable variable measureprec to set the number of digits
when printing the measure outputs.
Internally this is a global variable measure_precision.
Enable all measure commands to recognize measure_precision when
printing an output.
Default value is 5 (yielding 6 digits after .?).
2026-03-20 10:28:28 +01:00
Holger Vogt 9ac5bda207 After an ac simulation, a tran measurement causes a segfault.
A check prevents this issue.
2026-02-03 22:38:56 +01:00
Holger Vogt 417c52ee5c Remove compiler warnings 2026-02-03 15:05:24 +01:00
Holger Vogt ab87bd57a4 Re-enable compiling with clang
Patch thanks to Gon Solo, issue 826
2026-02-03 14:25:18 +01:00
Holger Vogt afb17cb6c7 New analogue and digital device models from TI contain
the token GND in their subcircuit. Up to now ngspice has
declared GND as global and replaced it by 0.

Now, if PS is selected as compat mode, GND is not
declared as global, and is not replaced inside of a subcircuit.
2026-02-03 14:25:09 +01:00
Holger Vogt b25ff08307 Moving window filtering with function 'newvec = mtimeavg(vec)'
Window of fixed time width given by 'set mtimeavgwindow=400u'
Length and scale of newvec resembles the original vetor vec.
Large vec and large mtimeavgwindow take their time.
OpenMP is used if available.
2026-02-03 14:23:32 +01:00
Holger Vogt 84ce2b4084 Exclude B voltage source, whan '.probe alli' is used.
It already gets a bxx#branch for current measurement.
2026-02-03 14:23:22 +01:00
dwarning 1601571432 Correct vgs assignment - bug found by K. OHara 2026-02-03 14:23:14 +01:00
dwarning 23eafe9978 remove redundant definition and unused variable 2026-02-03 14:22:57 +01:00
dwarning 81894e0c52 Minor change that helps VADistiller. 2026-02-03 14:22:48 +01:00
dwarning 06aa4989a6 convert to lower case for spice2 input and remove few warnings 2026-02-03 14:22:37 +01:00
dwarning 48438ba736 rm ngnutmeg from build list of old apps 2026-02-03 14:22:29 +01:00
Holger Vogt cd6ca5e86a re-enable maling old app ngsconvert
ngnutmeg is still defect
2026-02-03 14:22:21 +01:00
dwarning 1841709eab more realistic default values for case to ambient thermal resistance and device transconductances 2026-02-03 14:22:02 +01:00
dwarning d3b0dc1b31 Adapt VDMOS Vth temperature coefficient to usual notation with - for nch and + for pch. 2026-02-03 14:21:50 +01:00
Holger Vogt 2e5772e35e Add the non-nqs PSP103 OSDI model to spinit 2026-02-03 14:21:24 +01:00
Holger Vogt 8737839f41 Add a function m3avg(vector) for filtering of trap ringing.
Moving average with D(n) = (C(n-1)/2 + C(n) + C(n+1)/2)/2
2026-02-03 14:20:08 +01:00
Holger Vogt 8d21c8e79b Make pred available always 2026-02-03 14:19:42 +01:00
Holger Vogt fe55cbe69f Enable optional voltage based truncation error correction.
This is selectable as 'option newtrunc' (--enable-Predictor is required)

Remove --enable-NEWTRUNC

Add three option parameters (default):
lteTrtol (500), lteReltol (1e-3), lteAbstol (1e-6)

Add new error function for TRAP, similar to GEAR
 (tentative, to be improved), in ckttrun.c

Enable PREDICTOR as default with Visual Studio.
2026-02-03 14:18:55 +01:00
Holger Vogt ab49ea9657 Fix tiny bug. 2026-02-03 14:18:29 +01:00
Brian Taylor 50c4272544 Add function to verify that subckt port directions are compatible with auto bridging. Use set ps_ports_and_pins=1 to see the port directions. 2026-02-03 14:18:17 +01:00
lorenzo 66797fdebc Fixes a memory corruption bug resulting from improper parsing
and accessing of array parameters in OSDI models
2026-02-03 14:17:59 +01:00
dwarning 89a25ac6c1 Diode sensitivity analysis: Exclude few parameters and add level 3 geometry parameter. 2026-02-03 14:17:42 +01:00
dwarning f2ef953246 Fix the overlap in state vector for sensitivity states of diode and bjt model. 2026-02-03 14:17:16 +01:00
dwarning eea3af64e2 KLU bindings for separate sw diode only if sw resistor is given 2026-02-03 14:16:59 +01:00
Holger Vogt 4958221e92 Update comment to cktnumstates 2026-02-03 14:16:48 +01:00
dwarning f52749afa3 Diode model level=2 (Fowler-Nordheim) is not supported. 2026-02-03 14:16:11 +01:00
Holger Vogt abdd936cb8 Add missing function prototypes 2026-02-03 14:15:52 +01:00
dwarning 96d0559631 This fixed #822 diode discontinuity problem
Base recombination current appears in reverse and breakdown region too.
2026-02-03 14:15:38 +01:00
dwarning 58d7ad791e Add optional switch for separate bottom and sidewall diode model - configuration is dependent from model parameter RSW
Further sidewall knee current parameter IKP is implemented.
2026-02-03 14:15:28 +01:00
Holger Vogt d7f5169b0d Re-formatting 2026-02-03 14:15:08 +01:00
Holger Vogt ee8bf7a948 Add a comment 2026-02-03 14:14:52 +01:00
dwarning f1378f2e5a general vdmos update 2026-02-03 14:14:35 +01:00
Holger Vogt 6304f0124b Remove unused functions from the IFfrontEnd struct. 2026-02-03 14:13:54 +01:00
Holger Vogt 83bf3ae46b Remove a double entry 2026-02-03 14:13:42 +01:00
Holger Vogt 6dfaf3f11c Enable guessing the vector type or SP analysis in batch mode. 2026-02-03 14:13:26 +01:00
Holger Vogt bc7d68884e Remove variable and flag 'use_numparams'.
Not using numparam has not been a supported option for the last 20 years.
2026-02-03 14:13:04 +01:00
Holger Vogt f3871c3ea2 Try to equalise the last two time steps before a breakpoint,
if the second step would be smaller than CKTdelta otherwise.
2026-02-03 14:12:38 +01:00
Holger Vogt 8172362529 Using cbrt() instead of exp(log...) might be more efficient 2026-02-03 14:12:20 +01:00
dwarning 6bd5c2d03b VDMOS: apply m scaling fix for acld as well 2026-02-03 14:12:10 +01:00
Árpád Bűrmen 2bc63e71ae VDMOS scaling fixed. 2026-02-03 14:12:01 +01:00
Árpád Bűrmen 804658601e Minor change in VDMOS that helps VADistiller. 2026-02-03 14:11:51 +01:00
Holger Vogt c896fed414 Update to commit
172fb6d66 ("Fix Bug 817 - "Global models are not visible from
with subcircuits". Remove code that can miscount the number of
nodes to be renamed.", 2025-10-08)
Keep checking for x lines with nesting. This re-enables
simulating large cxircuits (e.g. SRAMs) with deeply nested
subcircuit calls.
2026-02-03 14:11:34 +01:00
Holger Vogt 1ef57ffc42 Add a variable 'debug-out-short' to enable a shortened debug-out.txt,
useful when large circuits are monitored, which otherwise may result
in GigaBit size of data.
2026-02-03 14:11:12 +01:00
dwarning 5836f9c487 vdmos convtest needs type for vd - load hack not needed anymore 2026-02-03 14:11:01 +01:00
dwarning ce94dd1587 vdmos: in case temp and dtemp is given - use dtemp and omit temp 2026-02-03 14:10:39 +01:00
dwarning f9cd5f1471 correct gate and source resistor temperature update 2026-02-03 14:10:23 +01:00
dwarning 564a97e693 correct rthca connection 2026-02-03 14:10:07 +01:00