Propagate probe and variable dependencies into analog function output variables #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per issue #67, the default implicit templates for ADMS (specifically e:dependency) do not correctly propagate probe and variable dependencies of input arguments into all output arguments. They only do this correctly for the function return value (by propagating these dependencies into the global expression containing the analog function call).
This PR augments e:dependency so that it treats analog function output variables in much the same way that it treats the left-hand side of assignments, propagating all probe and variable dependencies, and also setting flags such as "setinmodel", "setinevaluate", etc. just as assignments do.
This should fix issue #67 and should obsolete PR #68
I am also attaching a tarball that can be used to evaluate this PR. It contains:
rlc.va -- a simple series RLC model in Verilog A
rlc_AF.va --- the same model, but with all computation moved down into an analog function with multiple output variables
html_params.xml -- an ADMS "code generator" back-end that just makes an HTML file describing the module
xyceBasicTemplates.xml --- some templates that html_params.xml uses
two HTML files generated with html_params.xml from rlc.va and rlc_AF.va, using the fixed adms.implicit.xml file in this PR.
ADMS_AnalogFunctionIssue2.tar.gz
If one regenerates the HTML file from rlc_AF.va without using the fixes in this PR (e.g. with "admsXml -e xyceBasicTemplates -e html_params.xml rlc_AF.va"), one can see that the CapacitorCharge and InductorFlux variables are not properly marked with their dependencies on probes or parameters. As a result of this incorrect dependency tracking, the Jacobian is missing elements as well. Any real code generated from this model without these fixes would be wrong.