Commit Graph

2211 Commits

Author SHA1 Message Date
Pascal Kuthe d0bd945c00 slightly optimize predictor 2022-12-27 14:11:07 +01:00
Pascal Kuthe a7fced9327 ensure compilation succedes without OSDI 2022-12-27 14:09:52 +01:00
Pascal Kuthe 79b2d2d520 removed unneded changes 2022-12-27 14:09:22 +01:00
Holger Vogt e6265a3eed Move reference designator from A to N
replace inp2n by a copy of inp2a
OSDI is now called in case N: in inppas2
2022-12-27 14:03:18 +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 e28d3feee0 Remove unused variable debarr.
Add another example.
2022-12-11 15:39:10 +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 a0cf65ca1a Add B-source note 2022-12-11 15:33:24 +01:00
Holger Vogt 631ff35c34 The 8th parameter on a voltage or current source now is 'number of pulses'.
Previous usage had been PHASE, introduced by XSPICE, which has
been redundant to DELAY. PHASE is again available when compatibility flag
xs has been set.
2022-12-11 15:32:51 +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
Pascal Kuthe 75c2a3c621 calculate log frequency sweep such that start frequency and stop frequency are always exactly included 2022-12-11 15:29:19 +01:00
Pascal Kuthe c5d5da15ee fix: allow hicum/l2 to compile with older c++ compilers 2022-12-11 15:28:59 +01:00
Holger Vogt f13aa89626 Add new functions for operators x**y or x^y
compatmode hs: x>0 pow(x, y), x<0 pow(x, round(y)), X=0 0
compatmode lt: x>0 pow(x, y), x<0 pow(x, y) if y is close to integer, else 0
2022-12-11 15:27:26 +01:00
Holger Vogt 6af73bc97f remove unused 2022-12-11 15:24:04 +01:00
Holger Vogt d77e36dc1b To find the nearest integer, use nearbyint(). trunc() has delivered
only one-sided answers.
2022-12-11 15:23:20 +01:00
Holger Vogt 47f2b7c6af AlmostEqualUlps setting has been too strict: it failed in MINGW gcc.
3 --> 10
2022-12-11 15:22:54 +01:00
Holger Vogt 27ba1e39df Small correction to previous commit. 2022-10-17 16:47:51 +02:00
Holger Vogt 06d349ff06 Add a limit of 0.999 to bipolar parameters mje, mjc, and mjs.
The bipolar model is restricted to values < 1.
Fixes bug 583
2022-10-17 16:03:36 +02:00
Holger Vogt e2defea752 The derivative of pow shall use the new pow function as well,
when compat mode LT is selected.
2022-10-14 14:56:09 +02:00
Holger Vogt edab163192 If compatmode is lt, change the pow(x,y) and x**y functions:
If x < 0, output only if y is integer number, otherwise output 0
2022-10-14 13:50:37 +02:00
Holger Vogt 933b1fdb2b Add some comment 2022-10-14 13:50:20 +02:00
Holger Vogt 98763c0add Note: ix: dc value used for op instead of transient time=0 value
Former warning message or note only issued when dc value and
value at transient time=0 differ.
2022-10-08 16:45:38 +02:00
Holger Vogt 7483f6224d Note: vs: dc value used for op instead of transient time=0 value
Former warning message or note only issued when dc value and
value at transient time=0 differ.
2022-10-08 16:45:14 +02:00
Holger Vogt 07bb809158 Iterations for op or dc may start with arguments 0 for ln().
To cope with this, and potential overflow in exp function,
some limits have been added.
2022-10-07 13:19:22 +02:00
Holger Vogt 9e290a3461 tabs to spaces 2022-10-07 13:05:30 +02:00
Holger Vogt 8a097c020e Make error message more verbose: Instead of only "no such parameter on this device",
give name of bad parameter and respective line in netlist.
2022-10-07 13:05:10 +02:00
Holger Vogt d1cbcb080c Re-format cktdojob.c 2022-10-07 13:03:35 +02:00
Holger Vogt f073fb5c05 Consecutive tran and ac simulation may lead to gross errors
when TC or scale is used on the instance line of C and L.
Reason is the missing reset when CKTtemp is called once during each
simulation command. TC or scale is then applied again and again,
a reset is missing.

