removed unneded changes

This commit is contained in:
Pascal Kuthe 2022-12-10 00:27:18 +01:00 committed by Holger Vogt
parent 391959ab4a
commit 79b2d2d520
7 changed files with 13 additions and 162 deletions

View File

@ -2406,29 +2406,14 @@ static char *get_model_type(char *line)
}
static char *get_adevice_model_name(char *line, struct nscope *scope)
static char *get_adevice_model_name(char *line)
{
char *beg_ptr, *end_ptr, *name;
int i = 0;
char *ptr_end, *ptr_beg;
beg_ptr = skip_non_ws(line); /* eat device name */
beg_ptr = skip_ws(beg_ptr);
ptr_end = skip_back_ws(strchr(line, '\0'), line);
ptr_beg = skip_back_non_ws(ptr_end, line);
for (i = 0; i < 30; i++) { /* skip the terminals */
end_ptr = skip_non_ws(beg_ptr);
name = copy_substring(beg_ptr, end_ptr);
if (inp_find_model(scope, name)){
return name;
}else if (beg_ptr == end_ptr){
break;
}
end_ptr = skip_ws(end_ptr);
beg_ptr = end_ptr;
}
return NULL;
return copy_substring(ptr_beg, ptr_end);
}
@ -2647,7 +2632,7 @@ static void get_subckts_for_subckt(struct card *start_card, char *subckt_name,
nlist_adjoin(used_subckts, inst_subckt_name);
}
else if (*line == 'a') {
char *model_name = get_adevice_model_name( line, card->level);
char *model_name = get_adevice_model_name(line);
nlist_adjoin(used_models, model_name);
}
else if (has_models) {
@ -2733,7 +2718,7 @@ void comment_out_unused_subckt_models(struct card *start_card)
nlist_adjoin(used_subckts, subckt_name);
}
else if (*line == 'a') {
char *model_name = get_adevice_model_name(line, card->level);
char *model_name = get_adevice_model_name(line);
nlist_adjoin(used_models, model_name);
}
else if (has_models) {
@ -10021,7 +10006,7 @@ static char inp_get_elem_ident(char *type)
if (cieq(type, "res"))
return 'r';
/* xspice code models do not have unique type names,
but could also be a OpenVAF model. */
but could also be an OSDI/OpenVAF model. */
else
return 'a';
}
@ -10288,12 +10273,9 @@ void inp_rem_unused_models(struct nscope *root, struct card *deck)
/* num_terminals may be 0 for a elements */
if ((num_terminals != 0) || (*curr_line == 'a')) {
char *elem_model_name;
if (*curr_line == 'a'){
elem_model_name = get_adevice_model_name( curr_line, card->level);
if (!elem_model_name){
continue;
}
}else
if (*curr_line == 'a')
elem_model_name = get_adevice_model_name(curr_line);
else
elem_model_name = get_model_name(curr_line, num_terminals);
/* ignore certain cases, for example
@ -10304,7 +10286,7 @@ void inp_rem_unused_models(struct nscope *root, struct card *deck)
struct modellist *m =
inp_find_model(card->level, elem_model_name);
if (m) {
if (*curr_line != m->elemb && *curr_line != 'n')
if (*curr_line != m->elemb && !(*curr_line == 'n' && m->elemb == 'a'))
fprintf(stderr,
"warning, model type mismatch in line\n "
"%s\n",

View File

@ -1690,11 +1690,7 @@ numnodes(const char *line, struct subs *subs, wordlist const *modnames)
/* Paolo Nenzi Jan-2001 */
/* If model names equal node names, this code will fail! */
#ifdef OSDI
if ((c == 'n') ||(c == 'm') || (c == 'p') || (c == 'q') || (c == 'd')) { /* IF this is a mos, cpl, bjt or diode */
#else
if ((c == 'm') || (c == 'p') || (c == 'q') || (c == 'd')) { /* IF this is a mos, cpl, bjt or diode */
#endif
char *s = nexttok(line); /* Skip the instance name */
int gotit = 0;
int i = 0;
@ -2265,10 +2261,6 @@ inp_numnodes(char c)
return (4);
case 'z':
return (3);
#ifdef OSDI
case 'n':
return (7);
#endif
default:
fprintf(cp_err, "Warning: unknown device type: %c\n", c);

View File

@ -71,11 +71,6 @@ libinp_la_SOURCES = \
sperror.c \
inpxx.h
if OSDI_WANTED
libinp_la_SOURCES += inp2a.c
endif
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/frontend
AM_CFLAGS = $(STATIC)
AM_YFLAGS = -d

View File

@ -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");
}

View File

@ -245,6 +245,7 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task)
case 'B':
/* Bname <node> <node> [V=expr] [I=expr] */
/* Arbitrary source. */
INP2B(ckt, tab, current);
break;
case '.': /* .<something> Many possibilities */

View File

@ -8,9 +8,6 @@
/* inp2xx.c */
#ifdef OSDI
void INP2A(CKTcircuit *ckt, INPtables *tab, struct card *current);
#endif
void INP2B(CKTcircuit *ckt, INPtables *tab, struct card *current);
void INP2C(CKTcircuit *ckt, INPtables *tab, struct card *current);
void INP2D(CKTcircuit *ckt, INPtables *tab, struct card *current);

View File

@ -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