Commit Graph

637 Commits

Author SHA1 Message Date
Brian Taylor daf2d8e4e6 Fix some more -Wextra warnings.
Fix to inpcom.c removed by HVO
2025-06-13 00:11:09 +02:00
Holger Vogt 5d4bb23e3c Re-enable compilation with MS Visual Studio, as "ngspice/config.h"
is not available.
Add-on to commit
4881b2973 ("Fix Bug #772 - "ngspice + icarus verilog cosim: searches for ivlng.so                 in /usr/local/lib/ngspice ...". Use the configured library directory, NGSPICELIBDIR.", 2025-04-11)
2025-04-29 11:50:09 +02:00
Giles Atkinson 0a224fa704 Fix typo in vlnggen error message. 2025-04-29 11:37:48 +02:00
Giles Atkinson 4881b29730 Fix Bug #772 - "ngspice + icarus verilog cosim: searches for ivlng.so
in /usr/local/lib/ngspice ...".
Use the configured library directory, NGSPICELIBDIR.
2025-04-29 11:37:34 +02:00
Giles Atkinson 31e0c8e6cf Add two new functions to the shared library API.
ngSpice_Raw_Evt() requests a callback that returns all the
XSPICE events for a specific node that occurred during the last timestep.
ngSpice_Decode_Evt() provides numeric and string versions of
the event data.  Also fix some warnings in sharedspice.c.
2025-04-12 18:20:19 +02:00
Giles Atkinson 1d435daed7 Support use of XSPICE event nodes with iplot.
In graf.c, local function set() is renamed setflag() to avoid conflict
with a newly-visible global function with the same name.
2025-04-12 18:20:19 +02:00
Giles Atkinson db39671ae2 Do not strip event value member names (like "digital_node(strength")
from the name when creating a vector from event node history.
2025-04-12 18:20:19 +02:00
Giles Atkinson 33f206b916 Add two new XSPICE functions: EVTnew_value_call() and
EVTcancel_value_call().  EVTnew_value_call() specifies a function
to be called for each confirmed new value produced on an XSPICE
event node.  To be used to add event node support for iplot.
2025-04-12 18:20:19 +02:00
Brian Taylor 4bc4f7a0d0 Fix memory leak of parm when there is a closing ). 2025-02-20 23:33:39 +01:00
Giles Atkinson 61206e3aa7 The VPI module path should be first in the lib_args parameter. 2025-02-08 18:09:37 +00:00
Giles Atkinson 44cfd67a95 Fix an infinite loop with "eprvcd -a" and a misleading comment.
The command now works without any event nodes.
2025-02-08 18:05:03 +00:00
Giles Atkinson af9b2bd539 Code to suppress a spurious warning of a non-existent parameter,
missed from e858ca9465.
2025-02-08 15:28:20 +00:00
Giles Atkinson 8ad585a8e0 Do not link with the libraries needed for Ngspice itself. 2025-02-07 13:01:03 +01:00
Giles Atkinson 63eb332436 Add co-simulation with VHDL, using the GHDL compiler and d_cosim. 2025-01-30 09:45:35 +00:00
Giles Atkinson da8e237e11 Add .dylib file extension and improve some messages in d_cosim.
On Macos, the command "ghdl -e -shared ..." creates .dylib files.
2025-01-29 10:18:41 +00:00
Giles Atkinson e858ca9465 When parsing a XSPICE string-valued model parameter, break only
on a closing quote, string end or white space (if unquoted) and
unquoted ']' when parsing an array.  That allows generic value overrides
for GHDL models to pass through: "-gVar=value".  Previously, the string
was terminated on '='.  Also remove some dead and non-functional code.
2025-01-27 07:28:52 +00:00
Giles Atkinson 350147a231 Improve checking of XSPICE model parameters and tidy code.
Checking for null values moves from per-instance code to
per-device code, potentially removing duplicate error messages.
Limits on parameter values and sizes of array parameters that are
specified in the IFS files are now actually checked.
2025-01-27 07:28:52 +00:00
Giles Atkinson 24425315f8 Allow out-of-tree builds. Problem reported by Carsten Schönert. 2025-01-08 19:54:52 +01:00
Holger 114bda2941 Add missing backslash 2024-12-27 17:31:01 +01:00
Holger Vogt 6730474067 Make verilog/libvvp.def verilog/MSVC.CMD verilog/README.txt distributable 2024-12-27 17:11:12 +01:00
Holger 3fa09bd3cf Add missing header files to enable their distribution 2024-12-27 16:20:08 +01:00
Brian Taylor a841a66ee1 d_process needs to strip || at the end of the process_file string when using PSpice compat mode. The failure was found by @slh on the KiCad forum. 2024-12-15 22:12:17 +01:00
Holger Vogt deb3cd9809 Replace all BOOLEAN, BOOL, _Bool by bool
Remove all #undef bool (set in conjunction with #iclude <Windows.h>)
2024-12-15 10:25:28 +01:00
Giles Atkinson 932ef50cc3 Improve two error messages: in d_cosim, report the filename given,
not the last one tried; and report attempted use of iplot or
tclplot in batch mode only once.
2024-12-06 22:50:37 +01:00
Giles Atkinson 721aab9624 Fix a bug reported by Tom Hajjar with title "XSPICE d_osc usage" in
Help, 2024/12/5.  Also correct the timing of the request for the next
call and modify a constant to make the method more robust.  To support
the main change, cm_analog_set_temp_bkpt() now reports when a breakpoint
request is ignored, and T(x) values are set before an EVENT call.
2024-12-06 22:50:25 +01:00
Holger Vogt 68228ca33f Improve comments 2024-12-06 22:49:55 +01:00
Holger Vogt 660b183ad0 Revise check for '.probe alli' and event nodes:
Bail out, don't run any sim, don't change variable
'auto_bridge'.
2024-12-06 22:49:40 +01:00
Giles Atkinson 5980869040 Apply Patch #119 -
"Fix buffer overflow in src/xspice/icm/digital/d_state/cfunc.mod".
The change is not identical to the supplied patch. It was slightly
modified to make the original code more sane.
Found and patched by Artem Sinkevich.
2024-12-06 22:44:36 +01:00
Holger Vogt b350786c48 Some cosmetics 2024-11-02 22:40:54 +01:00
Holger Vogt bafa3ff8a3 Revert the sign of ac_gain.real
Fix bug no 697, reported by Matthieu Guerquin-Kern
2024-11-02 22:40:43 +01:00
Giles Atkinson 14844af175 Fix #686: "XSpice Verilog Vector Input Bug".
Bug report and fix by Aodhan Murray.
2024-11-02 22:34:23 +01:00
Holger Vogt 4a1698c22d enable compiling with CYGWIN 2024-11-02 22:31:13 +01:00
Giles Atkinson f4c7202130 Fix gcc warnings. 2024-11-02 22:30:45 +01:00
Giles Atkinson 64a9a0bfbc Add a utility function to the d_cosim code model to open dynamic
libraries. It automatically tries adding standard file extensions,
so that model lines for d_cosim can be the same for all OSs.
2024-11-02 22:30:15 +01:00
Giles Atkinson ce1ecca15e Add support for including Verilog simulation within an instance
of the d_cosim codemodel, using libvvp, the simulation runtime of
Icarus Verilog.  This complements the existing method using Verilator.
The new source code is built into two binary shared libraries,
ivlng.so (or .DLL) and ivlng.vpi that are loaded during simulation.
2024-11-02 22:30:07 +01:00
Giles Atkinson 693a9df09f Add support for Verilator's --timing option, allowing use of delays
in Verilog source code.  Also add two parameters to d_cosim:
sim_args is used to pass string arguments to a Verilator simulation;
and lib_args is for future use.  In vlnggen, also check for two causes
of failure: a verilator error may lead to creation of interfering header
files; and misleading instances of verilated_shim.cpp can cause an obscure
failure (reported by Diarmuid Collins).
Use a generic name for the generated DLL in MSVC.CMD.
2024-11-02 22:29:54 +01:00
Giles Atkinson 4173d0e220 Allow trailing null connections to be omitted from XSPICE device
lines.  Also tidy some code,
2024-11-02 22:29:34 +01:00
Giles Atkinson 98076281c6 Changes to d_cosim to work with initial support for Icarus Verilog.
Fully resolve symbols on loading and tolerate attempts to set
output in the past.
2024-11-02 22:29:19 +01:00
Holger Vogt fd72c3ce3e Bail out when state file is not found. 2024-11-02 22:26:53 +01:00
Brian Taylor d01868b725 Cleanup gcc compiler warnings. 2024-06-22 14:23:50 +02:00
Holger Vogt 63d496b564 New parameter char *linesource for fcn insert_new_line
Make Fcn inp_read in inpcom.c static
2024-05-14 16:29:51 +02:00
Holger Vogt 2d8fe0362f Allow delay of 0, as requested by Infineon model of the 2EDNY52X 2024-05-14 16:29:07 +02:00
Holger Vogt e151b691fb Add an additional funtion parameter 'filename' to fcn inp_readall
to transfer not only the folder, but also the file name of the
current input
2024-05-14 16:28:40 +02:00
Giles Atkinson 9f0e44cace Fix an error in cfbe1afa21 that causes a crash in d_cosim. 2024-05-01 10:55:10 +02:00
Holger Vogt 2bee691717 correct the link to the license text. 2024-05-01 10:31:58 +02:00
Giles Atkinson 5f59d76a03 Suppress some warnings from MSVC. 2024-05-01 10:31:25 +02:00
Giles Atkinson 6ce627e6f8 Tidy d_process/ifspec.ifs so that it works after changes in
mif_inp2.c and writ_ifs.c to enforce "Null_Allowed".
2024-05-01 10:31:15 +02:00
Giles Atkinson 27eda59034 Make the 'Null_Allowed' option for XSPICE code model parameters
behave as reasonably expected and as described in the manual.
Previously a missing (null) value was always accepted if the ifsspec.ifs
file contained a default value, and several of the the included
code models worked that way.  Where there was a useful default,
"no" has channged to "yes".  Some models with a look-up table defined
by two parameters had such defaults that did nothing useful. Thay have
been given useful vector defaults.  These changes should not affect
previously-working netlists.
2024-05-01 10:31:07 +02:00
Giles Atkinson 7dd2db904c Change CMPP-related struct Mif_Parse_Value to a union
as C99 allows initialisation of any member.  Also correct a comment
in miftypes.h.
2024-05-01 10:30:48 +02:00
Giles Atkinson 0152ea92db Support use of vector defaults for XSPICE vector parameters.
This answers Feature Request 60 - "Array as default value for parameter".
2024-05-01 10:30:40 +02:00