• 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. Issue with a SKILL code o/p

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 2544
  • 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

Issue with a SKILL code o/p

ssram
ssram over 6 years ago

Hi,

I've got the following SKILL code to print the unbound instances in layout and schematic. But it does print something like

(db:0x3f1e409a db:0x3f1e471a db:0x2047469a db:0x317c9e1a db:0x20471f1a
db:0x2047259a db:0x2047251a db:0x3f1e441a db:0x3f1e499a
)

as well along with the ptintf. How to avoid this?

Thanks

Ram

;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

procedure(srFindUnboundInst()

myLib = geGetEditCellView()~>libName
myCell = geGetEditCellView()~>cellName
myview = geGetEditCellView()~>viewName

unboundInst(myLib myCell myview)
)

procedure(unboundInst(myLib myCell myview @optional (mylist list()))
let(( cv insts myMaster skipLibList)
skipLibList=list("basic" "analogLib" "US_8ths")

cv=dbOpenCellViewByType(myLib myCell myview "" "r")
insts = cv~>instHeaders

foreach( header insts
myMaster= header~>master
getWarn()

if( myMaster
then
if( member( myview myMaster~>cell~>views~>name) && !member(myMaster mylist) && !member(header~>libName skipLibList)
then
mylist = cons( myMaster mylist)

mylist=unboundInst(header~>libName header~>cellName if(cv~>cellViewType=="schematic" then myview else header~>viewName) mylist)
)

else

printf("Unbound Master: Library:%s, Cell:%s, View:%s, Missing From: Lib:%s, Cell:%s, View:%s\n"
header~>libName header~>cellName header~>viewName cv~>libName cv~>cellName cv~>viewName)

);if
);foreach
dbClose(cv)

mylist

);let
);procedure

hiSetBindKey("Layout" "Super<Key>F1" "srFindUnboundInst()")

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Your unboundInst function returns the list of unbound instances (see the mylist variable at the end). You need that because it's a recursive function. This is then called as the last function in srFindUnboundInst, and so it's the return value of srFindUnboundInst. I suggest that you change the function to:

    procedure(srFindUnboundInst()
      let((myLib myCell myview)

        myLib = geGetEditCellView()~>libName
        myCell = geGetEditCellView()~>cellName
        myview = geGetEditCellView()~>viewName

        unboundInst(myLib myCell myview)
        t
      )
    )

    I also added in a let to declare some local variables to avoid myLib, myCell and myview becoming global variables. This function would now return t, and so when the return value is displayed in the CIW, it won't display the list.

    Regards,

    Andrew.

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

    Thanks a lot Andrew, this works.

    Also, I've the o/p getting printed in the CIW, how can i print that in a pop-up window instead?

    Thanks

    Sooraj

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

    Thanks a lot Andrew, this works.

    Also, I've the o/p getting printed in the CIW, how can i print that in a pop-up window instead?

    Thanks

    Sooraj

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

    I updated your code to be able to write to a temporary file, and then display that in the main function:

    procedure(srFindUnboundInst()
      let((myLib myCell myview tempFile tempPort)
    
        tempFile = makeTempFileName("/tmp/missingInstances")
        tempPort = outfile(tempFile)
        myLib = geGetEditCellView()~>libName
        myCell = geGetEditCellView()~>cellName
        myview = geGetEditCellView()~>viewName
    
        unboundInst(myLib myCell myview tempPort)
        close(tempPort)
        when(fileLength(tempFile)>0
          view(tempFile nil "Unbound instances")
        )
        deleteFile(tempFile)
        t
      )
    )
    
    procedure(unboundInst(myLib myCell myview @optional (outport stdout) (mylist list()))
      let(( cv insts myMaster skipLibList)
        skipLibList=list("basic" "analogLib" "US_8ths")
    
        cv=dbOpenCellViewByType(myLib myCell myview "" "r")
        insts = cv~>instHeaders
    
        foreach( header insts
          myMaster= header~>master
          getWarn()
    
          if( myMaster then
            if( member( myview myMaster~>cell~>views~>name) && !member(myMaster mylist) && !member(header~>libName skipLibList) then
              mylist = cons( myMaster mylist)
    
              mylist=unboundInst(
                header~>libName 
                header~>cellName 
                if(cv~>cellViewType=="schematic" then myview else header~>viewName)
                outport
                mylist
              )
            )
          else
            fprintf(outport "Unbound Master: Library:%s, Cell:%s, View:%s, Missing From: Lib:%s, Cell:%s, View:%s\n"
              header~>libName header~>cellName header~>viewName cv~>libName cv~>cellName cv~>viewName
            )
    
          );if
        );foreach
        dbClose(cv)
    
        mylist
    
      );let
    );procedure
    
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ssram
    ssram over 6 years ago in reply to Andrew Beckett

    This is exactly what i was expecting, it works like a charm!

    Thank you so much Andrew.

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

    Hi Andrew,

    I do not understand the logic of "if" statement. Could you tell me the purpose of this line ?

    mylist=unboundInst(
                header~>libName
                header~>cellName
                if(cv~>cellViewType=="schematic" then myview else header~>viewName)
                outport
                mylist
              )

    Thanks,

    ManChak

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

    Hi ManChak,

    That was in your code in the first place! I did not write it. 

    Presumably it's there so that if you cellView you're in is a schematic type, then it switches into the same view name as the current view (probably "schematic"). So for layouts it would switch into the view name instantiated; for schematic hierarchies you don't want to switch into the symbol but the corresponding schematic.

    However, as I said, this is not my code - it's yours...

    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