auto-import ngspice-17-10 on branch FC-6 from ngspice-17-10.src.rpm

This commit is contained in:
Chitlesh GOORAH 2007-03-17 11:52:32 +00:00
parent 1bd0039aac
commit 71025b7d1a
2 changed files with 225 additions and 12 deletions

206
ngspice-bjt.patch Normal file
View File

@ -0,0 +1,206 @@
--- /home/chitlesh/rpmbuild/SOURCES/ng-spice-rework-17/src/spicelib/parser/inp2q.c 2004-01-27 22:57:20.000000000 +0100
+++ ../SOURCES/ng-spice-rework-17/inp2q.c 2007-03-17 10:55:57.000000000 +0100
@@ -18,33 +18,41 @@
/* Qname <node> <node> <node> [<node>] <model> [<val>] [OFF]
* [IC=<val>,<val>] */
- int mytype; /* the type we looked up */
- 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 */
- char *nname1; /* the first node's name */
- char *nname2; /* the second node's name */
- char *nname3; /* the third node's name */
- char *nname4; /* the fourth node's name */
- void *node1; /* the first node's node pointer */
- void *node2; /* the second node's node pointer */
- void *node3; /* the third node's node pointer */
- void *node4; /* the fourth node's node pointer */
- int error; /* error code temporary */
- void *fast; /* pointer to the actual instance */
- IFvalue ptemp; /* a value structure to package resistance into */
- int waslead; /* flag to indicate that funny unlabeled number was found */
- double leadval; /* actual value of unlabeled number */
- char *model; /* the name of the model */
- INPmodel *thismodel; /* pointer to model description for user's model */
- void *mdfast; /* pointer to the actual model */
- IFuid uid; /* uid of default model */
+ int mytype; /* the type we looked up */
+ 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 */
+ char *nname1; /* the first node's name */
+ char *nname2; /* the second node's name */
+ char *nname3; /* the third node's name */
+ char *nname4; /* the fourth node's name */
+ char *nname5; /* the fifth node's name */
+ void *node1; /* the first node's node pointer */
+ void *node2; /* the second node's node pointer */
+ void *node3; /* the third node's node pointer */
+ void *node4; /* the fourth node's node pointer */
+ void *node5; /* the fifth node's node pointer */
+ int error; /* error code temporary */
+ int nodeflag; /* flag indicating 4 or 5 nodes */
+ void *fast; /* pointer to the actual instance */
+ IFvalue ptemp; /* a value structure to package resistance into */
+ int waslead; /* flag to indicate that funny unlabeled number was found */
+ double leadval; /* actual value of unlabeled number */
+ char *model; /* the name of the model */
+ INPmodel *thismodel; /* pointer to model description for user's model */
+ void *mdfast; /* pointer to the actual model */
+ IFuid uid; /* uid of default model */
mytype = INPtypelook("BJT");
if (mytype < 0) {
- LITERR("Device type BJT not supported by this binary\n");
- return;
+ LITERR("Device type BJT not supported by this binary\n");
+ return;
}
+#ifdef TRACE
+ printf("INP2Q: Parsing '%s'\n",current->line);
+#endif
+
+ nodeflag = 0; /* initially specify a 4 terminal device */
line = current->line;
INPgetTok(&line, &name, 1);
INPinsert(&name, tab);
@@ -55,63 +63,111 @@
INPgetNetTok(&line, &nname3, 1);
INPtermInsert(ckt, &nname3, tab, &node3);
INPgetTok(&line, &model, 1);
+
+ /* See if 4th token after device specification is a model name */
if (INPlookMod(model)) {
- /* do nothing for now */
- node4 = gnode;
- /* no action required */
+ /* 3-terminal device - substrate to ground */
+ node4 = gnode;
+ INPinsert(&model, tab);
} else {
- nname4 = model;
- INPtermInsert(ckt, &nname4, tab, &node4);
- INPgetTok(&line, &model, 1);
+ nname4 = model;
+ INPtermInsert(ckt, &nname4, tab, &node4);
+ INPgetTok(&line, &model, 1);
+ /* See if 5th token after device specification is a model name */
+#ifdef TRACE
+ printf("INP2Q: checking for 4 node device\n");
+#endif
+ if (INPlookMod(model)) {
+ /* 4-terminal device - special case with tnodeout flag not handled */
+ INPinsert(&model, tab);
+#ifdef ADMS
+ } else {
+ /* 5-terminal device */
+#ifdef TRACE
+ printf("INP2Q: checking for 5 node device\n");
+#endif
+ nodeflag = 1; /* now specify a 5 node device */
+ nname5 = model;
+ INPtermInsert(ckt, &nname5, tab, &node5);
+ INPgetTok(&line, &model, 1);
+ INPinsert(&model, tab);
+#endif
+ }
}
- INPinsert(&model, tab);
+
current->error = INPgetMod(ckt, model, &thismodel, tab);
+#ifdef TRACE
+ printf("INP2Q: Looking up model\n");
+#endif
if (thismodel != NULL) {
- if((thismodel->INPmodType != INPtypelook("BJT"))
+ if((thismodel->INPmodType != INPtypelook("BJT"))
&& (thismodel->INPmodType != INPtypelook("BJT2"))
&& (thismodel->INPmodType != INPtypelook("VBIC"))
#ifdef CIDER
&& (thismodel->INPmodType != INPtypelook("NBJT"))
&& (thismodel->INPmodType != INPtypelook("NBJT2"))
#endif
- ) {
+#ifdef ADMS
+ && (thismodel->INPmodType != INPtypelook("hicum0"))
+ && (thismodel->INPmodType != INPtypelook("hicum2"))
+ && (thismodel->INPmodType != INPtypelook("mextram"))
+#endif
+ ) {
LITERR("incorrect model type")
return;
}
+#ifdef ADMS
+ if (nodeflag && (thismodel->INPmodType != INPtypelook("hicum2")))
+ {
+ LITERR("Too much nodes for this model type")
+ return;
+ }
+#endif
type = (thismodel->INPmodType);
- mdfast = (thismodel->INPmodfast);
+ mdfast = (thismodel->INPmodfast);
} else {
- type = mytype;
- if (!tab->defQmod) {
- /* create default Q model */
- IFnewUid(ckt, &uid, (IFuid) NULL, "Q", UID_MODEL,
- (void **) NULL);
- IFC(newModel, (ckt, type, &(tab->defQmod), uid));
- }
- mdfast = tab->defQmod;
+ type = mytype;
+ if (!tab->defQmod) {
+ /* create default Q model */
+ IFnewUid(ckt, &uid, (IFuid) NULL, "Q", UID_MODEL,
+ (void **) NULL);
+ IFC(newModel, (ckt, type, &(tab->defQmod), uid));
+ }
+ mdfast = tab->defQmod;
}
-
+
#ifdef TRACE
- /* --- SDB debug statement --- */
- printf ("In INP2Q, just about to dive into newInstance\n");
+ printf ("INP2Q: Just about to dive into newInstance\n");
#endif
-
+
IFC(newInstance, (ckt, mdfast, &fast, name));
IFC(bindNode, (ckt, fast, 1, node1));
IFC(bindNode, (ckt, fast, 2, node2));
IFC(bindNode, (ckt, fast, 3, node3));
IFC(bindNode, (ckt, fast, 4, node4));
+
+ if ((type == INPtypelook ("hicum0")) ||
+ (type == INPtypelook ("hicum2")) ||
+ (type == INPtypelook ("mextram")) )
+ {
+ if (nodeflag) {
+ IFC(bindNode, (ckt, fast, 5, node5));
+ } else {
+ ((GENinstance *) fast)->GENnode5 = -1;
+ }
+ }
PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab));
if (waslead) {
#ifdef CIDER
if( type == INPtypelook("NBJT2") ) {
- LITERR(" error: no unlabelled parameter permitted on NBJT2\n")
- } else {
+ LITERR(" error: no unlabeled parameter permitted on NBJT2\n")
+ } else {
#endif
- ptemp.rValue = leadval;
- GCA(INPpName, ("area", &ptemp, ckt, type, fast));
+ ptemp.rValue = leadval;
+ GCA(INPpName, ("area", &ptemp, ckt, type, fast));
}
#ifdef CIDER
}
-#endif
+#endif
}
+

