• 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. common lisp features in SKILL

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 13998
  • 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

common lisp features in SKILL

tashah
tashah over 14 years ago
I am unable to use some of the common lisp features in SKILL. For example, I want to define following function: (defun myFunc ( a b @optional ( c 10 cSuppliedP) ;; cSuppliedP indicates whether argument is actually passed or not (list a b c cSuppliedP) Similarly, some other functions like push and pop from DPL and format function to print in specific format. Is there any way to find how common lisp (or franz lisp) functions are mapped into SKILL? For example, macroexpand-1 is mapped to expandMacro. Can anybody help with this? Thanks.
  • Cancel
  • skillUser
    skillUser over 14 years ago

     Hi Tashah,

    First, I am not familiar with "cSuppliedP" for a function argument.  I think that you would have to code this sort of behaviour yourself, something like the following:

    (defun myFunc ( a b @optional (c 'undef))
      (setq cSuppliedP nil)
      (if (eq c 'undef)
        (setq c 10)
        (setq cSuppliedP t)
      )
      ; ... rest of procedure, c either has default value and cSuppliedP is nil
      ; or it has the supplied value and cSuppliedP is true
    )

    As far as I know "push" and "pop" work with lists but are not documented, pushing and popping from a dpl interferes with the initial "nil" of the dpl list structure, so I don't think these work as they stand.  I should be relatively easy to implement this behaviour though?  For formatted print output you can use printf. 

    I apologise if this does not help much, but I am familiar with SKILL but unfamiliar with common lisp.  There is a "Scheme/SKILL++ Equivalents Table" in the documentation, this may help a little?

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tashah
    tashah over 14 years ago

    Thanks Lawence, it was quite useful. So, I guess my problem is when I use "Cadence SKILL API Finder", I am not finding these functions. As you said push and pop is supported, but they do not appear in search results.

    'undef is the new thing that I learned, thanks.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 14 years ago

     Hi Tashah,

    I should point out that "'undef" has no special meaning, it is just a value that the user is unlikely to supply, so when they do supply a value you can detect it.  Unfortunately this method would spoil the type template, for example if the type template for the function was "nnn" to indicate that a, b and c are to be supplied as numbers, then the default value 'undef of c would break this.  In this case you could just test in the code to see if the value of "c" is the same as the default - it does not detect whether the default was supplied though (would you need to detect this?), for example:

    (defun myFunc (a b @optional (c 10) "nnn")
      (if (equal c 10) (setq cSuppliedP nil) (setq cSuppliedP t))
      ; .. rest of code
    )

    The type template is a very useful feature, make use of it if you can.  If the user supplies something other than a number type (float or integer are acceptable here) then the function fails with a clear message. Other characters that can be used for the type template are things like "t" for a string, "l" for a list, "g" for general (anything), "x" for an integer (or 'fixnum'), "f" for a floating point ('flonum').

    I hope that this helps you.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tashah
    tashah over 14 years ago

    That is very valuable function. Thanks a lot.

    • 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