the start of a file written by a Windows editor. A BOM is never
legal SPICE syntax; left in place it glues to the first token
(fatal ".subckt/.ends mismatch" class errors in included libs).
coefficient list) one element at a time, calling askInstanceQuest for
every element. Two bugs made that catastrophic on a large chip:
* IFvalue val was uninitialised, so a query that did not set
v.numValue left `n' as stack garbage -- the element loop then ran
essentially forever.
* askInstanceQuest TMALLOCs the coefficient vector (vsrcask.c) on
every call and printvals()/printvals_old() never freed it, so the
listing leaked O(n^2) allocations -- tens of GB on a deck with many
stimulus sources.
Fix: memset val before the query and clamp n (kills the runaway loop),
and free the returned vector after use via a new free_if_vec() helper.
Verified: pulse coefficients still print correctly; show on MOS/BSIM4/
OSDI/vsource is unchanged and does not crash.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add CKTtopologyReduce() (cktsetup.c) to remove degree-1 dangling
capacitors/resistors -- e.g. dead-end opamp compensation caps -- that
otherwise cause spurious 'Timestep too small' aborts. Node degree is
counted generically over all device types; the floating node is pinned
with a unit diagonal. Disable with 'set no_topo_reduce'.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
running in parallel on a multi-core machine (12 min execution time
on a i9 9900, ngspice compiled with gcc, debug mode enabled.
Linux with Valgrind and Parallel are required.
showing errors in XSPICE code model support functions by default.
But errors may occur routinely and be handled by code.
To aid developers, setting variable "noisyxspice" will display the messages.
Also fix an error report in cm_event_queue(), remove XSPICE parse error
messages that are now shown twice and fix errors in d_source that
were seen with the new error reporting.
If either bridge has a single analog connection and two or more digital
connections it will act as a conventional multi-bit ADC or DAC.
When the low threshold is higher than the high threshold, adc_bridge
acts as a Schmitt trigger.
- Replace E source by G source with parallel resistor to improve
convergence.
- Add parallel resistor to avoid floating nodes
- Reduce refecrence C to 1u (and thus the max. current).