• 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. Script to search a library for each instantiation of a cell...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 4145
  • 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

Script to search a library for each instantiation of a cell layout.

dietSprunk
dietSprunk over 1 year ago

I'm looking for a way in SKILL to traverse a library for each instantiation of a cell layout.  The output can just be thrown to a single text report of the hierarchy of each individual cell finding.  Any help is greatly appreciated.

  • Cancel
Parents
  • ebecheto
    ebecheto over 1 year ago

    Here is another approach,

    Loop in every cell in the libraries you've decide, if the pattern of the name your looking for is matched .

    In your case, to search my_cell in lib1 and lib2, it would be :

    whereIncludeCell( "my_cell" list("lib1" "lib2") "layout" nil nil)

    ;; copyleft ebecheto
    
    ;pattern=".*_sim"
    
    ;; cv= geGetWindowCellView()
    ;; pattern="^ota$"
    ;; pattern="ota"
    ;; pattern="ramp"
    ;; pattern="nand"
    ;; views='("schematic" "cmos_sch")
    ;; cv~>cellName
    ;; cv~>libName
    
    ;pattern;=> ".*_sim"
    ;(setq libNames ddGetLibList()~>name)
    ;(setq libNames '("analogLib"))
    
    defun(whereIncludeCell (@optional (pattern "inv") (libNames nil) (views nil) (open nil)(short t))
    " check in views schematic cmos_sch, in cells, in libs, if a cell is instanciated  "
    let( (ddLibs libCellView libName cellName viewName cells)
    unless(libNames libNames=ddGetLibList()~>name)
    unless(views views=list("schematic" "cmos_sch"))
    unless(listp(libNames) libNames=list(libNames))
    unless(listp(views) views=list(views))
    ddLibs=setof(dd ddGetLibList() member(dd~>name libNames))
    ;<= ^^ database to search
    libCellView=remove( nil foreach(mapcan dd ddLibs foreach(mapcan cc dd~>cells foreach(mapcan vv cc~>views 
    if(member(vv~>name views)
    list(list(dd~>name cc~>name vv~>name))
    nil
    )))))
    ;<== ^^ get named list of (lib cell view) we want to search in
    lcv=car(libCellView);=> ("CORELIB" "XNR41" "cmos_sch")
    remove(nil foreach(mapcar lcv libCellView
    libName=nth(0 lcv) cellName=nth(1 lcv) viewName=nth(2 lcv)
    cv=dbOpenCellViewByType( libName cellName viewName)
    cells=(setof cell cv~>instances rexMatchp(pattern cell~>cellName))
    when(cells && open geOpen(?lib libName ?cell cellName ?view viewName))
    res=if(short car(cells~>cellName) cells~>cellName)
    if(cells list(libName cellName res) nil)
    ))))
    
    
    ;; _USAGE_
    ;; whereIncludeCell( "inv" list("CORELIB" "A_CELLS" "IOLIB_ANA_4M") nil)
    ;; whereIncludeCell( "DF" list("A_CELLS" "IOLIB_ANA_4M") nil)
    ;; whereIncludeCell( "DF" list("A_CELLS" "IOLIB_ANA_4M") "schematic")
    ;; whereIncludeCell( "ramp" "xtract_v2" nil)
    ;; whereIncludeCell( "ramp" "xtract_v2" nil t) ;<= open graphically every found cellview
    ;; flipFliops=whereIncludeCell( "DF" list("A_CELLS") nil)
    ;; length(flipFliops);=> 2
    
    printf("whereIncludeCell( \"DF\" list(\"A_CELLS\" \"IOLIB_ANA_4M\") nil)\n")
    printf("whereIncludeCell( \"DF\" list(\"A_CELLS\" \"IOLIB_ANA_4M\") nil t);<= open found views\n")
    
    

    Hope it helps,

    ++

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • ebecheto
    ebecheto over 1 year ago

    Here is another approach,

    Loop in every cell in the libraries you've decide, if the pattern of the name your looking for is matched .

    In your case, to search my_cell in lib1 and lib2, it would be :

    whereIncludeCell( "my_cell" list("lib1" "lib2") "layout" nil nil)

    ;; copyleft ebecheto
    
    ;pattern=".*_sim"
    
    ;; cv= geGetWindowCellView()
    ;; pattern="^ota$"
    ;; pattern="ota"
    ;; pattern="ramp"
    ;; pattern="nand"
    ;; views='("schematic" "cmos_sch")
    ;; cv~>cellName
    ;; cv~>libName
    
    ;pattern;=> ".*_sim"
    ;(setq libNames ddGetLibList()~>name)
    ;(setq libNames '("analogLib"))
    
    defun(whereIncludeCell (@optional (pattern "inv") (libNames nil) (views nil) (open nil)(short t))
    " check in views schematic cmos_sch, in cells, in libs, if a cell is instanciated  "
    let( (ddLibs libCellView libName cellName viewName cells)
    unless(libNames libNames=ddGetLibList()~>name)
    unless(views views=list("schematic" "cmos_sch"))
    unless(listp(libNames) libNames=list(libNames))
    unless(listp(views) views=list(views))
    ddLibs=setof(dd ddGetLibList() member(dd~>name libNames))
    ;<= ^^ database to search
    libCellView=remove( nil foreach(mapcan dd ddLibs foreach(mapcan cc dd~>cells foreach(mapcan vv cc~>views 
    if(member(vv~>name views)
    list(list(dd~>name cc~>name vv~>name))
    nil
    )))))
    ;<== ^^ get named list of (lib cell view) we want to search in
    lcv=car(libCellView);=> ("CORELIB" "XNR41" "cmos_sch")
    remove(nil foreach(mapcar lcv libCellView
    libName=nth(0 lcv) cellName=nth(1 lcv) viewName=nth(2 lcv)
    cv=dbOpenCellViewByType( libName cellName viewName)
    cells=(setof cell cv~>instances rexMatchp(pattern cell~>cellName))
    when(cells && open geOpen(?lib libName ?cell cellName ?view viewName))
    res=if(short car(cells~>cellName) cells~>cellName)
    if(cells list(libName cellName res) nil)
    ))))
    
    
    ;; _USAGE_
    ;; whereIncludeCell( "inv" list("CORELIB" "A_CELLS" "IOLIB_ANA_4M") nil)
    ;; whereIncludeCell( "DF" list("A_CELLS" "IOLIB_ANA_4M") nil)
    ;; whereIncludeCell( "DF" list("A_CELLS" "IOLIB_ANA_4M") "schematic")
    ;; whereIncludeCell( "ramp" "xtract_v2" nil)
    ;; whereIncludeCell( "ramp" "xtract_v2" nil t) ;<= open graphically every found cellview
    ;; flipFliops=whereIncludeCell( "DF" list("A_CELLS") nil)
    ;; length(flipFliops);=> 2
    
    printf("whereIncludeCell( \"DF\" list(\"A_CELLS\" \"IOLIB_ANA_4M\") nil)\n")
    printf("whereIncludeCell( \"DF\" list(\"A_CELLS\" \"IOLIB_ANA_4M\") nil t);<= open found views\n")
    
    

    Hope it helps,

    ++

    • Cancel
    • Vote Up +1 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