This patch adds a reset, i.e. the capacitance or inductance is
reset to its instance value in a call to *temp. It fixes bug#594.

Command 'alter' has been tested.

Resistance has not been tackled by this bug, because the line
here->RESconduct = here->RESm / (here->RESresist * factor * here->RESscale);
differs from
here->CAPcapac = here->CAPcapac * factor * here->CAPscale;
in that there is no accumulation of correction factors with here->RESconduct
2022-10-07 13:02:12 +02:00
Holger Vogt 564a3cb2f7 No error message when Optran returned 0 2022-10-07 12:40:49 +02:00
Holger Vogt d3a436b7dd re-format indmask.c 2022-10-07 12:39:49 +02:00
Holger Vogt 0387a95218 Add missing parameter retrival 2022-10-07 12:39:35 +02:00
Holger Vogt b4a2c85b54 Asl Lundin's correction only when suitable modelparameters are given. 2022-10-07 12:39:10 +02:00
Holger Vogt 879030bbd8 Add a warning when Lundin's correction factor is not
calculated because the geometries are too small (< 1um).
2022-10-07 11:37:55 +02:00
Holger Vogt 500d72f270 Add coil diameter dia to the inductor parameters.
dia (diameter) takes preference over csect (cross section)
2022-10-07 11:37:37 +02:00
Holger Vogt 79ef586fef Add Lundin's geometry correction to the
inductance formula
2022-10-07 11:37:13 +02:00
Holger Vogt 4a96691b49 Fix a bug in the inductance formula. 2022-10-07 11:36:50 +02:00
Holger Vogt f7c5c93635 Make error message more verbose:
State explicitely when transient op has failed.
2022-10-07 11:35:11 +02:00
Giles Atkinson aaa6798950 Fix bugs found while investigating Bug #585 (convergence failure only
on Linux).  In dctran.c make it impossible for a transient simulation
to run far past its end time and fix an infinite loop attempting to remove
the automatically-inserted ending breakpoint.  In outitf.c fix memory
corruption if the simulation does over-run (change suggested by Holger Vogt).
2022-10-07 11:32:02 +02:00
Holger Vogt e5c162f126 dc sweep fails after transient sim:
keep MODEDCTRANCURVE as provided by commit
7d8236766 ("b3ld.c, b4ld.c, b3v32ld.c: enable capacitance calculation during dc sweep", 2012-10-03)
Instead exclude current integration when MODEDCTRANCURVE is selected.
Unify setting ChargeComputationNeeded in b4vdld.c,
make it as in other b4xxld.c.
2022-10-07 11:31:06 +02:00
Holger Vogt 4c8324f166 VIN 3 0 PULSE (-1 1 2NS 2NS 2NS 50 NS 100 NS) is now standard
(missing dc value).
So revert the warning message:
VIN 3 0 dc 0 PULSE (-1 1 2NS 2NS 2NS 50 NS 100 NS) yields
a note message (not a warning)
2022-10-07 11:29:53 +02:00
Giles Atkinson daad3fb3c5 Fix memory leaks found by valgrind in the paranoia script. 2022-05-09 10:08:06 +02:00
dwarning 67508eab37 more logical setup for absurd parameter input 2022-05-09 10:07:05 +02:00
dwarning 720f29851a prevent crash for absurd parameter input 2022-05-09 10:06:55 +02:00
Holger Vogt cc285741f5 Don't use bitwise operators, but logic operators 2022-05-01 10:30:18 +02:00
Holger Vogt ff3580d70f Avoid circular redundant function declaration.
Include vsrcext.h only via vsrcdefs.h, so VSRCinstance is defined.
2022-05-01 10:30:12 +02:00
Holger Vogt cb17062344 Remove unused (preliminary) 2022-05-01 10:30:02 +02:00
Holger Vogt be4df00678 add some missing prototypes 2022-05-01 10:29:52 +02:00
dwarning d4f64da671 simplification of hicum2 model switches selfheat and nqs 2022-05-01 10:29:31 +02:00
dwarning 3d4d9b01d0 #bug 580: prevent crash in case of hicum2 default parameter set 2022-05-01 10:29:23 +02:00
dwarning 4038dd3a7f #bug 580: prevent crash in case of hicum2 default parameter set 2022-05-01 10:29:17 +02:00