Browse Source

remove the ancient nobjthack option to fake 3-terminal bjt's

pre-master-46
dwarning 10 years ago
committed by rlar
parent
commit
24dbbc393d
  1. 8
      doc/ngspice.texi
  2. 1
      src/frontend/miscvars.c
  3. 12
      src/frontend/subckt.c
  4. 5
      src/ngspice.txt

8
doc/ngspice.texi

@ -7743,10 +7743,6 @@ Do not check to make sure that there are no circuits suspended and no
plots un saved. Normally Ngspice warns the user when he tries to quit if plots un saved. Normally Ngspice warns the user when he tries to quit if
this is the case. this is the case.
@item nobjthack
Assume that BJTs have 4 nodes.
@item noparse @item noparse
Don't attempt to parse input files when they are read in (useful for Don't attempt to parse input files when they are read in (useful for
@ -7956,9 +7952,7 @@ recognized.
BJTs can have either 3 or 4 nodes, which makes it difficult for the BJTs can have either 3 or 4 nodes, which makes it difficult for the
subcircuit expansion routines to decide what to rename. If the fourth subcircuit expansion routines to decide what to rename. If the fourth
parameter has been declared as a model name, then it is assumed that parameter has been declared as a model name, then it is assumed that
there are 3 nodes, otherwise it is considered a node. To disable this,
you can set the variable "nobjthack" which forces BJTs to have 4 nodes
(for the purposes of subcircuit expansion, at least).
there are 3 nodes, otherwise it is considered a node.
The @@name[param] notation might not work with trace, iplot, etc. yet. The @@name[param] notation might not work with trace, iplot, etc. yet.

1
src/frontend/miscvars.c

@ -81,7 +81,6 @@ char *ft_setkwords[] = {
"moremode", "moremode",
"nfreqs", "nfreqs",
"noasciiplotvalue", "noasciiplotvalue",
"nobjthack",
"nobreak", "nobreak",
"noclobber", "noclobber",
"node", "node",

12
src/frontend/subckt.c

@ -126,7 +126,6 @@ struct subs {
* list of translated names (i.e. after subckt expansion) * list of translated names (i.e. after subckt expansion)
*/ */
static bool nobjthack = FALSE;
/* flag indicating use of the experimental numparams library */ /* flag indicating use of the experimental numparams library */
static bool use_numparams = FALSE; static bool use_numparams = FALSE;
@ -219,7 +218,6 @@ inp_subcktexpand(struct line *deck) {
(void) strcpy(model, ".model"); (void) strcpy(model, ".model");
if (!cp_getvar("modelline", CP_STRING, model)) if (!cp_getvar("modelline", CP_STRING, model))
(void) strcpy(model, ".model"); (void) strcpy(model, ".model");
nobjthack = cp_getvar("nobjthack", CP_BOOL, NULL);
use_numparams = cp_getvar("numparams", CP_BOOL, NULL); use_numparams = cp_getvar("numparams", CP_BOOL, NULL);
@ -1510,8 +1508,6 @@ numnodes(char *name, struct subs *subs, wordlist const *modnames)
/* for a given device type. */ /* for a given device type. */
/* Paolo Nenzi Jan-2001 */ /* Paolo Nenzi Jan-2001 */
/* I hope that works, this code is very very untested */
if ((c == 'm') || (c == 'p') || (c == 'q')) { /* IF this is a mos, cpl or bjt*/ if ((c == 'm') || (c == 'p') || (c == 'q')) { /* IF this is a mos, cpl or bjt*/
i = 0; i = 0;
s = buf; s = buf;
@ -1541,12 +1537,10 @@ numnodes(char *name, struct subs *subs, wordlist const *modnames)
return (0); return (0);
} }
return (i-1); /* compensate the unnecessary increment in the while cycle */ return (i-1); /* compensate the unnecessary increment in the while cycle */
} /* if (c == 'm' . . . */
if (nobjthack || (c != 'q')) /* for all other elements */
} else {
/* for all other elements */
return (n); return (n);
return (0);
}
} }

5
src/ngspice.txt

@ -5621,7 +5621,6 @@ TEXT: H no circuits suspended and no plots un-
TEXT: H saved. Normally Spice3 warns the user TEXT: H saved. Normally Spice3 warns the user
TEXT: H when he tries to quit if this is the TEXT: H when he tries to quit if this is the
TEXT: H case. TEXT: H case.
TEXT: H nobjthack Assume that BJTs have 4 nodes.
TEXT: H noparse Don't attempt to parse input files when TEXT: H noparse Don't attempt to parse input files when
TEXT: H they are read in (useful for debugging). TEXT: H they are read in (useful for debugging).
TEXT: H Of course, they cannot be run if they TEXT: H Of course, they cannot be run if they
@ -5807,9 +5806,7 @@ TEXT: H BJTs can have either 3 or 4 nodes, which makes it dif-
TEXT: H ficult for the subcircuit expansion routines to decide what TEXT: H ficult for the subcircuit expansion routines to decide what
TEXT: H to rename. If the fourth parameter has been declared as a TEXT: H to rename. If the fourth parameter has been declared as a
TEXT: H model name, then it is assumed that there are 3 nodes, oth- TEXT: H model name, then it is assumed that there are 3 nodes, oth-
TEXT: H erwise it is considered a node. To disable this, you can
TEXT: H set the variable "nobjthack" which forces BJTs to have 4
TEXT: H nodes (for the purposes of subcircuit expansion, at least).
TEXT: H erwise it is considered a node.
TEXT: H TEXT: H
TEXT: H The @name[param] notation might not work with trace, TEXT: H The @name[param] notation might not work with trace,
TEXT: H iplot, etc. yet. TEXT: H iplot, etc. yet.

Loading…
Cancel
Save