Commit Graph

799 Commits

Author SHA1 Message Date
Holger Vogt 0ee5e3f32a Add a control language function cvector, to create a complex vector.
Let vec1 = cvector(50)
will generate a complex vector, with the real part values
increasing from 0 to 49, the imaginary values are set to 0.
Useful in ac loops to store result data.
2023-07-15 11:17:10 +02:00
Pascal Kuthe e5d1885e39 make accessible 2023-05-27 10:47:11 +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 d53acbed8e Add noise capability to XSPICE code models
Coded according to acan., AC analysis

MIF_NOI is not yet supported by any code model, so
MIF_AC is used (code models behave like in ac mode,
they are noiseless.
2023-04-02 15:06:28 +02:00
Holger Vogt 95c4c0f587 Add inertial.h to the distributable headers 2023-03-25 15:36:15 +01:00
Holger Vogt 311ddeac0d Prepare for ngspice-40 2023-03-24 22:27:12 +01:00
Giles Atkinson 240a2b9406 Add missed file inertial.h. 2023-03-22 14:28:23 +01:00
Giles Atkinson 2643e3b17f New code-model library functions cm_schedule_output() and cm_getvar().
To be used in the inertial delay code for digital code models.
2023-03-22 14:27:35 +01:00
Giles Atkinson c1659a64c3 Change output event setup in evtload.c so that, when making an event call
to a code model, there is no longer a reference to the value of the event
at the head of the free list.  That allows all such free lists (with the
same data type) to be combined, probably improving performance.
This is in preparation for full implementation of inertial delay for
digital nodes.
2023-03-22 14:27:19 +01:00
Holger Vogt 71571a1432 Add function atanh to .control section 2023-03-18 22:31:48 +01:00
Holger Vogt d4ee9af2e6 We are developing towards ngspice-40 2023-03-18 14:34:27 +01:00
Holger Vogt 5cb5d218c9 Remove the obsolete RETSIGTYPE, replace by void 2023-03-18 14:30:29 +01:00
Brian Taylor 56d0c72924 Add port directions when logicexp or pindly are present. 2023-02-01 17:39:37 +01:00
holger b3676bb763 enable make dist 2023-01-30 13:09:15 +01:00
Holger Vogt 167c708e69 Add searchpath for *.osdi relative to ngspice executable 2023-01-27 16:10:28 +01:00
Holger Vogt 71002aa42f Prepare for ngspice-39 2023-01-24 15:49:42 +01:00
Pascal Kuthe 5791a2d449 ensure config.h is always included in cktdefs.h to ensure correct
type signature
2022-12-27 14:10:16 +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 6c1be283a7 Add a function ddt (derivative versus time) to the B-source funtion parser. 2022-12-11 15:38:22 +01:00
Brian Taylor 7ff8f3773f Handle cases where logicexp has a timing model but no pindly. This is rare, only 22 tests from the digital libraries. Move digital examples, add missing .spiceint file. 2022-12-11 15:34:33 +01:00
Holger Vogt e967b31c94 Add a new compatibility mode xs (for XSPICE) 2022-12-11 15:32:30 +01:00
Holger Vogt 27fb6cd0a6 Allow resetting the limit for warning mesaages, when a new run is started. 2022-12-11 15:32:11 +01:00
Brian Taylor 62aab3885d Move f_logicexp, f_pindly calls to u_process_instance. Use u_add_instance to copy gate instances and models to the replacement cards. 2022-12-11 15:16:37 +01:00
Brian Taylor a54aa4d1f7 Initial logicexp parser and gate generator. 2022-12-11 15:16:02 +01:00
Holger Vogt f1165052ad We are developing towards ngspice-39 2022-11-06 11:23:17 +01:00
Holger Vogt 14f42f805d Add info on new function ngCM_Input_Path 2022-10-29 15:48:58 +02:00
Holger Vogt eb70d81dab Add function
char* ngCM_Input_Path(const char* path);
to shared  ngspice API
to send file path for code model input files (e.g. dsource).
Such path cannot be extracted automatically when netlist has
been sent by ngSpice_Circ
2022-10-28 14:12:53 +02:00
holger 7eafd48cc0 Add udevices.h to makefile.am for 'make dist' 2022-10-24 20:27:57 +02:00
Holger Vogt 7fa5c7ad87 Typo 2022-10-22 15:53:32 +02:00
Holger Vogt 5bc1660773 prepare ngspice-38 2022-10-16 16:59:34 +02:00
Giles Atkinson e80b724460 Add two functions to the Code Model Library: cm_get_node_name()
makes circuit node names available to diagnostics, while
cm_probe_node() is needed for a bidirectional A/D bridge.
2022-10-08 16:47:50 +02:00
Holger Vogt 4713cf0bf7 add parameter description 2022-10-08 16:43:16 +02:00
Giles Atkinson b1341c8e30 Insert XSPICE bridging devices automatically when an analogue node
has the same name as an XSPICE event node (including digital nodes).
The function Evtcheck_nodes() is replaced by a new version in its
own file.
2022-10-07 13:19:59 +02:00
Brian Taylor 2d9f86c742 Check for name collisions between nodes generated during translation from Pspice to Xspice and instance pin or subckt port names. These are reported as ERRRORs. 2022-10-07 13:14:35 +02:00
Holger Vogt 7f65a68ad6 Improve (a little) the plotting of digital data with plot option digiplot:
Repair scaling on MS Windows:
Suppress y axis lettering and unit:
Allow or dis-allow grid.
2022-10-07 13:05:56 +02:00
Holger Vogt 1329942865 Add a new function char* gettok_np(char** s)
which finds a token, while scanning over (), like
they were white spaces. It also proceeds with s while
still finding (), (which gettok_noparens does not do).
2022-10-07 13:00:44 +02:00
Brian Taylor 7f38ce4ebb Remove debug code. 2022-10-07 12:55:42 +02:00
Brian Taylor e38e1099b5 Create pin and port lists only when variable ps_pins_and_ports is set != 0. 2022-10-07 12:54:17 +02:00
Brian Taylor bc8d67d5fa Generate lists of subckt ports indicating direction (in, out, inout.) 2022-10-07 12:51:33 +02:00
Brian Taylor 96a1b528fd Replace Pspice U* and .model cards with their Xspice equivalent statements. There are still memory leaks which will be plugged next. The .subckts have only digital ports, which will need to addressed for mixed A/D designs. 2022-10-07 12:49:29 +02:00
Brian Taylor a2fd346b1a Trial run at scanning cards for Pspice U* devices and models. #define INTEGRATE_UDEVICES to turn it on. No new cards are created yet, just lots of debugging info. 2022-10-07 12:48:51 +02:00
Brian Taylor 620c15a981 Initial files for translating Pspice u.. instances and timing models into Xspice equivalents. Standard gates, tristate gates, dff, jkff, dlatch are supported. Compound gates and pullup/down are not done. Makefile and frontend/inpcom.c changes have not been finished. These modifications will be needed to complete integration. 2022-10-07 12:47:59 +02:00
Holger Vogt 0faf386d45 We developing towards ngspice-38
The intermediate stage is named 37+
2022-06-23 08:33:01 +02:00
holger 6d3f92cec6 add new header spardefs.h to noinst_HEADERS 2022-05-12 17:35:16 +02:00
Holger Vogt 303cf0c92b Prepare ngspice-37 2022-05-11 13:48:33 +02:00
Holger Vogt 0e46f6f8a1 remove numerous unsigned int vs. int warnings
by setting all variables to type int.
Remove redundant function declarations by remmoving some includes
in span.c and vsrcdefs.h
In tmalloc convert int to size_t
2022-05-01 10:29:08 +02:00
Holger Vogt 08a12b5355 Add a function itoa10 and use it
instead of non-standard itoa.
2022-04-26 10:36:10 +02:00
Holger Vogt 597bc9edd0 Remove a typo: runable --> runnable 2022-04-26 10:34:11 +02:00
Alessio Cacciatori 4ebf4901b9 S-parameters in ngspice
With this commit the patch provided by Alessio Cacchiatori the S-parameter is completed:
Noise simulation added with C matrix output
Y and Z matrix output enabled

To allow compiling with gcc, the dense.h inline functions have been put into denseinlines.h
2022-04-25 21:31:28 +02:00
Alessio Cacciatori 2c10c4aebd S parameter simulation
Command '.sp'
arbitrary number of ports
ports made with modified VSRC

Patch provided by Alessio Cacciatori
https://sourceforge.net/p/ngspice/discussion/127605/thread/7a2655c86f/
2022-02-17 15:48:00 +01:00