Browse Source

first attempt to include NQS effect

pre-master-46
dwarning 2 years ago
committed by Holger Vogt
parent
commit
6e6e2fb203
  1. 52
      src/spicelib/devices/vbic/vbicacld.c
  2. 10
      src/spicelib/devices/vbic/vbicask.c
  3. 30
      src/spicelib/devices/vbic/vbicconv.c
  4. 201
      src/spicelib/devices/vbic/vbicdefs.h
  5. 4021
      src/spicelib/devices/vbic/vbicload.c
  6. 14
      src/spicelib/devices/vbic/vbicnoise.c
  7. 52
      src/spicelib/devices/vbic/vbicpzld.c
  8. 61
      src/spicelib/devices/vbic/vbicsetup.c

52
src/spicelib/devices/vbic/vbicacld.c

@ -46,32 +46,32 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt)
for( here = VBICinstances(model); here!= NULL;
here = VBICnextInstance(here)) {
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_Vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_Vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_Vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_Vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_Vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_Vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_Vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_Vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_Vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_Vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_Vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_Vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_Vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_Vbcp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_Vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_Vbci);
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_Vbcp);
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_Vrcx);
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_Vrbx);
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_Vrs);
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_Vre);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_vbcp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_vbci);
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_vbcp);
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_vrcx);
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_vrbx);
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_vrs);
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_vre);
/*
c The real part

10
src/spicelib/devices/vbic/vbicask.c

@ -122,19 +122,19 @@ VBICask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu
fabs(IS.rValue * *(ckt->CKTstate0 + here->VBICvrbp));
return(OK);
case VBIC_QUEST_GM:
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_vbei);
return(OK);
case VBIC_QUEST_GO:
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
value->rValue = *(ckt->CKTstate0 + here->VBICitzf_vbci);
return(OK);
case VBIC_QUEST_GPI:
value->rValue = *(ckt->CKTstate0 + here->VBICibe_Vbei);
value->rValue = *(ckt->CKTstate0 + here->VBICibe_vbei);
return(OK);
case VBIC_QUEST_GMU:
value->rValue = *(ckt->CKTstate0 + here->VBICibc_Vbci);
value->rValue = *(ckt->CKTstate0 + here->VBICibc_vbci);
return(OK);
case VBIC_QUEST_GX:
value->rValue = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
value->rValue = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
return(OK);
case VBIC_QUEST_CBE:
value->rValue = here->VBICcapbe;

30
src/spicelib/devices/vbic/vbicconv.c

@ -85,27 +85,27 @@ VBICconvTest(GENmodel *inModel, CKTcircuit *ckt)
delvrbp = Vrbp - *(ckt->CKTstate0 + here->VBICvrbp);
delvbcp = Vbcp - *(ckt->CKTstate0 + here->VBICvbcp);
ibehat = *(ckt->CKTstate0 + here->VBICibe) +
*(ckt->CKTstate0 + here->VBICibe_Vbei)*delvbei;
*(ckt->CKTstate0 + here->VBICibe_vbei)*delvbei;
ibexhat = *(ckt->CKTstate0 + here->VBICibex) +
*(ckt->CKTstate0 + here->VBICibex_Vbex)*delvbex;
*(ckt->CKTstate0 + here->VBICibex_vbex)*delvbex;
itzfhat = *(ckt->CKTstate0 + here->VBICitzf) +
*(ckt->CKTstate0 + here->VBICitzf_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzf_Vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzf_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzf_vbci)*delvbci;
itzrhat = *(ckt->CKTstate0 + here->VBICitzr) +
*(ckt->CKTstate0 + here->VBICitzr_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_Vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICitzr_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICitzr_vbci)*delvbci;
ibchat = *(ckt->CKTstate0 + here->VBICibc) +
*(ckt->CKTstate0 + here->VBICibc_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_Vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibc_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICibc_vbci)*delvbci;
ibephat = *(ckt->CKTstate0 + here->VBICibep) +
*(ckt->CKTstate0 + here->VBICibep_Vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_Vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_Vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_Vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_Vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_Vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_Vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_Vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_Vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_Vbci)*delvbci;
*(ckt->CKTstate0 + here->VBICibep_vbep)*delvbep;
ircihat = *(ckt->CKTstate0 + here->VBICirci) + *(ckt->CKTstate0 + here->VBICirci_vrci)*delvrci +
*(ckt->CKTstate0 + here->VBICirci_vbcx)*delvbcx + *(ckt->CKTstate0 + here->VBICirci_vbci)*delvbci;
irbihat = *(ckt->CKTstate0 + here->VBICirbi) + *(ckt->CKTstate0 + here->VBICirbi_vrbi)*delvrbi +
*(ckt->CKTstate0 + here->VBICirbi_vbei)*delvbei + *(ckt->CKTstate0 + here->VBICirbi_vbci)*delvbci;
irbphat = *(ckt->CKTstate0 + here->VBICirbp) + *(ckt->CKTstate0 + here->VBICirbp_vrbp)*delvrbp +
*(ckt->CKTstate0 + here->VBICirbp_vbep)*delvbep + *(ckt->CKTstate0 + here->VBICirbp_vbci)*delvbci;
ibcphat = *(ckt->CKTstate0 + here->VBICibcp) +
*(ckt->CKTstate0 + here->VBICibcp_Vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_Vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_Vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_Vbcp)*delvbcp;
*(ckt->CKTstate0 + here->VBICibcp_vbcp)*delvbcp;
iccphat = *(ckt->CKTstate0 + here->VBICiccp) + *(ckt->CKTstate0 + here->VBICiccp_vbep)*delvbep +
*(ckt->CKTstate0 + here->VBICiccp_vbci)*delvbci + *(ckt->CKTstate0 + here->VBICiccp_vbcp)*delvbcp;
Ibe = *(ckt->CKTstate0 + here->VBICibe);
Ibex = *(ckt->CKTstate0 + here->VBICibex);
Itzf = *(ckt->CKTstate0 + here->VBICitzf);

201
src/spicelib/devices/vbic/vbicdefs.h

@ -60,6 +60,9 @@ typedef struct sVBICinstance {
int VBICemitEINode; /* number of internal emitter node of vbic */
int VBICbaseBPNode; /* number of internal base node of vbic */
int VBICsubsSINode; /* number of internal substrate node */
int VBICxf1Node; /* number of internal excess phase 1 node itf */
int VBICxf2Node; /* number of internal excess phase 2 node itf */
int VBICbrEq; /* number of the branch equation added for current */
double VBICarea; /* area factor for the vbic */
double VBICicVBE; /* initial condition voltage B-E*/
@ -125,6 +128,10 @@ typedef struct sVBICinstance {
* (emitter prime,emitter prime) */
double *VBICsubsSISubsSIPtr; /* pointer to sparse matrix at
* (substrate prime, substrate prime) */
double *VBICemitEIXfPtr; /* pointer to sparse matrix at
* (emitter prime,xf) */
double *VBICbaseBIXfPtr; /* pointer to sparse matrix at
* (base prime,xf) */
double *VBICbaseEmitPtr; /* pointer to sparse matrix at
* (base,emit) */
@ -233,6 +240,32 @@ typedef struct sVBICinstance {
double *VBICtempSubsSIPtr;
double *VBICtempTempPtr;
/* excess phase */
double *VBICxf1Xf1Ptr; //
double *VBICxf1TempPtr;
double *VBICxf1BaseBIPtr; //
double *VBICxf1EmitEIPtr; //
double *VBICxf1CollCIPtr; //
double *VBICxf1Xf2Ptr; //
double *VBICxf2Xf1Ptr;
double *VBICtempXf2Ptr; //
double *VBICxf2BaseBIPtr;
double *VBICxf2EmitEIPtr;
double *VBICxf2CollCIPtr;
double *VBICxf2Xf2Ptr;
double *VBICemitXf2Ptr;
double *VBICemitEIXf2Ptr; //
double *VBICbaseBIXf2Ptr; //
double *VBICcollCIXf2Ptr; //
double *VBICxf1IbrPtr; //
double *VBICxf2IbrPtr; //
double *VBICibrXf1Ptr; //
double *VBICibrXf2Ptr; //
double *VBICibrIbrPtr; //
unsigned VBICareaGiven :1; /* flag to indicate area was specified */
unsigned VBICoff :1; /* 'off' flag for vbic */
unsigned VBICicVBEGiven :1; /* flag to indicate VBE init. cond. given */
@ -280,6 +313,7 @@ typedef struct sVBICinstance {
double VBICith_Vbex;
double VBICith_Vbep;
double VBICith_Vbcp;
double VBICqf_Vxf;
double VBICith_Vcep;
double VBICith_Vrci;
double VBICith_Vbcx;
@ -290,6 +324,9 @@ typedef struct sVBICinstance {
double VBICith_Vre;
double VBICith_Vrs;
double VBICcapxf;
double VBICindInduct;
int VBIC_selfheat; /* self-heating enabled */
#ifndef NONOISE
@ -308,6 +345,7 @@ typedef struct sVBICinstance {
BindElement *VBICcollCICollCIBinding ;
BindElement *VBICbaseBXBaseBXBinding ;
BindElement *VBICbaseBIBaseBIBinding ;
BindElement *VBICbaseBIXfBinding ;
BindElement *VBICemitEIEmitEIBinding ;
BindElement *VBICbaseBPBaseBPBinding ;
BindElement *VBICsubsSISubsSIBinding ;
@ -356,11 +394,14 @@ typedef struct sVBICinstance {
BindElement *VBICemitTempBinding ;
BindElement *VBICsubsTempBinding ;
BindElement *VBICcollCItempBinding ;
BindElement *VBICcollCIXf2Binding ;
BindElement *VBICcollCXtempBinding ;
BindElement *VBICbaseBItempBinding ;
BindElement *VBICbaseBXtempBinding ;
BindElement *VBICbaseBPtempBinding ;
BindElement *VBICemitEItempBinding ;
BindElement *VBICemitEIXf2Binding ;
BindElement *VBICemitEIXfBinding ;
BindElement *VBICsubsSItempBinding ;
BindElement *VBICtempCollBinding ;
BindElement *VBICtempCollCIBinding ;
@ -374,6 +415,18 @@ typedef struct sVBICinstance {
BindElement *VBICtempSubsBinding ;
BindElement *VBICtempSubsSIBinding ;
BindElement *VBICtempTempBinding ;
BindElement *VBICxf1BaseBIBinding ;
BindElement *VBICxf1CollCIBinding ;
BindElement *VBICxf1EmitEIBinding ;
BindElement *VBICxf1TempBinding ;
BindElement *VBICxf1Xf1Binding ;
BindElement *VBICxf1Xf2Binding ;
BindElement *VBICxf2BaseBIBinding ;
BindElement *VBICxf2CollCIBinding ;
BindElement *VBICxf2EmitEIBinding ;
BindElement *VBICxf2TempBinding ;
BindElement *VBICxf2Xf1Binding ;
BindElement *VBICxf2Xf2Binding ;
#endif
} VBICinstance ;
@ -389,92 +442,116 @@ typedef struct sVBICinstance {
#define VBICvrbi VBICstate+6
#define VBICvrbp VBICstate+7
#define VBICvbcp VBICstate+8
#define VBICvxf1 VBICstate+9
#define VBICvxf2 VBICstate+10
#define VBICibe VBICstate+11
#define VBICibe_vbei VBICstate+12
#define VBICibex VBICstate+13
#define VBICibex_vbex VBICstate+14
#define VBICitzf VBICstate+15
#define VBICitzf_vbei VBICstate+16
#define VBICitzf_vbci VBICstate+17
#define VBICitzf_vrth VBICstate+18
#define VBICitzr VBICstate+19
#define VBICitzr_vbci VBICstate+20
#define VBICitzr_vbei VBICstate+21
#define VBICibc VBICstate+22
#define VBICibc_vbci VBICstate+23
#define VBICibc_vbei VBICstate+24
#define VBICibep VBICstate+25
#define VBICibep_vbep VBICstate+26
#define VBICibe VBICstate+9
#define VBICibe_Vbei VBICstate+10
#define VBICirci VBICstate+27
#define VBICirci_vrci VBICstate+28
#define VBICirci_vbci VBICstate+29
#define VBICirci_vbcx VBICstate+30
#define VBICibex VBICstate+11
#define VBICibex_Vbex VBICstate+12
#define VBICirbi VBICstate+31
#define VBICirbi_vrbi VBICstate+32
#define VBICirbi_vbei VBICstate+33
#define VBICirbi_vbci VBICstate+34
#define VBICitzf VBICstate+13
#define VBICitzf_Vbei VBICstate+14
#define VBICitzf_Vbci VBICstate+15
#define VBICirbp VBICstate+35
#define VBICirbp_vrbp VBICstate+36
#define VBICirbp_vbep VBICstate+37
#define VBICirbp_vbci VBICstate+38
#define VBICitzr VBICstate+16
#define VBICitzr_Vbci VBICstate+17
#define VBICitzr_Vbei VBICstate+18
#define VBICibc VBICstate+19
#define VBICibc_Vbci VBICstate+20
#define VBICibc_Vbei VBICstate+21
#define VBICqbe VBICstate+39
#define VBICcqbe VBICstate+40
#define VBICcqbeci VBICstate+41
#define VBICibep VBICstate+22
#define VBICibep_Vbep VBICstate+23
#define VBICqbex VBICstate+42
#define VBICcqbex VBICstate+43
#define VBICirci VBICstate+24
#define VBICirci_Vrci VBICstate+25
#define VBICirci_Vbci VBICstate+26
#define VBICirci_Vbcx VBICstate+27
#define VBICqbc VBICstate+44
#define VBICcqbc VBICstate+45
#define VBICirbi VBICstate+28
#define VBICirbi_Vrbi VBICstate+29
#define VBICirbi_Vbei VBICstate+30
#define VBICirbi_Vbci VBICstate+31
#define VBICqbcx VBICstate+46
#define VBICcqbcx VBICstate+47
#define VBICirbp VBICstate+32
#define VBICirbp_Vrbp VBICstate+33
#define VBICirbp_Vbep VBICstate+34
#define VBICirbp_Vbci VBICstate+35
#define VBICqbep VBICstate+48
#define VBICcqbep VBICstate+49
#define VBICcqbepci VBICstate+50
#define VBICqbeo VBICstate+51
#define VBICcqbeo VBICstate+52
#define VBICgqbeo VBICstate+53
#define VBICqbe VBICstate+36
#define VBICcqbe VBICstate+37
#define VBICcqbeci VBICstate+38
#define VBICqbco VBICstate+54
#define VBICcqbco VBICstate+55
#define VBICgqbco VBICstate+56
#define VBICqbex VBICstate+39
#define VBICcqbex VBICstate+40
#define VBICibcp VBICstate+57
#define VBICibcp_vbcp VBICstate+58
#define VBICqbc VBICstate+41
#define VBICcqbc VBICstate+42
#define VBICiccp VBICstate+59
#define VBICiccp_vbep VBICstate+60
#define VBICiccp_vbci VBICstate+61
#define VBICiccp_vbcp VBICstate+62
#define VBICqbcx VBICstate+43
#define VBICcqbcx VBICstate+44
#define VBICqbcp VBICstate+63
#define VBICcqbcp VBICstate+64
#define VBICqbep VBICstate+45
#define VBICcqbep VBICstate+46
#define VBICcqbepci VBICstate+47
#define VBICircx_vrcx VBICstate+65
#define VBICirbx_vrbx VBICstate+66
#define VBICirs_vrs VBICstate+67
#define VBICire_vre VBICstate+68
#define VBICqbeo VBICstate+48
#define VBICcqbeo VBICstate+49
#define VBICgqbeo VBICstate+50
#define VBICqcth VBICstate+69 /* thermal capacitor charge */
#define VBICcqcth VBICstate+70 /* thermal capacitor current */
#define VBICqbco VBICstate+51
#define VBICcqbco VBICstate+52
#define VBICgqbco VBICstate+53
#define VBICvrth VBICstate+71
#define VBICicth_vrth VBICstate+72
#define VBICibcp VBICstate+54
#define VBICibcp_Vbcp VBICstate+55
#define VBICqcxf VBICstate+73
#define VBICcqcxf VBICstate+74
#define VBICgqxf VBICstate+75
#define VBICiccp VBICstate+56
#define VBICiccp_Vbep VBICstate+57
#define VBICiccp_Vbci VBICstate+58
#define VBICiccp_Vbcp VBICstate+59
#define VBICibc_vrxf VBICstate+76
#define VBICqbcp VBICstate+60
#define VBICcqbcp VBICstate+61
#define VBICixzf VBICstate+77
#define VBICixzf_vbei VBICstate+78
#define VBICixzf_vbci VBICstate+79
#define VBICixzf_vrth VBICstate+80
#define VBICircx_Vrcx VBICstate+62
#define VBICirbx_Vrbx VBICstate+63
#define VBICirs_Vrs VBICstate+64
#define VBICire_Vre VBICstate+65
#define VBICixxf VBICstate+81
#define VBICixxf_vrxf VBICstate+82
#define VBICqcth VBICstate+66 /* thermal capacitor charge */
#define VBICcqcth VBICstate+67 /* thermal capacitor current */
#define VBICitxf VBICstate+83
#define VBICitxf_vrxf VBICstate+84
#define VBICith_vrxf VBICstate+85
#define VBICvrth VBICstate+68
#define VBICicth_Vrth VBICstate+69
#define VBICindFlux VBICstate+86
#define VBICindVolt VBICstate+87
#define VBICnumStates 70
#define VBICnumStates 88
/* per model data */
typedef struct sVBICmodel { /* model structure for a vbic */

4021
src/spicelib/devices/vbic/vbicload.c
File diff suppressed because it is too large
View File

14
src/spicelib/devices/vbic/vbicnoise.c

@ -101,31 +101,31 @@ VBICnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *
NevalSrcInstanceTemp(&noizDens[VBICRCNOIZ],&lnNdens[VBICRCNOIZ],
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollNode,
*(ckt->CKTstate0 + inst->VBICircx_Vrcx), dtemp);
*(ckt->CKTstate0 + inst->VBICircx_vrcx), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRCINOIZ],&lnNdens[VBICRCINOIZ],
ckt,THERMNOISE,inst->VBICcollCXNode,inst->VBICcollCINode,
*(ckt->CKTstate0 + inst->VBICirci_Vrci), dtemp);
*(ckt->CKTstate0 + inst->VBICirci_vrci), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBNOIZ],&lnNdens[VBICRBNOIZ],
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseNode,
*(ckt->CKTstate0 + inst->VBICirbx_Vrbx), dtemp);
*(ckt->CKTstate0 + inst->VBICirbx_vrbx), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBINOIZ],&lnNdens[VBICRBINOIZ],
ckt,THERMNOISE,inst->VBICbaseBXNode,inst->VBICbaseBINode,
*(ckt->CKTstate0 + inst->VBICirbi_Vrbi), dtemp);
*(ckt->CKTstate0 + inst->VBICirbi_vrbi), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRENOIZ],&lnNdens[VBICRENOIZ],
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
*(ckt->CKTstate0 + inst->VBICire_Vre), dtemp);
*(ckt->CKTstate0 + inst->VBICire_vre), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRBPNOIZ],&lnNdens[VBICRBPNOIZ],
ckt,THERMNOISE,inst->VBICemitEINode,inst->VBICemitNode,
*(ckt->CKTstate0 + inst->VBICirbp_Vrbp), dtemp);
*(ckt->CKTstate0 + inst->VBICirbp_vrbp), dtemp);
NevalSrcInstanceTemp(&noizDens[VBICRSNOIZ],&lnNdens[VBICRSNOIZ],
ckt,THERMNOISE,inst->VBICsubsSINode,inst->VBICsubsNode,
*(ckt->CKTstate0 + inst->VBICirs_Vrs), dtemp);
*(ckt->CKTstate0 + inst->VBICirs_vrs), dtemp);
NevalSrc(&noizDens[VBICICNOIZ],&lnNdens[VBICICNOIZ],

52
src/spicelib/devices/vbic/vbicpzld.c

@ -39,32 +39,32 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
for( here = VBICinstances(model); here!= NULL;
here = VBICnextInstance(here)) {
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_Vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_Vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_Vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_Vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_Vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_Vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_Vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_Vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_Vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_Vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_Vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_Vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_Vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_Vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_Vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_Vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_Vbcp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_Vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_Vbci);
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_Vbcp);
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_Vrcx);
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_Vrbx);
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_Vrs);
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_Vre);
Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_vbei);
Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_vbex);
Itzf_Vbei = *(ckt->CKTstate0 + here->VBICitzf_vbei);
Itzf_Vbci = *(ckt->CKTstate0 + here->VBICitzf_vbci);
Itzr_Vbci = *(ckt->CKTstate0 + here->VBICitzr_vbci);
Itzr_Vbei = *(ckt->CKTstate0 + here->VBICitzr_vbei);
Ibc_Vbci = *(ckt->CKTstate0 + here->VBICibc_vbci);
Ibc_Vbei = *(ckt->CKTstate0 + here->VBICibc_vbei);
Ibep_Vbep = *(ckt->CKTstate0 + here->VBICibep_vbep);
Irci_Vrci = *(ckt->CKTstate0 + here->VBICirci_vrci);
Irci_Vbci = *(ckt->CKTstate0 + here->VBICirci_vbci);
Irci_Vbcx = *(ckt->CKTstate0 + here->VBICirci_vbcx);
Irbi_Vrbi = *(ckt->CKTstate0 + here->VBICirbi_vrbi);
Irbi_Vbei = *(ckt->CKTstate0 + here->VBICirbi_vbei);
Irbi_Vbci = *(ckt->CKTstate0 + here->VBICirbi_vbci);
Irbp_Vrbp = *(ckt->CKTstate0 + here->VBICirbp_vrbp);
Irbp_Vbep = *(ckt->CKTstate0 + here->VBICirbp_vbep);
Irbp_Vbci = *(ckt->CKTstate0 + here->VBICirbp_vbci);
Ibcp_Vbcp = *(ckt->CKTstate0 + here->VBICibcp_vbcp);
Iccp_Vbep = *(ckt->CKTstate0 + here->VBICiccp_vbep);
Iccp_Vbci = *(ckt->CKTstate0 + here->VBICiccp_vbci);
Iccp_Vbcp = *(ckt->CKTstate0 + here->VBICiccp_vbcp);
Ircx_Vrcx = *(ckt->CKTstate0 + here->VBICircx_vrcx);
Irbx_Vrbx = *(ckt->CKTstate0 + here->VBICirbx_vrbx);
Irs_Vrs = *(ckt->CKTstate0 + here->VBICirs_vrs);
Ire_Vre = *(ckt->CKTstate0 + here->VBICire_vre);
/*
c The real part

61
src/spicelib/devices/vbic/vbicsetup.c

@ -501,6 +501,27 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
here->VBICbaseBINode = tmp->number;
}
if (model->VBICdelayTimeFGiven) {
if(here->VBICxf1Node == 0) {
error = CKTmkVolt(ckt, &tmp, here->VBICname, "xf1");
if(error) return(error);
here->VBICxf1Node = tmp->number;
}
if(here->VBICxf2Node == 0) {
error = CKTmkVolt(ckt, &tmp, here->VBICname, "xf2");
if(error) return(error);
here->VBICxf2Node = tmp->number;
}
if(here->VBICbrEq == 0) {
error = CKTmkCur(ckt,&tmp,here->VBICname,"branch");
if(error) return(error);
here->VBICbrEq = tmp->number;
}
} else {
here->VBICxf1Node = 0;
here->VBICxf2Node = 0;
}
/* macro to make elements with built in test for out of memory */
#define TSTALLOC(ptr,first,second) \
do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
@ -584,8 +605,34 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
TSTALLOC(VBICtempSubsPtr,VBICtempNode,VBICsubsNode);
TSTALLOC(VBICtempSubsSIPtr,VBICtempNode,VBICsubsSINode);
TSTALLOC(VBICtempTempPtr,VBICtempNode,VBICtempNode);
if (model->VBICdelayTimeFGiven) {
TSTALLOC(VBICtempXf2Ptr, VBICtempNode, VBICxf2Node);
TSTALLOC(VBICxf1TempPtr, VBICxf1Node ,VBICtempNode);
}
}
if (model->VBICdelayTimeFGiven) {
TSTALLOC(VBICxf1Xf1Ptr ,VBICxf1Node ,VBICxf1Node);
TSTALLOC(VBICxf1BaseBIPtr,VBICxf1Node ,VBICbaseBINode);
TSTALLOC(VBICxf1EmitEIPtr,VBICxf1Node ,VBICemitEINode);
TSTALLOC(VBICxf1CollCIPtr,VBICxf1Node ,VBICcollCINode);
TSTALLOC(VBICxf1Xf2Ptr ,VBICxf1Node ,VBICxf2Node);
TSTALLOC(VBICxf2Xf1Ptr ,VBICxf2Node ,VBICxf1Node);
TSTALLOC(VBICxf2BaseBIPtr,VBICxf2Node ,VBICbaseBINode);
TSTALLOC(VBICxf2EmitEIPtr,VBICxf2Node ,VBICemitEINode);
TSTALLOC(VBICxf2CollCIPtr,VBICxf2Node ,VBICcollCINode);
TSTALLOC(VBICxf2Xf2Ptr ,VBICxf2Node ,VBICxf2Node);
TSTALLOC(VBICemitEIXf2Ptr,VBICemitEINode,VBICxf2Node);
TSTALLOC(VBICcollCIXf2Ptr,VBICcollCINode,VBICxf2Node);
TSTALLOC(VBICxf1IbrPtr, VBICxf1Node, VBICbrEq);
TSTALLOC(VBICxf2IbrPtr, VBICxf2Node, VBICbrEq);
TSTALLOC(VBICibrXf2Ptr, VBICbrEq, VBICxf2Node);
TSTALLOC(VBICibrXf1Ptr, VBICbrEq, VBICxf1Node);
TSTALLOC(VBICibrIbrPtr, VBICbrEq, VBICbrEq);
}
}
}
return(OK);
@ -636,6 +683,20 @@ VBICunsetup(
&& here->VBICcollCXNode != here->VBICcollNode)
CKTdltNNum(ckt, here->VBICcollCXNode);
here->VBICcollCXNode = 0;
if (model->VBICdelayTimeFGiven) {
if(here->VBICxf1Node > 0)
CKTdltNNum(ckt, here->VBICxf1Node);
here->VBICxf1Node = 0;
if(here->VBICxf2Node > 0)
CKTdltNNum(ckt, here->VBICxf2Node);
here->VBICxf2Node = 0;
if (here->VBICbrEq > 0)
CKTdltNNum(ckt, here->VBICbrEq);
here->VBICbrEq = 0;
}
}
}
return OK;

Loading…
Cancel
Save