• 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. How to print all the hierarchies of a cell being used in...

Stats

  • Replies 3
  • Subscribers 148
  • Views 93
  • Members are here 0

How to print all the hierarchies of a cell being used in a design using Skill Script?

GB20250109498
GB20250109498 6 hours ago

Hi, I want to search a cell used in a top schematic and print the hierarchies of the cell being used, Could you please help? I want to print the hiearchy in terms of cell names not instance names, Thanks in advance.

  • Cancel
  • Sign in to reply
Parents
  • Aurel B
    Aurel B 5 hours ago

    I think that there is a dedicated function for that in the recent Virtuoso versions.
    Otherwise the following should work in almost every versions : 

    (inScheme
    (let ( opened_views_table
           sch_view_names
           )
    
      (defglobalfun report_hierarchy ( cv "d" )
        "Return all the Libray, Cell, View tuples used in CV."
        (setq sch_view_names (parseString (schGetEnv "viewNameList") " ,"))
        ;; Reset table properly
        (setq opened_views_table (makeTable t nil))
        (let ( ( debug_mode (status debugMode        ) )
               ( tail_call  (status optimizeTailCall ) )
               )
          ;; Use tail-call optimization
          (sstatus debugMode        nil)
          (sstatus optimizeTailCall t  )
          (unwindProtect
            ;; Browse cellviews recursively, return the list of opened ones.
            (progn
              (browse (open (get_lcv cv)))
              opened_views_table[?]
              )
            ;; Properly reset tail-call optimization and close opened cellviews
            (progn
              (sstatus optimizeTailCall tail_call )
              (sstatus debugMode        debug_mode)
              (foreach key opened_views_table (dbClose opened_views_table[key]))
              (setq opened_views_table nil)
              ));progn ;unwindProtect
          ));let ;fun
    
      (defun get_lcv ( cv )
        "Return CV library, cell and view."
        (list cv->libName cv->cellName cv->viewName))
    
      (defun open ( lcv )
        "Return opened cellview described by LCV."
        (or opened_views_table[lcv]
            (setf opened_views_table[lcv] (apply 'dbOpenCellViewByType lcv))
            ))
    
      (defun browse ( cv )
        "Recursively browse CV and fill opened_views_table accordingly."
        ;; Browse cellview header
        (foreach header cv->instHeaders
          (let ( ( lcv (get_lcv header) )
                 )
            (unless opened_views_table[lcv]
              (let ( ( sub_cv (open lcv) )
                     )
                (case sub_cv->cellViewType
                  ;; Header describes a symbol, find first associated view.
                  ( "schematicSymbol"
                    (letseq ( ( lib   (car  lcv) )
                              ( cell  (cadr lcv) )
                              ( view  (car (exists view sch_view_names (ddGetObj lib cell view) )))
                              )
                      (when view (browse (open (list lib cell view))))
                      ))
                  ;; TODO - Support config views
    
                  ;; Any other view type, browse it directly
                  ( t (browse sub_cv) )
                ));case ;let
              ));unless ;let
          ));for each header ;fun
    
    
      )); Scheme closure
    
    
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 5 hours ago in reply to Aurel B

    Or use Edit->Hierarchy->Print Tree rather than having to write SKILL code. Or if you want to do this from SKILL, you can use schPrintTree or schPrintTreeConfig as a SKILL equivalent (these were added in IC23.1 ISR12). These also handle traversing config views rather than just a view list.

    Alternatively, if you want to do it from a config using SKILL in an older version, you can use my code in:

    How to print a hierarchy tree of a config-based schematic, normal schematic, or layout view using GUI or SKILL code in batch mode non-graphically

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Aurel B
    Aurel B 5 hours ago in reply to Andrew Beckett

    The ones I had in mind were : 
    schProduceUniqueCVHier & schProduceCVHierConfig but I haven't tried them yet.

    From https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/64551/how-to-use-schproduceuniquecvhier-in-scheme

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Aurel B
    Aurel B 5 hours ago in reply to Andrew Beckett

    The ones I had in mind were : 
    schProduceUniqueCVHier & schProduceCVHierConfig but I haven't tried them yet.

    From https://community.cadence.com/cadence_technology_forums/f/custom-ic-skill/64551/how-to-use-schproduceuniquecvhier-in-scheme

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information