• 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. How to change from one layer to other layer

Stats

  • Locked Locked
  • Replies 15
  • Subscribers 146
  • Views 22720
  • 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

How to change from one layer to other layer

sailesh
sailesh over 15 years ago

 HI ,

      i need the code to change the metal layers in layout, EX: when the code is loaded all the M1 layers in layout should be replaced by M2 automatically. iam able to do till gettin the available layers..but iam not able to replace them 

  • Cancel
  • kbhow
    kbhow over 15 years ago

    Hi Sailesh,

    Since you managed to get the layer. it will be easy for you to replace the metal layers.

    Example of changing a selected shapes from M1 to M2 on current cell view:

    selected_obj = geGetSelectedSet()

    foreach( obj selected_obj

        when( obj_id~>layerName == "M1"

            obj_id~>lpp = list("M2" "drawing")

        );when

    );foreach

     This is just an example to show you a simple way in changing the layer. You may write a routine for this. Happy coding.

    Regards,

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • babji
    babji over 15 years ago

    if you want to replace all the M1 layers in the current cellview (Selected or unselected) then do this. 

    ;---------------------------------------------------------------------------------------------------------------------------------- 

     prog( ()

    when(  geGetEditCellView()->mode == "r" println( "Need write access" ) return() );when

     foreach( shape geGetEditCellView()->shapes

        when( shape->layerName == "M1"   ; or shape->lpp == list( "M1" "drawing" )

            shape->lpp = list( "M2" "drawing" )  ; or shape->layerName = "M2"

            

        );when

    );fch 

     

    );prog 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    It's even easier than this. You could just do:

    geGetSelSet()~>layerName="M2"

    This avoids the need for the foreach loop. You can use a list of objects with the "squiggle" operator.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • babji
    babji over 15 years ago

     How about if we want to change all M1 shapes (Selected or not, level 0) can we do this.

     

    setof(  X geGetEditCellView( )~>shapes  X~>lpp == list(  "M1"  "drawing" )  )~>lpp = list(  "M2"  "drawing"  )

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

    You could, though it would be more efficient to find the matching lpp object first and then find its shapes, then iterate over those shapes to change the layer and purpose.  I don't have an example to hand, but it would be something like the following:

    m1lpp = car(setof(lpp geGetEditCellView()~>lpps lpp~>layerName=="M1" && lpp~>purpose=="drawing"))

    foreach(shape m1lpp~>shapes shape~>lpp=list("M2" "drawing"))

    Typically the number of shapes to process is an order of magnitude or more greater than the number of distinct layer-purpose pairs, hence the probable efficiency gain. YMMV depending on the design of course.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Yes, although generally you'll be better off doing:

    car(exists(lpp cv~>lpps lpp~>layerName=="M1" && lpp~>purpose=="drawing"))~>shapes~>lpp=list("M2" "drawing")

    For big cellViews, there will be fewer LPP objects than shapes, so you end up traversing a smaller list. For small cellViews, it makes no difference, so it's safer to use the LP-based approach.

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 15 years ago

    I should point out that Andrew's response is even more efficient since my example shows the use of foreach to iterate over the shapes to change their lpp, where really you can have a list on the left-hand side of the = when using the ~> operator and update the lpp for all items in the list in one hit (as babji also showed in their post).

    Regards,
    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Rahul Biradar
    Rahul Biradar over 9 years ago
    Hi how to use the above code for hierarchical layer replacement ?? regards rahul
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 9 years ago

    It is just another big loop.

    You need a list: processed cellViews

    Start of processing loop:

    Change layers in the current cellView.

    Save the cellView

    Add its name to the list of processed cellViews.

    You have to find all the instance masters in the current cellView (cvId~>instHeaders~>master)

    Close the cellView (this minimizes the number of open cellViews)

    for each master not in the list of processed cellViews

    Open the master for append

    Do the processing loop in the master

    Keep processing the masters till all are done

    End of processing loop

    ;;;;;;;;;;;;;;;;;;

    From an architecture standpoint, the loop should be in a function and called recursively.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 9 years ago

    Or you could just use leReplace().

    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