• 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. SKILL code to change all the existing Metal layers to its...

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 18151
  • 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

SKILL code to change all the existing Metal layers to its corresponding fillBlock layer

ssram
ssram over 6 years ago

I'm a very beginner to the SKILL scripting, so just looking out for help to write a SKILL code to change all the existing Metal layers to its corresponding fillBlock layer in my layout.

As a start i wrote a few lines to check if the selected metal is "m2" in my layout

and to print "Layer name is m2" if it is

& if it is not, and print "Layer name is NOT m2"

The code is below, but its not doing what i intend it to, please help me fix it:

procedure(MetalToFillBlock()
let((m2)
if(geGetSelSet()~>layerName == m2
then
printf("Layer name is m2")
else
printf("Layer name is NOT m2"))
);let
);procedure

  • Cancel
Parents
  • skillUser
    skillUser over 6 years ago

    There are a couple of issues with the code, the first is that variable 'm2' will be nil, but perhaps more importantly, geGetSelSet() returns a list, and so the result might be 'nil' or '("M2") or '("M2" "M2")' and so on.

    Perhaps something like 'forall' would be useful here?

    procedure(MetalToFillBlock()
      let((m2)
        m2 = "M2"
        if(forall(object geGetSelSet() object~>layerName == m2)  then
          printf("Layer name is %L for all selected objects\n" m2)
        else
          printf("Layer name is NOT %L for all selected objects\n" m2)
        ); if
      );let
    );procedure

    Hopefully this will help a little?

    Regards,

    Lawrence.

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

    Finally i got it working...!

    procedure(MetalToFillBlock()
      
      cv=geGetWindowCellView()
      shapes=geGetSelSet()
      m2list=setof(x geGetSelSet() x~>layerName=="m2")
      dbLayerOr(cv list("m1" "fillBlock") m2list)
    ;  dbLayerOr(cv list("m2" "fillBlock") m2list)
      dbLayerOr(cv list("m3a" "fillBlock") m2list)
      foreach(shape shapes
       when(shape->layerName == "m2"
    shape->lpp = list( "m2" "fillBlock" )
       );when
      );foreach
    );procedure
    But the only issue is that i need to have those lines for all the metal layers that i'm using. I'm not sure how to simplify it
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to ssram

    It's not entirely clear what the sequence of layer names are, but rather than parsing the layer name, and handling it that way, you could do:

    procedure(MetalToFillBlock()
      let((cv shapes layerName validLayers validBackwards below above newFig)
        validLayers=list("m1" "m2" "m3a" "m4" "m5") ; didn't understand what m3a was for
        validBackwards=reverse(validLayers)
        cv=geGetWindowCellView()
        shapes=geGetSelSet()
        foreach(shape shapes
          layerName=shape~>layerName
          ; don't convert first valid layer as there's no "below" layer
          when(member(layerName cdr(validLayers))
            below=cadr(member(layerName validBackwards))
            above=cadr(member(layerName validLayers))
            when(below && above
              ; use dbCopyFig rather than dbLayerOr as only dealing with one shape 
              ; at a time.
              newFig=dbCopyFig(shape cv)
              newFig~>lpp=list(below "fillBlock")
              newFig=dbCopyFig(shape cv)
              newFig~>lpp=list(above "fillBlock")
              shape~>purpose="fillBlock"
            )
          )
        )
      t
      )
    );procedure

    Note that this code is untested as I don't have anything suitable to try it on - but hopefully it gives you the hint as to how to do it.

    Regards,

    Andrew.

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

    It's not entirely clear what the sequence of layer names are, but rather than parsing the layer name, and handling it that way, you could do:

    procedure(MetalToFillBlock()
      let((cv shapes layerName validLayers validBackwards below above newFig)
        validLayers=list("m1" "m2" "m3a" "m4" "m5") ; didn't understand what m3a was for
        validBackwards=reverse(validLayers)
        cv=geGetWindowCellView()
        shapes=geGetSelSet()
        foreach(shape shapes
          layerName=shape~>layerName
          ; don't convert first valid layer as there's no "below" layer
          when(member(layerName cdr(validLayers))
            below=cadr(member(layerName validBackwards))
            above=cadr(member(layerName validLayers))
            when(below && above
              ; use dbCopyFig rather than dbLayerOr as only dealing with one shape 
              ; at a time.
              newFig=dbCopyFig(shape cv)
              newFig~>lpp=list(below "fillBlock")
              newFig=dbCopyFig(shape cv)
              newFig~>lpp=list(above "fillBlock")
              shape~>purpose="fillBlock"
            )
          )
        )
      t
      )
    );procedure

    Note that this code is untested as I don't have anything suitable to try it on - but hopefully it gives you the hint as to how to do it.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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