• 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 extract Pcell proprieties from a CV

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 143
  • Views 17291
  • 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

How to extract Pcell proprieties from a CV

VadimBorisov
VadimBorisov over 8 years ago

Hi all,

I need a small help, I want to extract of already existing pcell in the CV and them save it to the table. F.i. I need Width, number of gates and etc... 

The question is how to find the data, where should I look?

Kind regards,

Vadim 

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

    It's not that clear quite what you want. You can find the parameter values on the instance, or in the instHeader information; depends on whether you just need to collect the data for all the variants in the design, or all the specific instances.

    Here's some code I wrote a while back to report the PCell variants in the design hierarchy; this was done to provide similar information to that produced by the Stream Out interface in IC5141 (the IC61X stream interface doesn't produce this). The code is in LISP syntax (that's my preference) - hope that doesn't put you off.

    /* abReportPcellVariantsUsed.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 14, 2012 
    Modified   
    By         
    
    Code to report all the variants of pcells used in the design.
    Similar data came out of the "dump pcell info" option in pipo
    in IC5141, but that functionality is not there in xstream in IC61.
    
    To use:
    
    ; report on the hierarchy from the cellView in the current window
    abReportPcellVariantsUsed(?file "./report.txt")
    ; as above, but only showing non-default pcell parameters
    abReportPcellVariantsUsed(?file "./report.txt" ?nonDefault t)
    ; give a specific cellView id rather than current edit cellView
    abReportPcellVariantsUsed(?file "./report.txt" ?cv cvId)
    
    ***************************************************
    
    SCCS Info: @(#) abReportPcellVariantsUsed.il 06/14/12.11:59:31 1.1
    
    */
    
    
    /****************************************************************************
    *                                                                           *
    *           (abCollectPcellVariantsUsed cv [mastersDone pcells])            *
    *                                                                           *
    * Traverse hierarchy recursively, returning a table containing the variants *
    *      for each pcell superMaster that are used in the design. The 2nd      *
    *      and 3rd arguments are only passed from within the function when      *
    *                         it is called recursively                          *
    *                                                                           *
    ****************************************************************************/
    
    (defun abCollectPcellVariantsUsed (cv @optional 
                                          (mastersDone (makeTable 'done nil)) 
                                          (pcells (makeTable 'pcells nil)))
      (let (variants variantTable)
        ;--------------------------------------------------------------------
        ; Record that this master has been visited, to speed things up so
        ; that masters are not traversed more than once
        ;--------------------------------------------------------------------
        (setarray mastersDone cv t)
        (foreach instHeader (dbGetq cv instHeaders)
                 (if (setq variants (dbGetq instHeader variants))
                   ;---------------------------------------------------------
                   ; If there are variants of this instHeader, record them
                   ;---------------------------------------------------------
                   (progn
                     ;-------------------------------------------------------
                     ; Either get the existing variant table for this
                     ; pcell superMaster, or create a new one
                     ;-------------------------------------------------------
                     (setq variantTable 
                           (or 
                             (arrayref pcells (dbGetq instHeader master))
                             (setarray pcells (dbGetq instHeader master)
                                       (makeTable 'variants nil))))
                     ;-------------------------------------------------------
                     ; Record any variants found in the table
                     ;-------------------------------------------------------
                     (foreach variant variants
                              (setarray variantTable (dbGetq variant master) t)
                              )
                     )
                   ;---------------------------------------------------------
                   ; Otherwise traverse the hierarchy if not already visited.
                   ; Note: This includes any pcell variants, which may contain
                   ; hierarchy
                   ;---------------------------------------------------------
                   (unless (arrayref mastersDone (dbGetq instHeader master))
                     (abCollectPcellVariantsUsed (dbGetq instHeader master)
                                                 mastersDone pcells)
                     )
                   )
                 )
        pcells
        )
      )
    
    /************************************************************************
    *                                                                       *
    *  (abReportPcellVariantsUsed [?file poport] [?cv (geGetEditCellView)]  *
    *                          [?nonDefault nil])                           *
    *                                                                       *
    * Writes out a report of all the variants used in the design hierarchy. *
    * The ?file can be either a fileName, or an open port. The ?nonDefault  *
    * argument allows you to restrict the report to only output non-default *
    *                 pcell parameters in the variants list                 *
    *                                                                       *
    ************************************************************************/
    
    (defun abReportPcellVariantsUsed (@key (file poport) (cv (geGetEditCellView)) nonDefault)
      (let (pcells port defaults)
        (setq port
              (cond
                ((stringp file) (outfile file))
                ((and (openportp file) (outportp file)) file)
                (nil)))
        (when (null port)
          (error "abReportPcellVariantsUsed: first argument must be a valid file name to write to, or an open port: %L" file)
          )
        (setq pcells (abCollectPcellVariantsUsed cv))
        (foreach master pcells
                 ;-----------------------------------------------------------
                 ; If asked to output just the non-default parameters only,
                 ; record the superMaster defaults in a table
                 ;-----------------------------------------------------------
                 (when nonDefault
                   ;---------------------------------------------------------
                   ; since parameters can't be symbols, make default a spurious
                   ; value in case unlikely situation where variant has additional
                   ; parameter that the master does not 
                   ;---------------------------------------------------------
                   (setq defaults (makeTable 'defaults 'special))
                   (foreach param (dbGetq (dbGetq master parameters) value)
                            (setarray defaults (dbGetq param name) (dbGetq param value))
                            )
                   )
                 (fprintf port "PCell %s %s %s has variants:\n"
                          (dbGetq master libName)
                          (dbGetq master cellName)
                          (dbGetq master viewName)
                          )
                 (foreach variantMaster
                          (arrayref pcells master)
                          (fprintf port " ")
                          (foreach param (dbGetq (dbGetq variantMaster parameters) value)
                                   ;-----------------------------------------
                                   ; Output either just the non-default, or all parameters
                                   ;-----------------------------------------
                                   (when (or (null nonDefault)
                                             (nequal (arrayref defaults (dbGetq param name))
                                                     (dbGetq param value)))
                                     (fprintf port " %s=%L"
                                              (dbGetq param name) (dbGetq param value))
                                     )
                                   )
                          (fprintf port "\n")
                          )
                 (fprintf port "\n")
                 )
        (when (stringp file) 
          (close port))
        t
        )
      )
    

    Kind Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    It's not that clear quite what you want. You can find the parameter values on the instance, or in the instHeader information; depends on whether you just need to collect the data for all the variants in the design, or all the specific instances.

    Here's some code I wrote a while back to report the PCell variants in the design hierarchy; this was done to provide similar information to that produced by the Stream Out interface in IC5141 (the IC61X stream interface doesn't produce this). The code is in LISP syntax (that's my preference) - hope that doesn't put you off.

    /* abReportPcellVariantsUsed.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 14, 2012 
    Modified   
    By         
    
    Code to report all the variants of pcells used in the design.
    Similar data came out of the "dump pcell info" option in pipo
    in IC5141, but that functionality is not there in xstream in IC61.
    
    To use:
    
    ; report on the hierarchy from the cellView in the current window
    abReportPcellVariantsUsed(?file "./report.txt")
    ; as above, but only showing non-default pcell parameters
    abReportPcellVariantsUsed(?file "./report.txt" ?nonDefault t)
    ; give a specific cellView id rather than current edit cellView
    abReportPcellVariantsUsed(?file "./report.txt" ?cv cvId)
    
    ***************************************************
    
    SCCS Info: @(#) abReportPcellVariantsUsed.il 06/14/12.11:59:31 1.1
    
    */
    
    
    /****************************************************************************
    *                                                                           *
    *           (abCollectPcellVariantsUsed cv [mastersDone pcells])            *
    *                                                                           *
    * Traverse hierarchy recursively, returning a table containing the variants *
    *      for each pcell superMaster that are used in the design. The 2nd      *
    *      and 3rd arguments are only passed from within the function when      *
    *                         it is called recursively                          *
    *                                                                           *
    ****************************************************************************/
    
    (defun abCollectPcellVariantsUsed (cv @optional 
                                          (mastersDone (makeTable 'done nil)) 
                                          (pcells (makeTable 'pcells nil)))
      (let (variants variantTable)
        ;--------------------------------------------------------------------
        ; Record that this master has been visited, to speed things up so
        ; that masters are not traversed more than once
        ;--------------------------------------------------------------------
        (setarray mastersDone cv t)
        (foreach instHeader (dbGetq cv instHeaders)
                 (if (setq variants (dbGetq instHeader variants))
                   ;---------------------------------------------------------
                   ; If there are variants of this instHeader, record them
                   ;---------------------------------------------------------
                   (progn
                     ;-------------------------------------------------------
                     ; Either get the existing variant table for this
                     ; pcell superMaster, or create a new one
                     ;-------------------------------------------------------
                     (setq variantTable 
                           (or 
                             (arrayref pcells (dbGetq instHeader master))
                             (setarray pcells (dbGetq instHeader master)
                                       (makeTable 'variants nil))))
                     ;-------------------------------------------------------
                     ; Record any variants found in the table
                     ;-------------------------------------------------------
                     (foreach variant variants
                              (setarray variantTable (dbGetq variant master) t)
                              )
                     )
                   ;---------------------------------------------------------
                   ; Otherwise traverse the hierarchy if not already visited.
                   ; Note: This includes any pcell variants, which may contain
                   ; hierarchy
                   ;---------------------------------------------------------
                   (unless (arrayref mastersDone (dbGetq instHeader master))
                     (abCollectPcellVariantsUsed (dbGetq instHeader master)
                                                 mastersDone pcells)
                     )
                   )
                 )
        pcells
        )
      )
    
    /************************************************************************
    *                                                                       *
    *  (abReportPcellVariantsUsed [?file poport] [?cv (geGetEditCellView)]  *
    *                          [?nonDefault nil])                           *
    *                                                                       *
    * Writes out a report of all the variants used in the design hierarchy. *
    * The ?file can be either a fileName, or an open port. The ?nonDefault  *
    * argument allows you to restrict the report to only output non-default *
    *                 pcell parameters in the variants list                 *
    *                                                                       *
    ************************************************************************/
    
    (defun abReportPcellVariantsUsed (@key (file poport) (cv (geGetEditCellView)) nonDefault)
      (let (pcells port defaults)
        (setq port
              (cond
                ((stringp file) (outfile file))
                ((and (openportp file) (outportp file)) file)
                (nil)))
        (when (null port)
          (error "abReportPcellVariantsUsed: first argument must be a valid file name to write to, or an open port: %L" file)
          )
        (setq pcells (abCollectPcellVariantsUsed cv))
        (foreach master pcells
                 ;-----------------------------------------------------------
                 ; If asked to output just the non-default parameters only,
                 ; record the superMaster defaults in a table
                 ;-----------------------------------------------------------
                 (when nonDefault
                   ;---------------------------------------------------------
                   ; since parameters can't be symbols, make default a spurious
                   ; value in case unlikely situation where variant has additional
                   ; parameter that the master does not 
                   ;---------------------------------------------------------
                   (setq defaults (makeTable 'defaults 'special))
                   (foreach param (dbGetq (dbGetq master parameters) value)
                            (setarray defaults (dbGetq param name) (dbGetq param value))
                            )
                   )
                 (fprintf port "PCell %s %s %s has variants:\n"
                          (dbGetq master libName)
                          (dbGetq master cellName)
                          (dbGetq master viewName)
                          )
                 (foreach variantMaster
                          (arrayref pcells master)
                          (fprintf port " ")
                          (foreach param (dbGetq (dbGetq variantMaster parameters) value)
                                   ;-----------------------------------------
                                   ; Output either just the non-default, or all parameters
                                   ;-----------------------------------------
                                   (when (or (null nonDefault)
                                             (nequal (arrayref defaults (dbGetq param name))
                                                     (dbGetq param value)))
                                     (fprintf port " %s=%L"
                                              (dbGetq param name) (dbGetq param value))
                                     )
                                   )
                          (fprintf port "\n")
                          )
                 (fprintf port "\n")
                 )
        (when (stringp file) 
          (close port))
        t
        )
      )
    

    Kind Regards,

    Andrew.

    • 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