improved 'guesstopology'

fixed implementation of macro 'noise'
when building 'load' traverse block 'noise'
This commit is contained in:
r29173 2007-04-30 13:10:35 +00:00
parent 44c5f4721d
commit 1caee800ee
3 changed files with 180 additions and 223 deletions

View File

@ -3,7 +3,12 @@
<!--
$Id$
$Log$
Revision 1.9 2007-04-26 13:04:34 r29173
Revision 1.10 2007-04-30 13:10:35 r29173
improved 'guesstopology'
fixed implementation of macro 'noise'
when building 'load' traverse block 'noise'
Revision 1.9 2007/04/26 13:04:34 r29173
added cases initializeModel, initiliazeInstance (block name used by psp102)
Revision 1.8 2007/04/24 12:26:36 r29173
@ -56,33 +61,30 @@
-->
<!DOCTYPE admst SYSTEM "admst.dtd">
<admst version="2.2.0" xmlns:admst="http://mot-adms.sourceforge.net/xml-files/admst">
<admst version="2.2.6" xmlns:admst="http://mot-adms.sourceforge.net/xml-files/admst">
<!-- expression//function: mapping verilog-name == C-name of function -->
<admst:template match="function:getname">
<admst:template match="fname">
<admst:choose>
<admst:when test="[name='abs']"><admst:value-of select="'fabs'"/></admst:when>
<admst:when test="[name='\$shrinkl']"><admst:value-of select="'shrinkl'"/></admst:when>
<admst:when test="[name='\$shrinka']"><admst:value-of select="'shrinka'"/></admst:when>
<admst:when test="[name='log']"><admst:value-of select="'log10'"/></admst:when>
<admst:when test="[name='ln']"><admst:value-of select="'log'"/></admst:when>
<admst:when test="[name='limexp']"><admst:value-of select="'limexp'"/></admst:when>
<admst:when test="[name='\$limexp']"><admst:value-of select="'limexp'"/></admst:when>
<admst:when test="[name='\$model']"><admst:value-of select="'_modelname'"/></admst:when>
<admst:when test="[name='\$instance']"><admst:value-of select="'_instancename'"/></admst:when>
<admst:when test="[name='\$temperature']"><admst:value-of select="'_circuit_temp'"/></admst:when>
<admst:otherwise><admst:value-of select="name"/></admst:otherwise>
<admst:when test="[name='abs']">fabs</admst:when>
<admst:when test="[name='\$shrinkl']">shrinkl</admst:when>
<admst:when test="[name='\$shrinka']">shrinka</admst:when>
<admst:when test="[name='log']">log10</admst:when>
<admst:when test="[name='ln']">log</admst:when>
<admst:when test="[name='limexp']">limexp</admst:when>
<admst:when test="[name='\$limexp']">limexp</admst:when>
<admst:when test="[name='\$model']">_modelname</admst:when>
<admst:when test="[name='\$instance']">_instancename</admst:when>
<admst:when test="[name='\$temperature']">_circuit_temp</admst:when>
<admst:otherwise>%(name)</admst:otherwise>
</admst:choose>
</admst:template>
<admst:template match="function">
<admst:value-of select="name"/>
<admst:variable name="function" select="%s"/>
<admst:variable name="args" select=""/>
<admst:variable name="function" select="%(name)"/>
<admst:variable name="args"/>
<admst:for-each select="arguments">
<admst:if test="[not($args='')]">
<admst:variable name="args" select="$args,"/>
</admst:if>
<admst:variable test="[exists($args)]" name="args" select="$args,"/>
<admst:apply-templates select="." match="subexpression:stringify:noprobe"/>
<admst:variable name="args" select="$args%s"/>
</admst:for-each>
@ -95,7 +97,7 @@
</admst:when>
<admst:when test="[name='\$given']">
<admst:for-each select="arguments[position(.)=1]">
<admst:if test="adms[datatypename!='variable']">
<admst:if test="[datatypename!='variable']">
<admst:error format="$given: argument is not a variable\n"/>
</admst:if>
<admst:if test="[input='no']">
@ -116,13 +118,10 @@
</admst:otherwise>
</admst:choose>
</admst:for-each>
<admst:if test="/simulator/probe">
<admst:value-to select="/simulator/ddx" value="0.0"/>
</admst:if>
</admst:when>
<admst:otherwise>
<admst:variable name="mycode" select=""/>
<admst:if test="[not(nilled(arguments))]">
<admst:variable name="mycode"/>
<admst:if test="[exists(arguments)]">
<admst:for-each select="arguments">
<admst:apply-templates select="." match="subexpression:stringify:noprobe"/>
<admst:choose>
@ -136,202 +135,114 @@
</admst:for-each>
<admst:variable name="mycode" select="($mycode)"/>
</admst:if>
<admst:apply-templates select="." match="function:getname"/>
<admst:variable name="mycode" select="%s$mycode"/>
<admst:variable name="mycode" select="%(fname(.))$mycode"/>
<admst:value-to select="/simulator/tmp" value="$mycode"/>
</admst:otherwise>
</admst:choose>
</admst:template>
<admst:template match="guesstopology:variable:declaration">
<admst:for-each select="module/evaluation/variable">
<admst:assert test="adms[datatypename='variable']" format="expecting datatypename=variable\n"/>
<admst:if test="[scope='local' and OPdependent='no']">
<admst:value-of select="name"/>
<admst:if test="[type='integer']">int %s;\n</admst:if>
<admst:if test="[type='real']">double %s=0.0/0.0;\n</admst:if>
<admst:if test="[type='string']">char* %s;\n</admst:if>
</admst:if>
</admst:for-each>
<admst:reset select="module/evaluation/variable"/>
</admst:template>
<admst:template match="guesstopology">
<admst:template match="evaluatetopology">
<admst:choose>
<admst:when test="admst(.)/absolute[datatypefamily='basictype']"/>
<admst:when test="adms[datatypename='callfunction']"/>
<admst:when test="adms[datatypename='whileloop']">
<admst:apply-templates select="whileblock" match="guesstopology"/>
<admst:apply-templates select="while" match="guesstopology"/>
<admst:when test="[datatypename='callfunction']"/>
<admst:when test="[datatypename='whileloop']">
<admst:apply-templates select="whileblock" match="evaluatetopology"/>
<admst:apply-templates select="while" match="evaluatetopology"/>
</admst:when>
<admst:when test="adms[datatypename='conditional']">
<admst:when test="[datatypename='conditional']">
<admst:if test="if[nilled(variable[OPdependent='yes'])]">
<admst:apply-templates select="if" match="guesstopology"/>
<admst:apply-templates select="if" match="evaluatetopology"/>
<admst:choose>
<admst:when test="if/math[dependency='constant']">
<admst:apply-templates select="if" match="expression:stringify:noprobe"/>
<admst:text format="if\n(%s)\n"/>
<admst:text format="{\n"/>
<admst:apply-templates select="then" match="guesstopology"/>
<admst:apply-templates select="then" match="evaluatetopology"/>
<admst:text format="}\n"/>
<admst:if test="[not(nilled(else))]">
<admst:if test="[exists(else)]">
<admst:text format="else\n"/>
<admst:text format="{\n"/>
<admst:apply-templates select="else" match="guesstopology"/>
<admst:apply-templates select="else" match="evaluatetopology"/>
<admst:text format="}\n"/>
</admst:if>
</admst:when>
<admst:otherwise>
<admst:apply-templates select="then" match="guesstopology"/>
<admst:apply-templates select="else" match="guesstopology"/>
<admst:apply-templates select="then" match="evaluatetopology"/>
<admst:apply-templates select="else" match="evaluatetopology"/>
</admst:otherwise>
</admst:choose>
</admst:if>
</admst:when>
<admst:when test="adms[datatypename='contribution']">
<admst:value-of select="lhs/discipline/potential"/>
<admst:if test="lhs[nature='%p']">
<admst:when test="[datatypename='contribution']">
<admst:if test="lhs[discipline/potential=nature]">
<admst:choose>
<admst:when test="lhs/branch[grounded='no']">
<admst:if test="lhs/branch/nnode[location='internal']">
<admst:value-of select="lhs/branch/pnode/name"/>
<admst:value-of select="lhs/branch/nnode/name"/>
<admst:text format="here->%sNode = here->%sNode; /* nnode collapsed */ \n"/>
</admst:if>
<admst:if test="lhs/branch/pnode[location='internal']">
<admst:value-of select="lhs/branch/nnode/name"/>
<admst:value-of select="lhs/branch/pnode/name"/>
<admst:text format="here->%sNode = here->%sNode; /* pnode collapsed */ \n"/>
</admst:if>
<admst:text test="lhs/branch/nnode[location='internal']"
format="here->%(lhs/branch/nnode/name)Node = here->%(lhs/branch/pnode/name)Node; /* nnode collapsed */ \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"/>
</admst:when>
<admst:otherwise>
<admst:value-of select="lhs/branch/pnode/name"/>
<admst:text format="here->%sNode = 0; /* pnode collapsed to GND */ \n"/>
<admst:text format="here->%(lhs/branch/pnode/name)Node = 0; /* pnode collapsed to GND */ \n"/>
</admst:otherwise>
</admst:choose>
</admst:if>
<admst:variable name="contribution" select="%(.)"/>
<admst:variable name="psource" select="%(lhs/branch/pnode)"/>
<admst:variable name="nsource" select="%(lhs/branch/nnode)"/>
<admst:for-each select="rhs/probe">
<admst:variable name="pprobe" select="%(branch/pnode)"/>
<admst:variable name="nprobe" select="%(branch/nnode)"/>
<admst:choose>
<admst:when test="../..[static='yes']">
<admst:text format=" static_"/>
</admst:when>
<admst:when test="../..[dynamic='yes']">
<admst:text format=" dynamic_"/>
</admst:when>
<admst:when test="../..[whitenoise='yes']">
<admst:text format=" whitenoise_"/>
</admst:when>
<admst:when test="../..[flickernoise='yes']">
<admst:text format=" flickernoise_"/>
</admst:when>
<admst:otherwise/>
<admst:when test="$contribution[static='yes']"> <admst:text format=" static_"/> </admst:when>
<admst:when test="$contribution[dynamic='yes']"> <admst:text format=" dynamic_"/> </admst:when>
<admst:when test="$contribution[whitenoise='yes']"> <admst:text format=" whitenoise_"/> </admst:when>
<admst:when test="$contribution[flickernoise='yes']"> <admst:text format=" flickernoise_"/> </admst:when>
</admst:choose>
<admst:choose>
<admst:when test="branch/nnode[grounded='no']">
<admst:if test="../../lhs/branch/nnode[grounded='no']">
<admst:value-of select="branch/nnode/name"/>
<admst:value-of select="branch/pnode/name"/>
<admst:value-of select="../../lhs/branch/nnode/name"/>
<admst:value-of select="../../lhs/branch/pnode/name"/>
<admst:text format="jacobian4(%s,%s,%s,%s)\n"/>
</admst:if>
<admst:if test="../../lhs/branch/nnode[grounded='yes']">
<admst:value-of select="branch/nnode/name"/>
<admst:value-of select="branch/pnode/name"/>
<admst:value-of select="../../lhs/branch/pnode/name"/>
<admst:text format="jacobian2p(%s,%s,%s)\n"/>
</admst:if>
<admst:when test="[($nprobe/grounded='no')and($nsource/grounded='no')]">
<admst:text format="jacobian4(%($psource/name),%($nsource/name),%($pprobe/name),%($nprobe/name))\n"/>
</admst:when>
<admst:when test="[($nprobe/grounded='no')and($nsource/grounded='yes')]">
<admst:text format="jacobian2p(%($psource/name),%($pprobe/name),%($nprobe/name))\n"/>
</admst:when>
<admst:when test="[$nsource/grounded='no']">
<admst:text format="jacobian2s(%($psource/name),%($nsource/name),%($pprobe/name))\n"/>
</admst:when>
<admst:when test="[$nsource/grounded='yes']">
<admst:text format="jacobian1(%($psource/name),%($pprobe/name))\n"/>
</admst:when>
<admst:otherwise>
<admst:if test="../../lhs/branch/nnode[grounded='no']">
<admst:value-of select="branch/pnode/name"/>
<admst:value-of select="../../lhs/branch/nnode/name"/>
<admst:value-of select="../../lhs/branch/pnode/name"/>
<admst:text format="jacobian2s(%s,%s,%s)\n"/>
</admst:if>
<admst:if test="../../lhs/branch/nnode[grounded='yes']">
<admst:value-of select="branch/pnode/name"/>
<admst:value-of select="../../lhs/branch/pnode/name"/>
<admst:text format="jacobian1(%s,%s)\n"/>
</admst:if>
</admst:otherwise>
</admst:choose>
</admst:for-each>
</admst:when>
<admst:when test="adms[datatypename='assignment']">
<admst:if test="math[dependency='constant']">
<admst:if test="lhs[insource='yes' and OPdependent='no']">
<admst:apply-templates select="lhs" match="variable:lhs"/>
<admst:apply-templates select="rhs" match="expression:stringify:noprobe"/>
<admst:text format="=%s;\n"/>
</admst:if>
<admst:when test="[datatypename='assignment']">
<admst:if test="[(lhs/insource='yes') and (lhs/OPdependent='no')]">
<admst:apply-templates select="lhs" match="variable:lhs"/>
<admst:text format="="/>
<admst:apply-templates select="rhs" match="expression:stringify:noprobe"/>
<admst:text format="%s;\n"/>
</admst:if>
</admst:when>
<admst:when test="adms[datatypename='block']">
<admst:for-each select="item">
<admst:apply-templates select="." match="guesstopology"/>
</admst:for-each>
<admst:when test="[datatypename='block']">
<admst:apply-templates select="item" match="evaluatetopology"/>
</admst:when>
<admst:when test="adms[datatypename='expression']"/>
<admst:when test="adms[datatypename='probe']"/>
<admst:when test="adms[datatypename='variable']"/>
<admst:when test="adms[datatypename='mapply_unary']"/>
<admst:when test="adms[datatypename='mapply_binary']"/>
<admst:when test="adms[datatypename='mapply_ternary']"/>
<admst:when test="adms[datatypename='function']"/>
<admst:when test="adms[datatypename='number']"/>
<admst:when test="adms[datatypename='string']"/>
<admst:when test="adms[datatypename='nilled']"/>
<admst:when test="adms[datatypename='blockvariable']"/>
<admst:when test="[datatypename='expression']"/>
<admst:when test="[datatypename='probe']"/>
<admst:when test="[datatypename='variable']"/>
<admst:when test="[datatypename='mapply_unary']"/>
<admst:when test="[datatypename='mapply_binary']"/>
<admst:when test="[datatypename='mapply_ternary']"/>
<admst:when test="[datatypename='function']"/>
<admst:when test="[datatypename='number']"/>
<admst:when test="[datatypename='string']"/>
<admst:when test="[datatypename='nilled']"/>
<admst:when test="[datatypename='blockvariable']"/>
<admst:otherwise>
<admst:value-of select="adms/datatypename"/>
<admst:fatal format="%s: adms element not implemented\n"/>
<admst:fatal format="%(datatypename): adms element not implemented\n"/>
</admst:otherwise>
</admst:choose>
</admst:template>
<admst:template match="analog:guesstopology">
<admst:if test="code">
<admst:assert test="code/adms[datatypename='block']" format="expecting datatypename=block\n"/>
<admst:for-each select="code/item">
<admst:if test="adms[datatypename='block']">
<admst:if test="[name!='initial_model' and name!='initial_instance' and name!='initializeModel' and name!='initializeInstance'
and name!='initial_step' and name!='noise']">
<admst:apply-templates select="." match="block:local:declaration"/>
</admst:if>
</admst:if>
<admst:if test="adms[datatypename!='block']">
<admst:apply-templates select="." match="block:local:declaration"/>
</admst:if>
</admst:for-each>
<admst:apply-templates select="code" match="guesstopology:variable:declaration"/>
<admst:for-each select="code/item">
<admst:choose>
<admst:when test="adms[datatypename!='block']">
<admst:apply-templates select="." match="guesstopology"/>
</admst:when>
<admst:otherwise>
<admst:if test="[name!='initial_model' and name!='initial_instance' and name!='initializeModel' and name!='initializeInstance'
and name!='initial_step' and name!='noise']">
<admst:apply-templates select="." match="guesstopology"/>
</admst:if>
</admst:otherwise>
</admst:choose>
</admst:for-each>
</admst:if>
</admst:template>
<admst:template match="code">
<admst:value-of select="attribute[name='ngspicename']/value"/>
<admst:variable name="module" select="%s"/>
#include &quot;ngspice.h&quot;
#include &quot;cktdefs.h&quot;
@ -342,7 +253,7 @@
#include &quot;ifsim.h&quot;
#include &quot;suffix.h&quot;
#define jacobian(a,b) here->PTR_J_##a##_##b##_required=1;
#define jacobian(a,b) here-&gt;PTR_J_##a##_##b##_required=1;
#define static_jacobian4(p,q,r,s) jacobian(p,r) jacobian(p,s) jacobian(q,r) jacobian(q,s)
#define static_jacobian2s(p,q,r) jacobian(p,r) jacobian(q,r)
#define static_jacobian2p(p,r,s) jacobian(p,r) jacobian(p,s)
@ -364,24 +275,69 @@
int $(module)guesstopology (SMPmatrix *matrix, CKTcircuit *ckt, $(module)model *model, $(module)instance *here)
/* guess topology */
{
<admst:apply-templates select="analog" match="analog:guesstopology"/>
<admst:template match="evaluate.localvariables">
<admst:choose>
<admst:when test="[datatypename='assignment']">
<admst:if test="[(lhs/insource='yes') and (lhs/OPdependent='no')]">
<admst:push select="lhs[scope='local']" into="$localvariables" onduplicate="ignore"/>
</admst:if>
</admst:when>
<admst:when test="[datatypename='block']">
<admst:apply-templates select="item" match="evaluate.localvariables"/>
</admst:when>
<admst:when test="[datatypename='conditional']">
<admst:push select="if/variable[scope='local' and OPdependent='no']" into="$localvariables" onduplicate="ignore"/>
<admst:apply-templates select="then" match="evaluate.localvariables"/>
<admst:apply-templates select="else" match="evaluate.localvariables"/>
</admst:when>
<admst:when test="[datatypename='whileloop']">
<admst:apply-templates select="whileblock" match="evaluate.localvariables"/>
</admst:when>
<admst:when test="[datatypename='case']">
<admst:apply-templates select="caseitem/code" match="evaluate.localvariables"/>
</admst:when>
<admst:when test="[datatypename='contribution']"/>
<admst:when test="[datatypename='nilled']"/>
<admst:when test="[datatypename='callfunction']"/>
<admst:when test="[datatypename='blockvariable']"/>
<admst:otherwise>
<admst:error format="'%(datatypename): should not be reached\n"/>
</admst:otherwise>
</admst:choose>
</admst:template>
<admst:for-each select="analog/code[datatypename='block']/item">
<admst:if test="[(datatypename!='block') or (datatypename='block'
and name!='initial_model' and name!='initializeModel' and name!='initial_instance' and name!='initializeInstance'
and name!='initial_step' and name!='noise')]">
<admst:apply-templates select="." match="evaluate.localvariables"/>
</admst:if>
</admst:for-each>
<admst:for-each select="$localvariables">
<admst:if test="[type='integer']">int %(name);\n</admst:if>
<admst:if test="[type='real']">double %(name)=0.0/0.0;\n</admst:if>
<admst:if test="[type='string']">char* %(name);\n</admst:if>
</admst:for-each>
<admst:for-each select="analog/code[datatypename='block']/item">
<admst:if test="[(datatypename!='block') or (datatypename='block'
and name!='initial_model' and name!='initializeModel' and name!='initial_instance' and name!='initializeInstance'
and name!='initial_step' and name!='noise')]">
<admst:apply-templates select="." match="evaluatetopology"/>
</admst:if>
</admst:for-each>
return(OK);
}
</admst:template>
<admst:variable name="localvariables"/>
<admst:for-each select="/module">
<admst:value-of select="attribute[name='ngspicename']/value"/>
<admst:open file="%sguesstopology.c">
<admst:value-of select="/simulator/package_string"/>
<admst:text format="/***\n*** Interface: %s\n"/>
<admst:value-of select="/simulator/currentdate"/>
<admst:value-of select="/simulator/fullname"/>
<admst:text format=" *** created by: %s - %s ***/\n"/>
<admst:variable name="module" select="%(attribute[name='ngspicename']/value)"/>
<admst:open file="$(module)guesstopology.c">
<admst:text format="/***\n*** Interface: %(/simulator/package_string)\n"/>
<admst:text format=" *** created by: %(/simulator/fullname) - %(/simulator/currentdate) ***/\n"/>
<admst:apply-templates select="." match="code"/>
</admst:open>
<admst:value-of select="attribute[name='ngspicename']/value"/>
<admst:message format="%sguesstopology.c: file created\n"/>
<admst:message format="$(module)guesstopology.c: file created\n"/>
</admst:for-each>
</admst>

