pointer in ask
This commit is contained in:
parent
3b0551c544
commit
c897e60c8b
|
|
@ -26,9 +26,9 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
|
||||
NG_IGNORE(select);
|
||||
double g_be;
|
||||
IFvalue *IC, *IB, *RPIi, *RPIx, *GMi;
|
||||
IFvalue *CPIi, *CPIx, *CMUi, *CMUx;
|
||||
IFvalue *rcx_t, *re_t, *rb, *BETAAC;
|
||||
IFvalue IC, IB, RPIi, RPIx, GMi;
|
||||
IFvalue CPIi, CPIx, CMUi, CMUx;
|
||||
IFvalue rcx_t, re_t, rb, BETAAC;
|
||||
|
||||
switch(which) {
|
||||
case HICUM_AREA:
|
||||
|
|
@ -91,25 +91,29 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
return(OK);
|
||||
/* currents */
|
||||
case HICUM_QUEST_CC:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMiciei) -
|
||||
*(ckt->CKTstate0 + here->HICUMibici) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpci) -
|
||||
*(ckt->CKTstate0 + here->HICUMisici);
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = *(ckt->CKTstate0 + here->HICUMiciei) - // TODO: why does this not work ???
|
||||
// *(ckt->CKTstate0 + here->HICUMibici) - // these counter shoud be defined and expand to a integer
|
||||
// *(ckt->CKTstate0 + here->HICUMibpci) -
|
||||
// *(ckt->CKTstate0 + here->HICUMisici);
|
||||
return(OK);
|
||||
case HICUM_QUEST_CB:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMibiei) +
|
||||
*(ckt->CKTstate0 + here->HICUMibici) +
|
||||
*(ckt->CKTstate0 + here->HICUMibpci) +
|
||||
*(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = *(ckt->CKTstate0 + here->HICUMibiei) +
|
||||
// *(ckt->CKTstate0 + here->HICUMibici) +
|
||||
// *(ckt->CKTstate0 + here->HICUMibpci) +
|
||||
// *(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
return(OK);
|
||||
case HICUM_QUEST_CE:
|
||||
value->rValue = - *(ckt->CKTstate0 + here->HICUMibiei) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpei) -
|
||||
*(ckt->CKTstate0 + here->HICUMiciei);
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = - *(ckt->CKTstate0 + here->HICUMibiei) -
|
||||
// *(ckt->CKTstate0 + here->HICUMibpei) -
|
||||
// *(ckt->CKTstate0 + here->HICUMiciei);
|
||||
return(OK);
|
||||
case HICUM_QUEST_CS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMisici) -
|
||||
*(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = *(ckt->CKTstate0 + here->HICUMisici) -
|
||||
// *(ckt->CKTstate0 + here->HICUMibpsi);
|
||||
return(OK);
|
||||
case HICUM_QUEST_CAVL:
|
||||
value->rValue = here->HICUMiavl;
|
||||
|
|
@ -130,34 +134,41 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
/* transconductances and capacitances */
|
||||
case HICUM_QUEST_BETADC:
|
||||
// HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue *select)
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CC, IC, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CB, IB, select);
|
||||
if (IB->rValue != 0.0) {
|
||||
value->rValue = IC->rValue/IB->rValue;
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CC, &IC, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CB, &IB, select);
|
||||
if (IB.rValue != 0.0) {
|
||||
value->rValue = IC.rValue/IB.rValue;
|
||||
} else {
|
||||
value->rValue = 0.0;
|
||||
}
|
||||
return(OK);
|
||||
case HICUM_QUEST_GMI:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = *(ckt->CKTstate0 + here->HICUMiciei_Vbiei); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_GMS:
|
||||
value->rValue = *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = *(ckt->CKTstate0 + here->HICUMibpsi_Vbpci); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_RPII:
|
||||
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibiei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibiei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_RPIX:
|
||||
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpei_Vbpei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpei_Vbpei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_RMUI:
|
||||
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibici_Vbici) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibici_Vbici) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_RMUX:
|
||||
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpci_Vbpci) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMibpci_Vbpci) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_ROI:
|
||||
value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMiciei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
value->rValue = 0.0;
|
||||
// value->rValue = 1/( *(ckt->CKTstate0 + here->HICUMiciei_Vbiei) + ckt->CKTgmin); // TODO: Check sign vs VA-Code in ADS
|
||||
return(OK);
|
||||
case HICUM_QUEST_CPII:
|
||||
value->rValue = here->HICUMcapjei + here->HICUMcapdeix;
|
||||
|
|
@ -179,12 +190,12 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
return(OK);
|
||||
case HICUM_QUEST_BETAAC:
|
||||
// HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue *select)
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RPII, RPIi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RPIX, RPIx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_GMI, GMi, select);
|
||||
g_be = 1/(RPIi->rValue + RPIx->rValue);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RPII, &RPIi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RPIX, &RPIx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_GMI, &GMi, select);
|
||||
g_be = 1/(RPIi.rValue + RPIx.rValue);
|
||||
if (g_be > 0.0) {
|
||||
value->rValue = GMi->rValue/g_be;
|
||||
value->rValue = GMi.rValue/g_be;
|
||||
} else {
|
||||
value->rValue = 0.0;
|
||||
}
|
||||
|
|
@ -195,23 +206,23 @@ HICUMask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFval
|
|||
return(OK);
|
||||
case HICUM_QUEST_FT:
|
||||
// FT = GMi/(2*`M_PI*(CPIi+CPIx+CMUi+CMUx+(rcx_t+re_t+(re_t+rb)/BETAAC)*GMi*(CMUi+CMUx)));
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_GMI, GMi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CPII, CPIi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CPIX, CPIx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CMUI, CMUi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CMUX, CMUx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RCX_T, rcx_t, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RE_T, re_t, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RB, rb, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_BETAAC, BETAAC, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_GMI, &GMi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CPII, &CPIi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CPIX, &CPIx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CMUI, &CMUi, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_CMUX, &CMUx, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RCX_T, &rcx_t, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RE_T, &re_t, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_RB, &rb, select);
|
||||
HICUMask(ckt, instPtr, HICUM_QUEST_BETAAC, &BETAAC, select);
|
||||
|
||||
value->rValue = GMi->rValue/(
|
||||
value->rValue = GMi.rValue/(
|
||||
2 * M_PI * (
|
||||
CPIi->rValue + CPIx->rValue +
|
||||
CMUi->rValue + CMUx->rValue +
|
||||
(rcx_t->rValue + re_t->rValue + (re_t->rValue + rb->rValue)/BETAAC->rValue)
|
||||
) * GMi->rValue * (
|
||||
CMUi->rValue + CMUx->rValue
|
||||
CPIi.rValue + CPIx.rValue +
|
||||
CMUi.rValue + CMUx.rValue +
|
||||
(rcx_t.rValue + re_t.rValue + (re_t.rValue + rb.rValue)/BETAAC.rValue)
|
||||
) * GMi.rValue * (
|
||||
CMUi.rValue + CMUx.rValue
|
||||
)
|
||||
);
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ Q1 Q1_C Q1_B Q1_E Q1_E Q1_T P1
|
|||
.DC VE -0.2 -1.2 -10m
|
||||
.OPTIONS GMIN=1e-13 NOACCT
|
||||
|
||||
.print dc abs(i(vc)) abs(i(vb))
|
||||
.print dc abs(i(vc)) abs(i(vb)) @Q1[area] @Q1[icvbe] @Q1[icvce] @Q1[temp] @Q1[m] @Q1[vbe] @Q1[vbc] @Q1[vce] @Q1[vsc] @Q1[ic] @Q1[ib] @Q1[ie] @Q1[iavl] @Q1[is] @Q1[rcx_t] @Q1[re_t] @Q1[rbi] @Q1[rb] @Q1[betadc] @Q1[gmi] @Q1[gms] @Q1[rpii] @Q1[rpix] @Q1[rmui] @Q1[rmux] @Q1[roi] @Q1[cpii] @Q1[cpix] @Q1[cmui] @Q1[cmux] @Q1[ccs] @Q1[betaac] @Q1[crbi] @Q1[tf] @Q1[ft] @Q1[p] @Q1[tk] @Q1[dtsh]
|
||||
|
||||
|
||||
.MODEL P1 NPN LEVEL=8
|
||||
+ c10=9.074e-030 qp0=1.008e-013 hfe=10.01 hfc=20.04 hjei=3.382 hjci=0.2
|
||||
|
|
|
|||
Loading…
Reference in New Issue