• 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. Montecarlo simulation with Verilog-A and Python

Stats

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

Montecarlo simulation with Verilog-A and Python

farhan89
farhan89 over 7 years ago

Hi All,

I have a Verilog-A model of a transistor and now I am extending it for variability modeling. Currently I have a test variability model in Python that uses some libraries to generate results for Montecarlo simulation (using transistor model in python language). Now, I would like to convert the complete model in to Verilog-A compatible format. I have read Verilog-A manual and what I have understood is that I have to write a statistical block to run Montecarlo simulation (by generating samples for each simulation run). For that, I have few questions:

1. Can I call python code from Verilog-A or Statistical block to generate a model parameters sample from my python code and then run simulation using spectre simulator with python generated samples?

2. Can I define Joint PDF (means and co-variances matrix) in statistical block?

I am using Cadence IC 6.1.6 and MMSIM 14.10.

Thanks

Regards,

Farhan

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

    Farhan,

    For the first question, the answer is really no. You can potentially use DPI-C mechanism (see the section header "Calling functions implemented in C" in the Cadence Verilog-A reference manual), but even then that would be to just do some of the computation in the  model. The statistically varied parameters would come from the statistics block - you could of course then transform them in some what to whatever distribution  you wanted to use within your mode. You can't call python directly from Verilog-A and you can't call it to generate the samples in the statistics block.

    I'm not sure about the second question. You can define as many independent statistical variables as you like, and then the response would be based on the influence of those independent variables based on what the models (and circuit) does with them. So you'd end up with a joint PDF anyway. You can also define correlation coefficients between these statistical variables so they don't have to be completely uncorrelated either.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Farhan,

    For the first question, the answer is really no. You can potentially use DPI-C mechanism (see the section header "Calling functions implemented in C" in the Cadence Verilog-A reference manual), but even then that would be to just do some of the computation in the  model. The statistically varied parameters would come from the statistics block - you could of course then transform them in some what to whatever distribution  you wanted to use within your mode. You can't call python directly from Verilog-A and you can't call it to generate the samples in the statistics block.

    I'm not sure about the second question. You can define as many independent statistical variables as you like, and then the response would be based on the influence of those independent variables based on what the models (and circuit) does with them. So you'd end up with a joint PDF anyway. You can also define correlation coefficients between these statistical variables so they don't have to be completely uncorrelated either.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • farhan89
    farhan89 over 7 years ago in reply to Andrew Beckett

    Dear Andrew,

    Thank you for the explanation.

    I have read the ADE XL manual and found our that I can define model files as parameters as well. So, I think another work around would be to implement a custom menu in ADE-XL environment that checks for the Montecarlo parameters (specifically number of points/samples) and using this custom implemented menu I generate as many models (with varying model parameters) as defined in Montecarlo samples. Then I run my simulation by iterating over each model. In the end the flow would be:

    - Include model libraries as parameterized model i.e. VAR("myModelFile")

    - Set Montecarlo Parameters (X samples/ Points)

    - Generate X models using SKILL - Python

    - Run simulation by iterating over python generated model files

    What do you think?. Will this approach work?

    Regards,

    Farhan

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

    I doubt it. It's going to be a lot of work (and is horribly complicated) and it's not obvious what benefit running Monte Carlo gives over a normal sweep. I'd certainly not do it that way and I'm pretty au fait with the inner workings of ADE XL.

    Andrew.

    • 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