Commit Graph

3613 Commits

Author SHA1 Message Date
Brian Taylor 4b30113f60 Check current_subckt is set when printing TRANS_OUT. 2023-03-18 14:36:00 +01:00
Holger Vogt 8915d42241 Prevent crash during .probe p(...) when no subcircuits are given. 2023-03-18 14:35:33 +01:00
Holger Vogt 5ee7a0ad2d prevent crash when defect .model line is given
(no model name or no model type)
2023-03-18 14:35:11 +01:00
Holger Vogt d2fb3fb16b Prevent memory leak.
Remove use controls.
Safeguard against NULL.
2023-03-18 14:34:57 +01:00
Giles Atkinson 79fcb5d4bd Fix plotting bug reported by Robert Turnbull: ngspice-devel 2023-02-10. 2023-03-18 14:34:50 +01:00
Giles Atkinson 2233e2f825 Fix Bug #624 - "Destroy All Fails with an Open Plot Window" for X11.
Move XftDrawDestroy() call to a point where the window still exists.
2023-03-18 14:34:20 +01:00
Holger Vogt 75f9451702 Fix bug 624 also for MS Windows
by moving DestroyGraph() from WM_CLOSE to RemoveWindow()
2023-03-18 14:33:51 +01:00
Giles Atkinson d9b52eb3e1 Fix a bug reported by Thomas Hoffmann in ngspice-users discussion,
2023-02-18.  Incorrect tests were used to detect a crossing in the
first two data samples.
2023-03-18 14:33:13 +01:00
Giles Atkinson dbb5219dc7 Fix a crash reported by Thomas Hoffmann when using the "TARG AT=xxxx"
variant of "measure", General Form 1.
2023-03-18 14:32:46 +01:00
Brian Taylor 8dd16feee4 Use dstrings where fixed size char buffers should not have been used. 2023-03-18 14:32:31 +01:00
Brian Taylor 3365fd4309 Remove dead code. 2023-03-18 14:32:19 +01:00
Holger Vogt 50173ac617 Enable potential calls to tprint() for debugging 2023-03-18 14:32:04 +01:00
dwarning bccaee4821 correct fft dc scaling bug #620 2023-03-18 14:31:24 +01:00
Holger Vogt 9c6fe3f8e4 Definitely exclude A devices from power probing (and others with less than 2 pins). 2023-03-18 14:31:05 +01:00
Holger Vogt 5cb5d218c9 Remove the obsolete RETSIGTYPE, replace by void 2023-03-18 14:30:29 +01:00
Holger Vogt 3ff9643f49 Add a scale factor 'a' (atto, 1e-18) 2023-03-18 14:30:03 +01:00
Holger Vogt 4309bad14d Set the recounter to 0 upon every exit from function inp_get_param_level 2023-02-03 18:50:55 +01:00
Holger Vogt 33a3557910 Safeguard against NULL pointers 2023-02-03 11:44:57 +01:00
Holger Vogt 712ed8ac77 Safeguard against stack overflow, when wrongly introduce a circular
parameter dependency
2023-02-03 11:33:36 +01:00
Holger Vogt 20711c1c25 Safeguard against NULL pointers 2023-02-01 22:35:01 +01:00
Brian Taylor 56d0c72924 Add port directions when logicexp or pindly are present. 2023-02-01 17:39:37 +01:00
Brian Taylor 9c9301eca8 Remove delay ifdefs. 2023-02-01 17:38:28 +01:00
Brian Taylor f674b64264 Remove dead code from previous commit. 2023-02-01 17:37:36 +01:00
Brian Taylor f570b04d6c For unspecified gate delays (logic and tristate gates), which PSpice would consider as zero, set the rise and fall delays to 1.e-12s (the minimum for Xspice). For dff, jkff, dlatch, and srlatch use the Xspice default 1.0ns for rise and fall delays. If the ngspice variable (ps_port_directions & 2) is true, write the translated subckt to stdout, with TRANS_OUT prefix, for debugging purposes. The user could edit and replace the translated subckt if desired. 2023-02-01 17:36:36 +01:00
holger b3676bb763 enable make dist 2023-01-30 13:09:15 +01:00
Holger Vogt 4b8d575122 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.
2023-01-27 16:12:42 +01:00
Holger Vogt 49b7cb85db Add a shunt resistor of 1e15 Ohms to any X (subcircuit call) line
when the node name contain 'unconnected' and .probe alli is called.
2023-01-15 13:38:15 +01:00
Brian Taylor dcfe4e7134 ERROR messages should be printed to stderr. 2023-01-15 13:37:42 +01:00
Brian Taylor a76f8d5149 Fix some comments. 2023-01-09 16:33:25 +01:00
Holger Vogt ebd430e51b A preliminary fix to bug report 612
Don't set series voltage sources when flag probe_alli_nox
is set in .spiceinit
2023-01-09 16:32:00 +01:00
Holger Vogt 1a4880344f Update to fcn tprint:
allow multiple printouts in a single simulation run,
without overwriting the previous printout.
2023-01-09 16:31:44 +01:00
Holger Vogt 164ed05786 enable 'off', 'print', 'save' being part of a node name.
Only plain 'off' (case of bipolar), or 'print', 'save'
(in case of CIDER) will not be allowed.
2023-01-09 16:31:15 +01:00
Brian Taylor 6117836d01 Ensure that amatch output is not binary data. 2023-01-09 16:30:22 +01:00
Brian Taylor 90ec717f3b Add variable ps_udevice_exit. If set non-zero, ngspice will exit if there is an error processing f_logicexp or f_pindly. 2023-01-09 16:29:24 +01:00
Brian Taylor 5e6452099e Return errors from f_logicexp and f_pindly without calling exit. 2023-01-09 16:29:08 +01:00
Brian Taylor 0a3cdf8e3a Add more error checks for f_logicexp and f_pindly. 2023-01-09 16:28:43 +01:00
Giles Atkinson 301f50335d Add limited support for string-valued parameters in .param lines.
The right-hand side of an assignment may be a string expression
made up from quoted strings, and identifiers for other string parameters,
optionally in braces.  There may be no un-quoted spaces.
Example: .param str4=str1"String 4"str2{str3}

