rlar
9ddd1d7d40
fix commit: inp2q.c, #18/23, rewrite, combine two 'for' loop's
which replaced a INPgetNetTok() by INPgetTok()
causing a bug when handling special node names
for example this case
q1 /c /c 0 npnmodel
9 years ago
rlar
b2621174d3
inpgmod.c, plug a memory hole
Reported and fixed by Marek Bielik in message:
Subject: [Ngspice-devel] Memory leaks fix
Date: Tue, 18 Apr 2017 16:16:21 +0000
9 years ago
h_vogt
7489a37973
inpgval.c, inpdpar.c, beautify the code
9 years ago
h_vogt
fa6e21dd3a
inpgval.c, INPgetValue(), use INPgetNetTok() instead of INPgetTok()
To fix a bug reported by Clyde Shappee in
Subject: Problem with pole zero analysis and net names
https://sourceforge.net/p/ngspice/discussion/127605/thread/14338e7e/
When using node names with a leading slash '/'
on the "pz" analysis command line.
9 years ago
rlar
c6896cf338
accept .para shortcut for .param
9 years ago
rlar
f12ff5464e
inpptree.c, PTdifferentiate(), cleanup, use a #define
to express the expressions arguments more readable
9 years ago
mhx
efb8214945
fix spelling, "too much" versus "too many"
9 years ago
rlar
889aaebfd7
inp2m.c, #7/7, whitepace cleanup
9 years ago
rlar
576e522d38
inp2m.c, #6/7, reorder code
9 years ago
rlar
73e76fd88a
inp2m.c, #5/7, drop nname[]
9 years ago
rlar
74145c53a6
inp2m.c, #4/7, move code up into the for loop
9 years ago
rlar
5a95487ad7
inp2m.c, #3/7, simpify, move code down into the for loop
9 years ago
rlar
788c8f7067
inp2m.c, #2/7, simplify, move code down into for loop
9 years ago
rlar
bef3fd1dd5
inp2m.c, #1/7, insist on a valid model, don't default to something
Emit an error message when unable to identify a valid modelname token.
If a default model is needed, then create one explicitly:
m1 1 2 3 4 mosdefault
.model mosdefault mos1()
9 years ago
rlar
80ef8b308d
inp2m.c, do not restrict binning to four nodes
until now, for unknown reasons,
the search for binned modelnames was restricted to
instances with less than five nodes.
9 years ago
rlar
50c0424225
inp2q.c, inp2m.c, plug a memory leak
9 years ago
rlar
3ea412e7cd
bug fix for commit "inp2q.c, #17/23, rewrite, using a 'for' loop"
9 years ago
rlar
ba6955a1aa
inp2q.c, sanitise optional ports processing
Tie ports 4 and up to ground, iff not connected.
Actually, I think the model's DEVsetup routine should do this business,
we should pass -1 to denote the fact of being unconnected
9 years ago
rlar
3ce3424a9c
inp2q.c, #23/23, whitespace
9 years ago
rlar
9ad1a3033b
inp2q.c, #22/23, drop #ifdef, model_numnodes() does care about this
9 years ago
rlar
ac77e5b020
inp2q.c, #21/23, drop nname[] and model, use local 'token' instead
9 years ago
rlar
25fa9a4454
inp2q.c, #20/23, insist on a valid model, don't default to something
If a default model is needed, then create one explicitly:
q1 1 2 3 npndefault
.model npndefault npn()
Note:
This code was buggy anyway because the last token,
which turned out not to be a valid model name,
was silently swallowed.
Thus PARSECALL() didn't parse the whole thing.
9 years ago
rlar
b85a07c62c
inp2q.c, #19/23, rewrite, move code into the 'for' loop
9 years ago
rlar
b1ccdd2184
inp2q.c, #18/23, rewrite, combine two 'for' loop's
9 years ago
rlar
807115c145
inp2q.c, #17/23, rewrite, using a 'for' loop
9 years ago
rlar
03d3e2ea12
inp2q.c, #16/23, emit a message and give up, if we couldn't find the modelname token
Thats a functional change of ngspice.
So far we did cook up a "default" model when we didn't find a model token.
But this was buggy anyway, because in such cases we silently dropped
a token from beeing processed by PARSECALL()
Now, we emit a message, and skip this line alltogether.
9 years ago
rlar
83fb9353ef
inp2q.c, #15/23, rewrite, fall into an empty 'else' body when !ADMS
9 years ago
rlar
0bf0021a63
inp2q.c, #14/23, rewrite, assign model a bit later when recognised
9 years ago
rlar
ef37e92338
inp2q.c, #13/23, move code down
9 years ago
rlar
d2d9bffed0
inp2q.c, #12/23, move code down
Note; here i==4 and nodeflag still was 4
9 years ago
rlar
c8b1d18289
inp2q.c, #11/23, move code down
Note: here i==3 and nodeflag==4
9 years ago
rlar
c5ce68728f
inp2q.c, #10/23, use i to prepare for a loop
9 years ago
rlar
a21a2fd1b0
inp2q.c, #9/23, drop some TRACE code
9 years ago
rlar
16c00730e4
inp2q.c, #8/23, use a 'for' loop
Note: the range of nodeflag still is {4,5}
9 years ago
rlar
ffc943dfff
inp2q.c, #7/23, use an array
9 years ago
rlar
c82a9dd87e
inp2q.c, #6/23, transform boolean expression
Note: both values range over {4,5}
Thus, this is a functional invariant transformation
9 years ago
rlar
27d93293f9
inp2q.c, #5/23, rewrite using a new function model_numnodes()
9 years ago
rlar
b0fe181f12
inp2q.c, #4/23, transform boolean expression
9 years ago
rlar
042916ae88
inp2q.c, #3/23, renumber 'nodeflag'
range over {4,5} instead of {0,1}
9 years ago
rlar
9abcaa88ae
inp2q.c, #2/23, parenthesises and linewrap
9 years ago
rlar
c37ce079eb
inp2q.c, #1/23, rewrite, early 'exit' and 'return'
9 years ago
rlar
40ca7d6db3
inp2m.c, #9/9c, cleanup
9 years ago
rlar
eecd940af8
inp2m.c, #8/9c, drop valid_numnodes()
9 years ago
rlar
6edd684020
inp2m.c, #7/9c, rewrite valid_numnodes() using model_numnodes()
9 years ago
rlar
09fbc0ee97
inp2m.c, #6/9c, now fix model_numnodes()
to prevent instance struct storage beeing overwritten.
9 years ago
rlar
54f6bd8d56
inp2m.c, #5/9c, rewrite
9 years ago
rlar
01b75e08ab
inp2m.c, #4/9c, rewrite using model_numnodes()
9 years ago
rlar
396441e1ea
inp2m.c, #3/9c, abstraction, introduce model_numnodes()
Note:
This commit does not change behaviour in any way,
yet one can instantly see some sickness now.
Some of the models definitely do not have 7 nodes,
Actually we would like to fetch the number of terminals from
struct IFdevice, slot terms or slot numNames
But it turns out several models publish bogus values.
For example "B4SOI", which has 7 nodes, but claims to have 8
9 years ago
rlar
3bb68fbd7a
inp2m.c, #2/9c, rewrite using GENnode[]
9 years ago
rlar
81b5278674
inp2m.c, #1/9c, rename 'nodeflag'
9 years ago