Differences

This shows you the differences between the selected revision and the current version of the page.

gnucap:manual:tech:plugins:devices:allocation_and_setup 2009/06/05 01:50 gnucap:manual:tech:plugins:devices:allocation_and_setup 2009/12/17 11:40 current
Line 24: Line 24:
It is not expected to compute any values, but it is allowed to call "precalc" if needed in case the values affect topology.  It is preferred that the action of expand is the same regardless of parameter values. It is not expected to compute any values, but it is allowed to call "precalc" if needed in case the values affect topology.  It is preferred that the action of expand is the same regardless of parameter values.
-Expanding a subcircuit makes a copy of it, and remaps the nodes. Most components use a shallow copy. That is, if something is attached through a pointer, the value of the pointer is copied, not the attachment. Commons are never copied when the owner components are copied.+Expanding a subcircuit makes a copy of it, and remaps the nodes. Most components use a shallow copy. That is, if something is attached through a pointer, the value of the pointer is copied, not the attachment. Commons are never copied when the owner components are copied, but commons may be duplicated later if something changes.
== void expand_first() == == void expand_first() ==
Line 32: Line 32:
The expand_last function is an expand function that is done last, after any plain expand functions.  Usually it is not needed, but sometimes there are order dependencies, so this provides a way to control the calling order.  As an example, for current controlled sources with a sense element, the controlled source must be expanded after the sense element. The expand_last function is an expand function that is done last, after any plain expand functions.  Usually it is not needed, but sometimes there are order dependencies, so this provides a way to control the calling order.  As an example, for current controlled sources with a sense element, the controlled source must be expanded after the sense element.
-== void precalc() ==+== void precalc_first(), void precalc_last() ==
The precalc functions attempt to pre-calculate anything that will remain constant during a simulation run. This includes size dependent transistor parameters and the stamp values for linear elements.  It also evaluates parameter expressions. The precalc functions attempt to pre-calculate anything that will remain constant during a simulation run. This includes size dependent transistor parameters and the stamp values for linear elements.  It also evaluates parameter expressions.
It is possible that it may be called more than once.  It must not change its input data in any way.  If it is called twice in succession, the result must be the same as if it were called once. It is possible that it may be called more than once.  It must not change its input data in any way.  If it is called twice in succession, the result must be the same as if it were called once.
-The actual evaluation of constant linear elements is done hereFor nonlinear elements, it computes a first guess.+Some values must be calculated before determining structure.  These go in precalc_first. 
 + 
 +Some values must be calculated after structure is determinedThese go in precalc_last. 
 + 
 +Some values don't matter whether they are calculated before or after structure is determined.  It strictly doesn't matter  
 +whether they are in precalc_first or precalc_last.  By convention, evaluation of parameter expressions goes in  
 +precalc_first, calculation of other values that are done only once goes in precalc_last.
== void map_nodes() == == void map_nodes() ==
Map the user node names to internal node numbers.  Almost always, the inherited function does what is needed, which is to loop over all nodes (both ports and internal) and call their "map" function, and recursively map subcircuits. Map the user node names to internal node numbers.  Almost always, the inherited function does what is needed, which is to loop over all nodes (both ports and internal) and call their "map" function, and recursively map subcircuits.
 
gnucap/manual/tech/plugins/devices/allocation_and_setup.txt · Last modified: 2009/12/17 11:40 by aldavis
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Debian Driven by DokuWiki