From cc6100f5cb1dd1301a53301b4898b56c5bac1d26 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 1 Jan 2011 14:38:47 +0000 Subject: [PATCH] 'stop' and 'altermod' command execution modified --- ChangeLog | 6 ++++++ src/frontend/breakp.c | 5 +---- src/frontend/spiceif.c | 9 +++++++++ src/spicelib/analysis/dctran.c | 28 ++++++++++++++++++++++++---- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1115db6f..65b589ca2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +11-01-01 Holger Vogt + * breakp.c: update to multiple conditionals with '=' in stop command + dctran.c: set breakpoint upon startup from database dbs ('stop when time = xxx' command) + spiceif.c: additional call to CKTtemp(ckt) after 'altermod' command to set + device instance pParam for immediate use + 10-12-31 Holger Vogt * breakp.c: allow multiple conditionals with '=' in stop command diff --git a/src/frontend/breakp.c b/src/frontend/breakp.c index 3be0bf762..6d8e21fb2 100644 --- a/src/frontend/breakp.c +++ b/src/frontend/breakp.c @@ -88,11 +88,8 @@ com_stop(wordlist *wl) charr[3] = NULL; wln = wl_build(charr); wl_splice(wl->wl_next, wln); -// wl_free(wl->wl_next); -// wl->wl_next = NULL; -// wl = wl_append(wl, wln); } - + /* continue with parsing the enhanced wordlist */ if (wl->wl_next->wl_next && wl->wl_next->wl_next->wl_next) { wl = wl->wl_next; diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 49b0f12a6..95e9b5b94 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -928,6 +928,15 @@ if_setparam(CKTcircuit *ckt, char **name, char *param, struct dvec *val, int do_ dev = (GENinstance *)NULL; } doset(ckt, typecode, dev, mod, opt, val); + + /* Call to CKTtemp(ckt) will be invoked here only by 'altermod' commands, + to set internal model parameters pParam of each instance for immediate use, + otherwise e.g. model->BSIM3vth0 will be set, + but not pParam of any BSIM3 instance. + May contain side effects because call is abundant. h_vogt 110101 + */ + if (do_model) + CKTtemp(ckt); } static struct variable * diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 07f5a9cec..34b7eea37 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -16,6 +16,10 @@ Modified: 2000 AlansFixes #include "fteext.h" #include "missing_math.h" +/* for setting breakpoints required by dbs data base */ +extern struct dbcomm *dbs; +#include "ftedebug.h" + #ifdef XSPICE /* gtri - add - wbk - Add headers */ #include "miftypes.h" @@ -153,6 +157,22 @@ DCtran(CKTcircuit *ckt, firsttime = 1; save_mode = (ckt->CKTmode&MODEUIC) | MODETRANOP | MODEINITJCT; save_order = ckt->CKTorder; + +/* Add breakpoints here which have been requested by the user setting the + stop command as 'stop when time = xx'. + Get data from the global dbs data base. +*/ + if (dbs) { + struct dbcomm *d; + for (d = dbs; d; d = d->db_next) + if ((d->db_type == DB_STOPWHEN) && cieq(d->db_nodename1,"time") + && (d->db_value2 > 0)) { + CKTsetBreak(ckt, d->db_value2); + if (ft_ngdebug) + printf("breakpoint set to time = %g\n", d->db_value2); + } + } + #ifdef XSPICE /* gtri - begin - wbk - set a breakpoint at end of supply ramping time */ /* must do this after CKTtime set to 0 above */ @@ -175,10 +195,10 @@ DCtran(CKTcircuit *ckt, /* gtri - end - wbk - Call EVTop if event-driven instances exist */ } else #endif - converged = CKTop(ckt, - (ckt->CKTmode & MODEUIC) | MODETRANOP | MODEINITJCT, - (ckt->CKTmode & MODEUIC) | MODETRANOP | MODEINITFLOAT, - ckt->CKTdcMaxIter); + converged = CKTop(ckt, + (ckt->CKTmode & MODEUIC) | MODETRANOP | MODEINITJCT, + (ckt->CKTmode & MODEUIC) | MODETRANOP | MODEINITFLOAT, + ckt->CKTdcMaxIter); if(converged != 0) { fprintf(stdout,"\nTransient solution failed -\n");