Commit Graph

1007 Commits

Author SHA1 Message Date
Holger Vogt ca4ddf6bbc Fix bug 642 by replacing strstr() by search_plain_identifier() 2023-08-17 17:18:18 +02:00
Holger Vogt 4432987919 Initialize to remove VS2022 linker warnings 2023-08-13 11:32:38 +02:00
Holger Vogt 0db8d3b956 Reemove needless code, check for '}0',
don't do anything here if not true m=something
2023-08-12 14:55:48 +02:00
Holger Vogt 2f369d5435 Remove gcc compiler warning: remove needless code 2023-08-12 14:19:29 +02:00
Holger Vogt aecf5cdcba Fix comment on old-style .lib 2023-08-04 20:11:39 +02:00
Holger Vogt 4246b31126 Revert "Marcel Hendrix's fix for Bug #324 -"
This reverts commit d3a8634afe.
2023-07-30 16:01:15 +02:00
Giles Atkinson d3a8634afe Marcel Hendrix's fix for Bug #324 -
Difference between file and line input for '];'
2023-07-29 09:30:51 +01:00
Holger Vogt c9548c10c9 Prevent crash when number of parameter dependencies increases beyond
limit. Raise the limit from 100 to 200.
2023-07-25 15:18:02 +02:00
Holger Vogt 5e73be130a Allow ';' also at the beginning of a line. 2023-06-04 14:53:38 +02:00
Holger Vogt a99caf504f No syntax check for title line 2023-06-04 14:36:27 +02:00
Holger Vogt 6dc09e6592 During syntax check: v,i sources need two nodes,
and prevent crash upon buggy ac input.
2023-06-04 14:01:44 +02:00
Holger Vogt 1ddb1f58b4 Bail out if {...} or '...' are missing around RHS of the equation.
(...) may be possible, elsewhere additional {} are put around,
so we have {(...)}.
2023-06-04 10:36:21 +02:00
Holger Vogt 10e86d72d3 Prevent crash upon buggy user input (missing ] or >) 2023-06-03 17:09:10 +02:00
Holger Vogt a03369fc12 Improve error message 2023-06-03 15:48:06 +02:00
Holger Vogt 981c63f1ab Add an extra model stitching for CIDER only.
This one fills in actualLine, which is use by
parsing the CIDER model parameters in INPparseNumMod()
from inpgmod.c
2023-06-02 15:31:28 +02:00
Giles Atkinson e61db1d2cd Add parsing and translation of the FREQ form of E-source devices,
integrated with the existing parsing of AND/NAND/OR/NOR forms (inpcom.c).
For the implementation, add a new analog XSPICE code model, xfer.
Add an example to examples/sp.
2023-05-31 16:04:51 +02:00
Holger Vogt b271b6d9e3 safeguard against crash upon buggy input 2023-05-17 09:32:23 +02:00
Holger Vogt dfb53459dc .libsave: don't save the command itself, improve messaging 2023-04-26 11:26:11 +02:00
Holger Vogt ff9ff26613 .libsave: Print to file the expanded library read by .lib 2023-04-26 11:26:04 +02:00
Holger Vogt 5bd0346b64 Line concatenation: use dstring instead of tprintf:
Parsing time of Skywater libs reduced by more than 35%.
2023-04-22 14:55:23 +02:00
dwarning 4fed4bafa1 few cleanings to prevent compiler warnings 2023-04-15 16:57:33 +02:00
Holger Vogt 217e0577b8 Shift all compatibility handlinmg from inpcom.c into its own source files
inpcompat.c and inpcompat.h
2023-04-08 15:24:00 +02:00
Giles Atkinson 5aa48cab0b Do not generate netlist lines that use non-existent libraries.
To support that, give global scope to  function inp_pathresolve()
in inpcom.c.  Update internal documentation (long comment).
2023-04-01 13:56:12 +02:00
Holger Vogt 062785319a When '.probe alli' is set, disable auto bridging and set a flag 2023-03-24 22:10:18 +01:00
Holger Vogt f121c433a7 Check for buggy diode instance line, avoid crash 2023-03-22 14:29:48 +01:00
Holger Vogt 86951501a7 Add eprvcd to the commands which set node names to lower case,
but not the file names after >
Does not work for manually entered eprvcd commands, where the user
has to provide lower case node names.
2023-03-19 15:24:27 +01:00
Holger Vogt 3996d27b29 Make code a little more efficient 2023-03-18 22:31:33 +01:00
Holger Vogt 7af6c4a661 Re-enable single line parameter lists, separated by commas 2023-03-18 22:31:27 +01:00
Holger Vogt e4202ea181 The tc for R, L, C may include an expression
like tc={expression} or tc={expression}, 1.3u or
tc={expression}, {expression2}
2023-03-18 14:37:53 +01:00
Holger Vogt e4601c16ee Not a warning but an error, stopping the simulation 2023-03-18 14:37:33 +01:00
Holger Vogt f32f3ac8cd Improve previous commit: A bad .model line leads to a breakup
of the simulation.
2023-03-18 14:37:26 +01:00
Holger Vogt c61acefef7 Prevent crash when a bad .model line is given, like
.model
.model xxx
2023-03-18 14:37:19 +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 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 712ed8ac77 Safeguard against stack overflow, when wrongly introduce a circular
parameter dependency
2023-02-03 11:33:36 +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 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
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
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 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
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
Pascal Kuthe 744002dc49 fix sigfault on older c compilers 2022-12-11 15:35:53 +01:00
Holger Vogt e967b31c94 Add a new compatibility mode xs (for XSPICE) 2022-12-11 15:32:30 +01:00
Holger Vogt 59413a7f71 Add error messages when controlled_exit is called:
No exit without message.
2022-12-11 15:29:47 +01:00
Giles Atkinson 9801d06795 Fix XSPICE's node prefix '~' when PSPICE compatability is used. 2022-10-14 13:52:17 +02:00