port connected
This commit is contained in:
parent
c901eed4b2
commit
5a01cd09bf
|
|
@ -197,7 +197,15 @@ typedef struct s$(module)instance {
|
||||||
<admst:text format="\n"/>
|
<admst:text format="\n"/>
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
<admst:for-each select="node[grounded='no']">
|
<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>
|
</admst:for-each>
|
||||||
/* instance parameters */
|
/* instance parameters */
|
||||||
<admst:for-each select="variable[parametertype='instance' and input='yes']">
|
<admst:for-each select="variable[parametertype='instance' and input='yes']">
|
||||||
|
|
|
||||||
|
|
@ -183,12 +183,12 @@
|
||||||
<admst:choose>
|
<admst:choose>
|
||||||
<admst:when test="lhs/branch[grounded='no']">
|
<admst:when test="lhs/branch[grounded='no']">
|
||||||
<admst:text test="lhs/branch/nnode[location='internal']"
|
<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']"
|
<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:when>
|
||||||
<admst:otherwise>
|
<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:otherwise>
|
||||||
</admst:choose>
|
</admst:choose>
|
||||||
</admst:if>
|
</admst:if>
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
<admst:value-of select="name"/>
|
<admst:value-of select="name"/>
|
||||||
here->%sNode = -1;
|
here->%sNode = -1;
|
||||||
|
here->%(name)Node_mine = 0;
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
}
|
}
|
||||||
</admst:if>
|
</admst:if>
|
||||||
|
|
@ -144,13 +145,12 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
|
||||||
<admst:value-of select="value"/>
|
<admst:value-of select="value"/>
|
||||||
<admst:variable name="info" select="%s"/>
|
<admst:variable name="info" select="%s"/>
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
<admst:value-of select="name"/>
|
if(here->%(name)Node == -1)
|
||||||
<admst:value-of select="name"/>
|
|
||||||
if(here->%sNode == -1)
|
|
||||||
{
|
{
|
||||||
error=CKTmkVolt(ckt,&tmp,here->$(module)name,"X%(name)X");
|
error=CKTmkVolt(ckt,&tmp,here->$(module)name,"X%(name)X");
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
here->%sNode = tmp->number;
|
here->%(name)Node = tmp->number;
|
||||||
|
here->%(name)Node_mine = 1;
|
||||||
}
|
}
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
}
|
}
|
||||||
|
|
@ -185,16 +185,20 @@ $(module)unsetup(GENmodel *inModel, CKTcircuit *ckt)
|
||||||
for ( here = model->$(module)instances ;here != NULL ; here = here->$(module)nextInstance )
|
for ( here = model->$(module)instances ;here != NULL ; here = here->$(module)nextInstance )
|
||||||
{
|
{
|
||||||
<admst:for-each select="node[location='external']">
|
<admst:for-each select="node[location='external']">
|
||||||
if (!here->%(name)Node_connected && here->%(name)Node >= 0) {
|
if (here->%(name)Node_mine) {
|
||||||
CKTdltNNum(ckt, here->%(name)Node);
|
if (here->%(name)Node > 0)
|
||||||
here->%(name)Node = -1;
|
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>
|
||||||
<admst:for-each select="reverse(node[location='internal'])">
|
<admst:for-each select="reverse(node[location='internal'])">
|
||||||
if (here->%(name)Node > 0) {
|
if (here->%(name)Node_mine)
|
||||||
CKTdltNNum(ckt, here->%(name)Node);
|
if (here->%(name)Node > 0)
|
||||||
here->%(name)Node = -1;
|
CKTdltNNum(ckt, here->%(name)Node);
|
||||||
}
|
here->%(name)Node = -1;
|
||||||
|
here->%(name)Node_mine = 0;
|
||||||
</admst:for-each>
|
</admst:for-each>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue