• 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. Best way out of 2 ways to generate random voltage source...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 11795
  • 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

Best way out of 2 ways to generate random voltage source (DC)?

fastandig
fastandig over 4 years ago

Assume that I have a circuit with 4 transistors (with mismatch enabled) and therefore 4 digital inputs, and 1 digital output. I want to run transient simulation multiple times with Monte-Carlo mismatch (same MC run each time for same mismatch profile of the 4 transistors), for different inputs. The inputs are voltage sources which should have random values either VDD or GND for every transient run. I got to know of two ways to do this: 1) provide an input vector file in ADEXL where I specify input bit-streams for each transient run or 2) write ocean script. Which way would be better? Or if there is any other easier/faster way to accomplish this please let me know. A quick question: is there a command like randint() that I can enter in the global variable section to generate a random number for each transient run? Thank you.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    I'm not entirely sure I get what you want to do, but I think you could probably set your global variable to random(2) (which will then generate 1 or 0 randomly on each run).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fastandig
    fastandig over 4 years ago in reply to Andrew Beckett

    Thanks! Further to that question, how can I run transient analysis for multiple runs this way? Normally you write something like "1:10" for some variable to run a simulation 10 times. However if I set my voltage source to "random(2)*vdd_var", won't it only run one time? Because there is no vector specified unlike "1:10". Thank you.

    Edit: Maybe I can create another dummy variable and set to to "1:n". I will try that!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to fastandig

    Probably the simplest would be to just add some dummy variable (which isn't used anywhere) and have that sweep from 1:1:10. Note I've not tested this to see whether it works!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fastandig
    fastandig over 4 years ago in reply to Andrew Beckett

    Hah, I got it few seconds before you replied (see my edit :D) Thanks a lot!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • fastandig
    fastandig over 4 years ago in reply to Andrew Beckett

    I tried two ways but the random(2) is always "1". I tried single sweep with dummy variable going from 1:10, and random(2) was "1" for all 10 runs. I also tried with Monte-Carlo using corners and setting the dummy variable to different numbers for each corner. But the random(2) stays at "1". I ran random(2) in the console and it does give random 1 or 0 output. However when running simulations multiple times, it just stays at "1". Any suggestions? Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to fastandig

    OK, with ADE XL you need to make the expression (say): random(2)+dummy*0 

    This is where dummy is the name of your dummy variable that you are sweeping. This seems to work OK.

    With ADE Assembler you have to use a slightly different approach (I think this is due to a bug - I know why, because there's a tension between wanting expressions to be evaluated in the simulator where possible versus evaluating them as SKILL). If you use random(2) in the variable expression, it tries to get spectre to evaluate it and that fails.If I create a little function in my .cdsinit:

    procedure(CCFrand() random(2))

    and then use CCFrand() it seemed to work (once) but then not. So I also have to use CCFrand()+dummy*0 - that then works.

    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