Home
  • Products
  • Solutions
  • Support
  • Company
  • Products
  • Solutions
  • Support
  • Company
Community Forums Custom IC SKILL Set name of a waveform on ViVA for custom calculator fu...

Stats

  • Replies 8
  • Subscribers 137
  • Views 1265
  • Members are here 0

Set name of a waveform on ViVA for custom calculator function

LAFuentes
LAFuentes 2 months ago

Hi all,

I've made a custom calculator function that looks like this:

When plotting a signal, the waveform family name changes from "VT("/VCC") to match the function call "lfShiftOverlap(VT("/VCC") 0 6.4 3.2 )":

Since the function call is long, it gets truncated. That makes it hard to see which waveform is which when there's more than one (one needs to expand the field, or hover the mouse pointer over, or double click and open the properties menu...)

I would like to change the look of the waveform name in ViVA to something like this:

Where the waveform (first argument) shows up first, and maybe after that there's some more text telling this is not the original waveform.

So, that's the context of the problem.

I'm looking for a way to change the waveform name. Best case I can imagine: my custom calculator function would set a property or similar on the waveform, such that when plotting with the calculator, it shows up with the name I set instead of the default that is shown above.

I looked for a while how to change the name of the waveforms through Skill (and not manually, as I'm doing now to show).

The "ViVA Skill Ref" shows examples where the waveform names are modified. For example:

awvPlotList(window(1) list(list(1 2 3 4 5) list(2 3 4 5 6)) list(1 2 3 4 5) ?expr
list("expr1" "expr2") ?index list(3 4) ?color list("y1" "y66") ?lineType
list("line" "line") ?lineStyle list("solid" "dash") ?lineThickness list("medium"
"thick") ?showSymbols list(t t) ?dataSymbol list(4 5))

Generates two waveforms and edits their names through ?expr
list("expr1" "expr2")

but... I think that this won't work for me. I'm plotting from the calculator, with the "plot button" and not through another function call.

Sorry for the long post. Any pointer to a way to set the waveform name is appreciated. Or maybe to a different approach to solve the described issue.

Thanks

L.

  • Reply
  • Cancel
  • Cancel
Parents
  • ShawnLogan
    ShawnLogan 2 months ago

    Dear LAFuentes,

    LAFuentes said:
    I've made a custom calculator function that looks like this:
    LAFuentes said:
    I would like to change the look of the waveform name in ViVA to something like this:
    LAFuentes said:
    I'm plotting from the calculator, with the "plot button" and not through another function call.

    I understand you are plotting your results from the Calculator using your custom SKILL function. If I understand correctly, for every simulation set you perform, you must manually run your custom SKILL function using the Calculator after loading the arguments to your custom SKILL function into the Calculator. Without knowing the details of your function, I will propose the following slightly more automatic process that will, I believe, allow you to address your naming concern. Have you considered defining an output for your simulation set which is an ocean script? You may load your custom SKILL function into the script and execute it as long as you can access its arguments in ocean. An ocean script can use the ViVA SKILL functions within the script. Hence, after running your custom SKILL function and creating the waveform, you may plot it within the script and change its name using the SKILL function avwPlotList(), as an example.

    This will avoid the need to open the Calculator, load the script arguments, execute the script and then plot it. Might this be something to consider?

    To add an ocean script as an output, simply choose ocean as the type when defining a new variable as shown in Figure 1. A simple ocean script that prints an output to a text file using the ocnPrint() command is shown in the attached script (with the ".txt" extension included to allow me to upload it to this post).

    I am not sure, once again, of the nature of your custom SKILL function - but this method came to mind and I decided to pass it by you LAFuentes.

    Shawn

    Figure 1

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • ShawnLogan
    ShawnLogan 2 months ago in reply to ShawnLogan

    Figure 1

    ocnPrint( ?output "test_file_n10_sampled_wave.txt" VT("/n10") ?from 2e-09 ?to 9e-09 ?step 1e-10)

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 2 months ago in reply to ShawnLogan
    ShawnLogan said:
    An ocean script can use the ViVA SKILL functions within the script. Hence, after running your custom SKILL function and creating the waveform, you may plot it within the script and change its name using the SKILL function avwPlotList(), as an example.

    Whilst this is possible, it's generally not a good idea to put plotting functions within an OCEAN script measurement. There's a couple of reasons:

    1. The plotting will happen in the background processes (if plotting at end of simulation is performed) because the OCEAN script is run in each ICRP or expression evaluator (with LSCS) - so you won't see the plots if you run over corners or sweeps. You'd need to re-evaluate the expressions to get the plot to appear
    2. Any such plot won't appear in data sheets, or plotting templates

    Instead, you can alter the expression of your outputs - there's an approach shown in this article: How to create a calculator function that constructs a new waveform from numerical inputs but also works in Explorer/Assembler. This is using a (currently) private function, so maybe you could contact customer support to add another request for it to become public and documented. At the moment there are three duplicate CCRs asking for this, but two of them were filed by me and one by a member of my team, so it would be good to have somebody else asking for it!

    Note that changing the expression to something that isn't really the expression is not the best idea, because if you then send the expression to the calculator it will no longer be something that can be evaluated...

    The best approach (if using ADE) is to have your expression as an output, and then. you can specify the name column in the outputs and then it will be plotted with that name.

    Andrew

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • ShawnLogan
    ShawnLogan 1 month ago in reply to Andrew Beckett

    Dear Andrew.

    Andrew Beckett said:
    Whilst this is possible, it's generally not a good idea to put plotting functions within an OCEAN script measurement. There's a couple of reasons:

    Thank you for your insight on this approach! I was wondering if LAFeuntes might run this script after all his corners are complete as then his script could access the signal(s) of interest from the psf directory allow plotting the ensemble of results. Indeed, your comments about including an output as an ocean script to be executed will execute it for each corner - which is not what I understand LAFeuntes is trying to do. Thank you for clarifying this and adding your comment again!

    Shawn

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • LAFuentes
    LAFuentes 1 month ago in reply to ShawnLogan

    Thank you Shawn and Andrew!

    The code of the calculator function uses this pattern from the link Andrew shared above:

    procedure(CCSexampleCalcFunc(wave)
      cond(
        (drIsWaveform(wave) 
          ; handle a waveform and produce new waveform or a scalar value
        )
        (famIsFamily(wave)
          ; handle families by iterating over them
          famMap('CCSexampleCalcFunc wave)
        )
        (t
          ; indicate that you can't handle this data
          error("...")
        )
      )
    )

    I can share it if needed, but it may not add any useful information. The function takes multiple pieces of a waveform and overlaps them. Similar to an eye diagram. The declaration is procedure (lfShiftOverlap wave tinitial tfinal twindow) where wave can be a waveform or a family (from running corners, MC, sweeps), and the other arguments are scalar floats.

    Adding the function as an ADE output is not a preferred solution (I should say not a solution) because of the way I use this function. It's mostly a debugging tool, so I just go through my schematic plotting signals from the calculator. I don't have all those loaded as outputs, and I'd really want to keep it that way.

    I hope this makes it clearer the use case. It sounds like maybe there is no way to customize the waveform name on ViVA when plotted from the calculator?

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to LAFuentes

    Other than the expression trick (which I mentioned in the article), I think that's it. It would seem to me useful to have some way of adding a "hint" to the waveform object to specify a name to use instead of the expression, but I don't think there's any way to do this right now - I would suggest contacting customer support as this seems a useful enhancement to me to be able to do that.

    Andrew

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 1 month ago in reply to LAFuentes

    Other than the expression trick (which I mentioned in the article), I think that's it. It would seem to me useful to have some way of adding a "hint" to the waveform object to specify a name to use instead of the expression, but I don't think there's any way to do this right now - I would suggest contacting customer support as this seems a useful enhancement to me to be able to do that.

    Andrew

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Children
  • LAFuentes
    LAFuentes 1 month ago in reply to Andrew Beckett

    Sorry for taking some time to reply. I've been trying some ideas around the modification of the expression. No success so far (I'm not great at skill, really).

    I've submitted #46663463 both to have those private functions documented, and also because it seems I need more help on this. I can post back the result in here once solved.

    Thanks for the support!

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • LAFuentes
    LAFuentes 1 month ago in reply to LAFuentes

    After going through this with Cadence Support, there are two CCRs filed: one for documenting the private functions (CCR 2746318), the other one for having a way to rename waveforms from Skill (E-CCR 2745576).

    We could not find a way, using famSet/GetExpr to do the trick. It seems to be related to those function working over families instead of waveforms. Although, the case is not yet fully closed, and there's a lingering question for "Can I make a calc function that renames the waveforms for the case when they come as a family (as opposed to a plain waveform) using these private functions?". If this is doable, it may work as expected only for families, but not for simple waveforms. Will update if there are news about that.

    • Cancel
    • Up 0 Down
    • Reply
    • 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.

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

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