• 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. Using CPP macros to identify the version of SPECTRE and...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 9091
  • 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

Using CPP macros to identify the version of SPECTRE and have the netlist adapt itself to supported features

Herge
Herge over 3 years ago

Description of the problem

From one SPECTRE version to the other some new features may appear which maybe contradictory with usage in a previous version. For example "actimes" and  "acnames" which in earlier SPECTRE version (eg. 15.1) were allowed to have different numbers of entries ( "actimes" as an array of 10 times, "acnames"  the name of a single AC analysis); but in SPECTRE 19.1 and later, one must have "actimes_pair" set to "no" in order to achieve the same behaviour, whilst this new parameter is unknown to the previous versions. So in order to make one netlist compatible with older and newer simulator versions, a switch must be introduced that will activate "actimes_pair"  for newer versions.

Question

  1. Are their some CPP marco's predefined by SPECTRE allowing one to use #ifdef or other similar CPP commands to activate alternative chunks of code in the netlist depending on the simulator version ?
  2. Is there an equivalent in SPECTRE to the CPP "-dM" option that will output all predefined macro's ?

  3. Is there an alternative way maybe by using the "structural if-statement"  based on some pre-defined constant which would hold the subversion number (or even better a function that would return the different parts of the subversion number based on input arguments ?

Request

  • If no CPP macro is available to check the simulator version, can such a feature be implemented ?

  • If no constant is defined containing the subversion number can such constant be implemented ? Same request for a function yielding the various numbers / tokens forming the subversion number ?
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Some answers:

    1. You can use #ifdef in spectre netlists provide that you either pass -E or -Dmacro/-Dmacro=value/-Umacro on the command line. However, I don't believe there are any predefined macros with the spectre version number. It might have been nice to have macros defined corresponding to the "feature file" entries that  ADE uses to determine the capabilities within Spectre (which live in <SPECTREinstDir>/tools.lnx86/spectre/etc/files/features.dat ) but these don't exist either. Unfortunately there doesn't seem to be a feature file entry anyway for the actimes_pair change (which was an unfortunate incompatible change back in SPECTRE171 ISR4; I was not happy with that because it broke existing flows).
    2. No. Whilst -DM does read the predefined macros they are the cpp macros and they are not output anyway, so this doesn't help
    3. Structural if is probably not the best approach (as it's not really for analyses) and anyway there's no variable to do what you want.

    For your requests - you'll need to contact customer support for an enhancement request to be created.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Herge
    Herge over 3 years ago in reply to Andrew Beckett

    OK, Andrew, thank you.


    So I think I am doing to run "spectre -W" in order to get the subversion number into an environment variable and do something with it, probably with #ifdef or similar CPP commands.

    • 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