• 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 Design
  3. Getting more data after MC run directly in the Results table...

Stats

  • Replies 18
  • Subscribers 133
  • Views 12363
  • Members are here 0

Getting more data after MC run directly in the Results table?

StephanWeber
StephanWeber 3 months ago

Hi,

the ViVA calculator has some nice statistical functions, like average, stddev, skewness, kurtosis, and building more like Cpk or Jarque-Bera JB is not so difficult. But I struggle to get this not only in the calculator but really as output, e.g. to define a spec! E.g. we want Cpk>1.67 or  e.g. JB<3 for check for Gaussian data.

What works so far is this: 

I switch to Detailed table mode, select an output like Rsense or VoutDC, do a "plot across points", then I go to Viva and make "Send to Calculator", then I get an expression like swapSweep(Rsense "Design Points" "nom"), next I simply set x=swapSweep(Rsense "Design Points" "nom"). So it is no easy to get the mean and stddev and then to plot the Gaussian PDF of that fit.

However, I struggle to make that not only manually every time after the MC run but as output expression which would give a much higher automation. E.g. I want to see:

- The PDF plot for a fit for each MC analysis and my key outputs (I run MC vs VT corners)

- Also look for 5-sigma values

- Check if data is Gaussian, e.g. do also other fits like lognormal fit of JB is too large

- Or check at which corner the 5-sigma value is worst, etc.

This way I also do not need to plot Histograms etc. manually after each run.
His anybody done this before?

e.g. stddev(Rsense ?overall t) (with sweeps selected) works but skewness(Rsense ?overall t) (works in CIW!!) is changed to (skewness Rsense ?overall t)
same issue for kurtosis.

Are these Cadence-functions not registered in ADE?

Bye Stephan

  • Cancel
  • Sign in to reply
Parents
  • Andrew Beckett
    Andrew Beckett 3 months ago

    Stephan,

    You should just need to set the evalType column for the measurement to be "sweeps". Then it will make the measurement across the sweep (i.e. the Monte Carlo sweep), rather than the default eval type which is "point" - that's only evaluated per individual Monte Carlo point and so cannot compute results across the whole set of mc iterations.

    If you've built your post-processing functions properly, they should work across the sweep data too. 

    Personally I've not created the functions you're asking for in SKILL (I have for many others, of course), but I have used the ADE MATLAB integration to do the same thing... see this video: Using the Enhanced Virtuoso ADE Product Suite and MATLAB Integration: A Practical Guide (Video [cc])

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 3 months ago

    Stephan,

    You should just need to set the evalType column for the measurement to be "sweeps". Then it will make the measurement across the sweep (i.e. the Monte Carlo sweep), rather than the default eval type which is "point" - that's only evaluated per individual Monte Carlo point and so cannot compute results across the whole set of mc iterations.

    If you've built your post-processing functions properly, they should work across the sweep data too. 

    Personally I've not created the functions you're asking for in SKILL (I have for many others, of course), but I have used the ADE MATLAB integration to do the same thing... see this video: Using the Enhanced Virtuoso ADE Product Suite and MATLAB Integration: A Practical Guide (Video [cc])

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • StephanWeber
    StephanWeber 3 months ago in reply to Andrew Beckett

    Thanks Andrew for quick reply. I use meesurements across sweeps. 

    The key problem is that here ADE does not support all skill function, but only a few, like average, stddev, but not yet skewness and kurtosis.
    Whenever you enter e.g. kurtosis(..) it will immediately changed to (kurtosis ..).

    Getting the statistical functions is quite easy, all we need is the normal distribution pdf (~exp x^2), plus cdf and inverse cdf.

    I already made them all in Skill. Only the application is currently restricted, which is a pity. Want to avoid Matlab, prefer skill. 

    Here is the code for 2 such new functions. Doing the same for other distributions is easy too (e.g. for lognormal fits, etc.)

    procedure(phiNorm(x)
      let( (invSqrt2Pi)
        invSqrt2Pi = 0.3989422804014327 ; 1/sqrt(2*pi)
        invSqrt2Pi * exp(-(x*x)/2.0)
      )
    )

    procedure(cdfNorm(x)
      let( (sign z tz a1 a2 a3 a4 a5 phi tpoly cdf)
        a1 = 0.319381530
        a2 = -0.356563782
        a3 =  1.781477937
        a4 = -1.821255978
        a5 =  1.330274429

        sign = 1.0
        z    = x
        when(z < 0.0
          sign = -1.0
          z = -z
        )

        tz  = 1.0 / (1.0 + 0.2316419 * z)
        phi = phiNorm(z)

        tpoly = a1*tz + a2*tz*tz + a3*tz*tz*tz + a4*tz*tz*tz*tz + a5*tz*tz*tz*tz*tz
        cdf   = 1.0 - phi * tpoly

        if(sign < 0.0 then
          1.0 - cdf
        else
          cdf
        )
      )
    )

    Also making a plot of the Gaussfit works fine (but not from ADE, but from CIW):

    ; PdfNormal(mu sigma @optional nPoints)
    ;   - Build a normal pdf waveform from given mean and sigma
    ;   - x-range = [mu - 5s, mu + 5s]
    ;   - nPoints samples (default 200)
    ; Usage:
    ;   wNorm = PdfNormal(0.0 1.0)
    ;   plot(wNorm)


    procedure(PdfNormal(mu sigma @optional (nPoints 200))
      let( (startX endX dx sig2 normConst i xList yList xVal yVal)

        when(sigma <= 0.0
          return(nil)
        )

        when(nPoints < 2
          nPoints = 2
        )

        startX = mu - 5.0 * sigma
        endX   = mu + 5.0 * sigma
        when(endX <= startX
          return(nil)
        )

        dx       = (endX - startX) / (nPoints - 1)
        sig2     = sigma * sigma
        normConst = 1.0 / (sqrt(2.0 * 3.14159265358979) * sigma)

        xList = nil
        yList = nil

        for( i 0 nPoints-1
          xVal = startX + i * dx
          yVal = normConst * exp( -0.5 * ((xVal - mu)*(xVal - mu) / sig2) )
          xList = cons(xVal xList)
          yList = cons(yVal yList)
        )

        xList = reverse(xList)
        yList = reverse(yList)

        abMakeWaveform(yList xList)
      )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 3 months ago in reply to StephanWeber
    StephanWeber said:

    The key problem is that here ADE does not support all skill function, but only a few, like average, stddev, but not yet skewness and kurtosis.
    Whenever you enter e.g. kurtosis(..) it will immediately changed to (kurtosis ..).

    That's not true. ADE absolutely supports all SKILL functions, provided that they return scalar values or waveforms, and that they handled value coming in which are either scalars, waveforms or families. kurtosis and skewness are absolutely supported in ADE. Just because it changes to show parenthesis before the function doesn't mean they are not supported (I didn't see that behaviour - I was trying with IC25.1 ISR4 - and the results are correctly computed).

    I don't know how you are calling the functions above in ADE, but I suspect it's because they are not handling the arguments being potentially passed in as a waveform/family. You might need to use the standard pattern of a cond() function which does drIsWaveform, famIsFamily, famMap and so on around your code - as seen in many of my functions.

    I don't have the time today to try out your code and adapt it, but you could contact customer support to have one of the team investigate.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Frank Wiedmann
    Frank Wiedmann 3 months ago in reply to Andrew Beckett
    Andrew Beckett said:
    You might need to use the standard pattern of a cond() function which does drIsWaveform, famIsFamily, famMap and so on around your code - as seen in many of my functions.

    ... and as explained e.g. at https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1O0V000007MkO7UAK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to 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.

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

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