• 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 to Identify a LABEL over an Instance

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 143
  • Views 17890
  • 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 to Identify a LABEL over an Instance

skillUserD
skillUserD over 5 years ago

Hello,

I am in a need of a skill program to find all instances of a specific cell (Including Mosaics), throughout the hierarchy. The program should print the instance's name, xy coordinates at the top level, and extract a label name that is dropped on top of it. In case there is no label on top of the found instance, the program should print "No Label Found" in the report text file. This program aims to map PADs cells within top level.

I am using the below Cadence's solution to find instances and it works well. The missing feature is to identify LABELs that are on top of the found instances. 

I tried to use dbGetOverlap() function, within the below code, in few setups but it seems to fail to identify the existence of labels on top of the found instances.

For example: 


overlapLabel=dbGetTrueOverlaps(cv cadr(instBox) list("M1" "text"))

I am interested to add to the Cadence's solution below some code in order to identify labels on top of the found instances.

Any tip would be greatly appreciated.

Thanks,

Danny


--------------------------------------------------------

procedure(HilightCellByArea(lib cell level)
let((cv instList rect instBox)
;; Deleting old highlights.To prevent uncomment the below line
when(boundp('hset) hset->enable=nil)
cv=geGetWindowCellView()
rect=enterBox(
         ?prompts list("Enter the first corner of your box."
                        "Enter the last corner of your box.")
                )
     instList=dbGetOverlaps(cv rect nil level nil)
;; It uses hilite layer packet. You can change it to y0-y9 layer or any other hilite lpp
     ;;hset = geCreateHilightSet(cv list("y0" "drawing") nil)
     ;;hset = geCreateHilightSet(cv list("hilite" "drawing1") nil)
     hset = geCreateHilightSet(cv list("hilite" "drawing") nil)
        hset->enable = t
  foreach(instId instList
     if(listp(instId)
        then
        instBox=CCSTransformBBox(instId)
        instId=car(instBox)
        when(instId~>libName==lib && instId~>cellName==cell
                geAddHilightRectangle(hset cadr(instBox))
                fprintf(myFileId, "Highlighted the %L instance %L of hierarchy at:%L \n"
                        cell buildString(append1(caddr(instBox)~>name instId~>name) "/") cadr(instBox)
                     foundFlag=t)
                )
        else
        when(instId~>libName==lib && instId~>cellName==cell
                geAddHilightFig(hset instId)
                fprintf(myFileId, "Highlighted the %L instance %L of top cell at:%L \n"
                         cell instId~>name instId~>bBox)
                         foundFlag=t
                        )
                );if listp
        ) ;foreach
t
) ;let
) ;procedure
procedure(CCSTransformBBox(inst)
let((flatList y location)
while(listp(inst)
        y = car(inst)
        flatList = append(flatList list(y))
        inst = cadr(inst) ; next inst
       );while
location=dbTransformBBox(inst~>bBox dbGetHierPathTransform(list(flatList inst)))
list(inst location flatList)
);let
);procedure
  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    It works OK for me - note that you have to use a different approach in different branches of the code, and maybe because your close parentheses were a bit screwy (I fixed those too) - I suspect you may have inserted the code in the wrong place. Shows the benefit of clean and consistent indentation...

    Note I didn't spend time formatting the output - I'll leave that to you (BTW, the layer was "Metal1" "label" in my case, so you'll need to fix that for your technology).

    ;; ANDREW passed in the file id as an argument (defaults to appearing in the CIW)
    ;; rather than having another global variable
    procedure(HilightCellByArea(lib cell level @optional (myFileId poport))
      let((cv instList rect instBox overlapLabel foundFlag)
        ;; Deleting old highlights.To prevent uncomment the below line
        ;; ANDREW: using a global variable such as hset is a really bad idea as it's easy
        ;; to clash with somebody else's code. Note that this doesn't really delete the old
        ;; highlights either - it just  makes them invisible. I'd probably store the object as
        ;; a property on the window instead rather than making it global - if you are going
        ;; to make it global, use a prefix for the variable to make it unique
        when(boundp('hset) hset->enable=nil)
        cv=geGetWindowCellView()
        rect=enterBox(
          ?prompts list("Enter the first corner of your box."
          "Enter the last corner of your box.")
        )
        instList=dbGetOverlaps(cv rect nil level nil)
        ;; It uses hilite layer packet. You can change it to y0-y9 layer or any other hilite lpp
        ;;hset = geCreateHilightSet(cv list("y0" "drawing") nil)
        ;;hset = geCreateHilightSet(cv list("hilite" "drawing1") nil)
        hset = geCreateHilightSet(cv list("hilite" "drawing") nil)
        hset->enable = t
        foreach(instId instList
          if(listp(instId) then
            instBox=CCSTransformBBox(instId)
            instId=car(instBox)
            when(instId~>libName==lib && instId~>cellName==cell
              geAddHilightRectangle(hset cadr(instBox))
              fprintf(myFileId, "Highlighted the %L instance %L of hierarchy at:%L \n"
                cell buildString(append1(caddr(instBox)~>name instId~>name) "/") cadr(instBox)
              )
              foundFlag=t
              overlapLabel=dbGetTrueOverlaps(cv cadr(instBox) list("Metal1" "label"))
              fprintf(myFileId "LABEL FOUND: %L\n" overlapLabel~>theLabel)
            )
          else
            when(instId~>libName==lib && instId~>cellName==cell
              geAddHilightFig(hset instId)
              fprintf(myFileId, "Highlighted the %L instance %L of top cell at:%L \n"
                cell instId~>name instId~>bBox
              )
              foundFlag=t
              overlapLabel=dbGetTrueOverlaps(cv instId~>bBox list("Metal1" "label"))
              fprintf(myFileId "LABEL FOUND: %L\n" overlapLabel~>theLabel)
            )
          );if listp
        ) ;foreach
        t
      ) ;let
    ) ;procedure
    
    procedure(CCSTransformBBox(inst)
      let((flatList y location)
        while(listp(inst)
          y = car(inst)
          flatList = append(flatList list(y))
          inst = cadr(inst) ; next inst
        );while
        location=dbTransformBBox(inst~>bBox dbGetHierPathTransform(list(flatList inst)))
        list(inst location flatList)
      );let
    );procedure
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUserD
    skillUserD over 5 years ago in reply to Andrew Beckett

    Andrew, it seems like the code doesn't go down the hierarchy. It identifies the labels on the same level but if I put it few cells below, it doesn't find it.

    I tried using some transformtions but it seems not working....

    Thanks, 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to skillUserD

    Sorry, I didn't exhaustively test the code because I didn't entirely know what you wanted - and I was leaving it to you to correct for your precise needs. Because you're just using the output of dbGetOverlaps from the top level, you'd want to pass level as the dbGetTrueOverlaps calls used to find the labels. At the moment, no fourth argument is passed, and so it defaults to top level labels only. You'd then need to process the resulting lists to find the actual label object at the end - simplest is to call something like this on each result of the dbGetTrueOverlaps - since you're only trying to find the actual label text:

    Using abGetHierPathShape from this code will help. You could then do (and I didn't test this):

    foreach(overlapLabel dbGetTrueOverlaps(cv cadr(instBox) list("Metal1" "label") level)
    actualLabel=abGetHierPathShape(overlapLabel)
    when(actualLabel~>objType=="label"
    fprintf(myFileId "LABEL FOUND: %L\n" actualLabel~>theLabel)
    )
    )
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUserD
    skillUserD over 5 years ago in reply to Andrew Beckett

    Thanks Andrew. It works great.

    Danny

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • skillUserD
    skillUserD over 5 years ago in reply to Andrew Beckett

    Thanks Andrew. It works great.

    Danny

    • 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