• 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. VIVA Calculator function to get the all outputs and apply...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 16695
  • 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

VIVA Calculator function to get the all outputs and apply a procedure to all of them

oyayla
oyayla over 5 years ago

Hi,

I am running simulation in ADEXL and need a custom function for VIVA to apply same procedure to all signals saved in output. For instance, I have clock nets and I want to get all of them and look at the duty-cycle, edge rate etc.

It is a little more involved than about part since I have some regex and setof to filter before processing but if I can get all signals for current history, I can postprocess them later.

In ocean, I am just doing outputs() and getting all saved signals but I was able to do this in VIVA calculator due to the difficulties in getting current history, test name and opening result directory

thanks

yayla

Version Info:

ICADV12.3 64b 500.21

spectre -W =>

Tool 'cadenceMMSIM' Current project version '16.10.479'
sub-version  16.1.0.479.isr9

  • Cancel
  • oyayla
    oyayla over 5 years ago

    This is my initial trial. It works when I load into CIW but when added as custom function to calculator, it doesn't get session number:


                sess=axlGetWindowSession()
                sdb=axlGetMainSetupDB(sess)
                enabledTest=nth(0 setof(testName cadr(axlGetTests(sdb))
                             axlGetEnabled(axlGetTest(sdb testName))
                            ))
                psfDir=axlGetPointPsfDir(axlGetHistoryEntry(sdb axlGetHistoryName(axlGetCurrentHistory(sess))) enabledTest)
                openResults(psfDir)
                
                selectResults('tran)
                outSig = outputs(?map nil)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to oyayla

    It's far from clear to me why this would be useful to have as a calculator function. For a start, calculator functions produce a scalar, waveform or family of waveforms from (mostly) existing waveforms and other data (occasionally they'll do so by reading data from disk somewhere). In this case, what's the output going to be?

    Similarly, they are normally not responsible for opening the database - ViVA is running with some data context (the calculator will show you that at the top, and depends on whether the calculator was opened via the right mouse button over a specific point, or from the ADE XL/Assembler pulldown menus - in which case it is looking at the complete set of results (normally for a specific test though). So I wouldn't expect it to need to open the results in the fashion you've shown here.

    So what is the goal? What are you expecting it to do in the calculator itself? I know you've set you want to look at all the duty cycles or edge rates, but how are the results going to be returned in the calculator?

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • oyayla
    oyayla over 5 years ago in reply to Andrew Beckett

    Hi Andrew,

    The output of the procedure will be a wave. I have attached all procedure for the duty cycle. I have some pcreMatchList and setof functions to filter clock or/and to look at some signals only in a block. In the below example, My block name has "dcc" word inside so I am looking at duty-cycle of all toggling signals inside that cell without writing 24(signal number, x-axis in below image) output expressions with a single expression. Then, I am only looking at the outliers.

    Note: There is a linspace function inside which is a custom one similar to matlab's linspace function.


    procedure(plotDcy(sigList vcross tstart tend @optional (rex "f"))
        let( (sigFilter dcyList i sigClip dutyCyc dutyCycMin dutyCycMac dcyWave dutyCycWC outSig patRex)
        printf("Inside the function %L \n" getWorkingDir())
        if( rex != "f"
          then
                sess=axlGetWindowSession()
                sdb=axlGetMainSetupDB(sess)
                enabledTest=nth(0 setof(testName cadr(axlGetTests(sdb))
                             axlGetEnabled(axlGetTest(sdb testName))
                            ))
                psfDir=axlGetPointPsfDir(axlGetHistoryEntry(sdb axlGetHistoryName(axlGetCurrentHistory(sess))) enabledTest)
                openResults(psfDir)
                
                selectResults('tran)
                outSig = outputs(?map nil)

                patRex = pcreCompile(rex)
                sigList = pcreMatchList(patRex outSig)
          )

        ;;;; Rising Cross 25% higher of vcross and falling cross 25% lower of vcross
        sigFilter = setof(x sigList cross(clip(v(x) tstart tend) 0.75*vcross 1 "falling"))
        sigFilter = setof(x sigFilter cross(clip(v(x) tstart tend) 1.25*vcross 1 "rising"))
        
        dcyList = list(nil)
        i = 1

    ;;;;;;;;;;;;;;;;;;;;; HEADER ;;;;;;;;;;;;;;;;;;;;;;;;
        printf("Signal Number, Signal Name, Duty-Cycle\n")
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        foreach(s sigFilter
            sigClip = clip(v(s) tstart tend)
            dutyCyc = dutyCycle(sigClip ?mode "user" ?threshold vcross ?xName "time"   ?outputType "plot")
            
            dutyCycMin = ymin(dutyCyc)
            dutyCycMax = ymax(dutyCyc)
            if(abs(dutyCycMax-50)>abs(dutyCycMin-50) dutyCycWC=dutyCycMax dutyCycWC=dutyCycMin)

            printf("%d, %s, %.2f \n" i s dutyCycWC)

            tconc(dcyList dutyCycWC)
            i++
        );foreach
            
        dcyList = car(dcyList)

        dcyWave = artListToWaveform(mapcar('list linspace(1 length(dcyList) length(dcyList)) dcyList))

        dcyWave
        );let
    );procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • oyayla
    oyayla over 5 years ago in reply to oyayla

    I noticed one more thing in your reply. I am opening VIVA from adexl run as you mentioned so related psf result directory is shown as Context Result DB in Viva.

    This(opening result and outputs()) is how I was reading all the saved signals when I am not using VIVA custom function(when using ocn expression as the output expression) . If there are other ways to read all signals without opening the result directory as I am doing, that should be fine as well since the main goal of that is to read all saved signals.

    Thanks

    yayla

    • 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