From: Robert L. <Rob...@t-...> - 2010-12-30 11:55:05
|
Robert Larice <Rob...@t-...> writes: > It seems to me BSIM4GEgpPtr is rotten in the second run. > This is a pointer to a matrix element, and is engineered from BSIM4gNodePrime > I suppose, these extra nodes (BSIM4gNodePrime etc) > have to be allocated for the SPmatrix, > and it seems to me this is done only on the first run. > On the second run the new matrix doesn't know of these extra nodes, > and the element pointer points to an unused slot of the matrix. > So far just guessing. Hello again, in b4set.c there is: if ((here->BSIM4rgateMod > 0) && (here->BSIM4gNodePrime == 0)) { error = CKTmkVolt(ckt,&tmp,here->BSIM4name,"gate"); if(error) return(error); here->BSIM4gNodePrime = tmp->number; ... } else here->BSIM4gNodePrime = here->BSIM4gNodeExt; this is executed once for every `op' analysis. on the first run, BSIM4gNodePrime == 0, and the conditional if-body is executed. on the second run, BSIM4gNodePrime != 0, and is thus overwritten with an incorrect value (..gNodeExt) Now I don't know what the correct fix is. Either, the code was written with the implicit assumption, that the whole struct has to be bzero'ed on every new analysis. Or, the == 0 query should be just deleted, Or, CKTmkVolt is indeed meant to be called only on the first run, and the else-body should be guarded. Regards, Robert |