Home
  • Products
  • Solutions
  • Support
  • Company
  • Products
  • Solutions
  • Support
  • Company
Community Forums RAVEL DRC Programming for IC Packaging and… Constants defined n Ravel?

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 22
  • Views 39588
  • 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 9 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
Parents
  • Bjoern L
    Bjoern L over 9 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
    • Up 0 Down
    • Cancel
Reply
  • Bjoern L
    Bjoern L over 9 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
    • Up 0 Down
    • Cancel
Children
No Data

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.

© 2023 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information