View File

@ -1,6 +1,6 @@
Name: ngspice
Version: 17
Release: 8%{?dist}
Release: 10%{?dist}
Summary: A mixed level/signal circuit simulator
License: BSD
@ -9,11 +9,14 @@ URL: http://%{name}.sourceforge.net/
Source0: http://ovh.dl.sourceforge.net/sourceforge/%{name}/ng-spice-rework-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: %{name}-%{version}-pipemode.patch
Patch1: %{name}-bjt.patch
BuildRequires: readline-devel, libXext-devel, libpng-devel, libICE-devel
BuildRequires: libXaw-devel, mesa-libGL-devel, libXt-devel
%description
Ngspice is a general-purpose circuit simulator program.
It implements three classes of analysis:
@ -37,10 +40,10 @@ develop their own models for devices using the codemodel interface.
Summary: Documentation for ngspice, a mixed level/signal circuit simulator
Group: Documentation
Requires: ngspice = %{version}
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
%description doc
This package contains the documentation of ngspice in pdf, postscript
and info format.
@ -50,6 +53,7 @@ and info format.
%setup -q -n ng-spice-rework-%{version}
%patch0 -p0 -b .pipemode-xcircuit
%patch1 -p0 -b .bjt
%build
%ifarch x86_64 sparc64 ppc64 amd64
@ -64,14 +68,8 @@ cat src/spinit.in.ngspice | sed \
%endif
%configure \
--enable-cider \
--enable-dot-global \
--enable-predictor \
--enable-numparam \
--enable-xgraph \
--enable-xspice \
--with-x=yes \
--with-readline=yes \
%ifarch x86_64 sparc64 ppc64 amd64
--enable-libsuffix=64 \
%endif
@ -104,10 +102,10 @@ chmod +x %{buildroot}%{_libdir}/spice/{xtraevt.cm,xtradev.cm,analog.cm,spice2pol
%clean
%{__rm} -rf %{buildroot}
%post
%post doc
/sbin/install-info --quiet --info-dir=%{_infodir}/dir %{_infodir}/%{name}.info.* ||:
%preun
%preun doc
if [ "$1" -eq 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info.* --info-dir=%{_infodir}/dir ||:
fi
@ -116,7 +114,7 @@ fi
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README BUGS ChangeLog NEWS
%exclude %{_datadir}/ng-spice-rework/doc/
%exclude %{_datadir}/ng-spice-rework/doc/*
%exclude %{_datadir}/ng-spice-rework/examples/
%{_bindir}/cmpp
%{_bindir}/makeidx
@ -129,18 +127,27 @@ fi
%{_bindir}/xgraph
%{_datadir}/ng-spice-rework/
%{_libdir}/spice/
%{_infodir}/ngspice.info*.*
%{_mandir}/man1/ngnutmeg.1.*
%{_mandir}/man1/ngsconvert.1.*
%{_mandir}/man1/%{name}.1.*
%{_mandir}/manm/xgraph.man.*
%files doc
%defattr(-, root, root, -)
%{_infodir}/ngspice.info*.*
%{_datadir}/ng-spice-rework/doc/
%{_datadir}/ng-spice-rework/examples/
%Changelog
* Sat Mar 17 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-10
- fixed bug #227519 in spec file - Ville Skyttä
- patch: ngspice-bjt.patch fixes the problem with bjt devices that have less than five nodes
* Tue Jan 09 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-9
- dropped --enable-cider since it requires non-opensource software
- dropped --enable-predictor from %%configure
* Tue Dec 19 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-8
- patch0 for xcircuit pipemode
- XCircuit can work as an ng-spice front-end