summaryrefslogtreecommitdiff
path: root/cad
diff options
context:
space:
mode:
authorPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-02-11 19:40:33 +0000
committerPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-02-11 19:40:33 +0000
commit0ec10e2e24e2d23e2304ea38346290feacaa9ea0 (patch)
tree71d5db8afa7cd660cb6c3833b6674ee36af805b7 /cad
parent- add USE_MYSQL=yes (diff)
-Clean some warnings by using string.h instead of strings.h
Applied several patches from this website: http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/secD.html specifically fixes for: - Where command causes crashes - Recognition of scale factors in arbitrary source - Current Controlled Switch in subckt, parsing error - Noise analysis bug - Save segmentation faults - BSIM1 model xpart parameter random - Tran analysis default TSTEP PR: ports/143727 Submitted by: "Pedro F. Giffuni" <giffunip@tutopia.com>
Notes
Notes: svn path=/head/; revision=249606
Diffstat (limited to 'cad')
-rw-r--r--cad/spice/Makefile2
-rw-r--r--cad/spice/files/patch-src_include_os_bsd_h7
-rw-r--r--cad/spice/files/patch-src_lib_ckt_noisean_c25
-rw-r--r--cad/spice/files/patch-src_lib_ckt_traninit_c14
-rw-r--r--cad/spice/files/patch-src_lib_dev_bsim1_bimpar_c11
-rw-r--r--cad/spice/files/patch-src_lib_dev_mos6_mos6load_c11
-rw-r--r--cad/spice/files/patch-src_lib_fte_outitf_c11
-rw-r--r--cad/spice/files/patch-src_lib_fte_subckt_c22
-rw-r--r--cad/spice/files/patch-src_lib_fte_where_c18
-rw-r--r--cad/spice/files/patch-src_lib_inp_inpgtok_c41
-rw-r--r--cad/spice/files/patch-src_lib_inp_inpptree_c13
11 files changed, 168 insertions, 7 deletions
diff --git a/cad/spice/Makefile b/cad/spice/Makefile
index 9238d5f70d6d..3e3dc58144eb 100644
--- a/cad/spice/Makefile
+++ b/cad/spice/Makefile
@@ -7,7 +7,7 @@
PORTNAME= spice
PORTVERSION= 3f5.2
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= cad
MASTER_SITES= http://embedded.eecs.berkeley.edu/pubs/downloads/spice/:sources
DISTFILES= spice3f5${EXTRACT_SUFX}:sources \
diff --git a/cad/spice/files/patch-src_include_os_bsd_h b/cad/spice/files/patch-src_include_os_bsd_h
index bb30f55ce85c..95d2db43250f 100644
--- a/cad/spice/files/patch-src_include_os_bsd_h
+++ b/cad/spice/files/patch-src_include_os_bsd_h
@@ -1,6 +1,6 @@
---- src/include/os_bsd.h.orig Sat Apr 24 18:09:46 1993
-+++ src/include/os_bsd.h Mon Nov 12 03:14:36 2007
-@@ -8,18 +8,35 @@
+--- src/include/os_bsd.h.orig 1993-04-24 23:09:46.000000000 +0000
++++ src/include/os_bsd.h 2010-02-09 16:25:54.000000000 +0000
+@@ -8,18 +8,34 @@
#include "os_unix.h"
@@ -8,7 +8,6 @@
+#define HAS_STDLIB /* #include <stdlib.h> for libc defs */
+#define HAS_SYSVDIRS /* <sys/dirent.h> */
+#define HAS_INTWAITSTATUS /* wait(2) takes an int *, not a union */
-+#define HAS_STRINGS /* use <strings.h> instead of <string.h> */
+#define HAS_STRCHR /* strchr(3) instead of index(3) */
+#define HAS_ATRIGH /* acosh(3), asinh(3), atanh(3) */
+#define HAS_FLOAT_H /* float.h */
diff --git a/cad/spice/files/patch-src_lib_ckt_noisean_c b/cad/spice/files/patch-src_lib_ckt_noisean_c
new file mode 100644
index 000000000000..a23651be23bc
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_ckt_noisean_c
@@ -0,0 +1,25 @@
+--- src/lib/ckt/noisean.c.orig 2010-02-10 00:07:14.000000000 +0000
++++ src/lib/ckt/noisean.c 2010-02-10 00:11:12.000000000 +0000
+@@ -2,6 +2,9 @@
+ Copyright 1990 Regents of the University of California. All rights reserved.
+ Author: 1987 Gary W. Ng
+ **********/
++/* Patch to noisean.c by Richard D. McRoberts.
++ *
++ */
+
+ #include "spice.h"
+ #include <stdio.h>
+@@ -107,8 +110,12 @@
+ error = CKTop(ckt, (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITJCT,
+ (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT,
+ ckt->CKTdcMaxIter);
++ if (error) return(error);
+
++ ckt->CKTmode = (ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITSMSIG;
++ error = CKTload(ckt);
+ if (error) return(error);
++
+ data = (Ndata*)MALLOC(sizeof(Ndata));
+ step = 0;
+ data->freq = job->NstartFreq;
diff --git a/cad/spice/files/patch-src_lib_ckt_traninit_c b/cad/spice/files/patch-src_lib_ckt_traninit_c
new file mode 100644
index 000000000000..e600a2101c51
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_ckt_traninit_c
@@ -0,0 +1,14 @@
+--- src/lib/ckt/traninit.c.orig 2010-02-09 23:52:59.000000000 +0000
++++ src/lib/ckt/traninit.c 2010-02-09 23:57:48.000000000 +0000
+@@ -22,7 +22,10 @@
+ ckt->CKTinitTime = ((TRANan*)job)->TRANinitTime;
+ ckt->CKTmaxStep = ((TRANan*)job)->TRANmaxStep;
+ if(ckt->CKTmaxStep == 0) {
+- ckt->CKTmaxStep = (ckt->CKTfinalTime-ckt->CKTinitTime)/50;
++ if ( ckt->CKTstep < (ckt->CKTfinalTime - ckt->CKTinitTime)/50.0) {
++ ckt->CKTmaxStep = ckt->CKTstep; }
++ else
++ { ckt->CKTmaxStep = (ckt->CKTfinalTime - ckt->CKTinitTime)/50.0; }
+ }
+ ckt->CKTdelmin = 1e-9*ckt->CKTmaxStep; /* XXX */
+ ckt->CKTmode = ((TRANan*)job)->TRANmode;
diff --git a/cad/spice/files/patch-src_lib_dev_bsim1_bimpar_c b/cad/spice/files/patch-src_lib_dev_bsim1_bimpar_c
new file mode 100644
index 000000000000..ea59563335aa
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_dev_bsim1_bimpar_c
@@ -0,0 +1,11 @@
+--- src/lib/dev/bsim1/b1mpar.c.orig 2010-02-09 16:02:41.000000000 +0000
++++ src/lib/dev/bsim1/b1mpar.c 2010-02-09 16:03:44.000000000 +0000
+@@ -287,7 +287,7 @@
+ mod->B1gateBulkOverlapCapGiven = TRUE;
+ break;
+ case BSIM1_MOD_XPART :
+- mod->B1channelChargePartitionFlag = value->iValue;
++ mod->B1channelChargePartitionFlag = value->rValue;
+ mod->B1channelChargePartitionFlagGiven = TRUE;
+ break;
+ case BSIM1_MOD_RSH :
diff --git a/cad/spice/files/patch-src_lib_dev_mos6_mos6load_c b/cad/spice/files/patch-src_lib_dev_mos6_mos6load_c
new file mode 100644
index 000000000000..664f58498a76
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_dev_mos6_mos6load_c
@@ -0,0 +1,11 @@
+--- src/lib/dev/mos6/mos6load.c.orig 2010-02-09 16:16:28.000000000 +0000
++++ src/lib/dev/mos6/mos6load.c 2010-02-09 16:16:53.000000000 +0000
+@@ -509,7 +509,7 @@
+ }
+ vdshere = vds * here->MOS6mode;
+ von=(here->MOS6tVbi*model->MOS6type)+model->MOS6gamma*sarg
+- - model->MOS6gamma1 * vbsvbd;
++ - model->MOS6gamma1 * vbsvbd
+ - model->MOS6sigma * vdshere;
+ vgon = (here->MOS6mode==1?vgs:vgd) - von;
+
diff --git a/cad/spice/files/patch-src_lib_fte_outitf_c b/cad/spice/files/patch-src_lib_fte_outitf_c
new file mode 100644
index 000000000000..dda84bc00665
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_outitf_c
@@ -0,0 +1,11 @@
+--- src/lib/fte/outitf.c.orig 2010-02-09 15:49:01.000000000 +0000
++++ src/lib/fte/outitf.c 2010-02-09 15:49:55.000000000 +0000
+@@ -353,7 +353,7 @@
+
+ data->name = copy(name);
+
+- unique = devname;
++ unique = copy(devname);
+ INPinsert(&unique, (INPtables *) ft_curckt->ci_symtab);
+ data->specName = unique;
+
diff --git a/cad/spice/files/patch-src_lib_fte_subckt_c b/cad/spice/files/patch-src_lib_fte_subckt_c
new file mode 100644
index 000000000000..0604c39db8d3
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_subckt_c
@@ -0,0 +1,22 @@
+--- src/lib/fte/subckt.c.orig 2010-02-09 15:25:54.000000000 +0000
++++ src/lib/fte/subckt.c 2010-02-09 15:57:52.000000000 +0000
+@@ -648,6 +648,9 @@
+ case 'f':
+ case 'H':
+ case 'h':
++ /* 2 lines here to fix w bug, NCF 1/31/95 */
++ case 'W':
++ case 'w':
+ return (1);
+
+ default:
+@@ -944,7 +947,8 @@
+ case 't': return (4);
+ case 'u': return (3);
+ case 'v': return (2);
+- case 'w': return (3);
++ /* change 3 to 2 here to fix w bug, NCF 1/31/95 */
++ case 'w': return (2);
+ case 'z': return (3);
+
+ default:
diff --git a/cad/spice/files/patch-src_lib_fte_where_c b/cad/spice/files/patch-src_lib_fte_where_c
new file mode 100644
index 000000000000..bc3bc04eb299
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_where_c
@@ -0,0 +1,18 @@
+--- src/lib/fte/where.c.orig 2010-02-09 15:32:23.000000000 +0000
++++ src/lib/fte/where.c 2010-02-09 15:35:36.000000000 +0000
+@@ -17,6 +17,15 @@
+ {
+ char *msg;
+
++ /*CDHW typing where with no current circuit caused crashes CDHW*/
++ if (!ft_curckt) {
++ fprintf(cp_err, "There is no current circuit\n");
++ return;
++ }
++ else if (ft_curckt->ci_ckt != "") {
++ fprintf(cp_err, "No unconverged node found.\n");
++ return;
++ }
+ msg = (*ft_sim->nonconvErr)((GENERIC *) (ft_curckt->ci_ckt), 0);
+
+ printf("%s", msg);
diff --git a/cad/spice/files/patch-src_lib_inp_inpgtok_c b/cad/spice/files/patch-src_lib_inp_inpgtok_c
new file mode 100644
index 000000000000..29bce2b1f7b7
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_inp_inpgtok_c
@@ -0,0 +1,41 @@
+--- src/lib/inp/inpgtok.c.orig 2010-02-09 15:39:09.000000000 +0000
++++ src/lib/inp/inpgtok.c 2010-02-09 15:43:10.000000000 +0000
+@@ -27,6 +27,7 @@
+ int gobble; /* eat non-whitespace trash AFTER token? */
+ {
+ char * point;
++ int signstate;
+
+ /* scan along throwing away garbage characters */
+ for(point = *line;*point != '\0' ; point++ ) {
+@@ -41,6 +42,7 @@
+ /* mark beginning of token */
+ *line = point;
+ /* now find all good characters */
++ signstate = 0;
+ for(point = *line;*point!='\0';point++) {
+ if(*point == ' ') break;
+ if(*point == '\t') break;
+@@ -48,6 +50,22 @@
+ if(*point == '(') break;
+ if(*point == ')') break;
+ if(*point == ',') break;
++ /* This is not complex enough to catch all errors, but it will
++ get the "good" parses */
++ if(*point == '+' && (signstate == 1 || signstate == 3)) break;
++ if(*point == '-' && (signstate == 1 || signstate == 3)) break;
++ if(*point == '*') break;
++ if(*point == '/') break;
++ if(*point == '^') break;
++ if (isdigit(*point) || *point == '.') {
++ if (signstate > 1)
++ signstate = 3;
++ else
++ signstate = 1;
++ } else if (tolower(*point) == 'e' && signstate == 1)
++ signstate = 2;
++ else
++ signstate = 3;
+ }
+ if (point == *line && *point) /* Weird items, 1 char */
+ point++;
diff --git a/cad/spice/files/patch-src_lib_inp_inpptree_c b/cad/spice/files/patch-src_lib_inp_inpptree_c
index 0819cac1407d..289c1026772f 100644
--- a/cad/spice/files/patch-src_lib_inp_inpptree_c
+++ b/cad/spice/files/patch-src_lib_inp_inpptree_c
@@ -1,5 +1,5 @@
---- src/lib/inp/inpptree.c.orig Mon May 3 02:16:54 1993
-+++ src/lib/inp/inpptree.c Sun May 14 09:34:56 2006
+--- src/lib/inp/inpptree.c.orig 1993-05-03 09:16:54.000000000 +0000
++++ src/lib/inp/inpptree.c 2010-02-09 15:45:52.000000000 +0000
@@ -1,6 +1,8 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
@@ -32,3 +32,12 @@
}
break;
+@@ -977,7 +971,7 @@
+ break;
+ }
+
+- td = INPevaluate(&sbuf, &err, 0);
++ td = INPevaluate(&sbuf, &err, 1);
+ if (err == OK) {
+ el.token = TOK_VALUE;
+ el.type = TYP_NUM;