Home > Community > Forums > Custom IC SKILL > Return a script value as ADE output

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Return a script value as ADE output 

Last post Tue, Jun 25 2013 6:55 AM by Matth83. 2 replies.
Started by Matth83 24 Jun 2013 08:40 AM. Topic has 2 replies and 580 views
Page 1 of 1 (3 items)
Sort Posts:
  • Mon, Jun 24 2013 8:40 AM

    • Matth83
    • Not Ranked
    • Joined on Mon, Sep 24 2012
    • Posts 13
    • Points 185
    Return a script value as ADE output Reply

    Hi there,

    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

    • Post Points: 20
  • Mon, Jun 24 2013 1:05 PM

    Re: Return a script value as ADE output Reply

    Matth,

    The best way is to add a line on the first line in your OCEAN script:

    axlAddOutputs(list("BW" "Peak"))

    and then in your script, you can do your calculations and when you're ready you can do:

    axlOutputResult(resultOfYourCalc "BW")

    and then:

    axlOutputResult(resultOfOtherCalc "Peak")

    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).

    Andrew.

    • Post Points: 20
  • Tue, Jun 25 2013 6:55 AM

    • Matth83
    • Not Ranked
    • Joined on Mon, Sep 24 2012
    • Posts 13
    • Points 185
    Re: Return a script value as ADE output Reply

    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

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Matth83 at 24 Jun 2013 08:40 AM. Topic has 2 replies.