try to implement $port_connected (for temper node)

This commit is contained in:
rlar 2017-07-30 21:06:06 +02:00 committed by Holger Vogt
parent f19fbac057
commit 9b574a3715
5 changed files with 39 additions and 6 deletions

View File

@ -1880,6 +1880,10 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0.
<admst:variable name="xpq" select="$epq"/>
<admst:variable name="e" select="_DDT($x)"/>
</admst:when>
<admst:when test="[name='\$port_connected']">
<admst:assert test="arguments[1]/[datatypename='node']" format="%(name): argument is not a node\n"/>
<admst:variable name="e" select="(here->%(arguments[1])Node_connected /* port_connected 12 */)"/>
</admst:when>
<admst:when test="[name='\$given' or name='\$param_given']">
<admst:variable name="arg1" select="%(arguments[1])"/>
<admst:assert test="$arg1/[datatypename='variable' and input='yes']" format="%(name): argument is not a parameter\n"/>
@ -2019,6 +2023,8 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0.
</admst:when>
<admst:when test="[name='\$given' or name='\$param_given']">
</admst:when>
<admst:when test="[name='\$port_connected']">
</admst:when>
<admst:when test="[name='\$temperature']">
</admst:when>
<admst:when test="[name='\$mfactor']">
@ -2090,6 +2096,8 @@ inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0.
</admst:when>
<admst:when test="[name='\$given' or name='\$param_given']">
</admst:when>
<admst:when test="[name='\$port_connected']">
</admst:when>
<admst:when test="[name='\$temperature']">
</admst:when>
<admst:when test="[name='\$mfactor']">

View File

@ -198,6 +198,9 @@ typedef struct s$(module)instance {
<admst:text format=" /*%s*/"/>
</admst:if>
<admst:text format="\n"/>
</admst:for-each>
<admst:for-each select="node[grounded='no']">
<admst:text format=" unsigned %(name)Node_connected :1;\n"/>
</admst:for-each>
/* instance parameters */
<admst:for-each select="variable[parametertype='instance' and input='yes']">

View File

@ -42,6 +42,14 @@
</admst:template>
<admst:template match="function">
<admst:choose>
<admst:when test="[name='\$port_connected']">
<admst:message format="ZZ 11!! port_connecte, this one\n"/>
<admst:for-each select="arguments[position(.)=1]">
<admst:value-to select="/simulator/tmp" value="(here->%(.)Node_connected /* port_connected 13 */)"/>
</admst:for-each>
</admst:when>
<admst:otherwise>
<admst:variable name="function" select="%(name)"/>
<admst:variable name="args" select=""/>
<admst:for-each select="arguments">
@ -105,6 +113,8 @@
<admst:value-to select="/simulator/tmp" value="$mycode"/>
</admst:otherwise>
</admst:choose>
</admst:otherwise>
</admst:choose>
</admst:template>
<admst:template match="evaluatetopology">

View File

@ -98,6 +98,10 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *
<admst:if test="default[not(nilled(function[class='builtin']))]">
<admst:text format="}\n"/>
</admst:if>
</admst:for-each>
/* External Nodes, connected ? */
<admst:for-each select="node[location='external']">
here->%(name)Node_connected = (here->%(name)Node &gt;= 0);
</admst:for-each>
<admst:if test="node[location='internal']">
/* Internal Nodes */
@ -180,13 +184,16 @@ $(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;
}
</admst:for-each>
<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;
if (here->%(name)Node > 0) {
CKTdltNNum(ckt, here->%(name)Node);
here->%(name)Node = -1;
}
</admst:for-each>
}

View File

@ -609,6 +609,11 @@
<admst:value-to select="/simulator/tmp" value="%s"/>
</admst:for-each>
</admst:when>
<admst:when test="[name='\$port_connected']">
<admst:for-each select="arguments[position(.)=1]">
<admst:value-to select="/simulator/tmp" value="(here->%(.)Node_connected /* port_connected 14 */)"/>
</admst:for-each>
</admst:when>
<admst:when test="[name='\$given' or name='\$param_given']">
<admst:for-each select="arguments[position(.)=1]">
<admst:assert test="[datatypename='variable' and input='yes']" format="%(../name)(%(../arguments[1])): argument is not a parameter\n"/>