Holger Vogt
ace932e1b9
Patches provided by Carsten Schoenert: Misspellings, File access
2 years ago
Holger Vogt
f99a137eb3
Patch for snprintf provided by Marco Atzeri
2 years ago
Holger Vogt
d1abc8f6c7
typo
2 years ago
Giles Atkinson
ffcf3b24d9
Improve efficiency and irreversible CM support in EVTcall_hybrids() by
halting calls to code models as soon as the timestep is chenged.
This should have been included in 508fad0f55 .
2 years ago
Giles Atkinson
c18447f9f5
Add the support files for co-simulation with Verilog code
compiled by Verilator. Also add script files to Visual Studio builds
that are already installed by the Makefile builds.
2 years ago
Giles Atkinson
566e2938f4
Add XSPICE code model d_cosim, a generic adaptor for digital cosimulation.
2 years ago
Giles Atkinson
12fe7b90c4
Add new code model function cm_irreversible(). This may only be
called from an XSPICE code model's INIT call and has three effects:
the instance is treated as "hybrid" even when it does not use both
port types; its position in the hybrids array is adusted; and it
is explicitly notifed when called just befoore the end of an
analog time-step.
2 years ago
Giles Atkinson
34e6c4abea
Convert XSPICE's hybrid_index array to instance pointers.
That simplifies code and will be needed for irreversible code model support.
2 years ago
dwarning
2cf2693706
few code cleanings
2 years ago
Giles Atkinson
10386ee3e3
Commit [35d338]ngspice partly reverted commit 423f9a9db to fix deletion
of source files if make was accidentally used in the source tree.
That caused the original bug to return. Fix the problem by deleting
the generated source files by name (no such files exist in source.
Also make the generated files depend on cmpp, making 'make clean'
unnecessary after a chenge to cmpp.
2 years ago
dwarning
35d338f256
partly revert commit 423f9a9db - don't remove xspice/icm .c files
2 years ago
Brian Taylor
04c68d5f30
Cleanup child processes on Windows VisualC and Mingw. On Linux those processes quit when ngspice quits.
2 years ago
Brian Taylor
4219efb5d5
Make it explicit that null output ports are not allowed. The output port vector bounds are always >= 1.
2 years ago
Brian Taylor
c83d11c9c0
Call cm_cexit() to prevent the simulator running when d_process initialization errors occur.
2 years ago
Holger Vogt
21761207bc
Change license to 3-clause BSD (see
https://sourceforge.net/p/ngspice/ngspice/merge-requests/6/?limit=25#fd4f/73e6 )
2 years ago
Brian Taylor
09f070f582
Error handling improvements in cfunc.mod. Ensure that d_process.h wiil always respond to version and interface checks sent from sendheader. This is needed so that the pipe reads in sendheader do not cause Windows to hang when the interface version and in/out counts do not match. This hang was the cause of errors not being reported and the Windows gui hanging. Startup and header checks are now detected in cm_d_process, and the simulator will run but with runtime errors since a d_process model cannot be completely instantiated after initial errors. It would be good to find a means of gracefully halting the simulation run.
2 years ago
Brian Taylor
8c72a76844
Another attempt at clean up of error handling and reporting. It's OK on limux and cygwin, but Windows VisualC is being stubborn. I would prefer not to have to call exit(1) just for Windows, since then nothing is reported and the gui disappears in a puff of smoke. Even without the exit calls nothing gets reported with the Windows gui which will hang when there are errors detected by d_process.
2 years ago
Brian Taylor
4eae039779
Add modifications note.
2 years ago
Brian Taylor
4530cde8e2
Use Xspice cm_message_send to report errors rathen than printing to stderr and calling exit. When a d_process model has errors found in start(), sendheader(), and dprocess_exchangedata() these are reported, but if the model is run a SIGINT is raised. There must be a better way of stopping the simulator.
2 years ago
Brian Taylor
df28fabc42
Restore the deleted unused params to be backword compatible. Handle the case where the d_process instance has a null in vector, so that N_din is zero. This allows the model to be just a pattern generator. Add include to cmproto.h to avoid a forward ref. to an enum type.
2 years ago
Brian Taylor
307ba1985b
Remove unused reset_state param; do not allow null in and out, so there is at least 1 input and 1 output.
2 years ago
Brian Taylor
7820940be3
Remove the unused reset_delay param.
2 years ago
Brian Taylor
e762047fc2
Add array bounds check, fix typos.
2 years ago
Brian Taylor
022a340ddb
Fix VisualC and Mingw compiler warnings.
3 years ago
Brian Taylor
cccb4a1559
Add callback to free process memory.
3 years ago
Brian Taylor
33780055ee
Add MODIFICATIONS note, cleanup white space.
3 years ago
Brian Taylor
5c4352d02f
Add __MINGW64__ defines for builds on mingw with msys.
3 years ago
Brian Taylor
3bb6e86015
Add Windows Visual Studio support for the Isotel d_process xspice digital model. The Isotel mixedsim-master/examples/embedded/motorforce C code needs to have minor changes for _MSC_VER defines, and are not included with this commit. The changes relate to using #pragma pack(push, 1)...#pragma pack(pop) around some structs, and setting stdin/stdout in binary mode. It is doubtful that the cfunc.mod will compile on mingw or cygwin since I don't know if they support pipe/fork/exec/spawn calls. The code builds and runs on Windows, Linux, and MacOS. In the future, Giles Atkinson is looking at allowing Xspice models to load shared libraries (.dll, .so) which will avoid creating and communicating with an external program.
3 years ago
Holger Vogt
10d7297798
Add cm_cecit(). If the input file could not be opened, stop ngspice.
2 years ago
Holger Vogt
19ebfb1887
Add a code model function cm_exit(const int exitcode).
This function calls controlled_exit(exitcode) to shut
down gracefully.
2 years ago
Holger Vogt
7c3cb8169c
This is a re-write of the PWM generator.
It is modelled according to the new d_OSC by Giles Atkinson.
Here frequency is fixed and duty cycle is controlled by an
analog input.
3 years ago
Giles Atkinson
423f9a9db2
Fix a build bug for XSPICE: files generated for code models are
not removed when doing 'make clean' from release/src/xspice or above.
3 years ago
Giles Atkinson
62471ecede
Fix two bugs in cmpp: an unmatched right bracket in cfunc.mod
causes an infinite parsing loop (mod_yacc.y) and XSPICE macros
are replaced in string literals (mod_lex.l).
3 years ago
Holger Vogt
dbc5042263
Prevent a crash if port cntrl is set to NULL
3 years ago
Francesco Lannutti
fe89da2b2c
Getting rid of SPARSE for Initial Circuit Matrix creation. Now KLU is totally independent from SPARSE. This opens up the interface for other solvers as well
SPARSE can still used through '.options sparse', but it isn't possible to switch from KLU to SPARSE and viceversa at run-time
6 years ago
Francesco Lannutti
4c351f51bd
Moved the KLU binding structures to be property of the XSPICE connections, instead of XSPICE instances
6 years ago
Francesco Lannutti
534394c0bb
First attempt of KLU support for XSPICE
6 years ago
Holger Vogt
cb0e794907
Prevent buffer overflow, remove unused
3 years ago
Holger Vogt
de98e49956
Set brackets to remove gcc compiler warning
3 years ago
Giles Atkinson
ad02a7c47a
Remove duplicate definition of variable idp, as compiler may warn.
3 years ago
Holger Vogt
d173deea64
Activate callback, remove memory leak
3 years ago
Giles Atkinson
738881a014
Complete version of intertial delay for d_tristate. The State and
Strength members are treated independently and combined in the output.
3 years ago
Giles Atkinson
ee7250e11f
Fix a crash when trying to auto-bridge a real-valued event node
and improve an error message.
3 years ago
Holger Vogt
75ce3c95e3
eprvcd [-a] [-t timescale] node node ...
timescale is now given by minimum 1fs, maximum 1s.
3 years ago
Holger Vogt
7c0bbcd9b2
Remove vs2022 linker warning (ctx potentially uninitialized)
3 years ago
Holger Vogt
da3dda3269
replace exp10() by pow(10, ...),
exp10 not available in VS2022
3 years ago
Holger Vogt
dc5291fa91
fopen_with_path enable path search (directory of recent inputs or
NGSPICE_INPUT_DIR)
3 years ago
Giles Atkinson
4df2e69009
Fix Bug #629 - "XSPICE d_osc failures". The old code has been completely
replaced by a new design that is faster, more reliable and does not
usually insert analog breakpoints.
3 years ago
Giles Atkinson
4cc0ac846d
Add an option for parameters to the xfer code model to be provided
in a Touchstone-format file instead of as a model parameter.
The change to mif_inp2.c allows the "table" parameter to be omitted.
3 years ago
Giles Atkinson
84821a4cf5
Add support for including analog node changes in VCD file output,
and an option to explicitly set the VCD timestep. Correct the
output value for high-impedance nodes.
3 years ago