Commit Graph

635 Commits

Author SHA1 Message Date
Holger Vogt 33f18b485a Improve error messages when reading (and discarding) binned models,
e.g. for Skywater PDK with up to 160 bins per model parameter set.
2025-04-29 11:32:46 +02:00
Giles Atkinson 83d3890490 Fix a bug where a node name is mis-identified as the model for
an OSDI device and remove a limit on node count.
Problem was reported by user Sam in ngspice-users.
2025-03-01 13:45:01 +01:00
Holger Vogt 5db715296d Remove ADMS related code 2025-02-07 14:03:51 +01:00
Giles Atkinson abc3fceb7e Enhance sensitivity analysis with an option to choose the parameters
to be varied.  Shell-style wildcards ("*?") are supported.
2024-12-06 22:44:06 +01:00
Holger Vogt 8c806912d0 Improve convergence in Infineon Power MOS.
0**something is 0
2024-12-06 22:41:18 +01:00
Brian Taylor 75c2811fa9 Fix some memory leaks. 2024-12-06 22:39:49 +01:00
Holger Vogt 3d6d0d880a Improve comment 2024-11-02 22:44:11 +01:00
Holger Vogt 28d8301b5f Prevent crash upon buggy user input 2024-07-01 09:42:45 +02:00
Holger Vogt 442d8554f0 Enable single terminal n devices (Verilog-A modules) 2024-07-01 09:42:28 +02:00
Holger Vogt e5195c10a3 Enable monotonic negative growth of abscissa values. 2024-06-22 14:21:42 +02:00
Holger Vogt 36e7835afd Remove Valgrind "potentially undefined" message. 2024-06-22 14:20:44 +02:00
Holger Vogt 97d9f38421 Add (enhanced) patch by Giles Atkinson
Add controlled_exit() to errors when parsing functions.
Add verbose error messages, including line number and
name of the source file.

.lib file handlinmg with its recursive structure probably needs
testing and improvements.

More error messages may need this update.
2024-05-14 16:30:36 +02:00
Holger Vogt cf4684f9ae Stop ngspice in case of pwl errors, avoid crash. 2024-05-01 10:33:42 +02:00
Holger Vogt ee39b2600b Add a evaluation function which truly removes also the
scale factor from the token when gobble=0 before
moving on.
2024-03-29 17:16:41 +01:00
Holger Vogt 7d1ea80a2e F source fails when VNAM contains math symbols like '-'.
Use INPgetNetTok for instance parameters
like it has been done for nodes already.
2024-02-02 11:15:14 +01:00
Holger Vogt 4d0e65b3b6 Extend the error message 2024-01-07 11:56:56 +01:00
Holger Vogt 45850c07dc Don't silently accept wrong user input (missing nodes, values).
Check for at leat 4 tokens (name, n1, n2, val/model/...).
If the instance has not been set up correctly, bail out, prevent crash.
2023-12-12 16:29:28 +01:00
Holger Vogt efdf332061 Prevent a crash if hash model table was not generated,
e.g. due to missing valid models.
2023-10-27 23:13:41 +02:00
Holger Vogt f26dda8616 Formatting 2023-10-18 17:44:56 +02:00
Holger Vogt 8ef0aece58 During setup of the models thre have been search scans in the
linked model list modtab. The time used here grows approx.
quadratically with the number of models. If the numbers get large,
e.g. with the IHP Open PDK, setup time make simulation impractical.
Therefore the linked list modtab has been enhanced by a hash table
modtabhash, which allows linear search time and makes simulation
of a 200k transistor circuit with IHP PDK possible. Already
the setup time for 15k transistor circuits has been reduced.
2023-10-18 14:34:16 +02:00
Holger Vogt 9702557f81 Evaluate function gauss() in B sources. This is required when
in .model files the tokens 'temper' and gauss() coexist, because
then the B Source function parser is applied.
2023-10-16 17:53:58 +02:00
Holger Vogt daa58f4125 Fix previous commit [acb7f2]
Allow frequency 0 Hz (make check will do agian).
2023-09-11 22:48:50 +02:00
Holger Vogt acb7f2cd97 Make .ac error messages more verbose, prevent some crash,
enable default values.
2023-09-11 17:42:38 +02:00
Holger Vogt dfeb0bdb4e Improve error message on obsolete dot command 2023-09-11 14:28:20 +02:00
Holger Vogt 64c29e667e Improve error message on unimplemented dot command 2023-09-11 12:02:59 +02:00
Holger Vogt bc41e48126 Change message from Circuit2 to Parse 2023-07-31 14:25:23 +02:00
Holger Vogt ba2842b55a Prevent a crash if p==NULL (due to buggy input) 2023-07-15 11:32:26 +02:00
Holger Vogt a28784d6d7 Prevent crash if *line == NULL 2023-07-15 11:26:52 +02:00
Holger Vogt c7ebb7aabb Error message up to now was strictly for command line interactive use only.
Improve error message when parsing .ac lines.
2023-07-15 11:20:41 +02:00
Holger Vogt 3bb9cd738f CIDER: Plug small memory leaks in INPparseNumMod() 2023-07-15 11:16:01 +02:00
Giles Atkinson 1fdf7dac51 Fix Bug #623 - "Parser warning for voltage source".
Do not warn when a single-element vector lacks parentheses.
2023-07-15 11:14:57 +02:00
Holger Vogt b24c613ce6 Safeguard against bad arguments (no crash upon NULL) 2023-05-27 10:49:19 +02:00
Holger Vogt b6e9ba20b9 Add another error qualifier to decribe the current policy
when a doubling token exists (or is created) in the netlist.
2023-05-27 10:43:40 +02:00
Holger Vogt 962d9d2998 Avoid user induced buffer overflows.
Check against NULL pointer.
2023-05-27 10:41:49 +02:00
Holger Vogt 4231ad3f5f Prevent reading from NULL when user input is something like .ic=v 2023-05-27 10:40:24 +02:00
Holger Vogt 3ff9643f49 Add a scale factor 'a' (atto, 1e-18) 2023-03-18 14:30:03 +01:00
Pascal Kuthe a7fced9327 ensure compilation succedes without OSDI 2022-12-27 14:09:52 +01:00
Pascal Kuthe 79b2d2d520 removed unneded changes 2022-12-27 14:09:22 +01:00
Holger Vogt e6265a3eed Move reference designator from A to N
replace inp2n by a copy of inp2a
OSDI is now called in case N: in inppas2
2022-12-27 14:03:18 +01:00
Pascal Kuthe acfaf023b3 prototype for Verilog-A integration using OSDI and OpenVAF
This initial prototype is capable of performing DC, transient and AC
analysis. Not all features of OSDI are supported yet and there are still
some open questions regarding ngspice integration. However many usecase
already work very well and a large amount of CMC models are supported.
The biggest missing feature right now is noise analysis.

