committed by
Holger Vogt
7 changed files with 13 additions and 162 deletions
-
42src/frontend/inpcom.c
-
8src/frontend/subckt.c
-
5src/spicelib/parser/Makefile.am
-
109src/spicelib/parser/inp2a.c
-
1src/spicelib/parser/inppas2.c
-
3src/spicelib/parser/inpxx.h
-
7test_docker.sh
@ -1,109 +0,0 @@ |
|||
/********** |
|||
Copyright 1990 Regents of the University of California. All rights reserved. |
|||
Author: 1988 Thomas L. Quarles |
|||
Modified: 2001 Paolo Nenzi (Cider Integration) |
|||
**********/ |
|||
|
|||
#include "ngspice/ngspice.h" |
|||
|
|||
#include "ngspice/devdefs.h" |
|||
#include "ngspice/fteext.h" |
|||
#include "ngspice/ifsim.h" |
|||
#include "ngspice/inpdefs.h" |
|||
#include "ngspice/inpmacs.h" |
|||
|
|||
#include "inpxx.h" |
|||
#include <stdio.h> |
|||
|
|||
#ifdef XSPICE |
|||
#include "ngspice/mifproto.h" |
|||
#endif |
|||
|
|||
void INP2A(CKTcircuit *ckt, INPtables *tab, struct card *current) { |
|||
/* Mname <node> <node> <node> <node> <model> [L=<val>] |
|||
* [W=<val>] [AD=<val>] [AS=<val>] [PD=<val>] |
|||
* [PS=<val>] [NRD=<val>] [NRS=<val>] [OFF] |
|||
* [IC=<val>,<val>,<val>] |
|||
*/ |
|||
|
|||
int type; /* the type the model says it is */ |
|||
char *line; /* the part of the current line left to parse */ |
|||
char *name; /* the resistor's name */ |
|||
// limit to at most 20 nodes |
|||
const int max_i = 20; |
|||
CKTnode *node[20]; |
|||
int error; /* error code temporary */ |
|||
int numnodes; /* flag indicating 4 or 5 (or 6 or 7) nodes */ |
|||
GENinstance *fast; /* pointer to the actual instance */ |
|||
int waslead; /* flag to indicate that funny unlabeled number was found */ |
|||
double leadval; /* actual value of unlabeled number */ |
|||
INPmodel *thismodel; /* pointer to model description for user's model */ |
|||
GENmodel *mdfast; /* pointer to the actual model */ |
|||
int i; |
|||
|
|||
line = current->line; |
|||
|
|||
INPgetNetTok(&line, &name, 1); |
|||
INPinsert(&name, tab); |
|||
|
|||
for (i = 0;; i++) { |
|||
char *token; |
|||
INPgetNetTok(&line, &token, 1); |
|||
|
|||
if (i >= 2) { |
|||
txfree(INPgetMod(ckt, token, &thismodel, tab)); |
|||
|
|||
/* /1* check if using model binning -- pass in line since need 'l' and 'w' *1/ */ |
|||
/* if (!thismodel) */ |
|||
/* txfree(INPgetModBin(ckt, token, &thismodel, tab, line)); */ |
|||
|
|||
if (thismodel) { |
|||
INPinsert(&token, tab); |
|||
break; |
|||
} |
|||
} |
|||
if (i >= max_i) { |
|||
LITERR("could not find a valid modelname"); |
|||
return; |
|||
} |
|||
INPtermInsert(ckt, &token, tab, &node[i]); |
|||
} |
|||
|
|||
type = thismodel->INPmodType; |
|||
mdfast = thismodel->INPmodfast; |
|||
IFdevice *dev = ft_sim->devices[type]; |
|||
|
|||
if (!dev->registry_entry) { |
|||
|
|||
#ifdef XSPICE |
|||
MIF_INP2A(ckt, tab, current); |
|||
#else |
|||
LITERR("incorrect model type! Expected OSDI device"); |
|||
#endif |
|||
return; |
|||
} |
|||
|
|||
if (i == 0) { |
|||
LITERR("not enough nodes"); |
|||
return; |
|||
} |
|||
|
|||
if (i > *dev->terms) { |
|||
LITERR("too many nodes connected to instance"); |
|||
return; |
|||
} |
|||
|
|||
numnodes = i; |
|||
|
|||
IFC(newInstance, (ckt, mdfast, &fast, name)); |
|||
|
|||
for (i = 0; i < *dev->terms; i++) |
|||
if (i < numnodes) |
|||
IFC(bindNode, (ckt, fast, i + 1, node[i])); |
|||
else |
|||
GENnode(fast)[i] = -1; |
|||
|
|||
PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab)); |
|||
if (waslead) |
|||
LITERR(" error: no unlabeled parameter permitted on osdi devices\n"); |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
IMAGENAME="registry.gitlab.com/dospm/ngspice" |
|||
TAG="latest" |
|||
|
|||
docker build -t $IMAGENAME:$TAG . |
|||
docker run -it --rm --user "$(id -u)":"$(id -g)" -v "${PWD}":/tmp $IMAGENAME:$TAG /bin/bash |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue