Probably a basic question... I'm loading a script as an output in my ADE L/XL (with ocnEval("myscript")) and would like it to return a value in the ADE/Outputs/Value column.
Actually, my script always returns 'nil' per default, so nothing gets printed as 'Value'.I can get the result I'm looking for from the script (eg. the value of the integrated noise power in my circuit) , could even enter an 'eval(noisePower)' as an output but this would evaluate the noise power of the previous run (the 'eval' command is run before the script is evaluated)...
Is there a way for my script to return something else but 'nil' when using ocnEval()?
I've tried using when() as well as prog()+return() which indeed give me my noise power if I write them from CIW, but they don't seem to return anything when included in my script as sub-commands.
Thank you for your feedback,Regards,Matth
The best way is to add a line on the first line in your OCEAN script:
and then in your script, you can do your calculations and when you're ready you can do:
etc. So your script can output as many outputs as you like - you advertise the list of outputs on the first line, and then output them at a convenient spot (doesn't have to be the end) in your script.
You can also just use axlOutputResult(someValue) to output the value of the "script" (without having a name).
Thank you very much Andrew, it worked well for a single run.
Actually, I had a bit more work with my script since it detects what type of simulation was started (ADE L single, or parametric, or ADE XL) and calls a subscript to execute the routine (in my case, evaluate the noise power of my circuit).In the case of a parametric simulation, my script first lists the parametric runs (l_Runs) and then does something like:
foreach(RunName l_Runs resultDir_dd = strcat(paramDir "/" RunName) resultDir = strcat(resultDir_dd "/psf") evalstring(strcat("ocnEval(" subscript ")")) ;# calling the subscript axlOutputResult(NP))
With the above loop, the script returns only the last value of the Noise Power (here given by the subscript as 'NP') with axlOutputResult(NP) instead of a set of Noise Powers corresponding to each parametric run.So I had to list the '(Run NP) inside the loop and to call axlOutputResult(artListToWaveform(list(Runs NPs))) after the loop.
In the case of an ADE XL, my script lists all corners and then executes a foreach(Corner l_Corners ... ) in the same fashion as the parametric simulation, but leaving axlOutputResult(NP) inside the loop is enough to get my noise power as an output for each corner.Everything works fine now!
Thanks again Andrew,Kind regards,Matth