• 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. Vector operations in SKILL

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 12993
  • 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

Vector operations in SKILL

aicdesigner
aicdesigner over 4 years ago

Hi,

      Just curious to what extent SKILL has "kept up with the times". Along the lines of python and pandas where it is possible and encouraged to perform operations on vectors, does SKILL offer similar support?

For example, if I select a few pins -> geGetSelSet() gives me access to them.

geGetSelSet()~>xy gives me an array of the points.

If I now want an array of just the x-coordinates, I can't do xCoord( geGetSelSet()~>xy )

Q : is there something else I CAN do along the lines of what python/pandas offers that is more elegant than using a loop?

Thanks

  • Cancel
  • mbracht
    mbracht over 4 years ago

    Hi,

    geGetSelSet() does not return an array of points, it returns a list (technically a singly linked list) of the currently selected figures. A "figure" in turn has a bounding box that is defined in terms of a lower left and an upper right point.If you want for example the x-coordinates of the lower left points of all selected figures you need to go like this:

    (mapcar (lambda (bBox) (xCoord (lowerLeft bBox))) (geGetSelSet)~>bBox)

    SKILL does support arrays though - for example

    (declare vector[100])

    creates an array (named vector) with one 100 elements which provides true random access to it's elements in terms of an index. It is important to understand the difference between lists and arrays, like I said a list in SKILL is a linked list where each element has a pointer to the next element in the list. So to get to an element somewhere in the middle you need to iterate over the list element by element - this can slow down the performance of a SKILL script if you deal with very long lists.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to mbracht

    To follow on from what Max said, SKILL is a LISP which means it has numerous functions for processing lists - for example mapping functions to transform lists.

    So for example, if you want to find the xCoord of all selected origins:

    mapcar('xCoord geGetSelSet()~>xy)

    If you had two lists of numbers, and wanted to add the corresponding number of each list together you could do:

    mapcar('plus listA listB)

    The idea is that mapcar iterates over the list(s) and then calls the function given as the first argument with the corresponding element of each list (one or more lists). If there is one list, it passes one argument to the function; if there were 10 lists, it would pass 10 arguments and so on.

    There are several other mapping functions which do various other types of processing (e.g. map, mapc, mapcar, mapcan, maplist - and a few others).

    Note that the function passed as the first argument can either be a named function, or a function object created on the fly (Max used lambda to create an anonymous function). 

    There's also a convenience form, that you can do (using Max's example):

    xCoords=foreach(mapcar bBox geGetSelSet()~>bBox
      xCoord(lowerLeft(bBox))
    )

    This is equivalent - the foreach form takes the argument list from the argument after the mapping function name, and the body from within the foreach to produce an anonymous function:

    So it's not really a matter of SKILL keeping up with the times here - these have always existed in SKILL. Sure it's different from Python, but then again all languages are different. In fact Python has a number of concepts which have been inspired by LISP - and we have (here and there) added features to SKILL which were inspired by Python!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • aicdesigner
    aicdesigner over 4 years ago in reply to Andrew Beckett

    Thank you! Will definitely help me out.

    Is there a marketplace where one can find SKILL-code freelancers?

    • 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