• 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. adding Layersets to bindkeys

Stats

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

adding Layersets to bindkeys

ICLondon
ICLondon over 6 years ago

I love layersets.  I have unique layersets for vias (ie "via1" = m1 (draw, pin, fill), via1, & m2 (draw, pin, fill)), "base" layers, all "fill", all "pins", etc. 

I would like to be able to map and toggle them with bindkeys (or get some skill code where I could have the same functionality), as well as set the active layer for each - this would increase my productivity dramatically, imho.

Here is some code that Rupinder sent me a couple years ago (i had some time-off), but I am not certain how to implement it to get it working:

procedure( setActiveLayerAndLayerSetVisibility( metalLayer visible)

                let( (layer)

                                sprintf( layer "m%d drawing" metalLayer)

                                sprintf( layerSet "v%d" metalLayer )

                                pteSetLSVisible("All Layers" nil)

                                pteSetLSActive(?layerSets layerSet ?deactivateOthers t)

                                pteSetLSVisible(layerSet visible)

                                ;uncomment the following lines if you want this function to set active layer and start wire command

                                ;pteSetActiveLpp( layer )

                                ;leHiCreateWire()

                ) ;let

) ;procedure

Then you can add bindkeys to call the above function and pass different numbers and visibility status. For example, to activate layerSet v2, pass number 2 and t as arguments to the function call. “t” means the visibility of layers is on. “nil” means visibility is off.

hiSetBindKey "Layout" "<key>2" "setActiveLayerAndLayerSetVisibility( 2 t )"

hiSetBindKey "Layout" "<ctrl>2" "setActiveLayerAndLayerSetVisibility( 2 nil )"

Similarly, you can assign bindkey 3 to set v3 as active layerSet.

My first question is about the "%" - is this a generic string?  If so, how would this procedure include fill and pins for both metal layers associated with, for example, via1 (m1 &m2)?

Also, what does the "?" do? Lastly, would the same procedure work for "all pins", "all fill", and "all base layers?"

Thank you in advance to anyone interested in this topic!

London

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi London,

    First of all, I moved this into a suitable forum, since it wasn't a "Forum Questions, Suggestions and Feedback" question, it was a technical question about Custom IC SKILL. If you ask in the forum related to issues with the forum itself, then you're unlikely to get an answer.

    The % is a format control string as part of the sprintf/printf/fprintf function. The second argument to sprintf is a string which describes the format of the string you're trying to build. Using "%d" means pick the next argument and insert an integer converted to a string. It broadly follows the C sprintf/fprintf/printf functions, but the easiest way to find it is to use (in IC617 and later) cdsFinder, type printf, and then select printf in the matches and hit "More Info". On that page, follow the link to Common Output Format Specifications.

    The ? before a word in this case means that the function is called with a keyword argument, which means that the arguments are passed by name rather than by order. Some functions are defined that way.

    The bit using % only relates to setting the active layer. You might be better off just having a simpler function:

    procedure(MyMakeLayerSetVisible(layerSet)
      pteSetLSActive(?layerSets layerSet ?deactivateOthers t)
      pteSetLSVisible("All Layers" nil)
      pteSetLSVisible(layerSet t)
    )

    Then you can just use MyMakeLayerSetVisible("via1") or whatever you've called your layer set.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ICLondon
    ICLondon over 6 years ago in reply to Andrew Beckett

    Hi Andrew - thank you sooo much! Working on this...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ICLondon
    ICLondon over 6 years ago in reply to ICLondon

    Hi Andrew - between the two codes given by yourself and Rupinder, I was able to learn enough to realize there might be an easier way to attain my goal (and also realized how little I understand SKILL!).  As a work around, I was able to get the following bindkeys to work:

    hiSetBindKeys( "Layout" list(

    list("<Key>`" "(ctkToggleLayers (list \"base_all\" \"v0_all\" \"m1_all\"))")
    list("<Key>1" "(ctkToggleLayers (list \"m1_all\" \"v1_all\" \"m2_all\"))" "drdEnablePixelThreshold(!drdIsPixelThresholdEnabled())")
    list("<Key>2" "(ctkToggleLayers (list \"m2_all\" \"v2_all\" \"m3_all\"))")
    list("<Key>3" "(ctkToggleLayers (list \"m3_all\" \"v3_all\" \"m4_all\"))")
    list("<Key>4" "(ctkToggleLayers (list \"m4_all\" \"v4_all\" \"m5_all\"))")
    list("<Key>5" "(ctkToggleLayers (list \"m5_all\" \"v5_all\" \"m6_all\"))")
    list("<Key>6" "(ctkToggleLayers (list \"m6_all\" \"v6_all\" \"m7_all\"))")
    list("<Key>7" "(ctkToggleLayers (list \"m7_all\" \"v7_all\" \"m8_all\"))")
    list("<Key>8" "(ctkToggleLayers (list \"m8_all\" \"v8_all\" \"m9_all\"))")
    list("<Key>0" "(ctkToggleAllLayersObjects 'none (list \"base\" \"metals_all\" \"vias_all\"))")
    list("<Key>-" "(ctkToggleLayers \"pins_all\")")
    list("<Key>=" "(ctkToggleLayers \"fill_all\")")
    )) ;; hiSetBindKeys

    It works perfectly!  It took a while and some luck to figure out how to list multiple variables in one line, and I had to guess to get the "pins_all" and "fill_all", but ultimately it is exactly what I was looking for.  I encourage anyone who is looking for more effective bindkeys to try these out!

    Thank you so much for your support Andrew - enjoy!

    London

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to ICLondon

    Hi London,

    I'm not sure how others will be able to try them out, since you didn't provide the definition of ctkToggleAllLayersObjects or ctkToggleLayers?

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 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