• 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 code to Get all the lib and views used in cell from...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 5385
  • 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 code to Get all the lib and views used in cell from top to bottom hierarchy

ManjunathYalameli
ManjunathYalameli over 1 year ago

Hi All,

I am looking for a code to list all the Lib and views are used in cell from top to bottom hierarchy, Note: without listing duplicates. 

And if view is other then layout it should display lib cell name and view name.

Thanks in advance

Regards

Manju

  • Cancel
Parents
  • AurelBuche
    AurelBuche over 1 year ago

    Hi Manju,

    The following snippet might be a good start for you

    (inScheme
    (let ()
    
      (defun get_view_type (lib cell view "ttt")
        "Return LIB/CELL/VIEW view type, return nil if LIB/CELL/VIEW does not exist"
        ;;  From Cadence Support: "How can I get view type of cellView using SKILL?"
        ;; support.cadence.com/.../ArticleAttachmentPortal
        (and (eq 'ddViewType (type (ddGetObj lib cell view)))
             (ddMapGetFileViewType (ddGetObj lib cell view "*"))
             ));and ;def
    
      (defun get_sch_view (lib cell "tt")
        "Return first valid schematic view name out of LIB/CELL"
        (when (eq 'ddCellType (type (ddGetObj lib cell)))
          (car (exists view (parseString (envGetVal "schematic" "viewNameList" 'string))
                 (equal "schematic" (get_view_type lib cell view))
                 ))
          ));when ;def
    
      (defun apply_to_hierarchy (fun cv)
        "Apply FUN recursively to all cellviews from CV hierarchy"
        (funcall fun cv)
        (foreach sub_cv cv->instanceMasters
          (apply_to_hierarchy fun sub_cv)
          ;; When view is a symbol one, apply also fun to associated schematic one
          (when (equal "schematicSymbol" sub_cv->cellViewType)
            (letseq ((sch_view (get_sch_view sub_cv->libName sub_cv->cellName))
                     (sch_cv   (and sch_view (dbOpenCellViewByType sub_cv->libName sub_cv->cellName sch_view)))
                     )
              (when sch_cv (unwindProtect (apply_to_hierarchy fun sch_cv) (dbClose sch_cv)))
              ));letseq ;when
          ));foreach ;def
    
      (defglobalfun cst_flatten_hierarchy (cv "d")
        "Return flat hierarchy from CV"
        ;; Create and fill table containing all lib/cell/view tuples
        (let ((table (makeTable 'lcv nil)))
          (apply_to_hierarchy
            (lambda (cv) (setf table[(list cv->libName cv->cellName cv->viewName)] t))
            cv)
          ;; Return all lib/cell/view tuples
          table[?]))
    
      ));Scheme closure

    It should work on both schematic and layout views (not on config views though)

    Cheers

    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RK56
    RK56 over 1 year ago in reply to AurelBuche

    Manjunath,

    Another method would be to get the hierarchy tree from layout and process the output with shell (sort and uniq). This approach also works in terminal with 'fasttree' command

    -Ramakrishnan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ManjunathYalameli
    ManjunathYalameli over 1 year ago in reply to RK56

    Hi RamaKrishanan, 

    Thanks for the reply, let me try that. 

    regards

    Manjunath

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • ManjunathYalameli
    ManjunathYalameli over 1 year ago in reply to RK56

    Hi RamaKrishanan, 

    Thanks for the reply, let me try that. 

    regards

    Manjunath

    • 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