port connected

This commit is contained in:
rlar 2017-08-03 18:58:51 +02:00 committed by Holger Vogt
parent ab088aad1f
commit 09c8614cb2
3 changed files with 27 additions and 15 deletions

View File

@ -200,7 +200,15 @@ typedef struct s$(module)instance {
<admst:text format="\n"/>
</admst:for-each>
<admst:for-each select="node[grounded='no']">
<admst:text format=" unsigned %(name)Node_connected :1;\n"/>
<admst:choose>
<admst:when test="[location='internal']">
<admst:text format=" unsigned %(name)Node_mine :1;\n"/>
</admst:when>
<admst:otherwise>
<admst:text format=" unsigned %(name)Node_mine :1;\n"/>
<admst:text format=" unsigned %(name)Node_connected :1;\n"/>
</admst:otherwise>
</admst:choose>
</admst:for-each>
/* instance parameters */
<admst:for-each select="variable[parametertype='instance' and input='yes']">

View File

@ -183,12 +183,12 @@
<admst:choose>
<admst:when test="lhs/branch[grounded='no']">
<admst:text test="lhs/branch/nnode[location='internal']"
format="here->%(lhs/branch/nnode/name)Node = here->%(lhs/branch/pnode/name)Node; /* nnode collapsed */ \n"/>
format="here->%(lhs/branch/nnode/name)Node = here->%(lhs/branch/pnode/name)Node; /* nnode collapsed */\n here->%(lhs/branch/nnode/name)Node_mine = 0;\n"/>
<admst:text test="lhs/branch/pnode[location='internal']"
format="here->%(lhs/branch/pnode/name)Node = here->%(lhs/branch/nnode/name)Node; /* pnode collapsed */ \n"/>
format="here->%(lhs/branch/pnode/name)Node = here->%(lhs/branch/nnode/name)Node; /* pnode collapsed */\n here->%(lhs/branch/pnode/name)Node_mine = 0;\n"/>
</admst:when>
<admst:otherwise>
<admst:text format="here->%(lhs/branch/pnode/name)Node = 0; /* pnode collapsed to GND */ \n"/>
<admst:text format="here->%(lhs/branch/pnode/name)Node = 0; /* pnode collapsed to GND */ \n here->%(lhs/branch/pnode/name)Node_mine = 0;\n"/>
</admst:otherwise>
</admst:choose>
</admst:if>

View File

@ -114,6 +114,7 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
</admst:for-each>
<admst:value-of select="name"/>
here->%sNode = -1;
here->%(name)Node_mine = 0;
</admst:for-each>
}
</admst:if>
@ -144,13 +145,12 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
<admst:value-of select="value"/>
<admst:variable name="info" select="%s"/>
</admst:for-each>
<admst:value-of select="name"/>
<admst:value-of select="name"/>
if(here->%sNode == -1)
if(here->%(name)Node == -1)
{
error=CKTmkVolt(ckt,&amp;tmp,here-&gt;$(module)name,&quot;X%(name)X&quot;);
if(error) return(error);
here->%sNode = tmp->number;
here->%(name)Node = tmp->number;
here->%(name)Node_mine = 1;
}
</admst:for-each>
}
@ -185,16 +185,20 @@ $(module)unsetup(GENmodel *inModel, CKTcircuit *ckt)
for ( here = $(module)instances(model) ;here != NULL ; here = $(module)nextInstance(here) )
{
<admst:for-each select="node[location='external']">
if (!here->%(name)Node_connected && here->%(name)Node >= 0) {
CKTdltNNum(ckt, here->%(name)Node);
here->%(name)Node = -1;
if (here->%(name)Node_mine) {
if (here->%(name)Node > 0)
CKTdltNNum(ckt, here->%(name)Node);
here->%(name)Node_mine = 0;
}
if (!here->%(name)Node_connected)
here->%(name)Node = -1;
</admst:for-each>
<admst:for-each select="reverse(node[location='internal'])">
if (here->%(name)Node > 0) {
CKTdltNNum(ckt, here->%(name)Node);
here->%(name)Node = -1;
}
if (here->%(name)Node_mine)
if (here->%(name)Node > 0)
CKTdltNNum(ckt, here->%(name)Node);
here->%(name)Node = -1;
here->%(name)Node_mine = 0;
</admst:for-each>
}
}