• 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. Rename label and part of instance in multiple layouts

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 149
  • Views 18913
  • 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

Rename label and part of instance in multiple layouts

AnuJoamon
AnuJoamon over 16 years ago

I have many layout cells in my library in which I need to do two changes

  1. I want to replace label xxxABxxx with xxxCDxxx (in a specific layer say "m1" "dg")
  2. Replace instance yyyAByyy from library YYYY to instance zzzCDzzz from library ZZZZ.
  3. Check that there is no instance in the entire library coming either from the same library of one reference library (specified).

Anuj.

 

  • Cancel
Parents
  • dmay
    dmay over 16 years ago

    You have a lot of questions, so I highly recommend you read some Skill documentation. I am including some "untested" skill code. It should be almost ready to run. You should take a look at what I have done and look at some documentation to make sure you understand it. Your description of what you wanted is somewhat vague. It is unclear to me if "xxx", "yyy" and "zzz" are literal, or if wildcard matching is necessary. I assumed wildcards since that is the more complicated scenario. If the names are literal, then a simple == comparison is all that is needed in the check rather than a rexMatchp. Also, if it is literal, then you could skip the rexReplace and rexCompile commands altogether and do simple string assignments.

    I broke the code into a routine that runs on a cellview. This makes code testing easier. Run the "changeCell" routine on the current open layout cellview to make sure your labels and cellview are change appropriately. Since the save takes place in the calling routine, you can discard your edits, adjust the code and retest. If you change the value of the badLibrary in the optional arguments to whatever you are referring to in #3, then you can actually run "changeCell()" with no arguments and it will get the current open cellview and use the bad library name that you wish to check for.

    ;You must define myLibary and badRefLibrary

    procedure(doAllCells(myLibrary badRefLibrary)
      let((libId cv)
        libId = ddGetObj(myLibrary)
        foreach(cell libId~>cells~>name
            when(ddGetObj(myLibrary cell "layout")
                printf("Working on cell %s\n" cell)
                cv = dbOpenCellViewByType(myLibrary cell "layout" nil "a")
                changeCellView(cv badRefLibrary)
                dbSave(cv)
                dbClose(cv)
            )
        )
      ) ;let
    ) ;proc


    procedure(changeCellView(@optional (cv geGetEditCellView()) (badRefLibrary "myBadLibrary"))
      let((labels newLabel insts cellName newCellName badRefs)
        labels = setof(x cv~>shapes x~>objType=="label")
        rexCompile("AB")
        foreach(lbl labels
            ;If only replacing labels that are currently m1 then use this when statement
            when(lbl~>lpp == list("m1" "drawing")
                newLabel = rexReplace(lbl~>theLabel "CD" 0)
                lbl~>theLabel = newLabel
            )
            ;OR if wanting to convert the label to m1, use this
            lbl~>lpp = list("m1" "drawing")
        )

        insts = setof(x cv~>instances x~>libName == "YYYY" && rexMatchp("AB" x~>cellName))
        foreach(inst insts
            cellName = inst~>cellName
            rexCompile("yyy")
            newCellName = rexReplace(cellName "zzz" 0)
            rexCompile("AB")
            newCellName = rexReplace(newCellName "CD" 0)
            leReplaceAnyInstMaster(inst "ZZZZ" newCellName nil)
        )

        ;You must specify badRefLibrary
        badRefs = setof(x cv~>instances x~>libName == badRefLibrary)
        when(badRefs
            foreach(r badRefs
                printf("**ERROR: Found reference from library %s in %s\n" badRefLibrary r~>cellName)
            )
        )
      ) ;let
    ) ;proc

    -Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • dmay
    dmay over 16 years ago

    You have a lot of questions, so I highly recommend you read some Skill documentation. I am including some "untested" skill code. It should be almost ready to run. You should take a look at what I have done and look at some documentation to make sure you understand it. Your description of what you wanted is somewhat vague. It is unclear to me if "xxx", "yyy" and "zzz" are literal, or if wildcard matching is necessary. I assumed wildcards since that is the more complicated scenario. If the names are literal, then a simple == comparison is all that is needed in the check rather than a rexMatchp. Also, if it is literal, then you could skip the rexReplace and rexCompile commands altogether and do simple string assignments.

    I broke the code into a routine that runs on a cellview. This makes code testing easier. Run the "changeCell" routine on the current open layout cellview to make sure your labels and cellview are change appropriately. Since the save takes place in the calling routine, you can discard your edits, adjust the code and retest. If you change the value of the badLibrary in the optional arguments to whatever you are referring to in #3, then you can actually run "changeCell()" with no arguments and it will get the current open cellview and use the bad library name that you wish to check for.

    ;You must define myLibary and badRefLibrary

    procedure(doAllCells(myLibrary badRefLibrary)
      let((libId cv)
        libId = ddGetObj(myLibrary)
        foreach(cell libId~>cells~>name
            when(ddGetObj(myLibrary cell "layout")
                printf("Working on cell %s\n" cell)
                cv = dbOpenCellViewByType(myLibrary cell "layout" nil "a")
                changeCellView(cv badRefLibrary)
                dbSave(cv)
                dbClose(cv)
            )
        )
      ) ;let
    ) ;proc


    procedure(changeCellView(@optional (cv geGetEditCellView()) (badRefLibrary "myBadLibrary"))
      let((labels newLabel insts cellName newCellName badRefs)
        labels = setof(x cv~>shapes x~>objType=="label")
        rexCompile("AB")
        foreach(lbl labels
            ;If only replacing labels that are currently m1 then use this when statement
            when(lbl~>lpp == list("m1" "drawing")
                newLabel = rexReplace(lbl~>theLabel "CD" 0)
                lbl~>theLabel = newLabel
            )
            ;OR if wanting to convert the label to m1, use this
            lbl~>lpp = list("m1" "drawing")
        )

        insts = setof(x cv~>instances x~>libName == "YYYY" && rexMatchp("AB" x~>cellName))
        foreach(inst insts
            cellName = inst~>cellName
            rexCompile("yyy")
            newCellName = rexReplace(cellName "zzz" 0)
            rexCompile("AB")
            newCellName = rexReplace(newCellName "CD" 0)
            leReplaceAnyInstMaster(inst "ZZZZ" newCellName nil)
        )

        ;You must specify badRefLibrary
        badRefs = setof(x cv~>instances x~>libName == badRefLibrary)
        when(badRefs
            foreach(r badRefs
                printf("**ERROR: Found reference from library %s in %s\n" badRefLibrary r~>cellName)
            )
        )
      ) ;let
    ) ;proc

    -Derek

    • 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