test: test case for diode DC working with SH

test: add transient analysis to osdi_diode test

test: added docu text to osdi_diode test

test: added test case directories

fix: bug in osdi_load

test: small change to netlist

fix: implement DEVunsetup

fix: correct behaviour for MODEINITSMSIG

test: osdi diode enable all analysis modes

removed netlist

ignoring test results

added the build of the diode shared object to the python test script

deleting old stuff and always rebuilding the shared object

added diode_va.c to the repo

preparing CI

Create .gitlab-ci.yml file

(testing) add res, cap and multiple devices test

feat: use osdi command to load files

Previously OSDI shared object files were loaded from fixed directories.
This was unreliable, inconvenient and caused conflicts with XSPICE.

This commit remove the old loading mechanism and instead introduces the
`osdi` command that can load (a list of) osdi object files (like the
codemodel command for XSPICE). A typical usecase will use this as a
precommand in the netlist:

.control
pre_osdi foo.osdi
.endc

If the specified file is a relative path it is first resolved relative
to the parent directory of the netlist. If the osdi command is invoked
from the interactive prompt the file is resolved relative to the current
working directory instead.

This commit also moves osdi from the devices folder to the root src
folder like xspice. This better reflects the role of the code as users
may otherthwise (mistakenly) assume that osdi is just another
handwritten model.

test: update tests to new command

fix: do not ignore first parameter

feat: implement log message callback

fix: don't generate ddt matrix/rhs in DC sweep

fix: missing linker script

update to osdi 0.3

(testing) simplify test cases, fix bug

(testing) multiple devices test improvement

(testig) node collapsing bugfix

test: increase tolerance in tests

feat: update to newest OSDI header

fix: temperature update dt behaviour

fix: ignored models

fix: compilation script

fix: allow hicum/l2 to compile with older c++ compilers

fix: set required compiler flags for osdi

fix: disable x by default

fix: add missing SPICE functions

fix: update diode to latest ngspice version

feat: implement python CMC test runner

doc: Add README_OSDI.md

fix: make testing script work with python version before 3.9

fix: free of undefined local variable

fix: do not calculate time derivative during tran op

update osdi version

fixes for compilation on windows
2022-12-27 13:51:57 +01:00
Holger Vogt e28d3feee0 Remove unused variable debarr.
Add another example.
2022-12-11 15:39:10 +01:00
Holger Vogt 6c1be283a7 Add a function ddt (derivative versus time) to the B-source funtion parser. 2022-12-11 15:38:22 +01:00
Brian Taylor a0cf65ca1a Add B-source note 2022-12-11 15:33:24 +01:00
Holger Vogt f13aa89626 Add new functions for operators x**y or x^y
compatmode hs: x>0 pow(x, y), x<0 pow(x, round(y)), X=0 0
compatmode lt: x>0 pow(x, y), x<0 pow(x, y) if y is close to integer, else 0
2022-12-11 15:27:26 +01:00
Holger Vogt 6af73bc97f remove unused 2022-12-11 15:24:04 +01:00
Holger Vogt d77e36dc1b To find the nearest integer, use nearbyint(). trunc() has delivered
only one-sided answers.
2022-12-11 15:23:20 +01:00
Holger Vogt 47f2b7c6af AlmostEqualUlps setting has been too strict: it failed in MINGW gcc.
3 --> 10
2022-12-11 15:22:54 +01:00
Holger Vogt e2defea752 The derivative of pow shall use the new pow function as well,
when compat mode LT is selected.
2022-10-14 14:56:09 +02:00
Holger Vogt edab163192 If compatmode is lt, change the pow(x,y) and x**y functions:
If x < 0, output only if y is integer number, otherwise output 0
2022-10-14 13:50:37 +02:00
Holger Vogt 933b1fdb2b Add some comment 2022-10-14 13:50:20 +02:00