Subcircuits may have default and actual string parameters, but the values
must be single identifiers, not quoted strings or string expressions.
2023-01-09 16:26:59 +01:00
Brian Taylor fe52771aff Remove the old inverter code. 2022-12-27 14:21:05 +01:00
Brian Taylor 3578deda80 Refactor new_gen_output_models. 2022-12-27 14:20:43 +01:00
Holger Vogt 199b9deee6 For OSDI n devices: Enable model translation,
if model has been inside subcircuit.
2022-12-27 14:19:37 +01:00
Pascal Kuthe 79b2d2d520 removed unneded changes 2022-12-27 14:09:22 +01:00
Holger Vogt a4d13dae24 Suppress model type warning when device is of type N. 2022-12-27 14:04:56 +01:00
Holger Vogt 8f0eab90ee Replace 'a' by 'n' for OSDI device 2022-12-27 14:03:39 +01:00
Holger Vogt a95b114768 Revert previous commit: now treat a devices like ordinary devices. 2022-12-27 13:59:42 +01:00
Holger Vogt d8eb685fcc Preliminary fix to get_number_terminals:
check for tokens with '=' to stop and get number of nodes by
stepping back.
2022-12-27 13:59:20 +01:00
Holger Vogt 6ece9b5748 Exclude XSPICE specific error message.
Don't call fcn get_adevice_model_name().

Return a fixed value (5) for number of nodes:
This is wrong. It has to be replaced by a safe
method to figure out the number of terminals for
varying Verilog-A device models.
2022-12-27 13:57:20 +01:00
Holger Vogt 638ddbc91f Add case 'a' to fcn translate.
This is a hack, to be removed/altered when switching to
reference designator N instead of A.
2022-12-27 13:56:50 +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
Brian Taylor 0805856fb7 Distinguish between set/reset delays when possible. 2022-12-19 12:43:00 +01:00
Brian Taylor 253df17949 Make it optional to use zl/zh/lz/hz delays for utgate. 2022-12-19 12:42:36 +01:00