• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Adding Waveform function to Maestro

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 17196
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Adding Waveform function to Maestro

iguerra
iguerra over 7 years ago

Hi,

I am using the following procedure:

procedure(custom_plot( signal1 signal2 ) 
let( ()

xaxis=drCreateVec('double samples)
y_data=drCreateVec('double samples)

for(i 1 samples
drSetElem(xaxis i i)
drSetElem(y_data i delay(?wf1 signal1 ?value1 thr ?edge1 "either" ?nth1 i ?td1 0 ?tol1 nil ?wf2 signal2 ?value2 0 ?edge2 "falling"))

)

win = newWindow()
wave=drCreateWaveform(xaxis y_data)
awvPlotWaveform( win list( wave ) ?expr list("xylist") )
custom_plot=wave
))

 

It works correctly because I can see how a waveform raises with the desired result, however when I try to assign this procedure to an output in Maestro, it seems that the procedure works because still the waveform raises with the correct result, however, if I plot it from the result table icon I am having the following error:

 

 ("Exception" 1 t nil ("*Error* Exception: SKILL ERROR" nil))

I would really like to remove the awvPlotWaveform from the procedure in order to assign the wave to an output in Maestro and plot it from the results table, could you please provide some guide on how to achieve this?

Thanks and regards,

Ivick.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Ivick,

    Your code does not need these lines in the function:

    win = newWindow()
    awvPlotWaveform( win list( wave ) ?expr list("xylist") )
    custom_plot=wave

    It certainly should not have the plotting functions, and it's meaningless to assign the waveform to a variable with the same name as the function - that's not how you return something in SKILL). Simply have the variable being the last thing in the body of the function:

    procedure(custom_plot( signal1 signal2 ) 
      let( (x-axis y_data)

        xaxis=drCreateVec('double samples)
        y_data=drCreateVec('double samples)

        for(i 1 samples
          drSetElem(xaxis i i)
          drSetElem(y_data i delay(?wf1 signal1 ?value1 thr ?edge1 "either" ?nth1 i ?td1 0 ?tol1 nil ?wf2 signal2 ?value2 0 ?edge2 "falling"))
        )

        drCreateWaveform(xaxis y_data)

    ))

    However, where is samples coming from? Should it be an argument to the function?

    You should define the function in your .cdsinit (otherwise you'll get an eval error when the ICRP - background ADE process - tries to run it). Other than that, it should just work and you should be able to plot the result (assuming you sort out the samples variable).

    You can find lots of examples of custom calculator functions here: Custom IC Calculator SKILL Function Library

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • iguerra
    iguerra over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your reply, you are right, I missed the "sample" argument because I simplified my original function in order to isolate the issue but sure "sample" is not an issue.

    I already followed your suggestion and still not working:

    This is the function I am testing:

    procedure(dely3( signal1 signal2 thr samples simtime )
    let( ()

    xaxis=drCreateVec('double samples)
    dely_data=drCreateVec('double samples)

    for(i 1 samples
    drSetElem(xaxis i i)
    drSetElem(dely_data i delay(?wf1 signal1 ?value1 thr ?edge1 "either" ?nth1 i ?td1 0 ?tol1 nil ?wf2 signal2 ?value2 0 ?edge2 "falling" ?nth2 1 ?tol2 nil ?td2 -3.125e-11 ?stop simtime ?multiple nil))
    )


    drCreateWaveform(xaxis dely_data)

    ))

    I am sure the data and signals are right because I have developed other similar function but  dumping xaxis and dely_data into a textfile and I am able to see the expected results. however I really would like to have a waveform among the outputs in order I can plot them across corners/sweeps in the Results Browser.

    Thanks and regards,

    Ivick.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to iguerra

    Hi Ivick,

    The problem was that when called from ADE XL, signal1 and signal2 are family waveforms (with a sweep of just one point if you didn't do a sweep) for consistency for when you run with sweeps, and you need to write your code to handle family data. Otherwise the return value from delay is a waveform, and you're trying to add a waveform into the dely_data vector.

    By adding this fairly standard cond statement around your code (and putting  your variables into the let, since they should be local - that was just for code cleanliness), it then works:

    procedure(dely3( signal1 signal2 thr samples simtime ) 
      cond(
        ; if a waveform, do the processing
        (drIsWaveform(signal1)
          let( (xaxis dely_data)
            xaxis=drCreateVec('double samples)
            dely_data=drCreateVec('double samples)
    
            for(i 1 samples
              drSetElem(xaxis i i)
              drSetElem(dely_data i 
                delay(?wf1 signal1 ?value1 thr ?edge1 "either" ?nth1 i 
                  ?td1 0 ?tol1 nil ?wf2 signal2 ?value2 0 ?edge2 "falling" 
                  ?nth2 1 ?tol2 nil ?td2 -3.125e-11 ?stop simtime ?multiple nil
                )
              )
            )
            drCreateWaveform(xaxis dely_data)
          )
        )
        ; if a family, iterate over the family and call the
        ; function with each waveform and reassemble
        (famIsFamily(signal1)
          famMap('dely3 signal1 signal2 thr samples simtime)
        )
        (t
          error("dely3: Cannot handle %L\n" signal1)
        )
      )
    )

    Of course, if you change the name of the function, you'll need to change it in the famMap and the error call as well.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • iguerra
    iguerra over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    It seems the key is the "famMap" function. I tested it and it works now.

    However I have only one last question: when you plot the signal, ALL the runs will be processed, Is there a way to plot only the selected run? maybe by using "famGetSweepValues"?

    Thanks and regards,
    Ivick.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to iguerra

    Hi Ivick,

    I don't understand. If in ADE XL you've swept something (say), and go over the little plot icon in the box for your dely3 expression, and the particular point in the sweep and do Right Mouse->Plot, it will plot just that selected run.

    No need to use famGetSweepValues - I'm not sure how that would help?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • iguerra
    iguerra over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Unfortunately by following the steps you just said: " ...particular point in the sweep and do Right Mouse->Plot" it is plotting ALL the runs at once.


    However, I realized this is the behavior for any other plot I have among the results (even flat signals I saved). mMybe this behavior is something related to my current Virtuoso/Cadence setup, Do you know if something could set in order to force to plot only one run by following the "...Right Mouse->Plot"?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to iguerra

    That sounds like a bug - I don't recall that. What Virtuoso subversion are you using? (what does getVersion(t) in the CIW return?). If I know that, I can go back and check.

    Because it doesn't sounds correct, it's not going to be something that is a user setting - there's no reason why doing RMB->Plot over an individual point plotting all the signals would be something you'd want - that's what the "Plot All" menu choice is for.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • iguerra
    iguerra over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    My current Virtuoso sub-version is ICADV12.3-64b.500.19 (I have worked before with ICADV12.1-64b.500.15.2 and plotting single signals worked as expected).

    Maybe (if possible) you can provide some guide on how to solve this on my current version.

    Thanks a lot!

    Ivick.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to iguerra

    Ivick,

    I don't recall this happening in that version, and since it's recent I would have expected to have seen it. So it sounds a bit strange to me. To be sure, I am doing the plot from the context menu over one of the little plot icons and picking this item:

    The main thing I'd suggest is trying a later subversion - the latest is ICADV123 ISR22. If that doesn't work, contact customer support so that we can take a look.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information