• 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. ADEXL Monte Carlo simulation and dumping sim data to a txt...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 14364
  • 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

ADEXL Monte Carlo simulation and dumping sim data to a txt file

Svilen Mintchev
Svilen Mintchev over 6 years ago

Hi,

I need to run MC simulation, say 100 runs, and for every single run of these 100 I want to keep saving a voltage to a text file, for ex. at the system clock and I want to do this as the simulation is running. It would be convenient to keep all files in the same directory of my choice, and not in the respective MC run directories.  I know how to do the file saving part. What I can't figure out is how to name the files such that they don't over-write each other. Is there anything specific to the individual MC runs that I can include in the file name and how can I access that specific information from the simulation? For example, if I can include the MC run number it would solve the problem. Or maybe something else that distinguishes one MC run from another.

Thanks in advance.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    It would help somewhat if you explain how you're planning to write the files...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Svilen Mintchev
    Svilen Mintchev over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    The way I usually do is by defining a string variable in ADEXL, say file_name to which I assign the dir path and file name by using sprintf.


    (sprintf nil "/home/data/%s_%s.dat"  testname,runnote)

    testname and runnote are also variables.

    I will need to add something to the file name thus defined to distinguish files from separate MC runs.

    Then, in a verilogA block I use the conventional way of defining a string parameter, for ex. filename which takes the variable from ADEXL.  Also in that  verilogA I use $fopen, $fstrobe and $fclose to write to that file.

    I've used that before and it works for corner simulations but now I need to do it in a MC simulation.

      Thanks for helping.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Svilen Mintchev
    Svilen Mintchev over 6 years ago in reply to Svilen Mintchev

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to Svilen Mintchev

    Not sure what the blank post was for. Anyway, perhaps you could use $cds_get_mc_trial_number() in your Verilog-A code? It would have been useful if you'd mentioned in your original post that you were writing data using Verilog-A - that was a rather important fact that was missing.

    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