Applied Widlok patch

This commit is contained in:
pnenzi 2000-05-23 20:04:32 +00:00
parent 808021fef2
commit f9144f90b3
5 changed files with 168 additions and 9 deletions

View File

@ -1,17 +1,21 @@
2000-04-04 Paolo Nenzi <p.nenzi@ieee.or
2000-05-22 Paolo Nenzi <p.nenzi@ieee.org>
* cktpzstr.c, cktsens.c: Applied Widlok patches.
2000-04-04 Paolo Nenzi <p.nenzi@ieee.org>
* noisean.c: Merged the previous code with the new one included in
bsim4 distribution. This code originated from Weidong Lu
(bsim group).
1999-12-20 Paolo Nenzi <p.nenzi@ieee.org>
* noisean.c:
Bug: he ac noise analysis in Spice3f4 has a serious bug. In interactive mode,
it fails to reproduce frequency dependence known to exist. In batch (Spice2)
mode, it works only if a corresponding ac analysis has been run first.
Fix: This bug is fixed by providing a call to CKTload() in noisean.c as shown
by the source code patch which is attached below.
* noisean.c:
Bug: The ac noise analysis in Spice3f4 has a serious bug. In
interactive mode it fails to reproduce frequency dependence known
to exist. In batch (Spice2) mode, it works only if a corresponding
ac analysis has been run first.
Fix: This bug is fixed by providing a call to CKTload() in
noisean.c as shown by the source code patch which is attached below.
1999-09-08 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>

View File

