Relevant Link: Plot expression after ADE-XL run
In the given link Andrew Beckett shows how to plot output expressions from an ADE run. However, how does this work in the case of an expression that depends on another expression?
Say, for instance, I want gm/Id and I already have the expressions for gm and Id but if I use tables to store the expression, then when eval() evaluates gm/Id it won't find either since the expressions for gm and Id were stored in a table whose name is neither gm nor Id.
In addition, in Processing raw Spectre Monte Carlo data ?, Andrew Beckett calls a function ocnxlOpenResults(), where is this function? My version doesn't seem to have it. I ask because I'm trying to get rdb->outputs() to give me something other than nil. It gave me the outputs before, but for some reason I can't seem to get it to give me the outputs again. Any help in these two matters would be greatly appreciated.
To answer my own question about "what if an expression depends on another expression?", I found that using regex to substitute out the variables in the expressions for the variables used in the script was my best option for what I know about the software. Here is a section of the code I used for anyone wondering.
evalTable = makeTable( "evalTable" nil ) foreach( out outputList sprintf( expression "%L" outTable[out]->expression ) foreach( eval evalTable rexCompile( sprintf( nil "[^:]%s" eval ) ) if( rexExecute( expression ) then rexCompile( sprintf( nil "%s" eval ) ) expression = rexReplace( expression sprintf( nil "evalTable[\"%s\"]" eval ) 0 ) ) ) evalTable[out] = evalstring( expression ) )
Note that this code assumes that expressions that depend on previous expressions are listed LATER in the outputList list variable. I still don't know if there is a better way to do this or if cadence has some built in behavior that can be leveraged to avoid this issue, but this is what I found to work.
BTW, ocnxlOpenResults() was added in IC126.96.36.1990.10 (ISR10).
That makes sense. Explains why I couldn't use it. Thanks, Andrew.