• 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. Plot expression after ADE-XL run

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 143
  • Views 18860
  • 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

Plot expression after ADE-XL run

KGh94
KGh94 over 7 years ago

Hello,

I have adopted this piece of art from Andrew's post in this thread:

historyName=axlGetHistoryName(abXLRunAfterSimGetHistory())
    ; example of getting the resDB in this script
    resDB=axlReadHistoryResDB(historyName)
    foreach(point resDB->points()
        foreach(corner point->corners()
            printf("CORNER: %L\n" corner->name)
            foreach(test corner->tests()
                printf("TEST: %L\n" test->name)
                foreach(output test->outputs()
                    printf("  %s: %L\n" output->name||"" output->value)
                )
            )
        )
    )

This code works fine, except for the expressions values which are considered to be "wave". I would like to plot these waves using ViVa, so I edited the code:

historyName=axlGetHistoryName(abXLRunAfterSimGetHistory())
    ; example of getting the resDB in this script
    resDB=axlReadHistoryResDB(historyName)
    foreach(point resDB->points()
        foreach(corner point->corners()
            printf("CORNER: %L\n" corner->name)
            foreach(test corner->tests()
                printf("TEST: %L\n" test->name)
                foreach(output test->outputs()
when(output->value == "wave"
awvPlotWaveform(newWindow() list(output->valueAsString))
) printf(" %s: %L\n" output->name||"" output->value) ) ) ) )

The problem is with expressions in particular, which seem to be not view-able outside ADE-XL. So I get the warning:
*Warning* Wavenil is not a waveform object that can be displayed and will be DELETED automatically.

Is there a work-around for this? Any insight would be highly appreciated.

Best regards,
Karam

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Hi Karam,

    You need to re-evaluate the expressions. Something like this magic should do the job:

    procedure(abReadStuff(historyName @optional (session axlGetWindowSession()))
        let((resDB testTable testExprTable hist sdb sevSess asiSess expr name)
            sdb=axlGetMainSetupDB(session)
            hist=axlGetHistoryEntry(sdb historyName)
            testTable=makeTable("test" nil)
            resDB=axlReadHistoryResDB(historyName)
            foreach(point resDB->points()
                foreach(corner point->corners()
                    printf("CORNER: %L\n" corner->name)
                    foreach(test corner->tests()
                        printf("TEST: %L\n" test->name)
                        ;----------------------------------------------------
                        ; first time we come across the test, record all the
                        ; expressions from the info recorded in that history
                        ; in a table to make them easier to find
                        ;----------------------------------------------------
                        unless(testTable[test->name]
                            testExprTable=makeTable("testExpr" nil)
                            testTable[test->name]=testExprTable
                            sevSess=axlGetToolSession(session test->name ?history hist)
                            asiSess=sevEnvironment(sevSess)
                            foreach(out asiGetOutputList(asiSess)
                                when(out->expression
                                    name=out->name || sprintf(nil "%L" out->expression)
                                    testExprTable[name]=out->expression
                                )
                            )
                        )
                        ;----------------------------------------------------
                        ; Now iterate over the outputs and for "wave" expressions
                        ; open the results for that specific point, pull out the 
                        ; expression, and evaluate it
                        ;----------------------------------------------------
                        foreach(output test->outputs()
                            if(output->value == "wave" then
                                expr=testTable[test->name][output->name]
                                if(expr then
                                    openResults(test->resultsDir)
                                    errset(
                                        plot(eval(expr))
                                    )
                                else
                                    printf("Cannot find expression for output %L\n"
                                        output->name
                                    )
                                )
                            else
                                printf("  %s: %L\n" output->name||"" output->value)
                            )
                        )
                    )
                )
            )
        )
    )
    
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thank you for your continued wizardry. It looks like you are saving the expressions along with their names in a table and then retrieving the expression if it shows up in the test. Doesn't that scale expensively with an increased number of plots? I have implemented the following:

    when( output-> value == "wave"
        out=calcVal(output->name test->name ?cornerName corner->name)
        windowID=newWindow()
        awvPlotWaveform(windowID list(out))
    )

    I have also set an exception for nominal corner since it is apparently stored in corner->name as "nominal" but when using calcVal it has to be written as "Nominal", with a capital N, to avoid an error.

    Is there a problem with my version of plotting the waveform?

    Additionally, my legend position is set to "inside" by default. When attempting to save the plot using:

    awvPlotWaveform(windowID list(out))
    saveGraphImage(?window windowID ?fileName fileName ?quality 100 ?backgroundColor "white")

    The legend does not appear in the image. It seems that the legend takes some time to appear. so I used hiRegTimer("savePlot(windowID fileName)" 50) to save the plot after the simulation ends. Is there a better way to do this?

    Best regards,
    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to KGh94

    Karam,

    That's a good point - calcVal is a pretty reasonable way of doing this which is rather simpler than mine! I'd forgotten that it can be used for this (I've done it that way too).

    The graph image problem you're describing was a timing issuing in the code that I thought had been fixed a while back; which IC subversion are you using?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    Hello Andrew,

    Glad to know I'm in the right track. I am using 6.1.7-64b.500.9. So until an update rolls out, I have to stick to hiRegTimer()?

    Best regards,

    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to KGh94

    Karam,

    The issues I'm thinking of should have been resolved by the version you're using, so please report this to customer support. Probably using the timer is the only workaround in the meantime (I'm assuming adding ?enableLegend t doesn't make a difference - I wouldn't expect it to).

    Of course it would be worth checking with a later hotfix first in case it got fixed and I just didn't find a report of the issue (the latest is IC617 ISR16).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    I tried adding ?enableLegend t but it didn't help. To be fair, the legend box is captured in the image, only the text (and line color indicator) is missing. I would have been satisfied if it was the other way around, though.

    Best regards,
    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • KGh94
    KGh94 over 7 years ago in reply to Andrew Beckett

    Hello Andrew,

    Merry Christmas! I hope you're enjoying the holiday season. I have a question regarding calcVal:

    I am using out=calcVal(output->name test->name ?cornerName "Nominal") to get the plot for nominal corner only. However, when plotting out with awvPlotWaveform(newWindow() list(out)) it plots the result across all corners. What is confusing is that this happens for certain outputs only. Have you come across such an issue before?

    Edit: This happens when two outputs (in two different tests) have the same name and expression. The result shows "sim err" for one of the outputs and it seems like this has an effect on calcVal.

    Best regards,
    Karam

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to KGh94

    Karam,

    No, I've not seen this. Sounds like a bug. Please contact customer support...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to KGh94

    Karam,

    No, I've not seen this. Sounds like a bug. Please contact customer support...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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