• 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. Ravel EXIT Command?

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 23
  • Views 16700
  • 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

Ravel EXIT Command?

Rian
Rian over 9 years ago

Can you exit out of a .RAV file early?  i.e. If some shape is NOT found we currently report that error (and add a DRC in the center) but then we do NOT want to continue the rest of the file. This is usually because the rest of the file will add more erroneous DRC markers and we just want to quit and tell the designer to fix the shape first.

  • Cancel
  • Bjoern L
    Bjoern L over 9 years ago

    Hi Rian,

    The Ravel programming language is built around a different paradigm than procedural programming languages. You will therefore not find explicit control flow operators such as 'if' in it. This is by design, and there are other ways of achieving the same result.

    If you have a relational expression, and you feed it an empty relation, the result will be an empty relation. All relational operators have the property that if they are given empty relations as input (relations of size zero), they perform no work and an empty relation comes out. This means that if the result of a selection is empty, any other code that that result is fed into will not produce a result -- on the other hand, the inverse of the selection will. To take a concrete example, let us say that we have a constraint value that if greater than zero indicates to include something additional in the check:

    (constraint CHECK_FOO 1)

    (define step_x
      (select (...) R
        (and ...
             (greaterp (value CHECK_FOO) 0)
             ...)))

    (define step_y
      ... step_x ...)

    In the above, step_y will only be performed if the result of step_x is a non-empty relation, and step_x requires the constraint value CHECK_FOO to be positive in order to select anything. If something else should happen when CHECK_FOO is zero, one can either select for it, or take the difference if it fits better:

    (define step_z
      ... (difference R step_x) ...)

    The condition on which to branch need not be a constraint value, of course, but can be the value of a parameter or design property, or based on the presence of a design object, etc.

    In your case you already have an empty relation that may or may not hold a shape, and conditional on its presence you want to evaluate some other code. An easy way to propagate the "emptiness" of this relation, in case the shape is absent, is to combine this relation with another one. The result of a combination where one of the inputs is empty is always empty, so the combination will only be non-empty if the shape is present:

    ;; This relation is empty if the shape is not present.
    (define myshape
      ...)

    (define R_if_shape_present
      (PAIR_1 (combine R myshape)))

    Instead of the PAIR_1 macro from Ravel Standard Library, you can use a transform to remove the tuple constituent added by the combination.

    Note that if the rest of the code naturally depends on the relation holding the shape, it will automatically reduce to a no-op if the shape is not present. Only if the code does not depend on the shape itself would you have to introduce the dependency as I outline above.

    Regards,

    Björn

    • 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