CKTfndDev(), assert some facts
This commit is contained in:
parent
d9fbb36ac7
commit
6e7d70e4bb
|
|
@ -614,6 +614,7 @@ finddev_special(
|
||||||
int err;
|
int err;
|
||||||
int type = -1;
|
int type = -1;
|
||||||
|
|
||||||
|
// assert(third && *third == NULL); for all invocations
|
||||||
err = ft_sim->findInstance (ckt, &type, devptr, name);
|
err = ft_sim->findInstance (ckt, &type, devptr, name);
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
*device_or_model = 0;
|
*device_or_model = 0;
|
||||||
|
|
@ -1215,6 +1216,7 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr)
|
||||||
int err;
|
int err;
|
||||||
int type = -1;
|
int type = -1;
|
||||||
|
|
||||||
|
// assert(third && *third == NULL); for all invocations
|
||||||
err = ft_sim->findInstance (ckt, &type, devptr, name);
|
err = ft_sim->findInstance (ckt, &type, devptr, name);
|
||||||
if (err == OK)
|
if (err == OK)
|
||||||
return (type);
|
return (type);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ NOISEan (CKTcircuit *ckt, int restart)
|
||||||
inst = NULL;
|
inst = NULL;
|
||||||
code = CKTtypelook("Vsource");
|
code = CKTtypelook("Vsource");
|
||||||
if (code != -1) {
|
if (code != -1) {
|
||||||
|
// assert(third && *third == NULL);
|
||||||
error = CKTfndDev(ckt, NULL, &inst, job->input);
|
error = CKTfndDev(ckt, NULL, &inst, job->input);
|
||||||
if (!error && !((VSRCinstance *)inst)->VSRCacGiven) {
|
if (!error && !((VSRCinstance *)inst)->VSRCacGiven) {
|
||||||
errMsg = TMALLOC(char, strlen(noacinput) + 1);
|
errMsg = TMALLOC(char, strlen(noacinput) + 1);
|
||||||
|
|
@ -58,6 +59,7 @@ NOISEan (CKTcircuit *ckt, int restart)
|
||||||
|
|
||||||
code = CKTtypelook("Isource");
|
code = CKTtypelook("Isource");
|
||||||
if (code != -1 && inst==NULL) {
|
if (code != -1 && inst==NULL) {
|
||||||
|
// assert(third && *third == NULL);
|
||||||
error = CKTfndDev(ckt, NULL, &inst, job->input);
|
error = CKTfndDev(ckt, NULL, &inst, job->input);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* XXX ??? */
|
/* XXX ??? */
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ TFanal(CKTcircuit *ckt, int restart)
|
||||||
Itype = CKTtypelook("Isource");
|
Itype = CKTtypelook("Isource");
|
||||||
Vtype = CKTtypelook("Vsource");
|
Vtype = CKTtypelook("Vsource");
|
||||||
if(Itype != -1) {
|
if(Itype != -1) {
|
||||||
|
// assert(third && *third == NULL);
|
||||||
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
|
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
|
||||||
if(error ==0) {
|
if(error ==0) {
|
||||||
job->TFinIsI = 1;
|
job->TFinIsI = 1;
|
||||||
|
|
@ -61,6 +62,7 @@ TFanal(CKTcircuit *ckt, int restart)
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (Vtype != -1) && (ptr==NULL) ) {
|
if( (Vtype != -1) && (ptr==NULL) ) {
|
||||||
|
// assert(third && *third == NULL);
|
||||||
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
|
error = CKTfndDev(ckt, NULL, &ptr, job->TFinSrc);
|
||||||
job->TFinIsV = 1;
|
job->TFinIsV = 1;
|
||||||
job->TFinIsI = 0;
|
job->TFinIsI = 0;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name
|
||||||
if(!modPtr)
|
if(!modPtr)
|
||||||
return E_NOMOD;
|
return E_NOMOD;
|
||||||
|
|
||||||
|
// assert(third && *third == NULL);
|
||||||
error = CKTfndDev(ckt, NULL, &instPtr, name);
|
error = CKTfndDev(ckt, NULL, &instPtr, name);
|
||||||
|
|
||||||
if (error == OK) {
|
if (error == OK) {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
return(E_INTERN);
|
return(E_INTERN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assert(third);
|
||||||
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind1), here->MUTindName1);
|
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind1), here->MUTindName1);
|
||||||
if(error) {
|
if(error) {
|
||||||
IFuid namarray[2];
|
IFuid namarray[2];
|
||||||
|
|
@ -52,6 +53,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||||
"%s: coupling to non-existant inductor %s.",
|
"%s: coupling to non-existant inductor %s.",
|
||||||
namarray);
|
namarray);
|
||||||
}
|
}
|
||||||
|
// assert(third);
|
||||||
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind2), here->MUTindName2);
|
error = CKTfndDev(ckt, NULL, (GENinstance **) &(here->MUTind2), here->MUTindName2);
|
||||||
if(error) {
|
if(error) {
|
||||||
IFuid namarray[2];
|
IFuid namarray[2];
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam,
|
||||||
* (name, type, direct pointer) - the type and direct pointer
|
* (name, type, direct pointer) - the type and direct pointer
|
||||||
* WILL be set on return unless error is not OK
|
* WILL be set on return unless error is not OK
|
||||||
*/
|
*/
|
||||||
|
// assert(third) for all invocations
|
||||||
error = sim->findInstance (ckt, dev, fast, devnam);
|
error = sim->findInstance (ckt, dev, fast, devnam);
|
||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
|
||||||
|
|
@ -1394,6 +1394,7 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv)
|
||||||
|
|
||||||
/* get the unique IFuid for name (device/model) */
|
/* get the unique IFuid for name (device/model) */
|
||||||
INPretrieve(&name, ft_curckt->ci_symtab);
|
INPretrieve(&name, ft_curckt->ci_symtab);
|
||||||
|
// assert(third && *third == NULL);
|
||||||
err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name);
|
err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name);
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
typecode = -1;
|
typecode = -1;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ SENstartup(CKTcircuit *ckt, int restart)
|
||||||
type = -1;
|
type = -1;
|
||||||
fast = NULL;
|
fast = NULL;
|
||||||
|
|
||||||
|
// assert(third && *third == NULL);
|
||||||
err = CKTfndDev(ckt, &type, &fast, ckt->CKTsenInfo->SENdevices[i]);
|
err = CKTfndDev(ckt, &type, &fast, ckt->CKTsenInfo->SENdevices[i]);
|
||||||
if (err != OK)
|
if (err != OK)
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue