• 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. Monte Carlo simulation with verilog-a model using Spect...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 144
  • Views 19445
  • 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

Monte Carlo simulation with verilog-a model using Spectre

yueguoguo
yueguoguo over 12 years ago

Hi all,

I have written a behavioral model using verilog-a and want to simulate it using spectre.

Additionally, I want to study how the statistical variations of some of the parameters defined in my model affect the overal electrical characteristics, that is, I need to do a Monte Carlo simulation for this study.

I know how to do the Monte Carlo simulation provided with foundry PDK, so my problem is whether can I do the Monte Carlo with the parameters that I defined in my verilog-a model and plot the statistical analysis results as a histogram or something?

Thanks if any of you could lend me a hand on this!

-yueguoguo 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    There's an example in this solution of how to do this.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LuisGutierrez
    LuisGutierrez over 9 years ago

    Hi Andrew,

    Thank you for the link to the solution. I've tried it myself and it works. However, I wonder if it's possible to define the statistical parameter with respect to another parameter of the model.

    Say I have modeled a current source (see below) and I want the standard deviation to be a certain percentage of the value that the user defines in the schematic for the specific model. 

    --

    // VerilogA for user, vccs_mc, veriloga

    `include "constants.vams"
    `include "disciplines.vams"

    module vccs_mc(vpos,vneg,ipos,ineg);

    inout vpos,vneg,ipos,ineg;
    electrical vpos,vneg,ipos,ineg;

    (*cds_inherited_parameter*) parameter real gm_mc = 0;

    parameter real gm = 1u;
    localparam real gm_effective = (1+gm_mc)*gm; // nominal transconductance plus monte-carlo mismatch effect

    analog begin
    I(ipos,ineg) <+ gm_effective*V(vpos,vneg);
    end

    endmodule

    //

    How shall I define the variation of the parameter gm_mc in the .scs file such that is taken into account properly ? Currently I have the following:

    parameters gm_mc = 0

    statistics{

    mismatch {

    vary gm_mc dist=gauss std=1 percent=yes

    }

    }

    But when I run the Monte Carlo the simulator complains there's no statistical variation.

    Thanks in advance.

    Lucho

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    If I run with your statistics block, I get:

    Warning from spectre during Monte Carlo analysis `mc'.
    WARNING (SFE-3224): Variance of the mismatch parameter `gm_mc' is evaluted to be zero.
    Error found by spectre during Monte Carlo analysis `mc'.
    ERROR (SFE-3225): Variance (or standard deviation) of statistical
    parameters cannot be zero! Set `ignorezerovar=yes' in global options to
    bypass this check.

    This is because you have percent=yes and so the standard deviation is set to be 1% of the mean value (which is 0). That's not going to work.

    There's no need to make the standard deviation a function of an instance parameter. What you would do is have a normalized statistical parameter - e.g. a mean of 0, and standard deviation of 1, and then scale it in the model. In this case your model has a standard deviation of gm (if I remove the percent=yes) because you're multiplying gm_mc by gm. If you wanted it to be 1% of gm, you could write:

    localparam real gm_effective = (1+gm_mc*0.01)*gm; // nominal transconductance plus monte-carlo mismatch effect


    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • LuisGutierrez
    LuisGutierrez over 9 years ago

    Thanks for the explanation and the workaround Andrew. Your approach indeed does the trick.

    Regards,

    Lucho.

    • 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