• 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 Design
  3. Design migration tool

Stats

  • Locked Locked
  • Replies 21
  • Subscribers 125
  • Views 38556
  • 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

Design migration tool

Faizan UL HAQ
Faizan UL HAQ over 10 years ago

Hi,

I have a problem to transfer the simulation files from one design kit to another design kit in cadence virtuoso. The simulation files and circuit diagrams are quite many and it will take ages for me if i tranfer the files manually. Is there any kind of tool which can convert one design kit circuit diagrams into another design kit circuit diagrams.
BR

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    There are a couple of existing posts on this - http://community.cadence.com/cadence_technology_forums/f/48/p/30456/1338243#1338243 and http://community.cadence.com/cadence_technology_forums/f/48/p/13227/20248#20248

    These reference some code of mine which can be used to migrate to different libraries. Here's the current version of this code (the versions pointed to elsewhere are slightly old and have had some fixes/enhancements in the meantime).

    /* abConvertComponentParams.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jan 14, 2001 
    Modified   Sep 03, 2019 
    By         A.D.Beckett
    
    Can either convert a single cellView - in the current window:
    
    abConvertComponentParams("conv.config")
    
    Or one in a variable:
    
    abConvertComponentParams("conv.config" cellView)
    
    Or one in a variable, not doing the schematic check afterwards:
    
    abConvertComponentParams("conv.config" cellView nil)
    
    Or all the matching views in a library
    
    abConvertComponentParamsForLib("myLib" "schematic" "conv.config")
    
    Or all the matching viewTypes in a library
    
    abConvertComponentParamsForLibByViewType("myLib" "schematic" "conv.config")
    
    Or a whole design hierarchy:
    
    abConvertComponentParamsHier("conv.config")
    
    With some different keyword arguments:
    
    abConvertComponentParamsHier("conv.config" ?cellView cellView 
        ?viewList "schematic schem2 symbol" 
        ?stopList "symbol" ?check nil)
    
    (see the code below for details on the arguments to this function)
    
    
    Each uses a configuration file which contains the rules for conversion.
    
    The conversion configuration file contains a single list. Each sub-list
    is a disembodied property list, containing the following properties:
    
    fromLib:  Name of the library from which the component to
              be changed originates
              Is an anchored regular expression ("nfet" means "^nfet$"; ".*fet" means
              "^.*fet$")
    fromCell: Name of the cell of the component to be changed.
              An anchored regular expression.
    fromView: Name of the view of the component to be changed.
              Defaults to "symbol" if not specified.
              An anchored regular expression.
    toLib:    Name of the library in which the new component is
              to be found.
    toCell:   Name of the cell of the new component.
    toView:   Name of the view of the new component.
              Defaults to "symbol" if not specified.
    propMatch:
              An assoc list of property names and values. If the instance
              matches the cell name, and this key exists, it will match if
              all properties match. The property values are treated as anchored
              regular expressions (so "N.*" will match as "^N.*$").
    matchFunction:
              Name of a predicate function (which is passed the instId) to
              decide if this is a match. If neither propMatch nor matchFunction
              keys are provided, it is assumed to match. If both are supplied,
              they must both match.
    postProcess:
              Name of a function (passed the instance id) which is used to
              do any post-processing on the instance after conversion (before
              the callbacks are called). 
    runCallbacks: Invoke the callbacks after changes if this is t. If it is
              a list, then these are additional arguments to abInvokeInstCdfCallbacks
    params:   List of parameters to change. Each sub-list contains
              two to four elements:
                The original parameter name
                The new parameter name (or nil)
                [optional] a function to do some modification. The function
                will be passed the instance id, the original parameter name,
                and the existing parameter value, and will return the 
                updated parameter value.
                [optional] the type of the new parameter (if different from original)
              If the new parameter name is nil, it simply deletes the 
              original property.
    addProps: List of properties to add, or set. Each sub-list contains
              two or three elements:
                The name of the property
                The value to set.
                [optional] The type of the property (e.g. "netSet") if cannot be
                inferred from the value.
    
    An example would be:
    
    (
      (nil
       fromLib   "analogLib"
       fromCell  "nmos4"
       toLib     "test"
       toCell    "nmos4"
       runCallbacks t
       params (
               ("w" "width")
               ("l" "length" fixIt)
               )
       addProps (
                 ("isnoisy" t)
                 )
       )
      (nil
       fromLib   "analogLib"
       fromCell  ".*mos4"
       toLib     "test"
       toCell    "pmos4"
       propMatch (("subtype" "pxyz"))
       runCallbacks (?useInstCDF t ?callInitProc t)
       params (
               ("w" "width")
               ("l" "length")
               )
       )
    )
    
    For example, fixIt might be something like:
    
    procedure(fixIt(inst parName val)
      printf("Fixing %s on %s\n" parName inst~>name)
      ; double the value. Note evalstring is not really a good idea,
      ; just in case the parameter value is some legal SKILL which could do
      ; something unexpected (e.g. "exit()" !)
      sprintf(nil "%n" evalstring(val)*2)
      )
    
    Unless anything complicated is needed, there is no need to specify a conversion
    function. This may be needed for parameter scaling (e.g. changing from meters to
    microns)
    
    ***************************************************
    
    SCCS Info: @(#) abConvertComponentParams.il 09/03/19.17:39:04 1.13
    
    */
    
    /**********************************************************************
    *                                                                     *
    *           (abReadConvertComponentParamsConfig configFile)           *
    *                                                                     *
    * Read the configuration parameters for the conversion from the named *
    *                      file, and return the list                      *
    *                                                                     *
    **********************************************************************/
    
    (procedure (abReadConvertComponentParamsConfig configFile)
      (let (prt data)
           (setq prt (infile configFile))
           (while (and (setq data (lineread prt)) (eq data t)) t)
           (car data)
           )
      )
    
    /***************************************************************
    *                                                              *
    *      (abConvertComponentParamsPropMatch inst propMatch)      *
    *                                                              *
    * Check an instance against all the entries in the propMatch,  *
    *                 and return t if it matches.                  *
    *                                                              *
    ***************************************************************/
    
    (procedure (abConvertComponentParamsPropMatch inst propMatch)
      (let (propVal)
           (forall propPair propMatch
                   (and (setq propVal (dbGet inst (car propPair)))
                        (or
                         (and (stringp propVal)
                              (rexMatchp (sprintf nil "^%s$" (cadr propPair))
                                         propVal))
                         (equal (cadr propPair) propVal))
                        ))
           )
      )
    
    /***********************************************************************
    *                                                                      *
    *                      (abConvertComponentParams                       *
    *                              configFile                              *
    *          @optional (cellView (geGetEditCellView)) (check t)          *
    *                                  )                                   *
    *                                                                      *
    * Using the conversion configuration information, convert the cellView *
    *                              specified.                              *
    *                                                                      *
    ***********************************************************************/
    
    (procedure (abConvertComponentParams
                configFile
                @optional (cellView (geGetEditCellView)) (check t)
                )
      (let (master config newVal changed newParams valueType)
           ;-----------------------------------------------------------------
           ; Read the config file, unless the config parameters were
           ; passed in
           ;-----------------------------------------------------------------
           (setq config
                 (if (stringp configFile)
                     (abReadConvertComponentParamsConfig configFile)
                     configFile
                     )
                 )
           ;-----------------------------------------------------------------
           ; Try each component in the config
           ;-----------------------------------------------------------------
           (foreach component config
                    ;--------------------------------------------------------
                    ; Get the master for the replacement component
                    ;--------------------------------------------------------
                    (setq master 
                          (dbOpenCellViewByType
                           (getq component toLib)
                           (getq component toCell)
                           (or (getq component toView) "symbol")
                           )
                          )
                    ;--------------------------------------------------------
                    ; Fill in the default values in the config
                    ;--------------------------------------------------------
                    (unless (getq component fromView)
                            (putpropq component "symbol" fromView))
                    ;--------------------------------------------------------
                    ; Look at all the instances
                    ;--------------------------------------------------------
                    (foreach inst (dbGetq cellView instances)
                             ;-----------------------------------------------
                             ; If it matches
                             ;-----------------------------------------------
                             (when
                              (and
                               (rexMatchp 
                                (sprintf nil "^%s$" (getq component fromLib))
                                (dbGetq inst libName))
                               (rexMatchp 
                                (sprintf nil "^%s$" (getq component fromCell))
                                (dbGetq inst cellName))
                               (rexMatchp 
                                (sprintf nil "^%s$" (getq component fromView))
                                (dbGetq inst viewName))
                               (or (null (getq component propMatch))
                                   (abConvertComponentParamsPropMatch
                                    inst (getq component propMatch)))
                               (or (null (getq component matchFunction))
                                   (funcall (getq component matchFunction) inst))
                               )
                              (unless changed
                                      (dbReopen cellView "a")
                                      (setq changed t)
                                      )
                              ;----------------------------------------------
                              ; Initialise the list of new parameters
                              ;----------------------------------------------
                              (setq newParams nil)
                              ;----------------------------------------------
                              ; Then update all the properties
                              ;----------------------------------------------
                              (foreach param (getq component params)
                                       (when (and
                                              (setq newVal (dbGet inst (car param)))
                                              (nequal newVal "")
                                              )
                                             ;-------------------------------
                                             ; If a function was supplied, call it to
                                             ; process the value
                                             ;-------------------------------
                                             (when (caddr param)
                                                   (setq newVal 
                                                         (funcall (caddr param) inst 
                                                                  (car param) newVal))
                                                   )
                                             ;-------------------------------
                                             ; The valueType is either the existing
                                             ; type, or can be overridden with the 
                                             ; fourth entry in the param definition
                                             ;-------------------------------
                                             (setq valueType
                                                   (or (cadddr param)
                                                       (dbGetq
                                                         (dbFindProp inst (car param))
                                                         valueType)))
                                             ;-------------------------------
                                             ; Delete the old property, and 
                                             ; store the new
                                             ;-------------------------------
                                             (dbDeletePropByName inst (car param))
                                             ;-------------------------------
                                             ; If the new parameter name is non-nil
                                             ; add the new parameter into the list to add
                                             ;-------------------------------
                                             (when (cadr param)
                                               (setq newParams
                                                     (cons (list (cadr param) newVal 
                                                                 valueType) newParams))
                                               ) 
                                             ) 
                                       ) 
                              ;----------------------------------------------
                              ; Update the master to the new component
                              ; Must do this after changing the parameters, as otherwise
                              ; getting default values from the CDF doesn't work (since
                              ; the component changed)
                              ;----------------------------------------------
                              (dbSetq inst master master)
                              ;----------------------------------------------
                              ; Now go through the list of parameters and save them
                              ; trying to preserve the property type
                              ;----------------------------------------------
                              (foreach param newParams
                                       (if (caddr param)
                                         (dbReplaceProp inst (car param) 
                                                        (caddr param) (cadr param))
                                         (dbSet inst (cadr param) (car param))
                                         )
                                       )
                              ;----------------------------------------------
                              ; Now add any parameters that were asked to be set
                              ; Also supports optional type
                              ;----------------------------------------------
                              (foreach param (getq component addProps)
                                       (if (caddr param)
                                         (dbReplaceProp inst (car param) 
                                                        (caddr param) (cadr param))
                                         (dbSet inst (cadr param) (car param))
                                         )
                                       ) 
                              ;----------------------------------------------
                              ; invoke any postProcess function that has been 
                              ; defined
                              ;----------------------------------------------
                              (when (getq component postProcess)
                                (funcall (getq component postProcess) inst)
                                )
                              ;----------------------------------------------
                              ; If the configuration says to invoke the callbacks,
                              ; call them
                              ;----------------------------------------------
                              (when (getq component runCallbacks)
                                (if (listp (getq component runCallbacks))
                                  (apply 'abInvokeInstCdfCallbacks
                                         (cons inst (getq component runCallbacks)))
                                  (abInvokeInstCdfCallbacks inst)
                                  )
                                )
                              )
                             )
                    ;--------------------------------------------------------
                    ; Close the master replacement object (for tidiness)
                    ;--------------------------------------------------------
                    (dbClose master)
                    )
           ;-----------------------------------------------------------------
           ; If anything changed, need to save it
           ;-----------------------------------------------------------------
           (when changed 
                 (when check (schCheck cellView))
                 (dbSave cellView)
                 )
           ;-----------------------------------------------------------------
           ; Let the caller know if anything got changed
           ;-----------------------------------------------------------------
           changed
           )
      )
    
    /*****************************************************************************
    *                                                                            *
    *    (abConvertComponentParamsForLib libName viewName configFile [check])    *
    *                                                                            *
    * Convert all cells in the library libName which have a view viewName, using *
    *                     the configuration file passed in.                      *
    *                                                                            *
    *****************************************************************************/
    
    (procedure (abConvertComponentParamsForLib libName viewName configFile
                                               @optional (check t)
                                               )
      (let (config cellName cellView)
           ;-----------------------------------------------------------------
           ; Read the config file, unless the config parameters were
           ; passed in
           ;-----------------------------------------------------------------
           (setq config
                 (if (stringp configFile)
                     (abReadConvertComponentParamsConfig configFile)
                     configFile
                     )
                 )
           (foreach cell (getq (ddGetObj libName) cells)
                    (setq cellName (getq cell name))
                    (when (ddGetObj libName cellName viewName)
                          (setq cellView 
                                (dbOpenCellViewByType
                                 libName cellName viewName))
                          (when cellView
                                (printf "Converting %s/%s/%s\n" libName cellName viewName)
                                (abConvertComponentParams config cellView check)
                                (dbClose cellView)
                                )
                          )
                    )
           )
      t
      )
    
    /*********************************************************************
    *                                                                    *
    *             (abConvertComponentParamsForLibByViewType              *
    *          libName viewType configFile @optional (check t)           *
    *                                 )                                  *
    *                                                                    *
    * Convert all cells in the library libName which have a view of type *
    *         viewType, using the configuration file passed in.          *
    *                                                                    *
    *********************************************************************/
    
    (procedure (abConvertComponentParamsForLibByViewType
                 libName viewType configFile @optional (check t)
                 )
      (let (config cellName cellView viewName masterObj)
           ;-----------------------------------------------------------------
           ; Read the config file, unless the config parameters were
           ; passed in
           ;-----------------------------------------------------------------
           (setq config
                 (if (stringp configFile)
                     (abReadConvertComponentParamsConfig configFile)
                     configFile
                     )
                 )
           (foreach cell (getq (ddGetObj libName) cells)
                    (setq cellName (getq cell name))
                    (foreach view (getq (ddGetObj libName cellName) views)
                             (setq viewName (getq view name))
                             (setq masterObj
                                   (ddGetObj libName cellName viewName "*"))
                             (when (and masterObj 
                                        (equal (ddMapGetFileViewType masterObj)
                                               viewType))
                               (setq cellView 
                                     (dbOpenCellViewByType
                                       libName cellName viewName))
                               (when cellView
                                 (printf "Converting %s/%s/%s\n" libName cellName 
                                         viewName)
                                 (abConvertComponentParams config cellView check)
                                 (dbClose cellView)
                                 )
                               )
                             )
                    )
           )
      t
      )
    
    /*********************************************************************
    *                                                                    *
    *                   (abConvertComponentParamsHier                    *
    *             configFile [?cellView (geGetEditCellView)]             *
    *              [?viewList "schematic cmos.sch symbol"]               *
    *                        [?stopList "symbol"]                        *
    *                             [?check t]                             *
    *                          [?visited table]                          *
    *                                 )                                  *
    *                                                                    *
    * Traverse the design hierarchically, using the specified view list  *
    * and stop list, converting the parameters as outlined in the config *
    * file supplied. The ?visited argument is only intended to be passed *
    *  when this function is called recursively - end users should not   *
    *  pass this argument. ?check allows you to turn off the check done  *
    *  before saving. The default cellView to start from is the one in   *
    *                        the current window.                         *
    *                                                                    *
    *********************************************************************/
    
    (procedure (abConvertComponentParamsHier
                configFile @key (cellView (geGetEditCellView))
                (viewList "schematic cmos.sch symbol")
                (stopList "symbol")
                (check t)
                (visited (makeTable 'visited nil))
                )
      (let (config switchedView)
           ;-----------------------------------------------------------------
           ; Read the config file, unless the config parameters were
           ; passed in
           ;-----------------------------------------------------------------
           (setq config
                 (if (stringp configFile)
                     (abReadConvertComponentParamsConfig configFile)
                     configFile
                     )
                 )
           ;-----------------------------------------------------------------
           ; Convert the stop list to a list for convenience
           ;-----------------------------------------------------------------
           (when (stringp stopList)
                 (setq stopList (parseString stopList)))
           ;-----------------------------------------------------------------
           ; Convert the parameters for this cellView
           ;-----------------------------------------------------------------
           (abConvertComponentParams config cellView check)
           ;-----------------------------------------------------------------
           ; Traverse the hierarchy
           ;-----------------------------------------------------------------
           (foreach header (dbGetq cellView instHeaders)
                    (when (dbGetq header instances)
                      ;------------------------------------------------------
                      ; Switch into a cellView in the view list
                      ;------------------------------------------------------
                      (setq switchedView (dbGetAnyInstSwitchMaster 
                                           (car (dbGetq header instances))
                                           viewList))
                      (when switchedView
                        ;----------------------------------------------------
                        ; Unless I've been here before, or it's a pcell,
                        ; or it's in the stop list, then recursively call
                        ; this function
                        ;----------------------------------------------------
                        (unless
                          (or
                            (arrayref visited switchedView)
                            (dbGetq switchedView isParamCell)
                            (dbGetq switchedView superMaster)
                            (member (dbGetq switchedView viewName) stopList)
                            )
                          (setarray visited switchedView t)
                          (abConvertComponentParamsHier 
                            config
                            ?cellView switchedView
                            ?viewList viewList
                            ?stopList stopList
                            ?check check
                            ?visited visited
                            )
                          )
                        ) 
                      ) 
                    )
           t
           )
      )
    

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

    This also uses (optionally);

    /* abInvokeCdfCallbacks.il
    
    Author     A.D.Beckett
    Group      Structured Custom, Cadence Design Systems Ltd.
    Machine    SUN
    Date       Jul 11, 1995 
    Modified   Dec 23, 2013 
    By         A.D.Beckett
    
    Invoke all the CDF callbacks for instances
    
    The main entry point is (abInvokeCdfCallbacks cellView)
    which invokes all the CDF callbacks for every instance in
    a cellView. This has some keyword arguments which allow debug
    messages to be displayed, to invoke the formInitProc if needed,
    and to invoke using the instance CDF directly, rather than try
    to create something that looks more like the effective CDF that
    is found when the callbacks are normally invoked from the forms.
    
    You can use the variable abCallbackPatternsToIgnore so
    that some callbacks can be omitted.
    
    Extended in version 1.16 to allow ?filterFunc to be passed.
    This is a function that gets the cdf, the param name (nil
    for the initProc) and callback string.
    The function should return t if the callback should be called, 
    and nil otherwise. For example:
    
    procedure(MYfilterFunc(cdf paramName callback)
        destructuringBind(
            (lib @optional cell) abGetLibCellFromCDF(cdf)
            ; t if any other parameter than w for gpdk090/nmos1v
            !(lib=="gpdk090" && cell=="nmos1v" && param=="w")
        )
    )
    
    abInvokeCdfCallbacks(geGetEditCellView() ?filterFunc 'MYfilterFunc)
    
    ***************************************************
    
    SCCS Info: @(#) abInvokeCdfCallbacks.il 12/23/13.12:50:52 1.16
    
    */
    
    /***************************************************************
    *                                                              *
    *     The variable abCallbackPatternsToIgnore is set to be     *
    *      a list of patterns against which the callbacks are      *
    *      checked. If any of these patterns are matched then      *
    *                 the callback is not invoked.                 *
    *                                                              *
    ***************************************************************/
    
    (unless (boundp 'abCallbackPatternsToIgnore)
      (setq abCallbackPatternsToIgnore
            '("^MYPDKNot_Allowed.*")))
    
    /***************************************************************
    *                                                              *
    *   (abShouldCallbackBeExecuted callback filterFunc cdf param) *
    *                                                              *
    *  This checks the callback against all the patterns defined   *
    *     in the list abCallbackPatternsToIgnore to determine      *
    *       whether the callback should be executed or not.        *
    *    If filterFunc is passed, call with cdf, param name and    *
    *            callback - this should return t or nil            *
    *                                                              *
    ***************************************************************/
    
    (procedure (abShouldCallbackBeExecuted callback filterFunc cdf param)
      (and
        (forall pattern abCallbackPatternsToIgnore
                (null (rexMatchp pattern callback)))
        (if filterFunc
          (funcall filterFunc cdf param callback)
          t
          )
        )
      )
    
    /***************************************************************
    *                                                              *
    *                  (abGetLibCellFromCDF cdf)                   *
    *                                                              *
    *   Utility function to retrieve a list of lib and cell name   *
    *  from the CDF, regardless of whether it is an inst, cell or  *
    * lib CDF. For lib CDF it only returns a list of the lib name  *
    *                                                              *
    ***************************************************************/
    
    (procedure (abGetLibCellFromCDF cdf)
      (let (id)
        (setq id (getq cdf id))
        (case (type id)
          (dbobject
            (list (getq id libName) (getq id cellName))
            )
          (ddCellType
            (list (getq (getq id lib) name) (getq id name))
            )
          (ddLibType
            (list (getq id name))
            )
          )
        )
      )
    
    /*********************************************************************
    *                                                                    *
    *        (abCreateEffectiveCDFLookalike cdf [lookalikeParams]        *
    *                       [resetLookalikeParams])                      *
    *                                                                    *
    *     Create a structure which looks (sort of) like an effective     *
    *  CDF. The reason for creating this is to allow the "id" parameter  *
    *  to be correctly set to the cell, rather than the instance, which  *
    * is what happens if we use the cdfGetInstCDF() function to simulate *
    * cdfgData. The lookalikeParams optional parameter allows creation   *
    * of the parameters to be "lookalike" as well, so that callbacks can *
    * be called even if there is no actual instance. By default, the     *
    * parameters will be reset with using lookalikeParams, unless you    *
    *                   pass nil as the third argument.                  *
    *                                                                    *
    *********************************************************************/
    
    (procedure (abCreateEffectiveCDFLookalike cdf @optional lookalikeParams
                                              (resetLookalikeParams t))
      (let (new cdfFields newParam)
           (unless (getd 'make_abEffCDF)
                   ;---------------------------------------------------------
                   ; Because some slots appear twice in cdf->? have
                   ; to make the list unique
                   ;---------------------------------------------------------
                   (setq cdfFields (makeTable 'cdfFields))
                   (foreach field (getq cdf ?)
                            (setarray cdfFields  field t)
                            )
                   (eval `(defstruct abEffCDF ,@(getq cdfFields ?))))
           (setq new (make_abEffCDF))
           (when (and lookalikeParams (null (getd 'make_abEffCDFparam)))
             (setq cdfFields (makeTable 'cdfFields))
             (foreach field (getq (car (getq cdf parameters)) ?)
                      (setarray cdfFields field t))
             (eval `(defstruct abEffCDFparam ,@(getq cdfFields ?))))
           ;-----------------------------------------------------------------
           ; populate the effective cdf with the top level cdf attributes
           ;-----------------------------------------------------------------
           (foreach param (getq cdf ?)
                    (putprop new (get cdf param) param))
           ;-----------------------------------------------------------------
           ; Set the id and type attributes appropriately
           ;-----------------------------------------------------------------
           (when (equal (getq new type) "instData")
             (putpropq new (dbGetq (dbGetq (getq cdf id) master) cell) id)
             (putpropq new "cellData" type)
             )
           ;-----------------------------------------------------------------
           ; If we want the parameters to be lookalike too, create those
           ;-----------------------------------------------------------------
           (when lookalikeParams
             (putpropq new 
                       (foreach mapcar param (getq cdf parameters)
                                (setq newParam (make_abEffCDFparam))
                                (foreach slot (getq param ?)
                                         (putprop newParam (get param slot) slot))
                                (when resetLookalikeParams
                                  ; reset the value to defValue for safety
                                  (putpropq newParam (getq newParam defValue) value)
                                  )
                                newParam
                                )
                       parameters)
             ) ; when
           ;-----------------------------------------------------------------
           ; Add the parameters as properties in the effective cdf
           ;-----------------------------------------------------------------
           (foreach param (getq new parameters)
                    (putprop new param (getq param name))
                    )
           new
           )
      )
    
    /*******************************************************************
    *                                                                  *
    *        (abAddFormFieldsToEffectiveCDFLookalike cdf inst)         *
    *                                                                  *
    * Populate four extra fields - libraryName, cellName, viewName and *
    *  instanceName to emulate the forms on the forms - i.e. so that   *
    *  cdfgForm gets these slots. This is for callbacks which (badly)  *
    *   use cdfgForm to find out libraryName, cellName and viewName.   *
    *                                                                  *
    *******************************************************************/
    
    (procedure (abAddFormFieldsToEffectiveCDFLookalike cdf inst)
      (let (fieldData value)
        (unless (getd 'make_abEffCDFFormFields)
          (defstruct abEffCDFFormFields value defValue lastValue 
            editable enabled invisible)
          )
        (foreach (field attr) '(libraryName cellName viewName instanceName) 
                 '(libName cellName viewName name)
                 (setq value (dbGet inst attr))
                 (setq fieldData
                       (make_abEffCDFFormFields
                         ?value value
                         ?defValue value
                         ?lastValue value
                         ?editable t
                         ?enabled t
                         ?invisible nil
                         ))
                 (putprop cdf fieldData field)
                 )
        cdf
        )
      )
    
    /*******************************************************************
    *                                                                  *
    *       (abInvokeObjCdfCallbacks cdf @key (debug nil) order        *
    *       (callInitProc nil) (setCdfgForm t) (filterFunc nil))       *
    *                                                                  *
    *      Underlying function which does all the real work. This      *
    * is separated from the original function abInvokeInstCdfCallbacks *
    *    so that this can be called with a completely virtual CDF.     *
    *      See abInvokeInstCdfCallbacks for a description of the       *
    *  arguments - note that there is the ability to control whether   *
    *                     cdfgForm is set or not.                      *
    * Return nil if any callback failed with a SKILL error, t otherwise*
    *                                                                  *
    *******************************************************************/
    
    (procedure (abInvokeObjCdfCallbacks cdf @key (debug nil) order
                                         (callInitProc nil) (setCdfgForm t)
                                         filterFunc)
      ;----------------------------------------------------------------------
      ; Make cdfgData and cdfgForm dynamically scoped, to avoid
      ; interfering with any global usage of these variables
      ;----------------------------------------------------------------------
      (let (callback parameters cdfgData cdfgForm (success t))
           ;-----------------------------------------------------------------
           ; Set the cdfgData to be the instance CDF
           ;-----------------------------------------------------------------
           (setq cdfgData cdf)
           (setq cdfgForm nil)
           (when setCdfgForm 
             ;---------------------------------------------------------------
             ; some callbacks use cdfgForm instead
             ;---------------------------------------------------------------
             (setq cdfgForm cdfgData)
             )
           ;-----------------------------------------------------------------
           ; Call the formInitProc if there is one.
           ;-----------------------------------------------------------------
           (when callInitProc
                 (setq callback (getq cdfgData formInitProc))
                 (when (and callback 
                            (nequal callback "")
                            (abShouldCallbackBeExecuted callback filterFunc 
                                                        cdfgData nil))
                       (when debug
                             (printf "  Invoking formInitProc: '%s'\n" callback))
                       ;-----------------------------------------------------
                       ; Evaluate the callback
                       ;-----------------------------------------------------
                       (unless
                        (errset (evalstring 
                                 (strcat callback "(cdfgData)")) t)
                        (setq success nil)
                        )
                       )
                 )
           ;-----------------------------------------------------------------
           ; Control order of parameter evaluation. If order specified,
           ; just do those, otherwise do all in arbitrary order
           ;-----------------------------------------------------------------
           (if order
               (setq parameters (foreach mapcar param order
                                         (get cdfgData param)))
               (setq parameters (getq cdfgData parameters))
               )
           ;-----------------------------------------------------------------
           ; loop through all parameters
           ;-----------------------------------------------------------------
           (foreach param parameters
                    (setq callback (getq param callback))
                    (when (and callback 
                               (nequal callback "")
                               (abShouldCallbackBeExecuted callback filterFunc
                                                           cdfgData
                                                           (getq param name)))
                          (when debug
                                (printf "  Invoking callback for '%s': '%s'\n"
                                        (getq param name) callback))
                          ;--------------------------------------------------
                          ; evaluate the callback
                          ;--------------------------------------------------
                          (unless (errset (evalstring callback) t)
                           (setq success nil)
                           )
                          ))
      success))
    
    /*****************************************************************
    *                                                                *
    *       (abInvokeInstCdfCallbacks instance [?debug debug]        *
    *  [?order order] [?callInitProc callInitProc] [?useInstCDF nil] *
    *            [?addFormFields nil] [?filterFunc  nil]             *
    *                                                                *
    * Invoke all the parameter callbacks in the CDF for an instance. *
    *       This won't do anything if it doesn't have any CDF.       *
    * debug is a flag to turn on debug messages. order allows just   *
    * selected parameters to be called, in the specified order.      *
    * callInitProc allows the formInitProc to be called. useInstCDF  *
    * tells the formInitProc to be called with the instCDF rather    *
    * than the effective lookalike CDF. addFormFields tells it to    *
    * add the libraryName/cellName/viewName slots to emulate the     *
    * fields on the cdfgForm, which are used by some bad callback    *
    * code - note this is only done if useInstCDF is nil             *
    *                                                                *
    *****************************************************************/
    
    (procedure (abInvokeInstCdfCallbacks instance @key (debug nil) order
                                         (callInitProc nil) (useInstCDF nil)
                                         (addFormFields nil) (filterFunc nil))
      ;----------------------------------------------------------------------
      ; Make cdfgData and cdfgForm dynamically scoped, to avoid
      ; interfering with any global usage of these variables
      ;----------------------------------------------------------------------
      (let (cdf)
           (when debug
                 (printf " Invoking callbacks for instance '%s'\n"
                         (dbGetq instance name)))
           ;-----------------------------------------------------------------
           ; Set the cdf to be the instance CDF
           ;-----------------------------------------------------------------
           (setq cdf (cdfGetInstCDF instance))
           (unless useInstCDF
                   (setq cdf (abCreateEffectiveCDFLookalike cdf))
                   (when addFormFields
                     (abAddFormFieldsToEffectiveCDFLookalike cdf instance)
                     )
                   )
           ;-----------------------------------------------------------------
           ; Return value will be nil if any callbacks had errors
           ;-----------------------------------------------------------------
           (abInvokeObjCdfCallbacks
             cdf 
             ?debug debug ?order order ?callInitProc callInitProc
             ?setCdfgForm (null useInstCDF) ?filterFunc filterFunc
             )
      ))
    
    /***************************************************************
    *                                                              *
    *               (abConvertCdfToPcellParams cdf)                *
    *                                                              *
    * Take modified parameters in the CDF, and return this as the  *
    *      list of parameter names, types, and values that is      *
    *       needed to create a pcell with dbCreateParamInst.       *
    *                                                              *
    ***************************************************************/
    
    (procedure (abConvertCdfToPcellParams cdf)
      (foreach mapcar param
               (setof par (getq cdf parameters) 
                      (nequal (getq par value) (getq par defValue)))
               (list
                 (getq param name)
                 ; need to map this to pcell parameter types...
                 (case (getq param paramType)
                   (("int" "boolean" "float" "string") (getq param paramType))
                   (t "string")
                   )
                 (getq param value)
                 )
               )
      )
    
    /***************************************************************
    *                                                              *
    *        (abInvokeCdfCallbacks cellView @key (debug nil)       *
    *   (callInitProc nil) (useInstCDF nil) (addFormFields nil))   *
    *                         (filterFunc nil)                     *
    *                                                              *
    *  Invoke the CDF callbacks for all instances in the cellView. *
    *  Returns nil if any callback had a SKILL error, otherwise t  *
    *                                                              *
    ***************************************************************/
    
    (procedure (abInvokeCdfCallbacks cellView @key (debug nil) 
                                     (order nil)
                                     (callInitProc nil) (useInstCDF nil)
                                     (addFormFields nil) (filterFunc nil))
      (let ((success t))
           (when debug
                 (printf "Invoking callbacks for all instances in cell '%s'\n"
                         (dbGetq cellView cellName)))
           (foreach instance (dbGetq cellView instances)
                    (unless
                     (abInvokeInstCdfCallbacks instance 
                                               ?debug debug
                                               ?order order
                                               ?callInitProc callInitProc
                                               ?useInstCDF useInstCDF
                                               ?addFormFields addFormFields
                                               ?filterFunc filterFunc
                                               )
                     (setq success nil)
                     )
                    ) ; foreach
           success
           )
      ) ; procedure
    
    
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Faizan UL HAQ
    Faizan UL HAQ over 10 years ago

    Thanks Andrew for the help. Howver, as i am quite new to skill language, i have some basic questions.

    Based on my previous experience with C language,  what i have understood from the code is that it replaces cells from one design kit to the cells in another design kit.  I tried to execute the code in the following way.

    • ---made a connfiguration file with following content:

    (
      (nil
       fromLib   "cmos_rfa"
       fromCell  "pmos_rfa"
       toLib     "cmos_RFb"
       toCell    "pmos_rfb"
       runCallbacks t
       params (
               ("w" "width")
               ("l" "length" fixIt)
               )
       addProps (
                 ("isnoisy" t)
                 )
       )
     
    )

    // original names of design kit library were different than this but i have omitted then because of NDAs

    • copied your code to convert.il file and loaded it in CIW using following command.

    load "/home/pt/fulhaq/test/Skill_code/convert.il"

    • Ran the command abConvertComponentParams() with schematic name 'test'

    abConvertComponentParams("/home/pt/fulhaq/65nmtest/Skill_code/conv.config" "test")

    *Error* dbGetq: Object is not a db/dd/tech/bag object. - "test"

    However, i am getting the error:

    Error* dbGetq: Object is not a db/dd/tech/bag object. - "test"

    Moreover, i am not able to understand the functionality of  "propmatch" and "matchfuntion" in configuration file.

    regards

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

    First of all, the second argument to the function is a cellView ID not a string. So you'd need to do either:

    cvId=geGetEditCellView()

    if the design is open for edit in the current window, or:

    cvId=dbOpenCellViewByType("mylib" "mycell" "myview" "schematic" "a") ; the fourth argument would be "maskLayout" if it's a layout view

    and then pass cvId as the second argument.

    In the above example, you have "fixIt" included (which was in my example in the comments at the top). This means you have to define a function called fixIt which takes three arguments which does any  more complex corrections to the parameter. See the comments for more details.

    The propMatch property in the config is a way of limiting the match to only when there is a particular property on the instance with a particular value. These can be speciifed this way:

    propMatch (("w" "1.0u") ("fingers" "1"))

    If you do that, then the conversion would only be done if there is a property called w with value 1.0u, and fingers with value 1 (this is a silly example).

    If you need more complex matching, you can write a custom SKILL function which takes the instance Id of the instance being checked and returns t/nil to indicate whether this is a device you want to convert, and then reference this function name using matchFunction.

    matchFunction MyDoesItMatch

    and then in SKILL you'd define:

    procedure(MyDoesItMatch(instId)
      when(instId~>w=="1.0u" && instId~>fingers=="1"
         t
      )
    )

    for example.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Faizan UL HAQ
    Faizan UL HAQ over 10 years ago

    Thanks Andrew for the reply. With your help, I executed the code and now able to run the code for atleast component changes in one schematic. Initially, i tried to execute the code with one design kit components but later on, when i started to execute the code for two different design kit components (Lets say if i have to replace nmos transistor from one design kit to another nmos of 2nd design kit), there was an error that design kit library is not included. I think it is not even possible to include two different deisgn kit libraries at the same time in cadence environment. Still, i tried to add two design kit libraries but it didn't work. How you had executed the code? Did you have both design kit libraries installed at the same time in cadence environment?

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

    You need to have the libraries with both sets of symbols available to do the conversion. Sometimes there are conflicts between PDKs - especially if they are both from the same foundry - but provided you are not trying to do active editing with both PDKs at once, generally it should work OK to have both in the cds.lib at the same time.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • FormerMember
    FormerMember over 8 years ago

    Hello Andrew,

    The code gets pasted without formatting. All of it appears in a single line. I believe it's written in IDE. Any suggestions on how to fetch a readable/formatted code. 

    Regards,

    Jayesh

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

    Hi Jayesh,

    Unfortunately this copy and pasting problem is because of a plugin on the Cadence web site to add a reference to anything copied from the web site - and it messes up the formatting. I've discussed this with our IT in the past - I'll check  up on the current status.

    The workaround is to use firefox (or another browser) on Linux and then you can select the text and then paste using the middle mouse button (if you do an explicit Right Mouse->Copy then you'll have the same problem as on Windows/Mac).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • seanhuang
    seanhuang over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    I tried to use your skill code to convert one cell from TSMC 0.18um to TSMC 0.13um (Actually I just want to modify parameter "l" from 0.18um to 0.13um), but I got the following error:

    *WARNING* (DB-2700211): dbOpenCellViewByType: Failed to open cellview (inv_x1 symbol) from lib (newlib) in 'r' mode because cellview does not exist, or cellview type is not recognized by dbOpenCellViewByType.

    Also, could you please help with fixIt if I want to modify only parameter "l" from 0.18um to 0.13um? Thanks!

    My original library (mylib, TSMC 0.18) with original cell inv_x1 (symbol & schmatic), and I want to convert it to a complete new library (newlib, TSMC 0.13) with new cell. Here is my conv.config:

    (
      (nil
       fromLib   "mylib"
       fromCell  "inv_x1"
       toLib     "newlib"
       toCell    "inv_x1"
       runCallbacks t
       params (
               ("w" "width")
               ("l" "length" fixIt)
               )
       addProps (
                 ("isnoisy" t)
                 )
       )
      (nil
       fromLib   "mylib"
       fromCell  "inv_x1"
       toLib     "newlib"
       toCell    "inv_x1"
       propMatch (("subtype" "pxyz"))
       runCallbacks (?useInstCDF t ?callInitProc t)
       params (
               ("w" "width")
               ("l" "length")
               )
       )
    )
    
     
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to seanhuang

    The fromCell and toCell are not supposed to be the name of the cell you're converting. They should be the names of the cells instantiated in your circuit that you need repacking - so I would expect it to be having fromLib "tsmc18" and toLib "tsmc13" (or whatever the libraries are called) and the fromCell and toCell would be (say) "nmos2v" or similar (whatever the transistors are called in the PDK). Most likely the parameter names (w, l etc) are the same in both PDKs and so do not need mapping.

    A fixIt function would probably be something like:

    procedure(fixMinimumLength(inst parName val)
      let((valAsNum)
        valAsNum=cdfParseFloatString(val)
        ; this just allows for rounding errors - it says if the value is close to 0.18u
        if(abs(valAsNum-0.18u)<1n  then
          "0.13u"
        else
          val
        )
      )
    )

    You'd specify this for the l parameter only in the params section. So something like:

    (nil
      fromLib "tsmc18"
      fromCell "nmos1v"
      toLib "tsmc13"
      toCell "nmos1v"
      runCallbacks t
      params (
        ("l" "l" fixMinimumLength)
      )
    )

    Regards,

    Andrew.

    • 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