• 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. Type casting boolean?

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 142
  • Views 15783
  • 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

Type casting boolean?

markbeck
markbeck over 15 years ago

I'm trying to type cast a variable as boolean, but I keep getting some wierd error when I try to use it.

For example I've got the following code:

(defmacro mytest (foo "b") foo) 

If I try to execute: foo(t) I get the following error:

*Error* mytest: argument #1 should be ddUserType (type template = "b") - t

From what I understand, ddUserType is a boolean.  

Where did I mess up?

Mark

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Mark,

    Three things:

    1. "b" does not mean "boolean". It means a "dd" object. Hence passing a t will fail the type check, because it is not a dd object (as returned by ddGetId()).

    2. There is no boolean type in SKILL. So there is no type checking letter for it. In SKILL, nil means false (and nil is an empty list, so is an "l" type), and anything else means true.

    3. The string at the end of the formal parameter list is for type _checking_ not type _casting_.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • markbeck
    markbeck over 15 years ago

    Sorry I mis-typed, I meant to askabout type checking, not type casting.

    Thanks for the info.  I guess I'll just have to check the variable internally

    Mark

    • 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