Holger Vogt
46696a6aaa
If function is not found, bail out if strict_errorhandling is set.
4 years ago
Holger Vogt
632f8c033d
Make numoparam error messages more user friendly.
Add line number of netlist to the message.
Original line number added to new lines in inpcom.c.
Internal error messages only when 'ngdebug' is set
4 years ago
Holger Vogt
945786fba7
Make PTcheck more verbose:
Send error message containing failed expression
5 years ago
Holger Vogt
e2cf397b6d
Restrict the limit for exp function (linear growth when exponent
is larger than 14, commit [93a76d]) to the PSPICE compatibility
mode.
5 years ago
Holger Vogt
fd79e4b5c4
Don't parse the B source instance parameters, thus prevent memory leaks.
5 years ago
Jim Monte
8d16e3e034
FALLTHROUGH
6 years ago
Holger Vogt
c7e9c3884e
pow(a,b) function derivative: special case also for a=const
with enhnaced efficiency
introduce TRACE and TRACE1 for debugging
6 years ago
Holger Vogt
93a76d8e21
add a limit exp(arg) to the exp function. If arg is larger
than 14 (arbitrarily selected), continue with linear response.
6 years ago
dwarning
3dd94ba15c
differentiate tan and tanh in safe way without cos and cosh
8 years ago
rlar
6ef2a5f81b
fix code to fit the derivation
9 years ago
rlar
e36ded8122
fix derivations in comments
9 years ago
rlar
f12ff5464e
inpptree.c, PTdifferentiate(), cleanup, use a #define
to express the expressions arguments more readable
9 years ago
Francesco Lannutti
ef0dcfe5f2
avoid bison dependency `version >= 2.7'
10 years ago
rlar
d0897fd0c4
src/spicelib/parser/inpptree.c, bug fix, B expression of kind `max(0,expr)'
identified and reported by Marcel Hendrix,
expressions of this kind could trigger a segmentation violation.
PTdifferentiate() roughly evaluates to
ternary_fcn(ge0(0-expr), 0, PTdifferentate(expr))
and mkb() optimizes
0 - expr --> unary_minus(expr)
IFeval() invokes PTeval() for the derivative too,
PTeval() looks at the incorrect tree->funcnum
and tries to PTeval for a second argument which is not there,
(unary_minus does not have a second argument)
causing a segmentation fault.
10 years ago
rlar
36aa107c0e
src/spicelib/parser/inpptree.c, avoid warning, drop nested local `arg1' ...
10 years ago
rlar
45117c94fd
drop yyparse() prototypes, require bison >= 2.7 which emits them
11 years ago
rlar
1c6efd9481
polish bison/flex makefile rules
11 years ago
rlar
f4472f788e
spicelib/parser/inpptree.c, bug fix, "#287 Shared library crashes on using non existing functions "
"remcirc" has the potential to invoke INPfreeTree() with a NULL IFparseTree
Thanks to Craggan, who reported this in:
http://sourceforge.net/p/ngspice/bugs/287/
11 years ago
rlar
788a5e5fa0
inpptree parser, bug fix, segfault due to usage of an unknown function
for example:
B1 1 0 V = {log(2.0, 1.3) + nosuchthing(2.0, 1.3)}
11 years ago
rlar
9e72296e40
src/spicelib/parse, implement `nint()' (`B' language)
12 years ago
rlar
2602a492b2
fix `log' in `B' and in `.control', to base e instead of 10
In the B language this can be considered a bug fix.
In the .control language this is a severe change
and breaks backwards compatibility.
In all three languages 'numparam' 'B' and '.control' we now have
ln to the base e
log to the base e
log10 to the base 10
Thus log and log10 is now consistent
with the vast majority of programming languages.
ln is merely for convenience.
very few other languages have it.
I'd like to discourage its usage.
12 years ago
rlar
abfd38b535
B language, introduce `log10'
12 years ago
rlar
bdf70bd2b0
cleanup, rename PTln --> PTlog, PTF_LN --> PTF_LOG (`B' language)
12 years ago
rlar
93a212ca3c
cleanup, rename PTlog --> PTlog10, PTF_LOG --> PTF_LOG10 (`B' language)
12 years ago
rlar
aa7a7606c7
avoid multiple declarations of controlled_exit(), add 'noreturn' attribute
13 years ago
dwarning
2dcea6d7c1
parser/*.c: correct the `pwr' derivative
13 years ago
dwarning
91ab0a3c74
parser/*.c: implement a signed power function `pwr' for controlled sources
13 years ago
dwarning
b9a954df60
inpptree.c, ptfuncs.c: whitespace cleanup
13 years ago
h_vogt
1b4c17a464
rename spicelib/parser/inp.h to inpxx.h
since we have another "inp.h" in src/frontend
13 years ago
h_vogt
b85f6bbc7d
controlled_exit() instead of exit()
14 years ago
h_vogt
0a087a47c8
enable B source debugging in behavioral models, exit on error if variable strict_errorhandling is set
14 years ago
rlar
58b0614467
fix memory leaks in ASRC and in INPgetTree()
implement a reference counter `usecnt' for the elements
of the `INPparseTree'
14 years ago
rlar
4fb75fbd51
INPgetTree(), express the live range of some globals
14 years ago
rlar
d21b3a3cd5
mkfnode(), minor rewrite
14 years ago
rlar
7641450b29
inpptree.c, fix differentiation of PTF_FLOOR PTF_CEIL and PTF_POW
14 years ago
rlar
3bb2bd8e05
fix memory leak in PTparse()
14 years ago
rlar
9a75774e36
inpptree.c, polish comments
14 years ago
rlar
42653f7c3d
inpptree.c, fix premature memory allocation
14 years ago
rlar
6ea91d2834
upgrade INPgetTree()
14 years ago
rlar
d5f6bcbedf
drop some more casts
14 years ago
rlar
f285dd0aa8
use strchr() instead of index()
14 years ago
h_vogt
75767fcc3d
floor(), ceil() added
14 years ago
rlar
10346e055c
#1/4 #include <ngspice/...> --> #include "ngspice/..."
14 years ago
rlar
c139875468
bug fix, allow special nodenames "/Node" and "Node-4" in `B' expressions
15 years ago
rlar
d26015586c
#1/7 use a subdirectory "ngspice" for includes to create a uniq namespace
15 years ago
rlar
9e86e5ca66
rewrite (double)literal --> floating-point-literal
15 years ago
rlar
21a31ab2c2
tiny rewrite, make use of strtolower() and strtoupper()
16 years ago
rlar
6b5debfc1e
use `NUMELEMS' and add some `(int)' casts
16 years ago
rlar
01566f2b49
add casts to make `int' versus `size_t' conversions explicit
16 years ago
rlar
7b3960506f
wrap tmalloc MALLOC etc, into two macros TMALLOC and TREALLOC
16 years ago