Browse Source

adms/admst/ngspiceMODULEsetup.c.xml, adms, implement DEVunsetup()

Which is needed to release the allocated circuit nodes in
  the corresponding adms generated DEVsetup() routine.
This is required when invoking CKTsetup() more than once
  without an intervening "reset".
pre-master-46
rlar 9 years ago
parent
commit
987952e57e
  1. 2
      src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml
  2. 26
      src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml

2
src/spicelib/devices/adms/admst/ngspiceMODULEinit.c.xml

@ -65,7 +65,7 @@ SPICEdev $(module)info = {
$(module)mParam, /* DEVmodParam */
$(module)load, /* DEVload */
$(module)setup, /* DEVsetup */
NULL, /* DEVunsetup */
$(module)unsetup, /* DEVunsetup */
$(module)setup, /* DEVpzSetup */
$(module)temp, /* DEVtemperature */
$(module)trunc, /* DEVtrunc */

26
src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml

@ -166,6 +166,32 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
return(OK);
}
int
$(module)unsetup(GENmodel *inModel, CKTcircuit *ckt)
{
$(module)model *model = ($(module)model*)inModel;
$(module)instance *here;
/* loop through all the $(module) device models */
for ( ;model != NULL ;model = model->$(module)nextModel )
{
for ( here = model->$(module)instances ;here != NULL ; here = here->$(module)nextInstance )
{
<admst:for-each select="reverse(node[location='internal'])">
<admst:value-of select="name"/>
<admst:value-of select="name"/>
<admst:value-of select="name"/>
if (here->%sNode > 0) {
CKTdltNNum(ckt, here->%sNode);
here->%sNode = -1;
}
</admst:for-each>
}
}
return OK;
}
</admst:template>
<admst:for-each select="/module">

Loading…
Cancel
Save