• 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. How to add variable in model files?

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 125
  • Views 15221
  • 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

How to add variable in model files?

Firdos
Firdos over 4 years ago

There is some perimeter in model file which I want to access as a variable and can easily edit from design variable option. Can you please help me on that about how to add variables in model file?

For eg:-

The above picture is small section of a model file. There is a parameter "k" which I want to access as a variable in Design Variable of ADE Explorer or anywhere else, so that I can easily sweep the parameter. Can you please help me on it?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Use the method in this post (which you just posted in). Then you can add a variable in ADE k and it will override the value in the model file.

    Andrew

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

    I have tried the steps that you have given.

    But it is showing error during simulation. Value of k is not able to pass to the model file.

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

    And what was the error? This kind of information is rather helpful for diagnosing what's wrong...

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

    Actually, .cdsinit file is in read only mode and I am not able to edit this file.

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

    Well, I'm sure somebody at your end can help resolve that - either there's another file that you can edit that is loaded by the .cdsinit, or that policy should be relaxed. It's pretty rare to disallow user customisations completely.

    Another approach could be to put this entry:

    spectre.envOpts netlistModelFileFirst boolean t

    into ~/.cdsenv (i.e. the .cdsenv file in your home directory). Hopefully that's not readonly too (and if it is, presumably it's owned by you, so you could change that?)

    Andrew

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

    I have add the entry in my .cdsenv file, but during simulation, it is showing error " Cannot run the simulation because parameter 'k' has been used but no value has been assigned to it.

    Above picture is of my model file.

    Above is the picture of cdsenv file.

    Above is the picture of design variable in ADE Explorer

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

    OK, that's because of an error in your model file - when you first showed it, you had k=0.2 but now you've removed the 0.2. So it's unsurprising that this fails - you've created a syntax error by removing the value.

    You either need to leave a default value k=0.2 in the parameters statement (and use the redefinedparams switch I show in the other article) or remove the parameter k altogether from the parameters statement (in which case only the value used by ADE will be netlisted). 

    Regards,

    Andrew

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

    It's working now.

    Thank you very much.

    • 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