• 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. Help on getting Library names for all instances on display...

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 143
  • Views 19594
  • 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

Help on getting Library names for all instances on display form

venuuuuu
venuuuuu over 13 years ago

 Hi guys,

 I tried some code to  get  Library names for all instances on display form. I get it  But Display form doesnot work properly .

 Error is shown below

 *Error* TrShapeReportToPort: too few arguments (2 expected, 1 given) - (db:246261804)

 

 

 cv = geGetEditCellView()
procedure( TrShapeReportToPort( cv outport )
cv = geGetWindowCellView( cv )
;cv = geGetEditCellView()
librarys=nil
fprintf(
outport
"%s %s %s contains library's:"
cv~>libName cv~>cellName cv~>viewName
)
foreach(libryname cv~>instances~>libName
foreach(singlelib librarys
if(singlelib!=libryname then
librarys=cons(libryname librarys)
)
)
)
foreach(libname librarys
fprintf( outport "\n%-10s %-10s" "Library" libname )
)
list( cv~>libName cv~>cellName cv~>viewName )
)

TrReportBBox = '((120 729) (372 876))
procedure( TrShapeReport( cv )
thePort = outfile( "/tmp/ShapeReport.txt" )
when( thePort
TrShapeReportToPort( cv thePort )
close( thePort )
) ; when
view( "/tmp/ShapeReport.txt" TrReportBBox "Librarys" )
) ; procedure
hiSetBindKey("Layout" "Ctrl<Key>1"      "TrShapeReportToPort(cv)")

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Isn't that error message pretty self-explanatory? It's saying you're calling the function TrShapeReportToPort() with one argument, and it's expecting two. Looking at the definition of your code, it has two arguments, but when called from the bindkey, it is only giving a single argument.

    Hardly surprising it fails.

    I've not checked the rest of the code, because the formatting makes it pretty hard to read. Not really sure what it's trying to do - it seems pretty unclear. There's no form involved, so when you're talking about "getting library names for all instances on display form", I don't know what you mean - but the code won't be doing that. It appears to be doing some odd things...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • venuuuuu
    venuuuuu over 13 years ago

     hi Andrew,

     I wrote the TrlibraryReport function. It creates a list of librarys that cellview instances contains. But it dosn't working properly.

     cv = geGetEditCellView()
    librarys=nil
    foreach(libryname cv~>instances~>libName
    foreach(singlelib librarys
    if(singlelib!=libryname then
    librarys=cons(libryname librarys)
    )
    )
    )

    In above code, librarys(variable) should contain list of library's in in cellview. But when i enter library's in CIW then it shows "nil". Can u identify what's the problem?

     If it works  then librarys function displays a list of library's in the CIW. And then this function to send the report to a temporary file and to display this file for the user in a Design Framework II text window. Now total code is shown below.

     cv = geGetEditCellView()
    procedure( TrlibraryReportToPort( cv outport )
    librarys=nil
    fprintf(
    outport
    "%s %s %s contains library's:"
    cv~>libName cv~>cellName cv~>viewName
    )
    foreach(libryname cv~>instances~>libName
    foreach(singlelib librarys
    if(singlelib!=libryname then
    librarys=cons(libryname librarys)
    )
    )
    )
    foreach(libname librarys
    fprintf( outport "\n%-10s %-10s" "Library" libname )
    )
    list( cv~>libName cv~>cellName cv~>viewName )
    )

    TrReportBBox = '((120 729) (372 876))
    procedure( TrlibraryReport( cv )
    thePort = outfile( "/tmp/libraryReport.txt" )
    when( thePort
    TrlibraryReportToPort( cv thePort )
    close( thePort )
    ) ; when
    view( "/tmp/libraryReport.txt" TrReportBBox "Librarys" )
    ) ; procedure

     

     Or is there anyway to display librarys in a display?

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • venuuuuu
    venuuuuu over 13 years ago

     hi Andrew,

    I modified above code. It works fine but problem is all library list contains repeated libraryname's. The code is  below

     

     cv = geGetEditCellView()
    procedure( TrlibraryReportToPort( cv outport )
    ;cv = geGetWindowCellView( cv )
    ;cv = geGetEditCellView()
    librarys=nil
    librarys1=list(car(cv~>instances~>libName))
    librarys=append(librarys1 librarys)
    fprintf(
    outport
    "%s %s %s contains library's:"
    cv~>libName cv~>cellName cv~>viewName
    )

    ;;to doesnot get repeated libraryname's in list

    foreach(libryname cv~>instances~>libName
    foreach(singlelib librarys
    if(singlelib != libryname then
    librarys=append(list(libryname) librarys)
    );if
    );foreach
    );foreach
    foreach(libname librarys
    fprintf( outport "\n%-10s "  libname )
    )
    list( cv~>libName cv~>cellName cv~>viewName )
    )

    TrReportBBox = '((120 729) (372 876))
    procedure( TrlibraryReport( cv )
    thePort = outfile( "/tmp/libraryReport.txt" )
    when( thePort
    TrlibraryReportToPort( cv thePort )
    close( thePort )
    ) ; when
    view( "/tmp/libraryReport.txt" TrReportBBox "Librarys" )
    ) ; procedure
    hiSetBindKey("Layout" "Ctrl<Key>1"      "TrlibraryReport(cv)")

    Then o/p file displays

     venu practice layout contains library's:

     rajesh

     rajesh

     rajesh

     rajesh

     venu

     venu

    In above 1830bd18ba I want to display like this:

     venu practice layout contains library's:

     venu

    rajesh 

    I wrote foreach , if functions  in above code that is not working properly. please help me.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 13 years ago

    I recommend you build your library list using "cons" instead of "append" or "append1". This is the most efficient way to build a list if the order of the list doesn't matter. Then to make sure you don't have duplicates, add a simple member check. Do something like this:

    libList = nil 
    foreach(lib cv~>instHeaders~>libName
        unless(member(lib libList
           libList = cons(lib libList)
        )
    )

    The instHeaders list will be much shorter than the instances list since it will only have each referenced cellView in the list once (unless it is a pcell).

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • venuuuuu
    venuuuuu over 13 years ago

     Thank you  Derek. I it works good. Nd thank you all. I done it with all your help.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • GiriBabu
    GiriBabu over 13 years ago

     hi all,

    This code working only for present cellview level. But i need hierarchy level also. What iam talking about is when i run this script for top level, then my report shows list of library's of instances of top level block of top level view only. But i need list for hierarchy  Is there any command to get library names of instances which are in hierarchy level & present cellview.

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

    If you've been on the SKILL training class, there's an example of doing just this - getting the cellViews used throughout the hierarchy. In fact I'm sure there are numerous examples of doing a recursive hierarchy traversal both in the forum and on Cadence Online Support.

    One approach (from a 10 second search) might be to use code such as in this post.

    Are you posting as two different users?

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • venuuuuu
    venuuuuu over 13 years ago

     hi Andrew,

     It works fine. But it shows the information that which my layout doesnot exist. For example

               ("venu" "BUC" "layout_fp1")

                 ("venu" "BUC" "layout")

                ("venu" "BUC" "schematic")

          But i used   ("venu" "BUC" "layout")  only in my layout.  So i need only ("venu" "BUC" "layout") . Iam trying to get just like tree function in layout.

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

    That was just one example.  Here's another I just threw together which does it more directly:

    procedure(CCFfindLibsUsed(@optional 
        (cv geGetEditCellView()) libsFound 
        (visited makeTable('visited nil)))
      foreach(master cv~>instanceMasters
        unless(visited[master]
          visited[master]=t
          unless(member(master~>libName libsFound)
            libsFound=cons(master~>libName libsFound)
          )
          libsFound=CCFfindLibsUsed(master libsFound visited)
        )
      )
      libsFound
    )

     

    You'd then call:

    CCFfindLibsUsed()

    or

    CCFfindLibsUsed(topCellViewId)

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • venuuuuu
    venuuuuu over 13 years ago

     hi Andrew,

    I still not getting this code. My aim is to get library names for all instances used in cell view (It should get library names hierarchally). my code is below.

     

     

     cv = geGetEditCellView()
    procedure( TrlibraryReportToPort( cv  )
    libList = nil
    foreach(inst cv~>instHeaders
        lib=inst~>libName
        unless(member(lib libList)
           libList = cons(lib libList)
            )

    cellname=inst~>cellName
    viewname=inst~>viewName
    cv1 = dbOpenCellViewByType(lib cellname viewname nil "r")
    foreach(inst1 cv1~>instHeaders
       lib1=inst1~>libName
        unless(member(lib1 libList)
           libList = cons(lib1 libList)
            )
    cellname1=inst1~>cellName
    viewname1=inst1~>viewName
    cv2 = dbOpenCellViewByType(lib1 cellname1 viewname1 nil "r")
    foreach(inst2 cv2~>instHeaders
       lib2=inst2~>libName
        unless(member(lib2 libList)
           libList = cons(lib2 libList)
            )
    cellname2=inst2~>cellName
    viewname2=inst2~>viewName
    cv3 = dbOpenCellViewByType(lib2 cellname2 viewname2 nil "r")
    foreach(inst3 cv3~>instHeaders
       lib3=inst3~>libName
        unless(member(lib3 libList)
           libList = cons(lib3 libList)
            )

    cellname3=inst3~>cellName
    viewname3=inst3~>viewName
    cv4 = dbOpenCellViewByType(lib3 cellname3 viewname3 nil "r")
    foreach(inst4 cv4~>instHeaders
       lib4=inst4~>libName
        unless(member(lib4 libList)
           libList = cons(lib4 libList)
            )
    cellname4=inst~>cellName
    viewname4=inst~>viewName
    cv5 = dbOpenCellViewByType(lib4 cellname4 viewname4 nil "r")
    foreach(inst5 cv5~>instHeaders
       lib5=inst5~>libName
        unless(member(lib5 libList)
           libList = cons(lib5 libList)
            )
    cellname5=inst~>cellName
    viewname5=inst~>viewName
    cv6 = dbOpenCellViewByType(lib5 cellname5 viewname5 nil "r")
    foreach(inst6 cv6~>instHeaders
       lib6=inst6~>libName
        unless(member(lib6 libList)
           libList = cons(lib6 libList)
            )

    ))))))

     In this i wrote for 6 hierarchy levels only by for loop. For this i worte 6 for loops in top for loop. But I want simple way to

    get library list in hierarchally.  

    • 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