View File

@ -3,7 +3,12 @@
<!--
$Id$
$Log$
Revision 1.5 2007-04-26 13:04:34 r29173
Revision 1.6 2007-04-30 13:10:35 r29173
improved 'guesstopology'
fixed implementation of macro 'noise'
when building 'load' traverse block 'noise'
Revision 1.5 2007/04/26 13:04:34 r29173
added cases initializeModel, initiliazeInstance (block name used by psp102)
Revision 1.4 2006/03/05 09:38:41 pnenzi
@ -75,7 +80,11 @@
#include &quot;devdefs.h&quot;
#include &quot;suffix.h&quot;
#define adms_noiseSAVE(type,p,n,mag,freq,name)\\
/*fixme: noise not implemented in ngspice*/
#define ngspice_flickernoise(p,n,mag,freq,info)\\
{\\
}
#define ngspice_whitenoise(p,n,mag,info)\\
{\\
}
@ -313,7 +322,7 @@ int $(module)load(inModel,ckt)
<admst:for-each select="code/item">
<admst:if test="adms[datatypename='block']">
<admst:if test="[name!='initial_model' and name!='initial_instance' and name!='initializeModel' and name!='initializeInstance'
and name!='initial_step' and name!='noise']">
and name!='initial_step']">
<admst:apply-templates select="." match="block:local:declaration"/>
</admst:if>
</admst:if>
@ -330,7 +339,7 @@ int $(module)load(inModel,ckt)
</admst:when>
<admst:otherwise>
<admst:if test="[name!='initial_model' and name!='initial_instance' and name!='initializeModel' and name!='initializeInstance'
and name!='initial_step' and name!='noise']">
and name!='initial_step']">
<admst:apply-templates select="." match="block"/>
</admst:if>
</admst:otherwise>