@ -636,6 +636,14 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set)
#endif
if (!(p->flags & ISAROOT) && CKTpzTrapped == 3
&& NIpzK != 0.0 && NIpzK_mag > -10) {
#ifdef notdef
if (p->flags & ISAROOT) {
/* Ugh! muller doesn't work right */
new_trial->flags = ISAMINIMA;
new_trial->s.imag = scalb(NIpzK, (int) (NIpzK_mag / 2));
pretest = 0;
} else {
#endif
p->flags |= ISAMINIMA;
free(new_trial);
*new_trialp = p;

View File

@ -77,6 +77,22 @@ int sens_sens(CKTcircuit *ckt, int restart)
int type;
#ifndef notdef
#ifdef notdef
for (sg = sgen_init(ckt, 0); sg; sgen_next(&sg)) {
if (sg->is_instparam)
printf("%s:%s:%s -> param %s\n",
DEVices[sg->dev]->DEVpublic.name,
sg->model->GENmodName,
sg->instance->GENname,
sg->ptable[sg->param].keyword);
else
printf("%s:%s:%s -> mparam %s\n",
DEVices[sg->dev]->DEVpublic.name,
sg->model->GENmodName,
sg->instance->GENname,
sg->ptable[sg->param].keyword);
}
#endif
#ifdef ASDEBUG
DEBUG(1)
printf(">>> restart : %d\n", restart);
@ -101,6 +117,10 @@ int sens_sens(CKTcircuit *ckt, int restart)
(ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT,
ckt->CKTdcMaxIter);
#ifdef notdef
ckt->CKTmode = (ckt->CKTmode & MODEUIC)
| MODEDCOP | MODEINITSMSIG;
#endif
if (error)
return error;
@ -210,6 +230,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
}
#endif
#ifdef notdef
for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) {
save_states[j] = ckt->CKTstates[j];
ckt->CKTstates[j] = NULL;
}
#endif
for (i = 0; i < nfreqs; i++) {
/* XXX handle restart */
@ -248,6 +275,12 @@ int sens_sens(CKTcircuit *ckt, int restart)
E = ckt->CKTrhs;
iE = ckt->CKTirhs;
Y = ckt->CKTmatrix;
#ifdef notdef
for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) {
/* XXX Free new states */
ckt->CKTstates[j] = save_states[j];
}
#endif
error = CKTtemp(ckt);
if (error)
return error;
@ -258,6 +291,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
if (error)
return error;
#ifdef notdef
/* XXX Why? */
for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) {
ckt->CKTstates[j] = NULL;
}
#endif
}
/* Use a different vector & matrix */
@ -330,7 +370,9 @@ int sens_sens(CKTcircuit *ckt, int restart)
#ifdef ASDEBUG
DEBUG(1) printf("Original value: %g\n", sg->value);
#endif
#ifdef ASDEBUG
DEBUG(2) {
printf("Effect of device:\n");
spPrint(delta_Y, 0, 1, 1);
@ -529,6 +571,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
ckt->CKTmatrix = Y;
ckt->CKTbypass = bypass;
#ifdef notdef
for (j = 0; j <= ckt->CKTmaxOrder + 1; j++) {
if (ckt->CKTstates[j])
FREE(ckt->CKTstates[j]);
ckt->CKTstates[j] = save_states[j];
}
#endif
#endif
return OK;

View File

@ -0,0 +1,4 @@
2000-05-22 Paolo Nenzi <p.nenzi@ieee.org>
* x11.c: Applied Widlok patch and reintrodced some #ifdef notdef
code.

View File

@ -88,6 +88,8 @@ static int numdispplanes;
extern void internalerror (char *message);
extern void externalerror (char *message);
static void initlinestyles (void);
static void initcolors (GRAPH *graph);
extern void PushGraphContext (GRAPH *graph);
extern void SetColor (int colorid);
extern void Text (char *text, int x, int y);
@ -95,6 +97,7 @@ extern void SaveText (GRAPH *graph, char *text, int x, int y);
extern void PopGraphContext (void);
void slopelocation (GRAPH *graph, int x0, int y0);
void zoomin (GRAPH *graph);
static void X_ScreentoData (GRAPH *graph, int x, int y, double *fx, double *fy);
extern int DestroyGraph (int id);
extern void gr_redraw (GRAPH *graph);
extern void gr_resize (GRAPH *graph);
@ -287,6 +290,21 @@ handlekeypressed(Widget w, caddr_t clientdata, caddr_t calldata)
}
# ifdef notdef
void
keyhandler(clientdata, source, id)
caddr_t clientdata;
int *source;
XtInputId id;
{
# ifdef notdef
KEYwaiting = TRUE;
# endif
}
# endif
void
handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata)
{
@ -304,6 +322,17 @@ handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata)
}
# ifdef notdef
handlemotionev(w, clientdata, calldata)
Widget w;
caddr_t clientdata, calldata;
{
XMotionEvent *motionev = (XMotionEvent *) calldata;
switch
}
# endif
/* Recover from bad NewViewPort call. */
#define RECOVERNEWVIEWPORT() free((char *) graph);\
@ -496,6 +525,15 @@ X11_Arc(int x0, int y0, int radius, double theta1, double theta2)
x0 - radius,
currentgraph->absolute.height - radius - y0,
2 * radius, 2 * radius, t1, t2);
# ifdef notdef
printf("at %d, %d, %g %g x %d :: (%d, %d)\n",
x0, y0, theta1, theta2, radius, t1, t2);
printf("skip\n");
XSync(display, 0);
printf("XDrawArc(%d, %d, %d, %d, %d, %d)\n", x0 - radius,
currentgraph->absolute.height - radius - y0,
2 * radius, 2 * radius, t1, t2);
# endif
}
}
@ -540,6 +578,19 @@ X11_SetLinestyle(int linestyleid)
if (currentgraph->linestyle != linestyleid) {
# ifdef notdef
switch (linestyleid %3) {
case 0:
values.line_style = LineSolid;
break;
case 1:
values.line_style = LineOnOffDash;
break;
case 2:
values.line_style = LineDoubleDash;
break;
}
# endif
if ((linestyleid == 0 || numdispplanes > 1) && linestyleid != 1) {
/* solid if linestyle 0 or if has color, allow only one
* dashed linestyle */
@ -808,8 +859,10 @@ killwin(Widget w, caddr_t client_data, caddr_t call_data)
/* Iplots are done asynchronously */
DEVDEP(graph).isopen = 0;
DestroyGraph(graph->graphid);
/* MW. Not sure but DestroyGraph might free() to much - try Xt...() first */
XtDestroyWidget(DEVDEP(graph).shell);
DestroyGraph(graph->graphid);
}
@ -825,6 +878,15 @@ redraw(Widget w, caddr_t client_data, caddr_t call_data)
int n = 1;
DEVDEP(graph).isopen = 1;
# ifdef notdef
/* if there is a resize, let the resize routine handle the exposures */
if (XCheckWindowEvent(display, DEVDEP(graph).window,
(long) StructureNotifyMask, &ev)) {
resize(w, client_data, &ev);
return;
}
# endif
rects[0].x = pev->x;
rects[0].y = pev->y;
rects[0].width = pev->width;
@ -873,6 +935,38 @@ resize(Widget w, caddr_t client_data, caddr_t call_data)
}
# ifdef notdef
/* stolen from CP/lexical.c */
/* A special 'getc' so that we can deal with ^D properly. There is no way for
* stdio to know if we have typed a ^D after some other characters, so
* don't use buffering at all...
*/
static int inchar(fp)
FILE *fp;
{
char c;
int i;
extern int errno;
# ifdef HAS_TERMREAD
if (cp_interactive && !cp_nocc) {
i = read((int) fileno(fp), &c, 1);
if (i == 0)
return (EOF);
else if (i == -1) {
perror("read");
return (EOF);
} else
return ((int) c);
}
# endif
c = getc(fp);
return ((int) c);
}
# endif
void
X11_Input(REQUEST *request, RESPONSE *response)
{