I am trying to optimize the propagation delay of a comparator using ADE GXL. The propagation delay of the comparator is characterized using a transient simulation, but I also need to run a DC analysis to compute the actual threshold voltage when the parameter values of the circuit (e.g. transistor sizes) change.
I thus set up the two simulations (DC and tran) and wrote an expression that uses the result of the DC analysis inside the formula to extract the propagation delay from the transient analysis. The expressions are reported below as a reference.
DC analysis expression: xmax(deriv(v("/out" ?result "dc")))
TRAN analysis expression (the above expression is used within the long formula below):
delay(?wf1 v("/vout" ?result "tran") ?value1 xmax(deriv(v("/out" ?result "dc"))) ?edge1 "falling" ?nth1 1 ?td1 0.0 ?wf2 v("/out" ?result "tran") ?value2 (VAR("vrefval") / 2.0) ?edge2 "falling" ?nth2 1 ?td2r0 0.0 ?stop nil ?multiple nil)
This approach runs fine when I run the two simulations in ADE L, returning the desired value.
When I plug it in ADE GXL though, only the DC expression gets evaluated, and I get an "error eval" message for the transient simulation. My best guess is that the transient expression gets evaluated before the DC simulation is run, thus resulting in an error in the evaluation.
How can I enforce the correct order of simulation to fix the problem? Is there another way to do what I am trying to achieve?
Thank you in advance for your help!