View File

@ -5,7 +5,12 @@
-->
<!--
$Log$
Revision 1.15 2007-04-26 13:04:34 r29173
Revision 1.16 2007-04-30 13:10:35 r29173
improved 'guesstopology'
fixed implementation of macro 'noise'
when building 'load' traverse block 'noise'
Revision 1.15 2007/04/26 13:04:34 r29173
added cases initializeModel, initiliazeInstance (block name used by psp102)
Revision 1.14 2007/04/24 12:28:15 r29173
@ -1791,27 +1796,25 @@
<!-- analog//contribution[noise] -->
<admst:template match="contribution:noise">
<admst:message format="noise contribution not implemented - ignored!\n"/>
<admst:value-of select="lhs/branch/nnode/name"/>
<admst:value-of select="lhs/branch/pnode/name"/>
<admst:if test="[whitenoise='yes']">
<admst:text format="adms_noiseSAVE(whitenoise,%s,%s"/>
</admst:if>
<admst:if test="[flickernoise='yes']">
<admst:text format="adms_noiseSAVE(flickernoise,%s,%s"/>
</admst:if>
<admst:for-each select="rhs/tree/arguments">
<admst:value-of select="./adms/datatypename"/>
<admst:apply-templates select="." match="%s"/>
<admst:value-of select="/simulator/tmp"/>
<admst:text format=",%s"/>
</admst:for-each>
<admst:if test="[flickernoise='yes']">
<admst:text format=",NULL)\n"/>
<admst:text format="ngspice_flickernoise(%(lhs/branch/pnode/name),%(lhs/branch/nnode/name)"/>
<admst:for-each select="rhs/tree/arguments">
<admst:apply-templates select="." match="%(datatypename)"/>
<admst:value-of select="/simulator/tmp"/>
<admst:text format=",%s"/>
</admst:for-each>
<admst:text test="[count(rhs/tree/arguments)=2]" format=",NULL"/>
</admst:if>
<admst:if test="[whitenoise='yes']">
<admst:text format=",0,NULL)\n"/>
<admst:text format="ngspice_whitenoise(%(lhs/branch/pnode/name),%(lhs/branch/nnode/name)"/>
<admst:for-each select="rhs/tree/arguments">
<admst:apply-templates select="." match="%(datatypename)"/>
<admst:value-of select="/simulator/tmp"/>
<admst:text format=",%s"/>
</admst:for-each>
<admst:text test="[count(rhs/tree/arguments)=1]" format=",NULL"/>
</admst:if>
<admst:text format=")\n"/>
</admst:template>
<!-- variable:rhs -->
@ -1838,22 +1841,11 @@
</admst:template>
<!-- variable:lhs -->
<admst:template match="variable:lhs">
<admst:value-of select="name"/>
<admst:if test="[input='yes' and parametertype='model']">
<admst:text format="model-&gt;%s"/>
</admst:if>
<admst:if test="[input='yes' and parametertype='instance']">
<admst:text format="here-&gt;%s"/>
</admst:if>
<admst:if test="[input='no' and scope='global_model']">
<admst:text format="model-&gt;%s"/>
</admst:if>
<admst:if test="[input='no' and scope='global_instance']">
<admst:text format="here-&gt;%s"/>
</admst:if>
<admst:if test="[scope='local']">
<admst:text format="%s"/>
</admst:if>
<admst:text test="[input='yes' and parametertype='model']" format="model-&gt;%(name)"/>
<admst:text test="[input='yes' and parametertype='instance']" format="here-&gt;%(name)"/>
<admst:text test="[input='no' and scope='global_model']" format="model-&gt;%(name)"/>
<admst:text test="[input='no' and scope='global_instance']" format="here-&gt;%(name)"/>
<admst:text test="[scope='local']" format="%(name)"/>
</admst:template>
<!-- handle analog//callfunctions -->
<admst:template match="callfunction">