Applied Widlok patch
This commit is contained in:
parent
808021fef2
commit
f9144f90b3
|
|
@ -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
|
* noisean.c: Merged the previous code with the new one included in
|
||||||
bsim4 distribution. This code originated from Weidong Lu
|
bsim4 distribution. This code originated from Weidong Lu
|
||||||
(bsim group).
|
(bsim group).
|
||||||
|
|
||||||
1999-12-20 Paolo Nenzi <p.nenzi@ieee.org>
|
1999-12-20 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
* noisean.c:
|
||||||
* noisean.c:
|
Bug: The ac noise analysis in Spice3f4 has a serious bug. In
|
||||||
Bug: he ac noise analysis in Spice3f4 has a serious bug. In interactive mode,
|
interactive mode it fails to reproduce frequency dependence known
|
||||||
it fails to reproduce frequency dependence known to exist. In batch (Spice2)
|
to exist. In batch (Spice2) mode, it works only if a corresponding
|
||||||
mode, it works only if a corresponding ac analysis has been run first.
|
ac analysis has been run first.
|
||||||
Fix: This bug is fixed by providing a call to CKTload() in noisean.c as shown
|
Fix: This bug is fixed by providing a call to CKTload() in
|
||||||
by the source code patch which is attached below.
|
noisean.c as shown by the source code patch which is attached below.
|
||||||
|
|
||||||
|
|
||||||
1999-09-08 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>
|
1999-09-08 Emmanuel Rouat <emmanuel.rouat@wanadoo.fr>
|
||||||
|
|
|
||||||
|
|
@ -636,6 +636,14 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set)
|
||||||
#endif
|
#endif
|
||||||
if (!(p->flags & ISAROOT) && CKTpzTrapped == 3
|
if (!(p->flags & ISAROOT) && CKTpzTrapped == 3
|
||||||
&& NIpzK != 0.0 && NIpzK_mag > -10) {
|
&& 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;
|
p->flags |= ISAMINIMA;
|
||||||
free(new_trial);
|
free(new_trial);
|
||||||
*new_trialp = p;
|
*new_trialp = p;
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,22 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
#ifndef notdef
|
#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
|
#ifdef ASDEBUG
|
||||||
DEBUG(1)
|
DEBUG(1)
|
||||||
printf(">>> restart : %d\n", restart);
|
printf(">>> restart : %d\n", restart);
|
||||||
|
|
@ -101,6 +117,10 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
(ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT,
|
(ckt->CKTmode & MODEUIC) | MODEDCOP | MODEINITFLOAT,
|
||||||
ckt->CKTdcMaxIter);
|
ckt->CKTdcMaxIter);
|
||||||
|
|
||||||
|
#ifdef notdef
|
||||||
|
ckt->CKTmode = (ckt->CKTmode & MODEUIC)
|
||||||
|
| MODEDCOP | MODEINITSMSIG;
|
||||||
|
#endif
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
|
@ -210,6 +230,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
}
|
}
|
||||||
#endif
|
#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++) {
|
for (i = 0; i < nfreqs; i++) {
|
||||||
/* XXX handle restart */
|
/* XXX handle restart */
|
||||||
|
|
||||||
|
|
@ -248,6 +275,12 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
E = ckt->CKTrhs;
|
E = ckt->CKTrhs;
|
||||||
iE = ckt->CKTirhs;
|
iE = ckt->CKTirhs;
|
||||||
Y = ckt->CKTmatrix;
|
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);
|
error = CKTtemp(ckt);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
@ -258,6 +291,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
if (error)
|
if (error)
|
||||||
return 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 */
|
/* Use a different vector & matrix */
|
||||||
|
|
@ -330,7 +370,9 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
|
|
||||||
#ifdef ASDEBUG
|
#ifdef ASDEBUG
|
||||||
DEBUG(1) printf("Original value: %g\n", sg->value);
|
DEBUG(1) printf("Original value: %g\n", sg->value);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ASDEBUG
|
||||||
DEBUG(2) {
|
DEBUG(2) {
|
||||||
printf("Effect of device:\n");
|
printf("Effect of device:\n");
|
||||||
spPrint(delta_Y, 0, 1, 1);
|
spPrint(delta_Y, 0, 1, 1);
|
||||||
|
|
@ -529,6 +571,13 @@ int sens_sens(CKTcircuit *ckt, int restart)
|
||||||
ckt->CKTmatrix = Y;
|
ckt->CKTmatrix = Y;
|
||||||
ckt->CKTbypass = bypass;
|
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
|
#endif
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
2000-05-22 Paolo Nenzi <p.nenzi@ieee.org>
|
||||||
|
|
||||||
|
* x11.c: Applied Widlok patch and reintrodced some #ifdef notdef
|
||||||
|
code.
|
||||||
|
|
@ -88,6 +88,8 @@ static int numdispplanes;
|
||||||
|
|
||||||
extern void internalerror (char *message);
|
extern void internalerror (char *message);
|
||||||
extern void externalerror (char *message);
|
extern void externalerror (char *message);
|
||||||
|
static void initlinestyles (void);
|
||||||
|
static void initcolors (GRAPH *graph);
|
||||||
extern void PushGraphContext (GRAPH *graph);
|
extern void PushGraphContext (GRAPH *graph);
|
||||||
extern void SetColor (int colorid);
|
extern void SetColor (int colorid);
|
||||||
extern void Text (char *text, int x, int y);
|
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);
|
extern void PopGraphContext (void);
|
||||||
void slopelocation (GRAPH *graph, int x0, int y0);
|
void slopelocation (GRAPH *graph, int x0, int y0);
|
||||||
void zoomin (GRAPH *graph);
|
void zoomin (GRAPH *graph);
|
||||||
|
static void X_ScreentoData (GRAPH *graph, int x, int y, double *fx, double *fy);
|
||||||
extern int DestroyGraph (int id);
|
extern int DestroyGraph (int id);
|
||||||
extern void gr_redraw (GRAPH *graph);
|
extern void gr_redraw (GRAPH *graph);
|
||||||
extern void gr_resize (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
|
void
|
||||||
handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata)
|
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. */
|
/* Recover from bad NewViewPort call. */
|
||||||
#define RECOVERNEWVIEWPORT() free((char *) graph);\
|
#define RECOVERNEWVIEWPORT() free((char *) graph);\
|
||||||
|
|
@ -496,6 +525,15 @@ X11_Arc(int x0, int y0, int radius, double theta1, double theta2)
|
||||||
x0 - radius,
|
x0 - radius,
|
||||||
currentgraph->absolute.height - radius - y0,
|
currentgraph->absolute.height - radius - y0,
|
||||||
2 * radius, 2 * radius, t1, t2);
|
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) {
|
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) {
|
if ((linestyleid == 0 || numdispplanes > 1) && linestyleid != 1) {
|
||||||
/* solid if linestyle 0 or if has color, allow only one
|
/* solid if linestyle 0 or if has color, allow only one
|
||||||
* dashed linestyle */
|
* dashed linestyle */
|
||||||
|
|
@ -808,8 +859,10 @@ killwin(Widget w, caddr_t client_data, caddr_t call_data)
|
||||||
|
|
||||||
/* Iplots are done asynchronously */
|
/* Iplots are done asynchronously */
|
||||||
DEVDEP(graph).isopen = 0;
|
DEVDEP(graph).isopen = 0;
|
||||||
DestroyGraph(graph->graphid);
|
/* MW. Not sure but DestroyGraph might free() to much - try Xt...() first */
|
||||||
XtDestroyWidget(DEVDEP(graph).shell);
|
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;
|
int n = 1;
|
||||||
|
|
||||||
DEVDEP(graph).isopen = 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].x = pev->x;
|
||||||
rects[0].y = pev->y;
|
rects[0].y = pev->y;
|
||||||
rects[0].width = pev->width;
|
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
|
void
|
||||||
X11_Input(REQUEST *request, RESPONSE *response)
|
X11_Input(REQUEST *request, RESPONSE *response)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue