top vsrc
This commit is contained in:
parent
c9cd174761
commit
6f600772d9
|
|
@ -178,20 +178,6 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel)
|
|||
}
|
||||
}
|
||||
|
||||
/* check td + first >= 0 */
|
||||
|
||||
/*
|
||||
* Postition:
|
||||
* nxt = [0, order[
|
||||
* rpt = [0.. [
|
||||
* with
|
||||
* time == arr[nxt] + rpt*period + td
|
||||
*
|
||||
* (fixme, no thats inclusive see above)
|
||||
*
|
||||
* evtl ==order als Ende Kriterium, !!! must
|
||||
*/
|
||||
|
||||
/* (libc) Remainder Functions, `same sign ...' and magnitude ... */
|
||||
|
||||
#if 0
|
||||
|
|
@ -201,6 +187,7 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel)
|
|||
rest = time;
|
||||
#endif
|
||||
|
||||
/*hier gehts weiter*/
|
||||
if (!ckt->CKTbreak || here->nxt >= here->VSRCfunctionOrder)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ VSRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
|
|||
FREE(here);
|
||||
return(OK);
|
||||
}
|
||||
/* oder here delete ? */
|
||||
prev = &(here->VSRCnextInstance);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ pwl_state_get(struct pwl_state *this, double time)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
static struct pwl_state *
|
||||
pwl_state_init(struct pwl_state *this, VSRCinstance *here)
|
||||
{
|
||||
|
||||
|
|
@ -101,6 +101,9 @@ pwl_state_init(struct pwl_state *this, VSRCinstance *here)
|
|||
: here->VSRCr == 0 && here->VSRCrperiod == 0 && here->VSRCrBreakpt == 0 );
|
||||
#endif
|
||||
|
||||
if (!this)
|
||||
this = TMALLOC(struct pwl_state, 1);
|
||||
|
||||
this->len = here->VSRCfunctionOrder;
|
||||
this->arr = here->VSRCcoeffs;
|
||||
this->position = 0;
|
||||
|
|
@ -109,6 +112,8 @@ pwl_state_init(struct pwl_state *this, VSRCinstance *here)
|
|||
this->td = here->VSRCrdelay;
|
||||
this->tp = here->VSRCrperiod;
|
||||
this->rBreakpt = here->VSRCrBreakpt;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -387,10 +392,8 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt)
|
|||
|
||||
case PWL: {
|
||||
|
||||
if (!here->VSRC_state) {
|
||||
here->VSRC_state = TMALLOC(struct pwl_state, 1);
|
||||
pwl_state_init((struct pwl_state *) here->VSRC_state, here);
|
||||
}
|
||||
if (!here->VSRC_state)
|
||||
here->VSRC_state = pwl_state_init(NULL, here);
|
||||
|
||||
value = pwl_state_get((struct pwl_state *) here -> VSRC_state, time);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ VSRCunsetup(GENmodel *inModel, CKTcircuit *ckt)
|
|||
for (here = model->VSRCinstances; here != NULL;
|
||||
here=here->VSRCnextInstance)
|
||||
{
|
||||
/* here free * ? */
|
||||
if (here->VSRCbranch) {
|
||||
CKTdltNNum(ckt, here->VSRCbranch);
|
||||
here->VSRCbranch = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue