• 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 18114
  • 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
  • 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
  • mbracht
    mbracht over 6 years ago

    Hi,

    For one geGetSelSet() returns a list and not a shape. Assuming that you did select a shape (and not an instance or via or whatever) you  need to get at the (first and only) element in the list in terms of a car statement.
    Moreover you initialize a variable m2 to nil in the let statement - but I assume you want to compare against the string "m2". So try this:

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

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

    Thanks a lot for your quick response.

    But, this is a bit different from what i'm looking for.

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

    Thank you so much Lawrence, i think this is something closer to what i was looking for.

    Ultimately i was trying to find all the M2 in a selected set of groups and do certain operation. Basically, i need to change every M2 drawing to M1,M2&M3 fillBlock

    I was going to hard code this in the script. Do you have any idea how i could possibly do that?

    To tell you the whole idea, i need to convert all the existing "M2 drawing" to "M2-1 fillBlock", "M2 fillBlock" & "M2+1 fillBlock" so that i could have "M1 fillBlock", "M2 fillBlock" & "M3 fillBlock" wherever there was "M2 drawing"

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

    So, is there a way i could check the list for m2 (because the selected list could have other layers as well) and whenever there is an m2 found, change its layer purpose to fillBlock and add m2-1 as well as m2+1 fillBlock ?

    Or, is there a way i could do these changes for all selected m2 in the list using a "forall" / "foreach" operation?

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

    I'm planning to do this by hard coding it for all the layers like:

    cv=geGetWindowCellView()
    shapes=geGetSelSet()
    dbLayerOr(cv list("m1" "fillBlock") shapes)
    dbLayerOr(cv list("m2" "fillBlock") shapes)
    dbLayerOr(cv list("m3a" "fillBlock") shapes)

    The above code is hard coded only for m2, but i should be able to do this only for m2. 

    And once all the m2 are taken care, i should do the same for m3, m4, m5, etc.

    Thats where i'm stuck now, not knowing how to do it... 

    Any help appreciated.

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

    Now i'm doing the following, but its coming wrong since my layer generation is not coming good.

    procedure(MetalToFillBlock()
    cv=geGetWindowCellView()
    shapes=geGetSelSet()
    let((m0)
    m2 = "m2"
    foreach(object geGetSelSet() object~>layerName == m2
    dbLayerOr(cv list("m1" "fillBlock") shapes)
    dbLayerOr(cv list("m2" "fillBlock") shapes)
    dbLayerOr(cv list("m3a" "fillBlock") shapes)
    );foreach
    );let
    );procedure

    I know its wrong since in dbLayerOr i'm mentioning shapes as the whole selected list. So my, foreach seems not working. I think i'm doing it horribly wrong.

    • 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

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