• 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. RAVEL DRC Programming for IC Packaging and…
  3. Constants defined n Ravel?

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 23
  • Views 15281
  • 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

Constants defined n Ravel?

Martin Biehl
Martin Biehl over 12 years ago
Is there a way to define constants in Ravel? I have some numbers that I would like to define in one place for use in the code. They are not constraints so I do not want to define them as such since that would make it possible to change the values.
  • Cancel
  • Bjoern L
    Bjoern L over 12 years ago

    Martin,

    You can use macros to define constants. Simply define a macro of no arguments returning the constant value. To retrieve the value, call the macro. Here is an example:

    (macro PI () 3.141593)

    (define edge_circumference
      (transform (e) circular_edge
        (e 2 * (PI) * (radius e))))

     Kind regards, Björn

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Martin Biehl
    Martin Biehl over 12 years ago

    Thanks Bjoern for your quick reply.

    Kind Regards,

    Martin

    • 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